[PATCH weston v2 20/24] xwm: schedule repaint from MapRequest

Pekka Paalanen ppaalanen at gmail.com
Wed Dec 21 14:40:18 UTC 2016


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

When we as the WM tell the X server to map a window, it gets mapped. We
can start drawing into it immediately. There is no reason to wait for
any other events before drawing the decorations.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 xwayland/window-manager.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 4127fa9..cf616ec 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1039,6 +1039,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
 
 	if (window->frame_id == XCB_WINDOW_NONE)
 		weston_wm_window_create_frame(window);
+	assert(window->frame_id != XCB_WINDOW_NONE);
 
 	wm_log("XCB_MAP_REQUEST (window %d, %p, frame %d, %dx%d @ %d,%d)\n",
 	       window->id, window, window->frame_id,
@@ -1057,6 +1058,11 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
 
 	xcb_map_window(wm->conn, map_request->window);
 	xcb_map_window(wm->conn, window->frame_id);
+
+	/* Mapped in the X server, we can draw immediately.
+	 * Cannot set pending state though, no weston_surface until
+	 * xserver_map_shell_surface() time. */
+	weston_wm_window_schedule_repaint(window);
 }
 
 static void
-- 
2.10.2



More information about the wayland-devel mailing list