From 9e0f43e8cba45015487c692058c002f56087b9b8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 20 Aug 2018 19:15:27 +0000 Subject: entry completion: Avoid critical warnings We must not call move-to-rect unless we have a transient parent. --- gtk/gtkentrycompletion.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gtk') 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 -- cgit v1.2.1