Skip to content

Fix clipped shadows on useraction menus, when wayland and desktop scaling is enabled.

Andreas Haratzis requested to merge adre/kwin:fix_useraction_shadows into master

Hey all,

Got another hacky fix here!

This one is something pretty small though. I noticed that the shadows for some things (like the user action menu) were distorted:

shadow_before

It doesn't happen if the screen's scale is 100%, but does on 150% or 200%. I believe it's because the shadow images have devicePixelRatio set. When scene_opengl attempts to draw them onto a Nine Tile atlas for rendering, it assumes 1.0 scale, and therefore the images shrink. This doesn't happen for all shadows though: I can only repo it with shadows that are inited through Shadow::init(const QWindow *window).

Should scene_opengl (and others) assume that the shadows could have non-standard devicePixelRatios? Or should we sanitize the input by clearing the ratio when the shadows are received? I feel that I'm lacking context and project history to decide.

Personally I prefer solution A, because it's simpler and avoids changing assumptions. Plus I'm not sure what else has this assumption!

I've included both fixes and kept it a WIP until we decide.

Here is the same dropdown with the fix:

shadow_after

(also as a side note, I'm not sure what's going on with the graphical glitch inside the menu. I think it may be something in the breeze style since I don't see it with Oxygen, and I also sometimes see it in X11. I would like to fix it after this though. If anyone has some tips I'm all ears!)

Edited by Vlad Zahorodnii

Merge request reports

Loading