xwm: debug what kind decoration is drawn
authorPekka Paalanen <pekka.paalanen@collabora.com>
Wed, 4 Dec 2019 13:00:43 +0000 (15:00 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 12 Dec 2019 11:15:52 +0000 (13:15 +0200)
Knowing the kind of decoration drawn will help track down issues with
unexpected decorations.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
xwayland/window-manager.c

index 8da5fde0cfa43b169d126b350c62fce2ea8bd877..6a646fe9f12d33331923df9b6e2ceee0808298ed 100644 (file)
@@ -1226,8 +1226,7 @@ weston_wm_window_draw_decoration(struct weston_wm_window *window)
 {
        cairo_t *cr;
        int width, height;
-
-       wm_printf(window->wm, "XWM: draw decoration, win %d\n", window->id);
+       const char *how;
 
        weston_wm_window_get_frame_size(window, &width, &height);
 
@@ -1235,11 +1234,14 @@ weston_wm_window_draw_decoration(struct weston_wm_window *window)
        cr = cairo_create(window->cairo_surface);
 
        if (window->fullscreen) {
+               how = "fullscreen";
                /* nothing */
        } else if (window->decorate) {
+               how = "decorate";
                frame_set_title(window->frame, window->name);
                frame_repaint(window->frame, cr);
        } else {
+               how = "shadow";
                cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
                cairo_set_source_rgba(cr, 0, 0, 0, 0);
                cairo_paint(cr);
@@ -1248,6 +1250,9 @@ weston_wm_window_draw_decoration(struct weston_wm_window *window)
                              2, 2, width + 8, height + 8, 64, 64);
        }
 
+       wm_printf(window->wm, "XWM: draw decoration, win %d, %s\n",
+                 window->id, how);
+
        cairo_destroy(cr);
        cairo_surface_flush(window->cairo_surface);
        xcb_flush(window->wm->conn);