all repos — tint2 @ 052122389909832810c2e8bae3ef6f44d1f8b8b4

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Taskbar: thumbnails (interleave slow periodic throttling with event processing)
o9000 mrovi9000@gmail.com
commit

052122389909832810c2e8bae3ef6f44d1f8b8b4

parent

cbf3cebbb01831dc237643c91ec47e014e0d89b7

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -797,6 +797,7 @@ void taskbar_update_thumbnails(void *fast)

{ if (!panel_config.g_task.thumbnail_enabled) return; + double start_time = get_time(); change_timeout(&thumbnail_update_timer, 10 * 1000, 10 * 1000, taskbar_update_thumbnails, NULL); for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i];

@@ -806,6 +807,13 @@ for (GList *c = (taskbar->area.children && taskbarname_enabled) ? taskbar->area.children->next : taskbar->area.children; c; c = c->next) {

Task *t = (Task *)c->data; if (!fast || t->current_state == TASK_ACTIVE) task_refresh_thumbnail(t); + if (!fast) { + double now = get_time(); + if (now - start_time > 0.030) { + change_timeout(&thumbnail_update_timer, 10, 10 * 1000, taskbar_update_thumbnails, fast); + return; + } + } } } }