wayland: Rework asynchronous window configuration

This changes how asynchronous window configuration works. Prior to this
commit, it worked by MetaWindowWayland remembering the last
configuration it sent, then when the Wayland client got back to it, it
tried to figure out whether it was a acknowledgment of the configuration
or not, and finish the move. This failed if the client had acknowledged
a configuration older than the last one sent, and it had hacks to
somewhat deal with wl_shell's lack of configuration serial numbers.

This commits scraps that and makes the MetaWindowWayland take ownership
of sent configurations, including generating serial numbers. The
wl_shell implementation is changed to emulate serial numbers (assuming
each commit acknowledges the last sent configure event). Each
configuration sent to the client is kept around until the client one. At
this point, the position used for that particular configuration is used
when applying the acknowledged state, meaning cases where we have
already sent a new configuration when the client acknowledges a previous
one, we'll still use the correct position for the window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/907
This commit is contained in:
Jonas Ådahl
2019-07-05 18:10:14 +02:00
parent cc444d4991
commit 554644f9e0
13 changed files with 356 additions and 266 deletions

View File

@ -33,12 +33,8 @@ struct _MetaWaylandShellSurfaceClass
{
MetaWaylandActorSurfaceClass parent_class;
void (*configure) (MetaWaylandShellSurface *shell_surface,
int new_x,
int new_y,
int new_width,
int new_height,
MetaWaylandSerial *sent_serial);
void (*configure) (MetaWaylandShellSurface *shell_surface,
MetaWaylandWindowConfiguration *configuration);
void (*managed) (MetaWaylandShellSurface *shell_surface,
MetaWindow *window);
void (*ping) (MetaWaylandShellSurface *shell_surface,
@ -46,12 +42,8 @@ struct _MetaWaylandShellSurfaceClass
void (*close) (MetaWaylandShellSurface *shell_surface);
};
void meta_wayland_shell_surface_configure (MetaWaylandShellSurface *shell_surface,
int new_x,
int new_y,
int new_width,
int new_height,
MetaWaylandSerial *sent_serial);
void meta_wayland_shell_surface_configure (MetaWaylandShellSurface *shell_surface,
MetaWaylandWindowConfiguration *configuration);
void meta_wayland_shell_surface_ping (MetaWaylandShellSurface *shell_surface,
uint32_t serial);