pidgin: 992293bb: Adjust tooltips to offset their position...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sun Feb 15 17:00:47 EST 2009


-----------------------------------------------------------------
Revision: 992293bb475bd58a74acb83bdef4142c6a5ba41d
Ancestor: ff7369e151932e20c318abd10759b3a18ef1e3de
Author: karvanitis at hotmail.com
Date: 2009-02-15T21:42:34
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/992293bb475bd58a74acb83bdef4142c6a5ba41d

Modified files:
        pidgin/pidgintooltip.c

ChangeLog: 

Adjust tooltips to offset their position by half the cursor size.  This will
cause the tooltips to appear below the cursor, which matches behavior seen
elsewhere.  Fixes #8148.

-------------- next part --------------
============================================================
--- pidgin/pidgintooltip.c	15792b2164f75d2c03f68fbc71941d4cee733826
+++ pidgin/pidgintooltip.c	351156fd6027d9096f1247fa41f69274d5af53e7
@@ -135,14 +135,14 @@ setup_tooltip_window_position(gpointer d
 setup_tooltip_window_position(gpointer data, int w, int h)
 {
 	int sig;
-	int scr_w, scr_h, x, y;
+	int scr_w, scr_h, x, y, dy;
 #if GTK_CHECK_VERSION(2,2,0)
 	int mon_num;
 	GdkScreen *screen = NULL;
 #endif
 	GdkRectangle mon_size;
 	GtkWidget *tipwindow = pidgin_tooltip.tipwindow;
-
+	
 #if GTK_CHECK_VERSION(2,2,0)
 	gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
 	mon_num = gdk_screen_get_monitor_at_point(screen, x, y);
@@ -158,6 +158,12 @@ setup_tooltip_window_position(gpointer d
 	mon_size.y = 0;
 #endif
 
+#if GTK_CHECK_VERSION(2,4,0)
+	dy = gdk_display_get_default_cursor_size(gdk_display_get_default()) / 2;
+#else
+	dy = 0;
+#endif
+
 #if GTK_CHECK_VERSION(2,2,0)
 	if (w > mon_size.width)
 		w = mon_size.width - 10;
@@ -168,9 +174,9 @@ setup_tooltip_window_position(gpointer d
 	x -= ((w >> 1) + 4);
 
 	if ((y + h + 4) > scr_h)
-		y = y - h - 5;
+		y = y - h - dy - 5;
 	else
-		y = y + 6;
+		y = y + dy + 6;
 
 	if (y < mon_size.y)
 		y = mon_size.y;


More information about the Commits mailing list