wayland: Send a correct width / height for state changes

If we send out a configure notify for a window and then have some
other kind of state change, we need to make sure that we continue
to send out that new size, rather than the last size the client
sent us a buffer for.

In particular, a client might give us a 250x250 buffer and then
immediately request fullscreen. We send out a configure for the
monitor size and a state that tells it it's full-screen, but then
it takes focus, and since the client hasn't sent us a buffer for
the new size, we tell it it's fullscreen at 250x250.

Fix this.
This commit is contained in:
Jasper St. Pierre 2014-05-12 18:05:31 -04:00
parent 7732447abc
commit 33cb7f4a2c

View File

@ -38,6 +38,9 @@ struct _MetaWindowWayland
gboolean has_saved_pos;
int saved_x;
int saved_y;
int last_sent_width;
int last_sent_height;
};
struct _MetaWindowWaylandClass
@ -160,6 +163,9 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
wl_window->saved_x = constrained_rect.x;
wl_window->saved_y = constrained_rect.y;
wl_window->last_sent_width = constrained_rect.width;
wl_window->last_sent_height = constrained_rect.height;
meta_wayland_surface_configure_notify (window->surface,
constrained_rect.width,
constrained_rect.height);
@ -188,9 +194,11 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
static void
surface_state_changed (MetaWindow *window)
{
MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
meta_wayland_surface_configure_notify (window->surface,
window->rect.width,
window->rect.height);
wl_window->last_sent_width,
wl_window->last_sent_height);
}
static void