https://bugs.kde.org/show_bug.cgi?id=426069

--- Comment #5 from Vlad Zahorodnii <vlad.zahorod...@kde.org> ---
Git commit a75559c39081c80c7e31e9c7324b17e7a4efb3f1 by Vlad Zahorodnii.
Committed on 04/10/2021 at 05:57.
Pushed by vladz into branch 'Plasma/5.23'.

wayland: Reset Toplevel::surfaceId after surface is created

Xwayland will re-create the wl_surface object if the X11 window is
unmapped and mapped. That, and the fact that the order in which the
WL_SURFACE_ID client message event is received and the wl_surface object
is created is undefined can cause the following bug:

* WL_SURFACE_ID is received
* the old wl_surface object is destroyed, m_surfaceId is reset to 0
* new wl_surface is created but because m_surfaceId is 0, it won't be
  associated with the x11 window

This change ensures that kwin will associate the wl_surface with x11
window by making it not reset cached surface id when the old wl_surface
is destroyed.

However, we cannot leave m_surfaceId as is because wayland aggressively
re-uses object ids so kwin can associate wrong surface with x11 window.

To prevent that, this change also makes Toplevel::setSurface() reset
cached surface id.
Related: bug 442936


(cherry picked from commit 52c9dbb487f4ac98017b83a1deee912546cbff5f)

M  +2    -3    src/events.cpp
M  +1    -2    src/toplevel.cpp
M  +4    -15   src/toplevel.h
M  +2    -2    src/wayland_server.cpp

https://invent.kde.org/plasma/kwin/commit/a75559c39081c80c7e31e9c7324b17e7a4efb3f1

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to