Make tooltip positioning Xinerama-aware. (#127332)
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de> * gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip positioning Xinerama-aware. (#127332)
This commit is contained in:

committed by
Matthias Clasen

parent
94511bb111
commit
d17dc738e2
@ -1,3 +1,8 @@
|
||||
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip
|
||||
positioning Xinerama-aware. (#127332)
|
||||
|
||||
Fri Nov 21 01:57:21 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkscreen-x11.c (init_xinerama_support): Make monitor
|
||||
|
@ -1,3 +1,8 @@
|
||||
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip
|
||||
positioning Xinerama-aware. (#127332)
|
||||
|
||||
Fri Nov 21 01:57:21 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkscreen-x11.c (init_xinerama_support): Make monitor
|
||||
|
@ -1,3 +1,8 @@
|
||||
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip
|
||||
positioning Xinerama-aware. (#127332)
|
||||
|
||||
Fri Nov 21 01:57:21 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkscreen-x11.c (init_xinerama_support): Make monitor
|
||||
|
@ -1,3 +1,8 @@
|
||||
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip
|
||||
positioning Xinerama-aware. (#127332)
|
||||
|
||||
Fri Nov 21 01:57:21 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkscreen-x11.c (init_xinerama_support): Make monitor
|
||||
|
@ -1,3 +1,8 @@
|
||||
Sun Nov 23 22:26:25 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Make tooltip
|
||||
positioning Xinerama-aware. (#127332)
|
||||
|
||||
Fri Nov 21 01:57:21 2003 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk/x11/gdkscreen-x11.c (init_xinerama_support): Make monitor
|
||||
|
@ -390,10 +390,13 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips)
|
||||
GtkRequisition requisition;
|
||||
GtkWidget *widget;
|
||||
GtkStyle *style;
|
||||
gint x, y, w, h, scr_w, scr_h;
|
||||
gint x, y, w, h;
|
||||
GtkTooltipsData *data;
|
||||
gboolean keyboard_mode;
|
||||
GdkScreen *screen;
|
||||
GdkScreen *pointer_screen;
|
||||
gint monitor_num, px, py;
|
||||
GdkRectangle monitor;
|
||||
|
||||
if (!tooltips->tip_window)
|
||||
gtk_tooltips_force_window (tooltips);
|
||||
@ -410,8 +413,6 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips)
|
||||
gtk_tooltips_update_screen (tooltips, FALSE);
|
||||
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
scr_w = gdk_screen_get_width (screen);
|
||||
scr_h = gdk_screen_get_height (screen);
|
||||
|
||||
data = tooltips->active_tips_data;
|
||||
|
||||
@ -436,12 +437,22 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips)
|
||||
|
||||
x -= (w / 2 + 4);
|
||||
|
||||
if ((x + w) > scr_w)
|
||||
x -= (x + w) - scr_w;
|
||||
else if (x < 0)
|
||||
x = 0;
|
||||
gdk_display_get_pointer (gdk_screen_get_display (screen),
|
||||
&pointer_screen, &px, &py, NULL);
|
||||
if (pointer_screen != screen)
|
||||
{
|
||||
px = x;
|
||||
py = y;
|
||||
}
|
||||
monitor_num = gdk_screen_get_monitor_at_point (screen, px, py);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
|
||||
if ((y + h + widget->allocation.height + 4) > scr_h)
|
||||
if ((x + w) > monitor.x + monitor.width)
|
||||
x -= (x + w) - (monitor.x + monitor.width);
|
||||
else if (x < monitor.x)
|
||||
x = monitor.x;
|
||||
|
||||
if ((y + h + widget->allocation.height + 4) > monitor.y + monitor.height)
|
||||
y = y - h - 4;
|
||||
else
|
||||
y = y + widget->allocation.height + 4;
|
||||
|
Reference in New Issue
Block a user