[mutter] wayland: Send a correct width / height for state changes



commit 33cb7f4a2cd1cf93c9caf6e1b364e04ef297823e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon May 12 18:05:31 2014 -0400

    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.

 src/wayland/window-wayland.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c
index b74fc78..5cfee47 100644
--- a/src/wayland/window-wayland.c
+++ b/src/wayland/window-wayland.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]