[PATCH weston 1/1] xwm: improve override-redirect debug messages

Fabien Lahoudere fabien.lahoudere at collabora.com
Fri May 4 09:10:14 UTC 2018


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

Explicitly say if O-R is yes or no, to not have to remember which
messages possibly printed it.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere at collabora.com>

Conflicts:
	xwayland/window-manager.c
---
 xwayland/window-manager.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 32a756c..0ac8639 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -747,14 +747,25 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve
 	const struct weston_desktop_xwayland_interface *xwayland_api =
 		wm->server->compositor->xwayland_interface;
 	struct weston_wm_window *window;
+	const char *or_str = " unk";
 
-	wm_log("XCB_CONFIGURE_NOTIFY (window %d) %d,%d @ %dx%d%s\n",
+	if (wm_lookup_window(wm, configure_notify->window, &window)) {
+		if (!!configure_notify->override_redirect == !!window->override_redirect)
+			or_str = ".";
+		else
+			or_str = " BUG!";
+	} else {
+		window = NULL;
+	}
+
+	wm_log("XCB_CONFIGURE_NOTIFY (window %d) %d,%d @ %dx%d, O-R: %s%s\n",
 	       configure_notify->window,
 	       configure_notify->x, configure_notify->y,
 	       configure_notify->width, configure_notify->height,
-	       configure_notify->override_redirect ? ", override" : "");
+	       configure_notify->override_redirect ? "yes" : "no",
+	       or_str);
 
-	if (!wm_lookup_window(wm, configure_notify->window, &window))
+	if (!window)
 		return;
 
 	window->x = configure_notify->x;
@@ -1136,8 +1147,8 @@ weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 			return;
 	}
 
-	wm_log("XCB_MAP_NOTIFY (window %d%s)\n", map_notify->window,
-	       map_notify->override_redirect ? ", override" : "");
+	wm_log("XCB_MAP_NOTIFY (window %d) O-R : %s\n", map_notify->window,
+	       map_notify->override_redirect ? "yes" : "no");
 
 	if (!wm_lookup_window(wm, map_notify->window, &window))
 		return;
@@ -1449,11 +1460,11 @@ weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 	xcb_create_notify_event_t *create_notify =
 		(xcb_create_notify_event_t *) event;
 
-	wm_log("XCB_CREATE_NOTIFY (window %d, at (%d, %d), width %d, height %d%s%s)\n",
+	wm_log("XCB_CREATE_NOTIFY (window %d, at (%d, %d), width %d, height %d, O-R: %s%s)\n",
 	       create_notify->window,
 	       create_notify->x, create_notify->y,
 	       create_notify->width, create_notify->height,
-	       create_notify->override_redirect ? ", override" : "",
+	       create_notify->override_redirect ? "yes" : "no",
 	       our_resource(wm, create_notify->window) ? ", ours" : "");
 
 	if (our_resource(wm, create_notify->window))
@@ -1493,11 +1504,11 @@ weston_wm_handle_reparent_notify(struct weston_wm *wm, xcb_generic_event_t *even
 		(xcb_reparent_notify_event_t *) event;
 	struct weston_wm_window *window;
 
-	wm_log("XCB_REPARENT_NOTIFY (window %d, parent %d, event %d%s)\n",
+	wm_log("XCB_REPARENT_NOTIFY (window %d, parent %d, event %d, O-R: %s)\n",
 	       reparent_notify->window,
 	       reparent_notify->parent,
 	       reparent_notify->event,
-	       reparent_notify->override_redirect ? ", override" : "");
+	       reparent_notify->override_redirect ? "yes" : "no");
 
 	if (reparent_notify->parent == wm->screen->root) {
 		weston_wm_window_create(wm, reparent_notify->window, 10, 10,
-- 
1.8.3.1



More information about the wayland-devel mailing list