Taskbar: thumbnails (make sure window is not minimized)

This commit is contained in:
o9000
2017-11-15 12:14:37 +01:00
parent d463dcb5b4
commit ebe30774ac

View File

@@ -387,6 +387,9 @@ cairo_surface_t *screenshot(Window win, size_t size)
if (!XGetWindowAttributes(server.display, win, &wa) || wa.width <= 0 || wa.height <= 0) if (!XGetWindowAttributes(server.display, win, &wa) || wa.width <= 0 || wa.height <= 0)
goto err0; goto err0;
if (window_is_iconified(win))
goto err0;
size_t w, h; size_t w, h;
w = (size_t)wa.width; w = (size_t)wa.width;
h = (size_t)wa.height; h = (size_t)wa.height;
@@ -437,6 +440,9 @@ cairo_surface_t *screenshot(Window win, size_t size)
goto err4; goto err4;
} }
if (window_is_iconified(win))
goto err4;
result = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (int)tw, (int)th); result = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (int)tw, (int)th);
u_int32_t *data = (u_int32_t *)cairo_image_surface_get_data(result); u_int32_t *data = (u_int32_t *)cairo_image_surface_get_data(result);
memset(data, 0, tw * th); memset(data, 0, tw * th);
@@ -504,6 +510,8 @@ cairo_surface_t *get_window_thumbnail_cairo(Window win, int size)
XWindowAttributes wa; XWindowAttributes wa;
if (!XGetWindowAttributes(server.display, win, &wa)) if (!XGetWindowAttributes(server.display, win, &wa))
return NULL; return NULL;
if (window_is_iconified(win))
return NULL;
int w, h; int w, h;
w = wa.width; w = wa.width;
h = wa.height; h = wa.height;