xwm: schedule repaint from MapRequest

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@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index d9d1bae..37c8603 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1040,7 +1040,8 @@
 	window->map_request_y = window->y;
 
 	if (window->frame_id == XCB_WINDOW_NONE)
-		weston_wm_window_create_frame(window);
+		weston_wm_window_create_frame(window); /* sets frame_id */
+	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,
@@ -1059,6 +1060,11 @@
 
 	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