weston/xwayland
Pekka Paalanen ad0da4596d xwm: do not draw decor twice on map
Normal windows enter the MapRequest handler, which schedules drawing the
decorations. Then Xwayland realizes the window, which ends with a call
to xserver_map_shell_surface(). The decorations are already drawn, no
need to draw them a second time. However, MapRequest handler could not
set the pending state because the weston_surface did not exist at the
time, because it gets created only when Xwayland realizes the window,
which happens after XWM has forwarded the MapWindow in MapRequest
handler. Therefore set the pending state explicitly at the end.
Scheduling had it done much later anyway.

Now that the pending state is set much earlier, it seems to be more
likely that it gets set before Xwayland's first commit is handled. This
means that -geometry command line option of X11 apps already takes the
geometry (decorations) into account. I do not think it is reliable yet,
though.

There is still the race between Xwayland committing and XWM setting the
pending state assuming the very next commit latches it in appropriately.
The race exists not because of Wayland, but because WL_SURFACE_ID comes
via X11, and could be processed after wl_compositor.create_surface and
wl_surface.commit. That commit/pending race is solved by a following patch.

For override-redirect windows weston_wm_window_schedule_repaint()
reduced into a call to weston_wm_window_set_pending_state_OR(), so we
can just call that directly. It should not matter that the call is moved
to the end of the function.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2017-04-13 11:34:36 +01:00
..
dnd.c xwayland: Create the drag-and-drop window in weston_wm_dnd_init 2016-11-22 12:01:37 +00:00
hash.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
hash.h include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
launcher.c libweston: Properly namespace modules entrypoint 2017-01-17 18:24:53 +01:00
selection.c xwayland: fix three minor typos 2017-01-03 11:59:19 +00:00
window-manager.c xwm: do not draw decor twice on map 2017-04-13 11:34:36 +01:00
xwayland-api.h xwayland: Introduce a private struct for XWayland interface 2016-08-14 09:29:08 +02:00
xwayland-internal-interface.h xwayland: add set_toplevel_with_position to internal API 2017-01-18 13:21:02 +02:00
xwayland.h xwayland: make the plugin usable by libweston compositors 2016-07-01 14:34:33 +03:00