Taskbar: thumbnails (small fixes and disable shm for now)
o9000 mrovi9000@gmail.com
3 files changed,
8 insertions(+),
8 deletions(-)
M
src/taskbar/task.c
→
src/taskbar/task.c
@@ -649,7 +649,8 @@ {
if (!task || state == TASK_UNDEFINED || state >= TASK_STATE_COUNT) return; - task_refresh_thumbnail(task); + if (!task->thumbnail) + task_refresh_thumbnail(task); taskbar_start_thumbnail_timer(TRUE); if (state == TASK_ACTIVE && task->current_state != state) {
M
src/taskbar/taskbar.c
→
src/taskbar/taskbar.c
@@ -365,7 +365,7 @@ void taskbar_start_thumbnail_timer(gboolean fast)
{ if (!panel_config.g_task.thumbnail_enabled) return; - change_timeout(&thumbnail_update_timer, 100, 10 * 1000, taskbar_update_thumbnails, (void*)(long)fast); + change_timeout(&thumbnail_update_timer, 500, 10 * 1000, taskbar_update_thumbnails, (void*)(long)fast); } void taskbar_init_fonts()
M
src/util/window.c
→
src/util/window.c
@@ -388,7 +388,7 @@ cairo_surface_t *screenshot(Window win, size_t size)
{ cairo_surface_t *result = NULL; XWindowAttributes wa; - if (!XGetWindowAttributes(server.display, win, &wa) || wa.width <= 0 || wa.height <= 0) + if (!XGetWindowAttributes(server.display, win, &wa) || wa.width <= 0 || wa.height <= 0 || wa.map_state != IsViewable) goto err0; if (window_is_iconified(win))@@ -448,7 +448,8 @@ fprintf(stderr, RED "tint2: !xshmgetimage" RESET "\n");
goto err4; } - if (window_is_iconified(win)) + XGetWindowAttributes(server.display, win, &wa); + if (wa.map_state != IsViewable) goto err4; result = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (int)tw, (int)th);@@ -544,9 +545,7 @@ cairo_surface_t *get_window_thumbnail_cairo(Window win, int size)
{ static cairo_filter_t filter = CAIRO_FILTER_BEST; XWindowAttributes wa; - if (!XGetWindowAttributes(server.display, win, &wa)) - return NULL; - if (window_is_iconified(win)) + if (!XGetWindowAttributes(server.display, win, &wa) || wa.width <= 0 || wa.height <= 0 || wa.map_state != IsViewable) return NULL; int w, h; w = wa.width;@@ -616,7 +615,7 @@
cairo_surface_t *get_window_thumbnail(Window win, int size) { cairo_surface_t *image_surface = NULL; - if (server.has_shm && server.composite_manager) { + if (0 && server.has_shm && server.composite_manager) { image_surface = screenshot(win, (size_t)size); if (image_surface && cairo_surface_is_blank(image_surface)) { cairo_surface_destroy(image_surface);