# HG changeset patch # User Kosta Arvanitis # Date 1234734154 0 # Node ID 2d873973b4d62a322727f21225525597436d076e # Parent b90c26f391b0f74554540435850168e32b12a261 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. committer: John Bailey diff -r b90c26f391b0 -r 2d873973b4d6 pidgin/pidgintooltip.c --- a/pidgin/pidgintooltip.c Sun Feb 15 21:26:22 2009 +0000 +++ b/pidgin/pidgintooltip.c Sun Feb 15 21:42:34 2009 +0000 @@ -135,14 +135,14 @@ 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 @@ 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 @@ 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;