Taskbar: thumbnails (use image size without cosidering frame)
This commit is contained in:
@@ -359,9 +359,12 @@ char *get_window_name(Window win)
|
|||||||
|
|
||||||
cairo_surface_t *get_window_thumbnail(Window win)
|
cairo_surface_t *get_window_thumbnail(Window win)
|
||||||
{
|
{
|
||||||
int x, y, w, h;
|
XWindowAttributes wa;
|
||||||
if (!get_window_coordinates(win, &x, &y, &w, &h) || !w || !h)
|
if (!XGetWindowAttributes(server.display, win, &wa))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
int w, h;
|
||||||
|
w = wa.width;
|
||||||
|
h = wa.height;
|
||||||
|
|
||||||
int tw, th;
|
int tw, th;
|
||||||
double sx, sy;
|
double sx, sy;
|
||||||
@@ -381,10 +384,6 @@ cairo_surface_t *get_window_thumbnail(Window win)
|
|||||||
ox = oy = 0;
|
ox = oy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
XWindowAttributes wa;
|
|
||||||
if (!XGetWindowAttributes(server.display, win, &wa))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
cairo_surface_t *x11_surface =
|
cairo_surface_t *x11_surface =
|
||||||
cairo_xlib_surface_create(server.display, win, wa.visual, w, h);
|
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);
|
cairo_surface_t *image_surface = cairo_surface_create_similar_image(x11_surface, CAIRO_FORMAT_ARGB32, tw, th);
|
||||||
|
|||||||
Reference in New Issue
Block a user