tests: Use gdk_window_new_child()

This commit is contained in:
Benjamin Otte 2016-10-17 20:17:03 +02:00
parent 8417ecd602
commit dff5a7bd64

View File

@ -262,26 +262,16 @@ gtk_offscreen_box_realize (GtkWidget *widget)
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.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.wclass = GDK_INPUT_OUTPUT;
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),
gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK,
&allocation);
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, widget);
@ -289,9 +279,22 @@ gtk_offscreen_box_realize (GtkWidget *widget)
G_CALLBACK (pick_offscreen_child), offscreen_box);
attributes.window_type = GDK_WINDOW_OFFSCREEN;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y;
/* Child 1 */
attributes.x = attributes.y = 0;
attributes.width = allocation.width;
attributes.height = allocation.height;
if (offscreen_box->child1 && gtk_widget_get_visible (offscreen_box->child1))
{
gtk_widget_get_allocation (offscreen_box->child1, &child_area);