X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftooltip%2Ftooltip.c;h=cf62db392d68afcd605d6002398196448766bf3d;hb=c929b4afa0049f43fd31927680303d3516f6e84f;hp=eb880dd721107574544e8029ec4b487f673bd5b5;hpb=4c60717430896e520cf7255dbc9874a7990dd531;p=chaz%2Ftint2 diff --git a/src/tooltip/tooltip.c b/src/tooltip/tooltip.c index eb880dd..cf62db3 100644 --- a/src/tooltip/tooltip.c +++ b/src/tooltip/tooltip.c @@ -80,6 +80,8 @@ void tooltip_trigger_show(Area* area, Panel* p, XEvent *e) // Position the tooltip in the center of the area 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; g_tooltip.panel = p; if (g_tooltip.mapped && g_tooltip.area != area) { tooltip_copy_text(area); @@ -149,22 +151,22 @@ void tooltip_adjust_geometry() 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; - if ( x+width <= screen_width && y+height <= screen_height && x>=0 && y>=0) + if ( x+width <= screen_width && y+height <= screen_height && x>=server.monitor[panel->monitor].x && y>=server.monitor[panel->monitor].y ) return; // no adjustment needed if (panel_horizontal) { min_x=0; - max_width=screen_width; - max_height=screen_height-panel->area.height; + max_width=server.monitor[panel->monitor].width; + max_height=server.monitor[panel->monitor].height-panel->area.height; if (panel_position & BOTTOM) min_y=0; else min_y=panel->area.height; } else { - max_width=screen_width-panel->area.width; + max_width=server.monitor[panel->monitor].width-panel->area.width; min_y=0; - max_height=screen_height; + max_height=server.monitor[panel->monitor].height; if (panel_position & LEFT) min_x=panel->area.width; else