[libgd/wip/ernestask/gtk4: 17/17] notification: use specialized GdkWindow constructors



commit def9334f4010fab398b885d020ea5f8123cf14e1
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sun Mar 11 10:16:53 2018 +0200

    notification: use specialized GdkWindow constructors

 libgd/gd-notification.c |   28 ++++------------------------
 1 files changed, 4 insertions(+), 24 deletions(-)
---
diff --git a/libgd/gd-notification.c b/libgd/gd-notification.c
index 0830adc..679be7c 100644
--- a/libgd/gd-notification.c
+++ b/libgd/gd-notification.c
@@ -181,39 +181,19 @@ gd_notification_realize (GtkWidget *widget)
   GtkAllocation allocation;
   GtkWidget *child;
   GdkWindow *window;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
 
   gtk_widget_set_realized (widget, TRUE);
 
   gtk_widget_get_allocation (widget, &allocation);
 
-  attributes.x = allocation.x;
-  attributes.y = allocation.y;
-  attributes.width = allocation.width;
-  attributes.height = allocation.height;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
-
-  attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_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);
+  window = gdk_window_new_child (gtk_widget_get_parent_window (widget), &allocation);
   gtk_widget_set_window (widget, window);
   gtk_widget_register_window (widget, window);
 
-  attributes.x = 0;
-  attributes.y = attributes.height + priv->animate_y;
-  attributes.event_mask = gtk_widget_get_events (widget) |
-                          GDK_EXPOSURE_MASK |
-                          GDK_VISIBILITY_NOTIFY_MASK |
-                          GDK_ENTER_NOTIFY_MASK |
-                          GDK_LEAVE_NOTIFY_MASK;
+  allocation.x = 0;
+  allocation.y = allocation.height + priv->animate_y;
 
-  priv->bin_window = gdk_window_new (window, &attributes, attributes_mask);
+  priv->bin_window = gdk_window_new_child (window, &allocation);
   gtk_widget_register_window (widget, priv->bin_window);
 
   child = gtk_bin_get_child (bin);


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