all repos — tint2 @ 3190c5b7de7925f0f0d9570e7124936b9079bc20

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

Scaling support - tooltips (issue #656)
o9000 mrovi9000@gmail.com
commit

3190c5b7de7925f0f0d9570e7124936b9079bc20

parent

5db0dceec23f24133cda220475a762538b974d17

2 files changed, 6 insertions(+), 2 deletions(-)

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

@@ -655,12 +655,13 @@ if (!panel_config.g_task.thumbnail_enabled)

return; if (task->current_state == TASK_ICONIFIED) return; + Panel *panel = (Panel*)task->area.panel; double now = get_time(); if (now - task->thumbnail_last_update < 0.1) return; if (debug_thumbnails) fprintf(stderr, "tint2: thumbnail for window: %s" RESET "\n", task->title ? task->title : ""); - cairo_surface_t *thumbnail = get_window_thumbnail(task->win, panel_config.g_task.thumbnail_width); + cairo_surface_t *thumbnail = get_window_thumbnail(task->win, panel_config.g_task.thumbnail_width * panel->scale); if (!thumbnail) return; if (task->thumbnail)
M src/tooltip/tooltip.csrc/tooltip/tooltip.c

@@ -281,7 +281,9 @@ cairo_stroke(c);

Color fc = g_tooltip.font_color; cairo_set_source_rgba(c, fc.rgb[0], fc.rgb[1], fc.rgb[2], fc.alpha); - PangoLayout *layout = pango_cairo_create_layout(c); + PangoContext *context = pango_cairo_create_context(c); + pango_cairo_context_set_resolution(context, 96 * panel->scale); + PangoLayout *layout = pango_layout_new(context); pango_layout_set_font_description(layout, g_tooltip.font_desc); pango_layout_set_wrap(layout, PANGO_WRAP_WORD); pango_layout_set_text(layout, g_tooltip.tooltip_text, -1);

@@ -297,6 +299,7 @@ -r1.x / 2 + left_bg_border_width(g_tooltip.bg) + g_tooltip.paddingx * panel->scale,

-r1.y / 2 + 1 + top_bg_border_width(g_tooltip.bg) + g_tooltip.paddingy * panel->scale); pango_cairo_show_layout(c, layout); g_object_unref(layout); + g_object_unref(context); if (g_tooltip.image) { cairo_translate(c,