[gtk+] flowbox: Use gdk_window_new_child()



commit 1c6a879e1c3843c3b039eeee090cd23396734637
Author: Benjamin Otte <otte redhat com>
Date:   Mon Oct 17 20:21:00 2016 +0200

    flowbox: Use gdk_window_new_child()

 gtk/gtkflowbox.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index b3a914b..28e1815 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -3192,28 +3192,20 @@ gtk_flow_box_realize (GtkWidget *widget)
 {
   GtkFlowBox *box = GTK_FLOW_BOX (widget);
   GtkAllocation allocation;
-  GdkWindowAttr attributes = {0};
   GdkWindow *window;
 
   gtk_widget_get_allocation (GTK_WIDGET (box), &allocation);
   gtk_widget_set_realized (GTK_WIDGET (box), TRUE);
 
-  attributes.x = allocation.x;
-  attributes.y = allocation.y;
-  attributes.width = allocation.width;
-  attributes.height = allocation.height;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (GTK_WIDGET (box))
-                                | GDK_ENTER_NOTIFY_MASK
-                                | GDK_LEAVE_NOTIFY_MASK
-                                | GDK_POINTER_MOTION_MASK
-                                | GDK_KEY_PRESS_MASK
-                                | GDK_BUTTON_PRESS_MASK
-                                | GDK_BUTTON_RELEASE_MASK;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-
-  window = gdk_window_new (gtk_widget_get_parent_window (GTK_WIDGET (box)),
-                           &attributes, GDK_WA_X | GDK_WA_Y);
+  window = gdk_window_new_child (gtk_widget_get_parent_window (GTK_WIDGET (box)),
+                                 gtk_widget_get_events (GTK_WIDGET (box))
+                                 | GDK_ENTER_NOTIFY_MASK
+                                 | GDK_LEAVE_NOTIFY_MASK
+                                 | GDK_POINTER_MOTION_MASK
+                                 | GDK_KEY_PRESS_MASK
+                                 | GDK_BUTTON_PRESS_MASK
+                                 | GDK_BUTTON_RELEASE_MASK,
+                                 &allocation);
   gtk_widget_register_window (GTK_WIDGET (box), window);
   gtk_widget_set_window (GTK_WIDGET (box), window);
 }


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