• Vlad Zahorodnii's avatar
    [x11] Add support for _GTK_FRAME_EXTENTS · 84d75cb5
    Vlad Zahorodnii authored
    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.
    Reviewers: #kwin, davidedmundson
    Reviewed By: #kwin, davidedmundson
    Subscribers: cblack, trmdi, kwin
    Tags: #kwin
    Differential Revision: https://phabricator.kde.org/D24660
manage.cpp 28.9 KB