summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2017-11-13 16:20:52 -0500
committerDaniel Stone <daniels@collabora.com>2017-12-05 14:08:15 +0000
commit3f53d9179bcdb11d053527336ac4a49f274bc8d1 (patch)
treeb1fc41323cfb1b5820299e4bd41a7cd378623d0f
parentef82bdfdd742eda36ecd66da3aefde91a914731a (diff)
xwm: Only send configure a window if the new size is different
If we configure a window with the same size and wait for the sync alarm to go off, the resizing is gonna block. The event is only handled is the size actually changed. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--xwayland/window-manager.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index c4ca0c60..f31e3c73 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -2569,6 +2569,7 @@ send_configure(struct weston_surface *surface, int32_t width, int32_t height)
struct weston_wm_window *window = get_wm_window(surface);
struct weston_wm *wm = window->wm;
struct theme *t = window->wm->theme;
+ int new_width, new_height;
int vborder, hborder;
if (window->decorate && !window->fullscreen) {
@@ -2580,14 +2581,20 @@ send_configure(struct weston_surface *surface, int32_t width, int32_t height)
}
if (width > hborder)
- window->width = width - hborder;
+ new_width = width - hborder;
else
- window->width = 1;
+ new_width = 1;
if (height > vborder)
- window->height = height - vborder;
+ new_height = height - vborder;
else
- window->height = 1;
+ new_height = 1;
+
+ if (window->width == new_width && window->height == new_height)
+ return;
+
+ window->width = new_width;
+ window->height = new_height;
if (window->frame)
frame_resize_inside(window->frame, window->width, window->height);