-static int x_original, y_original, x, y, width, height;
+static int x, y, width, height;
void tooltip_trigger_show(Area* area, Panel* p, XEvent *e)
{
// Position the tooltip in the center of the area
void tooltip_trigger_show(Area* area, Panel* p, XEvent *e)
{
// Position the tooltip in the center of the area
- x = x_original = area->posx + area->width / 2 + e->xmotion.x_root - e->xmotion.x;
- y = y_original = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y;
+ x = area->posx + area->width / 2 + e->xmotion.x_root - e->xmotion.x;
+ y = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y;
+ if (!panel_horizontal)
+ y -= height/2;
int mx, my;
Window w;
XTranslateCoordinates( server.dsp, server.root_win, g_tooltip.panel->main_win, x, y, &mx, &my, &w);
int mx, my;
Window w;
XTranslateCoordinates( server.dsp, server.root_win, g_tooltip.panel->main_win, x, y, &mx, &my, &w);
- Area* area = click_area(g_tooltip.panel, mx, my);
+ Area* area;
+ if (!panel_horizontal)
+ my += height/2; /* we adjusted y in tooltip_trigger_show, revert or we won't find the correct area anymore */
+ area = click_area(g_tooltip.panel, mx, my);
width = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingx + r2.width;
height = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingy + r2.height;
width = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingx + r2.width;
height = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingy + r2.height;
Panel* panel = g_tooltip.panel;
int screen_width = server.monitor[panel->monitor].x + server.monitor[panel->monitor].width;
int screen_height = server.monitor[panel->monitor].y + server.monitor[panel->monitor].height;
Panel* panel = g_tooltip.panel;
int screen_width = server.monitor[panel->monitor].x + server.monitor[panel->monitor].width;
int screen_height = server.monitor[panel->monitor].y + server.monitor[panel->monitor].height;