[gtk/wip/carlosg/input-fixes] gtktexthandle: Set parent through API call



commit 2c23546ba90ff1a44789e9281d8fc952f0b40af5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Apr 25 00:09:41 2020 +0200

    gtktexthandle: Set parent through API call
    
    The GtkWidget::parent property went readonly, use the API call
    to ensure the text handle has a parent set.

 gtk/gtktexthandle.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index c38c3c08b5..fda579ca52 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -459,10 +459,14 @@ gtk_text_handle_init (GtkTextHandle *widget)
 GtkTextHandle *
 gtk_text_handle_new (GtkWidget *parent)
 {
-  return g_object_new (GTK_TYPE_TEXT_HANDLE,
-                       "parent", parent,
-                       "css-name", I_("cursor-handle"),
-                       NULL);
+  GtkTextHandle *handle;
+
+  handle = g_object_new (GTK_TYPE_TEXT_HANDLE,
+                         "css-name", I_("cursor-handle"),
+                         NULL);
+  gtk_widget_set_parent (GTK_WIDGET (handle), parent);
+
+  return handle;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]