[gtk] entry completion: Avoid critical warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] entry completion: Avoid critical warnings
- Date: Mon, 20 Aug 2018 19:19:55 +0000 (UTC)
commit 9e0f43e8cba45015487c692058c002f56087b9b8
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Aug 20 19:15:27 2018 +0000
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(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]