D27861: WIP: Rework xdg-shell implementation

Vlad Zahorodnii noreply at phabricator.kde.org
Thu Mar 5 08:51:36 GMT 2020


zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION SUMMARY
  First of all, sorry for the big patch.
  
  Currently, we implement Wayland protocol wrappers in KWayland and then
  add necessary "glue" code here in KWin. Because KWayland is a KF library,
  we are not able to change existing API in ways that may break API or
  ABI compatibility. So, if some particular wrapper has been implemented
  incorrectly, we can't do that much about it except maybe leaving
  comments that look like "// TODO KF6".
  
  Another problem with KWayland is that we try to build abstractions over
  something that is unstable. We do this in the name of the "don't repeat
  yourself" mantra. While it is a good approach to keep the amount of
  duplicated code as low as possible, we basically ask for trouble. If a
  new version of an unstable protocol comes along with dramatic changes,
  we are screwed.
  
  The current xdg-shell wrappers in KWayland were designed for xdg-shell
  v5, which didn't have objects such as xdg-toplevel or xdg-positioner.
  Unfortunately, we can't change existing classes because of the API and
  ABI compatibility promises we made.
  
  This change splits the XdgShellClient class to better match existing
  abstractions in the xdg-shell protocol. Unfortunately, since xdg-shell
  wrappers in KWayland weren't designed for xdg-shell v6+, I had to
  re-implement them here in KWin. The new wrappers weren't implemented in
  KWayland because I cannot guarantee that the future versions of the
  wrappers will be API compatible.
  
  The XdgSurface{V6}Client class is concerned mainly about things such as
  mapped/unmapped state and geometry, while XdgToplevel{V6}Client and
  XdgPopup{V6}Client are concerned about role-specific things, for example
  the window state, etc.
  
  In the new client classes, configure events are handled differently.
  Instead of blocking configure events, we try to send them as late as
  possible. Delaying configure events will let us merge changeMaximize()
  for X11 clients and Wayland clients and it also fixes the bug where
  we don't send the final configure event when user has finished resizing
  a window.
  
  Given that configure events are not sent immediately, XdgSurfaceClient
  and XdgSurfaceV6Client keep the last requested frame geometry and the
  last requested client geometry.
  
  This change doesn't intend to fix all things that are currently broken
  in the xdg-shell wrappers and the XdgShellClient class. For example,
  we don't reset XdgSurfaceInterface when the wl_surface is unmapped, we
  handle xdg-popup grabs poorly, etc. Instead, this change lays the
  foundation for the future improvements.

TEST PLAN
  Tests pass.

REPOSITORY
  R108 KWin

BRANCH
  split-xdg-shell-client-2

REVISION DETAIL
  https://phabricator.kde.org/D27861

AFFECTED FILES
  CMakeLists.txt
  autotests/integration/maximize_test.cpp
  autotests/integration/move_resize_window_test.cpp
  autotests/integration/quick_tiling_test.cpp
  autotests/integration/xdgshellclient_rules_test.cpp
  autotests/integration/xdgshellclient_test.cpp
  cmake/modules/FindWaylandProtocols.cmake
  deleted.cpp
  effects.cpp
  placement.cpp
  shellsurfaceclient.cpp
  shellsurfaceclient.h
  subsurfacetreemonitor.cpp
  subsurfacetreemonitor.h
  wayland_server.cpp
  wayland_server.h
  xdgdecorationv1interface.cpp
  xdgdecorationv1interface.h
  xdgdecorationv1interface_p.h
  xdgshellclient.cpp
  xdgshellclient.h
  xdgshellinterface.cpp
  xdgshellinterface.h
  xdgshellinterface_p.h
  xdgshellv6client.cpp
  xdgshellv6client.h
  xdgshellv6interface.cpp
  xdgshellv6interface.h
  xdgshellv6interface_p.h

To: zzag, #kwin
Cc: kwin, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200305/9881e402/attachment-0001.html>


More information about the kwin mailing list