From 1ab8b854dff3452a708189e980ca84aebfc59984 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 12 Oct 2015 08:04:55 -0400 Subject: [PATCH] Improve debug logging of Wayland windows Displaying all Wayland windows with the XID of 0x0 makes it hard to figure out what is going on ... use the recently-added window->stamp to show Wayland windows as W1/W2/W3... --- src/core/window.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 8cbbfaf7a..d075cabaa 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -763,10 +763,22 @@ meta_window_update_desc (MetaWindow *window) { g_clear_pointer (&window->desc, g_free); - if (window->title) - window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title); + if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) + { + if (window->title) + window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title); + else + window->desc = g_strdup_printf ("0x%lx", window->xwindow); + } else - window->desc = g_strdup_printf ("0x%lx", window->xwindow); + { + guint64 small_stamp = window->stamp - G_GUINT64_CONSTANT(0x100000000); + + if (window->title) + window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%.10s)", small_stamp, window->title); + else + window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT , small_stamp); + } } static void