Taskbar: thumbnails (config, tint2conf and doc)
This commit is contained in:
@@ -50,6 +50,8 @@ char *task_get_tooltip(void *obj)
|
||||
|
||||
cairo_surface_t *task_get_thumbnail(void *obj)
|
||||
{
|
||||
if (!panel_config.g_task.thumbnail_enabled)
|
||||
return NULL;
|
||||
Task *t = (Task *)obj;
|
||||
if (!t->thumbnail)
|
||||
task_refresh_thumbnail(t);
|
||||
@@ -620,12 +622,14 @@ void reset_active_task()
|
||||
|
||||
void task_refresh_thumbnail(Task *task)
|
||||
{
|
||||
if (!panel_config.g_task.thumbnail_enabled)
|
||||
return;
|
||||
if (task->current_state == TASK_ICONIFIED)
|
||||
return;
|
||||
double now = get_time();
|
||||
if (now - task->thumbnail_last_update < 0.1)
|
||||
return;
|
||||
cairo_surface_t *thumbnail = get_window_thumbnail(task->win);
|
||||
cairo_surface_t *thumbnail = get_window_thumbnail(task->win, panel_config.g_task.thumbnail_width);
|
||||
if (!thumbnail)
|
||||
return;
|
||||
if (task->thumbnail)
|
||||
|
||||
@@ -46,6 +46,8 @@ typedef struct GlobalTask {
|
||||
Color font[TASK_STATE_COUNT];
|
||||
int config_font_mask;
|
||||
gboolean tooltip_enabled;
|
||||
gboolean thumbnail_enabled;
|
||||
int thumbnail_width;
|
||||
} GlobalTask;
|
||||
|
||||
// Stores information about a task.
|
||||
|
||||
@@ -46,7 +46,7 @@ gboolean hide_taskbar_if_empty;
|
||||
gboolean always_show_all_desktop_tasks;
|
||||
TaskbarSortMethod taskbar_sort_method;
|
||||
Alignment taskbar_alignment;
|
||||
static timeout *thumbnail_update_timer = NULL;
|
||||
static timeout *thumbnail_update_timer;
|
||||
|
||||
static GList *taskbar_task_orderings = NULL;
|
||||
|
||||
@@ -85,6 +85,7 @@ void default_taskbar()
|
||||
hide_task_diff_monitor = FALSE;
|
||||
hide_taskbar_if_empty = FALSE;
|
||||
always_show_all_desktop_tasks = FALSE;
|
||||
thumbnail_update_timer = NULL;
|
||||
taskbar_sort_method = TASKBAR_NOSORT;
|
||||
taskbar_alignment = ALIGN_LEFT;
|
||||
default_taskbarname();
|
||||
@@ -362,6 +363,8 @@ void init_taskbar_panel(void *p)
|
||||
|
||||
void taskbar_start_thumbnail_timer()
|
||||
{
|
||||
if (!panel_config.g_task.thumbnail_enabled)
|
||||
return;
|
||||
change_timeout(&thumbnail_update_timer, 100, 10 * 1000, taskbar_update_thumbnails, NULL);
|
||||
}
|
||||
|
||||
@@ -792,6 +795,8 @@ void update_minimized_icon_positions(void *p)
|
||||
|
||||
void taskbar_update_thumbnails(void *arg)
|
||||
{
|
||||
if (!panel_config.g_task.thumbnail_enabled)
|
||||
return;
|
||||
for (int i = 0; i < num_panels; i++) {
|
||||
Panel *panel = &panels[i];
|
||||
for (int j = 0; j < panel->num_desktops; j++) {
|
||||
|
||||
Reference in New Issue
Block a user