summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-10-18 00:20:02 +0200
committerBenjamin Otte <otte@redhat.com>2016-10-18 00:22:35 +0200
commit3fc32511b5a2b98ebdcb486e2269e6fd2d7dacf7 (patch)
tree6b437c5b1cf5bddcf291d678e0b26f34ac240f21
parent9127e49f455ba4fea046d44115e2b07a0c5b21fb (diff)
downloadgtk+-3fc32511b5a2b98ebdcb486e2269e6fd2d7dacf7.tar.gz
iconview: Use gdk_window_new_child()
-rw-r--r--gtk/gtkiconview.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 444143b1d7..4e828b2b71 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1267,48 +1267,32 @@ gtk_icon_view_realize (GtkWidget *widget)
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
GtkAllocation allocation;
GdkWindow *window;
- GdkWindowAttr attributes;
- gint attributes_mask;
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
/* Make the main, clipping window */
- 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 = GDK_VISIBILITY_NOTIFY_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),
+ GDK_VISIBILITY_NOTIFY_MASK,
+ &allocation);
gtk_widget_set_window (widget, window);
gtk_widget_register_window (widget, window);
- gtk_widget_get_allocation (widget, &allocation);
-
/* Make the window for the icon view */
- attributes.x = 0;
- attributes.y = 0;
- attributes.width = MAX (icon_view->priv->width, allocation.width);
- attributes.height = MAX (icon_view->priv->height, allocation.height);
- attributes.event_mask = (GDK_SCROLL_MASK |
- GDK_SMOOTH_SCROLL_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_KEY_PRESS_MASK |
- GDK_KEY_RELEASE_MASK) |
- gtk_widget_get_events (widget);
-
- icon_view->priv->bin_window = gdk_window_new (window,
- &attributes, attributes_mask);
+ icon_view->priv->bin_window = gdk_window_new_child (window,
+ gtk_widget_get_events (widget)
+ | GDK_SCROLL_MASK
+ | GDK_SMOOTH_SCROLL_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_BUTTON_RELEASE_MASK
+ | GDK_KEY_PRESS_MASK
+ | GDK_KEY_RELEASE_MASK,
+ &(GdkRectangle) { 0, 0,
+ MAX (icon_view->priv->width, allocation.width),
+ MAX (icon_view->priv->height, allocation.height)});
gtk_widget_register_window (widget, icon_view->priv->bin_window);
gdk_window_show (icon_view->priv->bin_window);
}