xwayland: detect initially positioned X11 windows
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 16 Nov 2016 12:15:18 +0000 (14:15 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 18 Jan 2017 11:21:02 +0000 (13:21 +0200)
commit882aff09324ba72d1d9136d6ad9f3c99dab1631b
treeaab969dfdb04dec843a07a37fa4debb8f19844cd
parent37111e157a10217a37b30f0d12605ba14b28667b
xwayland: detect initially positioned X11 windows

X11 applications expect -geometry command line option to work for
setting the initial window position, but currently this does not work.

During map, detect X11 windows that set an explicit position. This works
by heuristics: if window position is not 0,0 then it is explicitly
positioned. Legacy fullscreen windows are also at 0,0 but these are
detected earlier.

Explicitly store the window position at map request time to detect
client-positioned windows, and use it as the suggested initial position.
weston_wm_window::x and y have been overwritten due to reparenting when
we eventually need the initial position.

This patch requires that the new set_toplevel_with_position() hook is
implemented in the shell.

Note that this patch is about positioning xwayland toplevels, not
override-redirect windows which are already handled.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
xwayland/window-manager.c