Mercurial > pidgin
diff pidgin/pidgintooltip.c @ 31611:6ee534f155d7
Fix a bug where the tooltip is destroyed when it have a lot of information. Fixes #10510
author | masca@cpw.pidgin.im |
---|---|
date | Fri, 13 May 2011 04:32:48 +0000 |
parents | a8cc50c2279f |
children | e2a1510da13d |
line wrap: on
line diff
--- a/pidgin/pidgintooltip.c Thu May 12 12:47:40 2011 +0000 +++ b/pidgin/pidgintooltip.c Fri May 13 04:32:48 2011 +0000 @@ -134,6 +134,7 @@ { int sig; int scr_w, scr_h, x, y, dy; + int preserved_x, preserved_y; int mon_num; GdkScreen *screen = NULL; GdkRectangle mon_size; @@ -154,6 +155,9 @@ if (h > mon_size.height) h = mon_size.height - 10; + preserved_x = x; + preserved_y = y; + x -= ((w >> 1) + 4); if ((y + h + 4) > scr_h) @@ -175,6 +179,12 @@ x = mon_size.x; } + /* If the mouse covered by the tipwindow, move the tipwindow + * to the righ side of the it */ + if ((preserved_x >= x) && (preserved_x <= (x + w)) + && (preserved_y >= y) && (preserved_y <= (y + h))) + x = preserved_x + dy; + gtk_widget_set_size_request(tipwindow, w, h); gtk_window_move(GTK_WINDOW(tipwindow), x, y); gtk_widget_show(tipwindow);