Commit ebe30774 authored by o9000's avatar o9000

Taskbar: thumbnails (make sure window is not minimized)

parent d463dcb5
......@@ -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)
goto err0;
if (window_is_iconified(win))
goto err0;
size_t w, h;
w = (size_t)wa.width;
h = (size_t)wa.height;
......@@ -437,6 +440,9 @@ cairo_surface_t *screenshot(Window win, size_t size)
goto err4;
}
if (window_is_iconified(win))
goto err4;
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);
memset(data, 0, tw * th);
......@@ -504,6 +510,8 @@ cairo_surface_t *get_window_thumbnail_cairo(Window win, int size)
XWindowAttributes wa;
if (!XGetWindowAttributes(server.display, win, &wa))
return NULL;
if (window_is_iconified(win))
return NULL;
int w, h;
w = wa.width;
h = wa.height;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment