commit 3fd35d6
Michael Forney
·
2016-04-30 05:18:22 +0000 UTC
parent 0bf9eac
xdg_surface: Send configure when changing mode
1 files changed,
+19,
-4
+19,
-4
1@@ -75,14 +75,27 @@ remove_state(struct xdg_surface *xdg_surface, uint32_t state)
2 return false;
3 }
4
5+static uint32_t
6+send_configure(struct xdg_surface *xdg_surface, int32_t width, int32_t height) {
7+ uint32_t serial = wl_display_next_serial(swc.display);
8+
9+ if (width < 0)
10+ width = xdg_surface->window.configure.width;
11+ if (height < 0)
12+ height = xdg_surface->window.configure.height;
13+
14+ xdg_surface_send_configure(xdg_surface->resource, width, height, &xdg_surface->states, serial);
15+
16+ return serial;
17+}
18+
19 static void
20 configure(struct window *window, uint32_t width, uint32_t height)
21 {
22 struct xdg_surface *xdg_surface = wl_container_of(window, xdg_surface, window);
23
24 window->configure.acknowledged = false;
25- xdg_surface->configure_serial = wl_display_next_serial(swc.display);
26- xdg_surface_send_configure(xdg_surface->resource, width, height, &xdg_surface->states, xdg_surface->configure_serial);
27+ xdg_surface->configure_serial = send_configure(xdg_surface, width, height);
28 }
29
30 static void
31@@ -91,7 +104,7 @@ focus(struct window *window)
32 struct xdg_surface *xdg_surface = wl_container_of(window, xdg_surface, window);
33
34 add_state(xdg_surface, XDG_SURFACE_STATE_ACTIVATED);
35- configure(window, window->configure.width, window->configure.height);
36+ send_configure(xdg_surface, -1, -1);
37 }
38
39 static void
40@@ -100,7 +113,7 @@ unfocus(struct window *window)
41 struct xdg_surface *xdg_surface = wl_container_of(window, xdg_surface, window);
42
43 remove_state(xdg_surface, XDG_SURFACE_STATE_ACTIVATED);
44- configure(window, window->configure.width, window->configure.height);
45+ send_configure(xdg_surface, -1, -1);
46 }
47
48 static void
49@@ -133,6 +146,8 @@ set_mode(struct window *window, unsigned mode)
50 add_state(xdg_surface, XDG_SURFACE_STATE_FULLSCREEN);
51 break;
52 }
53+
54+ send_configure(xdg_surface, -1, -1);
55 }
56
57 static const struct window_impl xdg_surface_window_impl = {