summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-10-17 20:21:10 +0200
committerBenjamin Otte <otte@redhat.com>2016-10-18 00:22:35 +0200
commitf8a48507a65482cd7e97f1ab1807f4e4551b9512 (patch)
tree0d4bb4de3417cce95a93ea5b2543078305393ca1
parent1c6a879e1c3843c3b039eeee090cd23396734637 (diff)
downloadgtk+-f8a48507a65482cd7e97f1ab1807f4e4551b9512.tar.gz
listbox: Use gdk_window_new_child()
-rw-r--r--gtk/gtklistbox.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 026911509e..466ba1422a 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -2156,24 +2156,19 @@ static void
gtk_list_box_realize (GtkWidget *widget)
{
GtkAllocation allocation;
- GdkWindowAttr attributes = { 0, };
GdkWindow *window;
gtk_widget_get_allocation (widget, &allocation);
gtk_widget_set_realized (widget, 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 (widget) |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK;
- attributes.wclass = GDK_INPUT_OUTPUT;
-
- window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, GDK_WA_X | GDK_WA_Y);
+ window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
+ gtk_widget_get_events (widget)
+ | GDK_ENTER_NOTIFY_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_BUTTON_RELEASE_MASK,
+ &allocation);
gdk_window_set_user_data (window, (GObject*) widget);
gtk_widget_set_window (widget, window); /* Passes ownership */
}