[gnome-builder/wip/gtk4-port: 986/1774] libide/gui: use root for ide_widget_get_context()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 986/1774] libide/gui: use root for ide_widget_get_context()
- Date: Mon, 11 Jul 2022 22:31:30 +0000 (UTC)
commit 84bace9aa51db52996e7da29b3001eab7544f6aa
Author: Christian Hergert <chergert redhat com>
Date: Wed May 11 17:40:42 2022 -0700
libide/gui: use root for ide_widget_get_context()
The native isn't enough, as that would stop at popovers.
src/libide/gui/ide-gui-global.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/libide/gui/ide-gui-global.c b/src/libide/gui/ide-gui-global.c
index 224898b94..38e99f563 100644
--- a/src/libide/gui/ide-gui-global.c
+++ b/src/libide/gui/ide-gui-global.c
@@ -157,18 +157,18 @@ static gboolean dummy_cb (gpointer) { return G_SOURCE_REMOVE; }
IdeContext *
ide_widget_get_context (GtkWidget *widget)
{
- GtkWidget *toplevel;
+ GtkRoot *root;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- toplevel = GTK_WIDGET (gtk_widget_get_native (widget));
+ root = gtk_widget_get_root (widget);
- if (IDE_IS_WORKSPACE (toplevel))
- return ide_workspace_get_context (IDE_WORKSPACE (toplevel));
+ if (IDE_IS_WORKSPACE (root))
+ return ide_workspace_get_context (IDE_WORKSPACE (root));
- if (toplevel != NULL)
+ if (root != NULL)
{
- GObjectClass *object_class = G_OBJECT_GET_CLASS (toplevel);
+ GObjectClass *object_class = G_OBJECT_GET_CLASS (root);
GParamSpec *pspec = g_object_class_find_property (object_class, "context");
if (G_IS_PARAM_SPEC_OBJECT (pspec) &&
@@ -178,7 +178,7 @@ ide_widget_get_context (GtkWidget *widget)
IdeContext *ret;
g_value_init (&value, IDE_TYPE_CONTEXT);
- g_object_get_property (G_OBJECT (toplevel), "context", &value);
+ g_object_get_property (G_OBJECT (root), "context", &value);
ret = g_value_dup_object (&value);
g_idle_add_full (G_PRIORITY_LOW, dummy_cb, ret, g_object_unref);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]