]> git.mdlowis.com Git - proto/labwc.git/commit
xwayland: Better document/assert view/surface association
authorJohn Lindgren <john@jlindgren.net>
Fri, 11 Nov 2022 20:54:26 +0000 (15:54 -0500)
committerJohn Lindgren <john@jlindgren.net>
Fri, 11 Nov 2022 20:56:13 +0000 (15:56 -0500)
commite848bd2f6b7d9d5a4c07e86f8f020d48d803348f
tree36665785f09eff056146a4cfc5a1d12a4ae6d093
parent00002d67ea3b9d2f50c8e651276eea8ac8436445
xwayland: Better document/assert view/surface association

Each XWayland view is paired with a particular wlr_xwayland_surface and
its lifetime is tied to that surface.  This condition in handle_map():

    if (xsurface != view->xwayland_surface)

could never be true since the view is only registered to receive the
"map" signal from view->xwayland_surface, and no other.  So the code
updating view->xwayland_surface in handle_map() was dead.

So let's clean things up a little:

- Remove the dead code
- Add some comments, and slightly rearrange code to match
- Add/update assert()s in signal handlers for consistency
- Pass xsurface as <data> when calling handle_unmap() and
  handle_destroy() explicitly, to be consistent
src/xwayland.c