[x11] Add support for _GTK_FRAME_EXTENTS
Needs ReviewPublic

Authored by zzag on Oct 15 2019, 10:41 AM.
"Love" token, awarded by lephuong."Love" token, awarded by GB_2."Love" token, awarded by ngraham."Love" token, awarded by ognarb.


Group Reviewers

KDE is known for having a strong view on the client-side decorations vs
server-side decorations issue. The main argument raised against CSD is
that desktop will look less consistent when clients start drawing window
decorations by themselves, which is somewhat true. It all ties to how
well each toolkit is integrated with the desktop environment.

KDE doesn't control the desktop market on Linux. Another big "player"
is GNOME. Both KDE and GNOME have very polarized views on in which
direction desktop should move forward. The KDE community is pushing more
toward server-side decorations while the GNOME community is pushing
more toward client-side decorations. Both communities have developed
great applications and it's not rare to see a GNOME application being
used in KDE Plasma. The only problem is that these different views are
not left behind the curtain and our users pay the price. Resizing GTK
clients in Plasma became practically impossible due to resize borders
having small hit area.

When a client draws its window decoration, it's more likely that it also
draws the drop-shadow around the decoration. The compositor must know
the extents of the shadow so things like snapping and so on work as
expected. And here lies the problem... While the xdg-shell protocol has
a way to specify such things, the NetWM spec doesn't have anything like
that. There's _GTK_FRAME_EXTENTS in the wild, however the problem with
it is that it's a proprietary atom, which is specific only to GTK apps.

Due to that, _GTK_FRAME_EXTENTS wasn't implemented because implementing
anything like that would require major changes in how we think about

Recent xdg-shell window geometry patches adjusted geometry abstractions
in kwin to such a degree that it's very easy to add support for client
side decorated clients on X11. We just have to make sure that the
X11Client class provides correct buffer geometry and frame geometry when
the gtk frame extents are set.

Even though the X11 code is feature frozen, I still think it's worth
to have _GTK_FRAME_EXTENTS support in kwin because it will fix the resize
issues. Also, because KWin/Wayland is unfortunately far from becoming
default, it will help us with testing some implementation bits of the
window geometry from xdg-shell.

BUG: 390550
FIXED-IN: 5.18.0

Test Plan

Things like quick tiling, maximizing, tiling scripts and so on work as
expected with GTK clients.

Diff Detail

R108 KWin
Lint OK
No Unit Test Coverage
Build Status
Buildable 17709
Build 17727: arc lint + arc unit
zzag created this revision.Oct 15 2019, 10:41 AM
Restricted Application added a project: KWin. · View Herald TranscriptOct 15 2019, 10:41 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Oct 15 2019, 10:41 AM
ngraham edited the summary of this revision. (Show Details)Oct 15 2019, 1:55 PM
GB_2 awarded a token.Mon, Oct 21, 10:17 AM
zzag edited the summary of this revision. (Show Details)Mon, Oct 21, 12:06 PM
trmdi added a subscriber: trmdi.Mon, Nov 11, 2:20 AM