From 98ab770ab87ce8cfe240a864f382d2553244d782 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 4 Dec 2019 15:00:43 +0200 Subject: [PATCH] xwm: debug what kind decoration is drawn Knowing the kind of decoration drawn will help track down issues with unexpected decorations. Signed-off-by: Pekka Paalanen --- xwayland/window-manager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 8da5fde0..6a646fe9 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -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);