From 48e7e38b11ce4f1add6154f80113becf6291ec43 Mon Sep 17 00:00:00 2001 From: o9000 Date: Tue, 29 Mar 2016 14:35:24 +0200 Subject: [PATCH] Compute task button size correctly if max size is 0 (issue #575) --- src/taskbar/taskbar.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index de7ed4c..7c7d9b9 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -223,6 +223,11 @@ void init_taskbar_panel(void *p) if ((panel->g_task.config_background_mask & (1 << TASK_URGENT)) == 0) panel->g_task.background[TASK_URGENT] = panel->g_task.background[TASK_ACTIVE]; + if (!panel->g_task.maximum_width) + panel->g_task.maximum_width = server.monitors[panel->monitor].width; + if (!panel->g_task.maximum_height) + panel->g_task.maximum_height = server.monitors[panel->monitor].height; + if (panel_horizontal) { panel->g_task.area.posy = panel->g_taskbar.area.posy + panel->g_taskbar.background[TASKBAR_NORMAL]->border.width + @@ -262,9 +267,6 @@ void init_taskbar_panel(void *p) PANGO_ELLIPSIZE_END, FALSE); - if (!panel->g_task.maximum_width && panel_horizontal) - panel->g_task.maximum_width = server.monitors[panel->monitor].width; - panel->g_task.text_posx = panel->g_task.background[0]->border.width + panel->g_task.area.paddingxlr; panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); if (panel->g_task.has_icon) {