[gtk/wip/matthiasc/popup2: 43/51] baby steps towards not being a toplevel
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup2: 43/51] baby steps towards not being a toplevel
- Date: Mon, 18 Mar 2019 12:48:48 +0000 (UTC)
commit 3ec20f21498d9d2118c2c91d181126a243ef8633
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 17 14:13:11 2019 -0400
baby steps towards not being a toplevel
Set a parent for the widget, and set a transient parent for
the surface.
gtk/gtkpopup.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkpopup.c b/gtk/gtkpopup.c
index 73f9e548ca..14e14e3938 100644
--- a/gtk/gtkpopup.c
+++ b/gtk/gtkpopup.c
@@ -237,6 +237,7 @@ gtk_popup_realize (GtkWidget *widget)
0, 10);
#else
priv->surface = gdk_surface_new_toplevel (priv->display, 20, 20);
+ gdk_surface_set_transient_for (priv->surface, gtk_widget_get_surface (priv->relative_to));
#endif
gtk_widget_set_surface (widget, priv->surface);
@@ -565,6 +566,7 @@ gtk_popup_set_relative_to (GtkPopup *popup,
priv->relative_to = relative_to;
g_signal_connect (priv->relative_to, "size-allocate", G_CALLBACK (size_changed), popup);
priv->display = gtk_widget_get_display (relative_to);
+ gtk_widget_set_parent (GTK_WIDGET (popup), relative_to);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]