Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.
What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.
In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.
send_configure was originally modelled after
wl_shell_surface::send_configure, which takes these arguments. However,
the X WM and xdg_surface::configure variants don't use these arguments.
We already store the resize edges for a surface while it's being
resized, so just use the saved state in the wl_shell_surface variant.
Make sure we're looking at the right location. The frame could have
received a motion event from a pointer from a different wl_seat, but
under X it looks like our core pointer moved. Move the frame pointer
to the button press location before deciding what to do.
If we're going to move or resize an xwayland surface, we used to just
pick the first seat in the list for doing the move/resize. Ideally we
can map from the XInput device doing the click to the corresponding
weston_seat, but that requires using xcb xinput, which isn't well supported.
Instead, lets use a simple heuristic that just picks the pointer that
most recently delivered a button event to the window in question.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73807
Set up X windows that are transient for another window as transient
surfaces in shell.c. This keeps the transient windows on top of their
parent as windows are raised, lowered for fullscreened.
https://bugs.freedesktop.org/show_bug.cgi?id=69443