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

Submitted by Fabien Lahoudere on May 4, 2018, 9:10 a.m.

Details

Message ID 1525425014-9487-2-git-send-email-fabien.lahoudere@collabora.com
State New
Series "xwm: Handle changing override redirect flag"
Headers show

Commit Message

Fabien Lahoudere May 4, 2018, 9:10 a.m.
From: Pekka Paalanen <pekka.paalanen@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@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>

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

Patch hide | download patch | download mbox

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,