void tooltip_trigger_show(Area* area, Panel* p, int x_root, int y_root) { x = x_root; y = y_root; g_tooltip.panel = p; if (g_tooltip.mapped && g_tooltip.area != area) { tooltip_copy_text(area); tooltip_update(); stop_tooltip_timeout(); } else if (!g_tooltip.mapped) { start_show_timeout(); } }
void tooltip_trigger_show(Area *area, Panel *p, XEvent *e) { // Position the tooltip in the center of the area x = area->posx + MIN(area->width / 3, 22) + e->xmotion.x_root - e->xmotion.x; y = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y; just_shown = TRUE; g_tooltip.panel = p; if (g_tooltip.mapped && g_tooltip.area != area) { tooltip_copy_text(area); tooltip_update(); stop_tooltip_timeout(); } else if (!g_tooltip.mapped) { start_show_timeout(); } }