[libwnck/wip/muktupavels/gtk4: 3/13] pager: use gdk_window_new_child



commit 5c031124e6b1fa0e7afcb9ad3a1ea6677f0f4750
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun May 21 01:09:13 2017 +0300

    pager: use gdk_window_new_child

 libwnck/pager.c |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index 6dfd48f..21dc591 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -329,11 +329,9 @@ _wnck_pager_set_screen (WnckPager *pager)
 static void
 wnck_pager_realize (GtkWidget *widget)
 {
-
-  GdkWindowAttr attributes;
-  gint attributes_mask;
   WnckPager *pager;
   GtkAllocation allocation;
+  gint event_mask;
   GdkWindow *window;
 
   pager = WNCK_PAGER (widget);
@@ -344,22 +342,15 @@ wnck_pager_realize (GtkWidget *widget)
 
   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.visual = gtk_widget_get_visual (widget);
-  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK |
-                         GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
-                         GDK_SCROLL_MASK |
-                         GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK |
-                         GDK_POINTER_MOTION_HINT_MASK;
-
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-
-  window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+  event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK |
+               GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+               GDK_SCROLL_MASK |
+               GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK |
+               GDK_POINTER_MOTION_HINT_MASK;
+
+  window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
+                                 event_mask, &allocation);
+
   gtk_widget_set_window (widget, window);
   gdk_window_set_user_data (window, widget);
 


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