mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 01:31:13 +00:00
GtkTooltip: take csd shadows into account for placement
When placing tooltips, we don't want the shadow to influence our choice. https://bugzilla.gnome.org/show_bug.cgi?id=731187
This commit is contained in:
parent
49bb39ecf5
commit
179d6a4c7b
@ -980,6 +980,7 @@ gtk_tooltip_position (GtkTooltip *tooltip,
|
||||
GdkRectangle monitor;
|
||||
guint cursor_size;
|
||||
GdkRectangle bounds;
|
||||
GtkBorder border;
|
||||
|
||||
#define MAX_DISTANCE 32
|
||||
|
||||
@ -990,8 +991,10 @@ gtk_tooltip_position (GtkTooltip *tooltip,
|
||||
|
||||
screen = gtk_widget_get_screen (new_tooltip_widget);
|
||||
|
||||
width = gtk_widget_get_allocated_width (GTK_WIDGET (tooltip->current_window));
|
||||
height = gtk_widget_get_allocated_height (GTK_WIDGET (tooltip->current_window));
|
||||
_gtk_window_get_shadow_width (GTK_WINDOW (tooltip->current_window), &border);
|
||||
|
||||
width = gtk_widget_get_allocated_width (GTK_WIDGET (tooltip->current_window)) - border.left - border.right;
|
||||
height = gtk_widget_get_allocated_height (GTK_WIDGET (tooltip->current_window)) - border.top - border.bottom;
|
||||
|
||||
monitor_num = gdk_screen_get_monitor_at_point (screen,
|
||||
tooltip->last_x,
|
||||
@ -1133,6 +1136,9 @@ found:
|
||||
}
|
||||
#endif
|
||||
|
||||
x -= border.left;
|
||||
y -= border.top;
|
||||
|
||||
gtk_window_move (GTK_WINDOW (tooltip->current_window), x, y);
|
||||
gtk_widget_show (GTK_WIDGET (tooltip->current_window));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user