diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-08-20 19:15:27 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-08-20 19:15:27 +0000 |
commit | 9e0f43e8cba45015487c692058c002f56087b9b8 (patch) | |
tree | e9bae739216181c715a697c6561d98f1e0019c88 /gtk | |
parent | 3e4d7250a005b799a4b7500f84dbabf3ec758750 (diff) | |
download | gtk+-9e0f43e8cba45015487c692058c002f56087b9b8.tar.gz |
entry completion: Avoid critical warnings
We must not call move-to-rect unless we have
a transient parent.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkentrycompletion.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index bf1a7a425c..acb7f04425 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1461,14 +1461,16 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) gtk_tree_path_free (path); } - gdk_surface_move_to_rect (_gtk_widget_get_surface (completion->priv->popup_window), - &allocation, - GDK_GRAVITY_SOUTH, - GDK_GRAVITY_NORTH, - GDK_ANCHOR_FLIP_Y | GDK_ANCHOR_SLIDE_X, - 0, 0); - - gtk_widget_show (completion->priv->popup_window); + if (gtk_window_get_transient_for (GTK_WINDOW (completion->priv->popup_window))) + { + gdk_surface_move_to_rect (_gtk_widget_get_surface (completion->priv->popup_window), + &allocation, + GDK_GRAVITY_SOUTH, + GDK_GRAVITY_NORTH, + GDK_ANCHOR_FLIP_Y | GDK_ANCHOR_SLIDE_X, + 0, 0); + gtk_widget_show (completion->priv->popup_window); + } } static void |