[gtk+] toolpalette: Use gdk_window_new_child()



commit d6eedf19dc289ac87e68d2d50254448889b0a3b9
Author: Benjamin Otte <otte redhat com>
Date:   Mon Oct 17 20:19:10 2016 +0200

    toolpalette: Use gdk_window_new_child()

 gtk/gtktoolpalette.c |   26 ++++++++------------------
 1 files changed, 8 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 8f1e762..52936f0 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -704,29 +704,19 @@ gtk_tool_palette_realize (GtkWidget *widget)
 {
   GtkAllocation allocation;
   GdkWindow *window;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
 
   gtk_widget_set_realized (widget, TRUE);
 
   gtk_widget_get_allocation (widget, &allocation);
 
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.x = allocation.x;
-  attributes.y = allocation.y;
-  attributes.width = allocation.width;
-  attributes.height = allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.event_mask = gtk_widget_get_events (widget)
-                         | GDK_VISIBILITY_NOTIFY_MASK
-                         | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-                         | GDK_BUTTON_MOTION_MASK
-                         | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
-                         | GDK_TOUCH_MASK;
-  attributes_mask = GDK_WA_X | GDK_WA_Y;
-
-  window = gdk_window_new (gtk_widget_get_parent_window (widget),
-                           &attributes, attributes_mask);
+  window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
+                                 gtk_widget_get_events (widget)
+                                 | GDK_VISIBILITY_NOTIFY_MASK
+                                 | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+                                 | GDK_BUTTON_MOTION_MASK
+                                 | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
+                                 | GDK_TOUCH_MASK,
+                                 &allocation);
   gtk_widget_set_window (widget, window);
   gtk_widget_register_window (widget, window);
 


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