Properly call Toplevel::setSurface for wl_surface_id X11 client message event
ClosedPublic

Authored by graesslin on Jun 10 2016, 2:22 PM.

Details

Summary

For an X11 window through Xwayland KWin gets a client message with the
Surface id. KWin has two code paths for handling that:

  • Wayland Surface is created after the X11 event
  • Wayland Surface is created before the X11 event

In the first code path in WaylandServer KWin called Toplevel::setSurface,
the other code path just updated the m_surface without calling into
setSurface. This means the connects for the Surface were not set up,
resulting in the worst case in accessing deleted memory after the Surface
was destroyed.

This change now ensures that setSurface is called from both code paths.
That should fix the potential crash and could also be a fix to the
problem that sometimes X windows seem to not be damaged correctly.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 4333.Jun 10 2016, 2:22 PM
graesslin retitled this revision from to Properly call Toplevel::setSurface for wl_surface_id X11 client message event.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptJun 10 2016, 2:22 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
sebas accepted this revision.Jun 13 2016, 9:21 PM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Jun 13 2016, 9:21 PM
This revision was automatically updated to reflect the committed changes.