Authored by davidedmundson on Mar 8 2019, 3:36 PM.



This is used by GTK clients to know whether to draw as though they have
focus or not. Whilst it's most visible for CSDs headers, use of the
active/inactive palette (or backdrop class in GTK terms) applies

Rationale of the flag is to allow the WM to hint visual states without
giving input, i.e so you can hint that the parent of a modal dialog
should be shown as active. Though kwin only sets it on the truly active
window to match the behaviour our other windows follow.

BUG: 398832

I expect this to be potentially controversial as it's new code in X11,
so in advance:

  • Unlike GTK_FRAME_EXTENTS, it is part of the specificiation (albeit

1.4) even i3 supports it.

  • It does fix a real world issue
  • It's only 2 lines (plus trivial boiler plate in kwindowsystem)
  • It's in code path that we rely on for our existing code
  • If there's a situation where this does break, the worst that will

happen is a client gets a visual hint to have focus incorrectly, which
ultimately is the same as the current state

Test Plan

Used my CSS for breeze-gtk
moved between windows

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Mar 8 2019, 3:36 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 8 2019, 3:36 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Mar 8 2019, 3:36 PM

I still don't see a need for this property. All we do is something gtk can easily do itself. We are working around a gtk bug in all window managers. I think that's wrong.

Furthermore we decided to be feature Frozen on X11.

rooty added a subscriber: rooty.Mar 12 2019, 6:49 AM

This is a really good idea. Nothing to lose and tons to gain, especially considering we get to use our existing code

+1, sometimes just a little bit of flexibility has a big effect.

rooty accepted this revision.Mar 12 2019, 1:39 PM
This revision is now accepted and ready to land.Mar 12 2019, 1:39 PM
ognarb added a subscriber: ognarb.Mar 12 2019, 3:53 PM

From my side a -1 as we are feature frozen. Gtk can easily check whether the window manager supports this property and if not do the same as this patch does. This is clearly a gtk bug and if gtk fixed it, it works for everyone and there is no need to incorrectly claim support for the property. Has this issue been reported to Gtk devs?

Gtk can easily check whether the window manager supports this property and if not do the same as this patch does.

Whilst I would agree GTK should have kept their fallback, re-adding it couldn't be the same (at least, not by following focus)
The flag itself does solve a real problem that we would hit in Qt if we tried to have the same visual effects.

If I had a different window palette for unfocused windows as soon as I open a combo box (and grab focus) the window would appear to be inactive.
Breeze style doesn't have different palettes for unfocused windows, but that's a chicken and egg problem.

We also shouldn't just think GTK, it's exposed in at least SDL as well.

rooty added a comment.EditedMar 17 2019, 9:38 AM

We quite literally have nothing to lose by landing this.

(And whether or not GTK developers want to or need to tackle this issue has very little to do with the price of tea in China, especially considering that this would help us too in case we decide to implement these effects and wouldn't hinder in the slightest)

rooty resigned from this revision.Mar 28 2019, 11:22 PM
This revision now requires review to proceed.Mar 28 2019, 11:22 PM

bump, this is a change I do want to push for.

I am happy to have a technical discussion as long as it addresses the comments that I have already mentioned.

I did look at patching GTK before I went for kwin. It is far from trivial to do correctly in the client because of all the edge cases. Kwin's mantra has always been "window manager knows best" when clients try and inferring things about state, this is another classic occasion.
It doesn't make sense to make a bigger patch that won't work as well as the simple one.

+1, big improvement for almost no code change. I know we're technically feature frozen but I think this is a case where a little flexibility can go a long way.

zzag accepted this revision.May 10 2019, 2:29 PM

On one hand, we have broken clients. On the other hand, we have our promise to keep KWin/X11 feature frozen.

It's really sad that GNOME developers didn't express any intent to address this issue, so let's get this change in.

I hope that from now on we can keep our promise and be focused more towards Wayland.

This revision is now accepted and ready to land.May 10 2019, 2:29 PM
This revision was automatically updated to reflect the committed changes.