listbox: Use gdk_window_new_child()

This commit is contained in:
Benjamin Otte 2016-10-17 20:21:10 +02:00
parent 1c6a879e1c
commit f8a48507a6

View File

@ -2156,24 +2156,19 @@ static void
gtk_list_box_realize (GtkWidget *widget) gtk_list_box_realize (GtkWidget *widget)
{ {
GtkAllocation allocation; GtkAllocation allocation;
GdkWindowAttr attributes = { 0, };
GdkWindow *window; GdkWindow *window;
gtk_widget_get_allocation (widget, &allocation); gtk_widget_get_allocation (widget, &allocation);
gtk_widget_set_realized (widget, TRUE); gtk_widget_set_realized (widget, TRUE);
attributes.x = allocation.x; window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
attributes.y = allocation.y; gtk_widget_get_events (widget)
attributes.width = allocation.width; | GDK_ENTER_NOTIFY_MASK
attributes.height = allocation.height; | GDK_LEAVE_NOTIFY_MASK
attributes.window_type = GDK_WINDOW_CHILD; | GDK_POINTER_MOTION_MASK
attributes.event_mask = gtk_widget_get_events (widget) | | GDK_BUTTON_PRESS_MASK
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK | | GDK_BUTTON_RELEASE_MASK,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; &allocation);
attributes.wclass = GDK_INPUT_OUTPUT;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, GDK_WA_X | GDK_WA_Y);
gdk_window_set_user_data (window, (GObject*) widget); gdk_window_set_user_data (window, (GObject*) widget);
gtk_widget_set_window (widget, window); /* Passes ownership */ gtk_widget_set_window (widget, window); /* Passes ownership */
} }