GtkTooltip: Fix tooltip positioning on X11
On X11, gdk_window_move_to_rect() uses the position of the window to
calculate how it should be moved. However, any pending resizes that will
be executed on show() are not taken into account, resulting in
incorrectly positioned tooltips in case a tooltip window is re-used
often. This is not solved by gtk_widget_realize(), as this will do
nothing if the window is already realized.
Let's add a call to the private gtk_window_move_resize() function, so
that the size is always recalculated before the window is sent to
gdk_window_move_to_rect().
This exact fix was also needed in GtkMenu (7298e73c
), with similar
reasoning.
Fixes #2142
Fixes #2227
This commit is contained in:
parent
6104130af2
commit
bb1d5e7de7
@ -880,6 +880,7 @@ gtk_tooltip_position (GtkTooltip *tooltip,
|
||||
int anchor_rect_padding;
|
||||
|
||||
gtk_widget_realize (GTK_WIDGET (tooltip->current_window));
|
||||
gtk_window_move_resize (tooltip->current_window);
|
||||
window = _gtk_widget_get_window (GTK_WIDGET (tooltip->current_window));
|
||||
|
||||
tooltip->tooltip_widget = new_tooltip_widget;
|
||||
|
Loading…
Reference in New Issue
Block a user