Closed polter-rnd closed 1 year ago
This sounds like a bug in QtWayland, I don't think we should be trying to workaround this on our side.
I agree that this fix is quite suspicious and I'm not sure if it should be merged, but let me share my findings first.
I also thought that it's a bug in qtwayland, but apparently I was incorrect. That's true that window dimming is present since commit e532733 (which you have backported to Fedora's Qt5). But this commit has not introduced a bug, it has fixed the inconsistent behavior instead. That's because of the way Qt handles focus -- it uses keyboard focus to select active or inactive palette to draw. And when we click on the decoration to move or resize the window, application loses keyboard focus, so it has to be drawn inactive. However until e532733
qtwayland relied on Xdg hint for that (so that dimming was not occurring), while xcb
backend not, that was inconsistent and was a bug. But the decoration itself should not be drawn inactive in that case, that's why they introduced wayland-specific windowStates()
in that commit to check for Xdg hints, which we're using to fix titlebar dimming.
So to be short, the dimming of widgets is not specific to wayland backend, it occurs on xcb as well and looks like it's an intended behavior. I didn't notice that because I use wayland daily, and on xcb+XWayland it does not occur because of XWayland limitation -- I guess that's because Xwayland doesn't pass events happening with the decoration to the app itself.
To summarize:
e532733
- dimming happens on XCB, not happens on Wayland and XWaylandWhy nobody complains about that - I think because they don't use Inactive palette for that purpose, like in Fusion or Breeze style in KDE, window itself never becomes greyed-out even if it's not focused, only titlebar is drawn inactive. But GTK behaves differently and draws the whole app inactive in that case, and adwaita-qt tries to minic it as much as possible and that's great, however it leads to dimming.
How can it be fixed, from my opinion:
QGnomePlatform is now unmaintained and not actively developed. For decoration improvements please submit your change to https://github.com/FedoraQt/QAdwaitaDecoration instead.
Experimental fix for nasty bug with losing window focus -- #115 or https://github.com/FedoraQt/adwaita-qt/issues/170
This is really a dirty hack, but it actually works. Only for Wayland.
One can test it using my copr repo