Taskbar: thumbnails (use image size without cosidering frame)

This commit is contained in:
o9000 2017-11-14 15:41:21 +01:00
parent 812e306376
commit e5ecc0c15d

View file

@ -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);