From e5ecc0c15d4ec42787971ed0b0c28848ea183455 Mon Sep 17 00:00:00 2001 From: o9000 Date: Tue, 14 Nov 2017 15:41:21 +0100 Subject: [PATCH] Taskbar: thumbnails (use image size without cosidering frame) --- src/util/window.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/util/window.c b/src/util/window.c index 17ec411..1a8ecf0 100644 --- a/src/util/window.c +++ b/src/util/window.c @@ -359,9 +359,12 @@ char *get_window_name(Window win) cairo_surface_t *get_window_thumbnail(Window win) { - int x, y, w, h; - if (!get_window_coordinates(win, &x, &y, &w, &h) || !w || !h) + XWindowAttributes wa; + if (!XGetWindowAttributes(server.display, win, &wa)) return NULL; + int w, h; + w = wa.width; + h = wa.height; int tw, th; double sx, sy; @@ -381,10 +384,6 @@ cairo_surface_t *get_window_thumbnail(Window win) ox = oy = 0; } - XWindowAttributes wa; - if (!XGetWindowAttributes(server.display, win, &wa)) - return NULL; - cairo_surface_t *x11_surface = cairo_xlib_surface_create(server.display, win, wa.visual, w, h); cairo_surface_t *image_surface = cairo_surface_create_similar_image(x11_surface, CAIRO_FORMAT_ARGB32, tw, th);