all repos — tint2 @ 580c3e765f882ad3dc427290320b36d4474aea6b

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

Extend mouse over area to edge of panel for first and last area, if full width clickable (issue #572)
o9000 mrovi9000@gmail.com
commit

580c3e765f882ad3dc427290320b36d4474aea6b

parent

7dc24b8ee6833fe5af96d8f22d6ee5225b6ab344

1 files changed, 61 insertions(+), 2 deletions(-)

jump to
M src/util/area.csrc/util/area.c

@@ -583,6 +583,65 @@ panel_refresh = TRUE;

mouse_over_area = NULL; } +gboolean area_is_first(void *obj) +{ + Area *a = obj; + if (!a->on_screen) + return FALSE; + + Panel *panel = a->panel; + + Area *node = &panel->area; + + while (node) { + if (!node->on_screen) + return FALSE; + if (node == a) + return TRUE; + + GList *l = node->children; + node = NULL; + for (; l; l = l->next) { + Area *child = l->data; + if (!child->on_screen) + continue; + node = child; + break; + } + } + + return FALSE; +} + +gboolean area_is_last(void *obj) +{ + Area *a = obj; + if (!a->on_screen) + return FALSE; + + Panel *panel = a->panel; + + Area *node = &panel->area; + + while (node) { + if (!node->on_screen) + return FALSE; + if (node == a) + return TRUE; + + GList *l = node->children; + node = NULL; + for (; l; l = l->next) { + Area *child = l->data; + if (!child->on_screen) + continue; + node = child; + } + } + + return FALSE; +} + gboolean area_is_under_mouse(void *obj, int x, int y) { Area *a = obj;

@@ -605,9 +664,9 @@ if (a->_is_under_mouse && a->_is_under_mouse != full_width_area_is_under_mouse)

return a->_is_under_mouse(a, x, y); if (panel_horizontal) - return x >= a->posx && x <= a->posx + a->width; + return (x >= a->posx || area_is_first(a)) && (x <= a->posx + a->width || area_is_last(a)); else - return y >= a->posy && y <= a->posy + a->height; + return (y >= a->posy || area_is_first(a)) && (y <= a->posy + a->height || area_is_last(a)); } Area *find_area_under_mouse(void *root, int x, int y)