Mercurial > pidgin
changeset 25468:2d873973b4d6
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 <rekkanoryo@rekkanoryo.org>
author | Kosta Arvanitis <karvanitis@hotmail.com> |
---|---|
date | Sun, 15 Feb 2009 21:42:34 +0000 |
parents | b90c26f391b0 |
children | 33ceb2b708cf |
files | pidgin/pidgintooltip.c |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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;