diff options
author | Alexander Larsson <alexl@redhat.com> | 2018-03-20 15:21:12 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2018-03-20 15:21:12 +0100 |
commit | 63e060a21de336ec49b1de02c74359842d9034c5 (patch) | |
tree | 2efb29d70bff6cb5d0a9ca6825ea8aac50566242 /gtk | |
parent | 3dce0dcca705c4ab6d8c4f5067db93947184b6af (diff) | |
download | gtk+-63e060a21de336ec49b1de02c74359842d9034c5.tar.gz |
GtkWidget: Start renaming widget->window
This is an automated change doing these command:
git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface
git checkout NEWS*
Diffstat (limited to 'gtk')
97 files changed, 332 insertions, 332 deletions
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c index e023f971e7..2a990a685f 100644 --- a/gtk/a11y/gtkentryaccessible.c +++ b/gtk/a11y/gtkentryaccessible.c @@ -243,7 +243,7 @@ gtk_entry_icon_accessible_do_action (AtkAction *action, gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area); event = gdk_event_new (GDK_BUTTON_PRESS); - event->any.surface = g_object_ref (gtk_widget_get_window (widget)); + event->any.surface = g_object_ref (gtk_widget_get_surface (widget)); event->button.button = 1; event->any.send_event = TRUE; event->button.time = GDK_CURRENT_TIME; @@ -976,7 +976,7 @@ gtk_entry_accessible_get_character_extents (AtkText *text, _gtk_widget_get_allocation (widget, &allocation); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_window, &y_window); *x = x_window + allocation.x + x_layout + char_rect.x; @@ -1017,7 +1017,7 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text, gtk_entry_get_layout_offsets (entry, &x_layout, &y_layout); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_window, &y_window); x_local = x - x_layout - x_window; diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c index ac37c6aba0..754b7990a1 100644 --- a/gtk/a11y/gtklabelaccessible.c +++ b/gtk/a11y/gtklabelaccessible.c @@ -1010,7 +1010,7 @@ gtk_label_accessible_get_character_extents (AtkText *text, pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect); pango_extents_to_pixels (&char_rect, NULL); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_window, &y_window); *x = x_window + x_layout + char_rect.x; @@ -1050,7 +1050,7 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text, gtk_label_get_layout_offsets (label, &x_layout, &y_layout); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_window, &y_window); x_local = x - x_layout - x_window; diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c index 389b052269..32ce984c7f 100644 --- a/gtk/a11y/gtktextcellaccessible.c +++ b/gtk/a11y/gtktextcellaccessible.c @@ -486,9 +486,9 @@ get_origins (GtkWidget *widget, { GdkSurface *window; - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, x_window, y_window); - window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); gdk_surface_get_origin (window, x_toplevel, y_toplevel); if (GTK_IS_TREE_VIEW (widget)) diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c index 3decaafd38..3445a36308 100644 --- a/gtk/a11y/gtktextviewaccessible.c +++ b/gtk/a11y/gtktextviewaccessible.c @@ -454,7 +454,7 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, return -1; view = GTK_TEXT_VIEW (widget); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_widget, &y_widget); if (coords == ATK_XY_SCREEN) @@ -523,7 +523,7 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset); gtk_text_view_get_iter_location (view, &iter, &rectangle); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); if (window == NULL) return; diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index cc28bbcf49..4c97e67830 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -1099,7 +1099,7 @@ gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent, GdkSurface *window; gint x_toplevel, y_toplevel; - window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); w_x += x_toplevel; @@ -1175,7 +1175,7 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent, { #ifdef GDK_WINDOWING_X11 gtk_window_present_with_time (GTK_WINDOW (toplevel), - gdk_x11_get_server_time (gtk_widget_get_window (widget))); + gdk_x11_get_server_time (gtk_widget_get_surface (widget))); #else gtk_window_present (GTK_WINDOW (toplevel)); #endif diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c index 39c2a2bb36..4f80a852ca 100644 --- a/gtk/a11y/gtkwidgetaccessible.c +++ b/gtk/a11y/gtkwidgetaccessible.c @@ -586,13 +586,13 @@ gtk_widget_accessible_get_extents (AtkComponent *component, { *x = allocation.x; *y = allocation.y; - window = gtk_widget_get_parent_window (widget); + window = gtk_widget_get_parent_surface (widget); } else { *x = 0; *y = 0; - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); } gdk_surface_get_origin (window, &x_window, &y_window); *x += x_window; @@ -600,7 +600,7 @@ gtk_widget_accessible_get_extents (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); *x -= x_toplevel; @@ -635,7 +635,7 @@ gtk_widget_accessible_grab_focus (AtkComponent *component) { #ifdef GDK_WINDOWING_X11 gtk_window_present_with_time (GTK_WINDOW (toplevel), - gdk_x11_get_server_time (gtk_widget_get_window (widget))); + gdk_x11_get_server_time (gtk_widget_get_surface (widget))); #else gtk_window_present (GTK_WINDOW (toplevel)); #endif @@ -663,7 +663,7 @@ gtk_widget_accessible_set_extents (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkSurface *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_current, &y_current); x_current += x; @@ -703,7 +703,7 @@ gtk_widget_accessible_set_position (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkSurface *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_surface (widget); gdk_surface_get_origin (window, &x_current, &y_current); x_current += x; diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c index 5cb205c403..3b072ca981 100644 --- a/gtk/a11y/gtkwindowaccessible.c +++ b/gtk/a11y/gtkwindowaccessible.c @@ -240,7 +240,7 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible) if (gtk_window_is_active (window)) atk_state_set_add_state (state_set, ATK_STATE_ACTIVE); - gdk_surface = gtk_widget_get_window (widget); + gdk_surface = gtk_widget_get_surface (widget); if (gdk_surface) { state = gdk_surface_get_state (gdk_surface); @@ -385,7 +385,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, return; } - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); if (window == NULL) return; @@ -432,7 +432,7 @@ gtk_window_accessible_get_size (AtkComponent *component, return; } - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); if (window == NULL) return; diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index ad9f205cfb..3730b1feb2 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -321,7 +321,7 @@ gtk_accel_label_init (GtkAccelLabel *accel_label) { GtkAccelLabelPrivate *priv; - gtk_widget_set_has_window (GTK_WIDGET (accel_label), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (accel_label), FALSE); accel_label->priv = gtk_accel_label_get_instance_private (accel_label); priv = accel_label->priv; diff --git a/gtk/gtkactionbar.c b/gtk/gtkactionbar.c index a567240560..5e179a4682 100644 --- a/gtk/gtkactionbar.c +++ b/gtk/gtkactionbar.c @@ -411,7 +411,7 @@ gtk_action_bar_init (GtkActionBar *action_bar) GtkWidget *widget = GTK_WIDGET (action_bar); GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); priv->revealer = gtk_revealer_new (); gtk_widget_set_parent (priv->revealer, widget); diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c index e396d05cf8..7f0e7525b2 100644 --- a/gtk/gtkappchooserwidget.c +++ b/gtk/gtkappchooserwidget.c @@ -1176,7 +1176,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self) self->priv = gtk_app_chooser_widget_get_instance_private (self); - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); gtk_widget_init_template (GTK_WIDGET (self)); diff --git a/gtk/gtkapplication-wayland.c b/gtk/gtkapplication-wayland.c index f1e85f02df..a5f48df251 100644 --- a/gtk/gtkapplication-wayland.c +++ b/gtk/gtkapplication-wayland.c @@ -44,7 +44,7 @@ gtk_application_impl_wayland_handle_window_realize (GtkApplicationImpl *impl, GdkSurface *gdk_surface; gchar *window_path; - gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); if (!GDK_IS_WAYLAND_SURFACE (gdk_surface)) return; diff --git a/gtk/gtkapplication-x11.c b/gtk/gtkapplication-x11.c index ee20c6d3ca..989e9c3380 100644 --- a/gtk/gtkapplication-x11.c +++ b/gtk/gtkapplication-x11.c @@ -42,7 +42,7 @@ gtk_application_impl_x11_handle_window_realize (GtkApplicationImpl *impl, GdkSurface *gdk_surface; gchar *window_path; - gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); if (!GDK_IS_X11_SURFACE (gdk_surface)) return; @@ -65,7 +65,7 @@ gtk_application_impl_x11_get_window_system_id (GtkApplicationImplDBus *dbus, { GdkSurface *gdk_surface; - gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); if (GDK_IS_X11_SURFACE (gdk_surface)) return g_variant_new_uint32 (GDK_SURFACE_XID (gdk_surface)); diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 90f2ddea17..79f882d8e4 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -94,7 +94,7 @@ gtk_bin_class_init (GtkBinClass *class) static void gtk_bin_init (GtkBin *bin) { - gtk_widget_set_has_window (GTK_WIDGET (bin), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (bin), FALSE); } static GType diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 892f5b7c4e..bfe4b2bf11 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -1288,7 +1288,7 @@ gtk_box_init (GtkBox *box) { GtkBoxPrivate *priv = gtk_box_get_instance_private (box); - gtk_widget_set_has_window (GTK_WIDGET (box), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE); priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->children = NULL; diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index b5803375d7..6f6599479a 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -435,7 +435,7 @@ gtk_button_init (GtkButton *button) gtk_widget_set_can_focus (GTK_WIDGET (button), TRUE); gtk_widget_set_receives_default (GTK_WIDGET (button), TRUE); - gtk_widget_set_has_window (GTK_WIDGET (button), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE); priv->in_button = FALSE; priv->button_down = FALSE; diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index f04a7c358c..94ae028d38 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -665,7 +665,7 @@ gtk_calendar_init (GtkCalendar *calendar) priv = calendar->priv = gtk_calendar_get_instance_private (calendar); gtk_widget_set_can_focus (widget, TRUE); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)), GTK_STYLE_CLASS_VIEW); diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index 4a5bf529a3..1703e99760 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -451,7 +451,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, if (!is_editable) return NULL; - window = gtk_widget_get_window (gtk_widget_get_toplevel (widget)); + window = gtk_widget_get_surface (gtk_widget_get_toplevel (widget)); if (event) device = gdk_event_get_device (event); diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index e29eee4164..9b3dc1997c 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -419,7 +419,7 @@ gtk_cell_view_init (GtkCellView *cellview) cellview->priv = gtk_cell_view_get_instance_private (cellview); cellview->priv->orientation = GTK_ORIENTATION_HORIZONTAL; - gtk_widget_set_has_window (GTK_WIDGET (cellview), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (cellview), FALSE); } static void diff --git a/gtk/gtkcenterbox.c b/gtk/gtkcenterbox.c index f7b4382749..dd88735cfb 100644 --- a/gtk/gtkcenterbox.c +++ b/gtk/gtkcenterbox.c @@ -724,7 +724,7 @@ gtk_center_box_class_init (GtkCenterBoxClass *klass) static void gtk_center_box_init (GtkCenterBox *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->start_widget = NULL; self->center_widget = NULL; diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c index be3d40fee5..91d2395620 100644 --- a/gtk/gtkcolorbutton.c +++ b/gtk/gtkcolorbutton.c @@ -376,7 +376,7 @@ gtk_color_button_init (GtkColorButton *button) GtkStyleContext *context; GdkContentFormats *targets; - gtk_widget_set_has_window (GTK_WIDGET (button), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE); /* Create the widgets */ priv = button->priv = gtk_color_button_get_instance_private (button); diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c index 08c1b32327..3f7178fbd8 100644 --- a/gtk/gtkcolorplane.c +++ b/gtk/gtkcolorplane.c @@ -134,7 +134,7 @@ create_surface (GtkColorPlane *plane) width = gtk_widget_get_width (widget); height = gtk_widget_get_height (widget); - surface = gdk_surface_create_similar_surface (gtk_widget_get_window (widget), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget), CAIRO_CONTENT_COLOR, width, height); @@ -408,7 +408,7 @@ gtk_color_plane_init (GtkColorPlane *plane) plane->priv = gtk_color_plane_get_instance_private (plane); - gtk_widget_set_has_window (GTK_WIDGET (plane), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (plane), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE); atk_obj = gtk_widget_get_accessible (GTK_WIDGET (plane)); diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index 16347a048d..b763f558ef 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -579,7 +579,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch) swatch->priv->has_menu = TRUE; gtk_widget_set_can_focus (GTK_WIDGET (swatch), TRUE); - gtk_widget_set_has_window (GTK_WIDGET (swatch), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (swatch), FALSE); swatch->priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (swatch)); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->long_press_gesture), diff --git a/gtk/gtkdebugupdates.c b/gtk/gtkdebugupdates.c index c345bca057..672afae4d4 100644 --- a/gtk/gtkdebugupdates.c +++ b/gtk/gtkdebugupdates.c @@ -180,7 +180,7 @@ gtk_window_manage_updates (GtkWidget *widget, cairo_region_union (region, draw->region); } gtk_debug_updates_print (updates, region, "Queued update"); - gdk_surface_invalidate_region (gtk_widget_get_window (widget), region, TRUE); + gdk_surface_invalidate_region (gtk_widget_get_surface (widget), region, TRUE); cairo_region_destroy (region); /* Then remove all outdated regions */ diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index 7bcd158ec9..899a368d94 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -348,7 +348,7 @@ static NSWindow * get_toplevel_nswindow (GtkWidget *widget) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - GdkSurface *window = gtk_widget_get_window (toplevel); + GdkSurface *window = gtk_widget_get_surface (toplevel); if (gtk_widget_is_toplevel (toplevel) && window) return [gdk_quartz_surface_get_nsview (window) window]; @@ -633,11 +633,11 @@ gtk_drag_find_widget (GtkWidget *widget, if (gtk_widget_get_parent (widget)) { gint tx, ty; - GdkSurface *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_surface (widget); GdkSurface *parent_window; GtkAllocation allocation; - parent_window = gtk_widget_get_window (gtk_widget_get_parent (widget)); + parent_window = gtk_widget_get_surface (gtk_widget_get_parent (widget)); /* Compute the offset from allocation-relative to * window-relative coordinates. @@ -646,7 +646,7 @@ gtk_drag_find_widget (GtkWidget *widget, allocation_to_window_x = allocation.x; allocation_to_window_y = allocation.y; - if (gtk_widget_get_has_window (widget)) + if (gtk_widget_get_has_surface (widget)) { /* The allocation is relative to the parent window for * window widgets, not to widget->window. @@ -930,7 +930,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, } } - gdk_surface_get_position (gtk_widget_get_window (toplevel), &tx, &ty); + gdk_surface_get_position (gtk_widget_get_surface (toplevel), &tx, &ty); data.x = event->dnd.x_root - tx; data.y = event->dnd.y_root - ty; @@ -1124,9 +1124,9 @@ gtk_drag_begin_internal (GtkWidget *widget, if (x != -1 && y != -1) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - window = gtk_widget_get_window (toplevel); + window = gtk_widget_get_surface (toplevel); gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y); - gdk_surface_get_root_coords (gtk_widget_get_window (toplevel), x, y, + gdk_surface_get_root_coords (gtk_widget_get_surface (toplevel), x, y, &x, &y); dx = (gdouble)x; dy = (gdouble)y; diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 0d24b36e1a..05189ea9cc 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -326,7 +326,7 @@ gtk_drag_get_source_widget (GdkDragContext *context) { GtkWidget *widget = tmp_list->data; - if (gtk_widget_get_window (widget) == gdk_drag_context_get_source_surface (context)) + if (gtk_widget_get_surface (widget) == gdk_drag_context_get_source_surface (context)) return widget; tmp_list = tmp_list->next; @@ -445,7 +445,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, } } - window = gtk_widget_get_window (toplevel); + window = gtk_widget_get_surface (toplevel); gdk_surface_get_position (window, &tx, &ty); gdk_event_get_root_coords (event, &x_root, &y_root); @@ -501,7 +501,7 @@ gtk_drag_find_widget (GtkWidget *widget, /* Get the widget at the pointer coordinates and travel up * the widget hierarchy from there. */ - widget = _gtk_widget_find_at_coords (gtk_widget_get_window (widget), + widget = _gtk_widget_find_at_coords (gtk_widget_get_surface (widget), x, y, &x, &y); if (!widget) return FALSE; @@ -946,7 +946,7 @@ gtk_drag_begin_internal (GtkWidget *widget, toplevel = gtk_widget_get_toplevel (widget); gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y); - gdk_surface_get_device_position (gtk_widget_get_window (toplevel), + gdk_surface_get_device_position (gtk_widget_get_surface (toplevel), device, &dx, &dy, NULL); @@ -958,7 +958,7 @@ gtk_drag_begin_internal (GtkWidget *widget, content->formats = gdk_content_formats_ref (target_list); content->time = time; - context = gdk_drag_begin (gtk_widget_get_window (toplevel), device, GDK_CONTENT_PROVIDER (content), actions, dx, dy); + context = gdk_drag_begin (gtk_widget_get_surface (toplevel), device, GDK_CONTENT_PROVIDER (content), actions, dx, dy); if (context == NULL) { g_object_unref (content); diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c index 1f762eb80f..ade77fb8db 100644 --- a/gtk/gtkdragdest.c +++ b/gtk/gtkdragdest.c @@ -37,7 +37,7 @@ gtk_drag_dest_realized (GtkWidget *widget) GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel)) - gdk_surface_register_dnd (gtk_widget_get_window (toplevel)); + gdk_surface_register_dnd (gtk_widget_get_surface (toplevel)); } static void @@ -47,7 +47,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget, GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel) && gtk_widget_get_realized (toplevel)) - gdk_surface_register_dnd (gtk_widget_get_window (toplevel)); + gdk_surface_register_dnd (gtk_widget_get_surface (toplevel)); } static void @@ -132,7 +132,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget, * { * GdkModifierType mask; * - * gdk_surface_get_pointer (gtk_widget_get_window (widget), + * gdk_surface_get_pointer (gtk_widget_get_surface (widget), * NULL, NULL, &mask); * if (mask & GDK_CONTROL_MASK) * gdk_drag_status (context, GDK_ACTION_COPY, time); diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c index a42db6cb57..977e48e019 100644 --- a/gtk/gtkdrawingarea.c +++ b/gtk/gtkdrawingarea.c @@ -304,7 +304,7 @@ gtk_drawing_area_class_init (GtkDrawingAreaClass *class) static void gtk_drawing_area_init (GtkDrawingArea *darea) { - gtk_widget_set_has_window (GTK_WIDGET (darea), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (darea), FALSE); } /** diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 8cdac60e2c..b5832bc8c4 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -2499,7 +2499,7 @@ gtk_entry_init (GtkEntry *entry) gint i; gtk_widget_set_can_focus (GTK_WIDGET (entry), TRUE); - gtk_widget_set_has_window (GTK_WIDGET (entry), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (entry), FALSE); priv->editable = TRUE; priv->visible = TRUE; diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index d05d010632..63e7bec3c8 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1382,7 +1382,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) GtkTreeViewColumn *action_column; gint action_height; - window = gtk_widget_get_window (completion->priv->entry); + window = gtk_widget_get_surface (completion->priv->entry); if (!window) return; @@ -1390,7 +1390,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) if (!completion->priv->filter_model) return; - gtk_widget_get_window_allocation (completion->priv->entry, &allocation); + gtk_widget_get_surface_allocation (completion->priv->entry, &allocation); gtk_widget_get_preferred_size (completion->priv->entry, &entry_req, NULL); @@ -1533,7 +1533,7 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion) { gtk_grab_add (completion->priv->popup_window); gdk_seat_grab (gdk_device_get_seat (completion->priv->device), - gtk_widget_get_window (completion->priv->popup_window), + gtk_widget_get_surface (completion->priv->popup_window), GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH, TRUE, NULL, NULL, prepare_popup_func, completion); diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index e27bfab98f..e2f47c44e3 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -341,7 +341,7 @@ gtk_expander_init (GtkExpander *expander) expander->priv = priv = gtk_expander_get_instance_private (expander); gtk_widget_set_can_focus (GTK_WIDGET (expander), TRUE); - gtk_widget_set_has_window (GTK_WIDGET (expander), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (expander), FALSE); priv->label_widget = NULL; priv->child = NULL; diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 706ab3c2a5..7900b07969 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -466,7 +466,7 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button) GtkWidget *icon; GdkContentFormats *target_list; - gtk_widget_set_has_window (GTK_WIDGET (button), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE); priv = button->priv = gtk_file_chooser_button_get_instance_private (button); diff --git a/gtk/gtkfilechoosernativequartz.c b/gtk/gtkfilechoosernativequartz.c index e1e837c80f..08c7a74d2c 100644 --- a/gtk/gtkfilechoosernativequartz.c +++ b/gtk/gtkfilechoosernativequartz.c @@ -529,7 +529,7 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self) if (transient_for) { gtk_widget_realize (GTK_WIDGET (transient_for)); - data->parent = gdk_quartz_surface_get_nswindow (gtk_widget_get_window (GTK_WIDGET (transient_for))); + data->parent = gdk_quartz_surface_get_nswindow (gtk_widget_get_surface (GTK_WIDGET (transient_for))); if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self))) data->modal = TRUE; diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c index 09fabb8b27..c0635d2d0c 100644 --- a/gtk/gtkfilechoosernativewin32.c +++ b/gtk/gtkfilechoosernativewin32.c @@ -789,7 +789,7 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self) if (transient_for) { gtk_widget_realize (GTK_WIDGET (transient_for)); - data->parent = gdk_win32_surface_get_handle (gtk_widget_get_window (GTK_WIDGET (transient_for))); + data->parent = gdk_win32_surface_get_handle (gtk_widget_get_surface (GTK_WIDGET (transient_for))); if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self))) data->modal = TRUE; diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index b23f1dbf00..575a68e79a 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -8506,7 +8506,7 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl) impl->priv = gtk_file_chooser_widget_get_instance_private (impl); priv = impl->priv; - gtk_widget_set_has_window (GTK_WIDGET (impl), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (impl), FALSE); priv->local_only = FALSE; priv->preview_widget_active = TRUE; diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index a54ee0e2d9..e22a2d2fa0 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -176,7 +176,7 @@ gtk_fixed_init (GtkFixed *fixed) fixed->priv->children = NULL; - gtk_widget_set_has_window (GTK_WIDGET (fixed), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (fixed), FALSE); } /** diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index d95aaff98e..83fab0146f 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -3734,7 +3734,7 @@ gtk_flow_box_init (GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); - gtk_widget_set_has_window (GTK_WIDGET (box), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE); priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->selection_mode = GTK_SELECTION_SINGLE; diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c index 4a6dcba0dc..480da183ed 100644 --- a/gtk/gtkfontbutton.c +++ b/gtk/gtkfontbutton.c @@ -578,7 +578,7 @@ gtk_font_button_init (GtkFontButton *font_button) font_button->priv = gtk_font_button_get_instance_private (font_button); priv = font_button->priv; - gtk_widget_set_has_window (GTK_WIDGET (font_button), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (font_button), FALSE); priv->button = gtk_button_new (); g_signal_connect (priv->button, "clicked", G_CALLBACK (gtk_font_button_clicked), font_button); diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index 3ab05f3d9d..f34e187447 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -825,7 +825,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser) fontchooser->priv = gtk_font_chooser_widget_get_instance_private (fontchooser); priv = fontchooser->priv; - gtk_widget_set_has_window (GTK_WIDGET (fontchooser), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (fontchooser), FALSE); gtk_widget_init_template (GTK_WIDGET (fontchooser)); diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index f78fc040f0..48e36aca71 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -606,7 +606,7 @@ gesture_within_window (GtkGesture *gesture, GtkWidget *widget; widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); while (window) { diff --git a/gtk/gtkgizmo.c b/gtk/gtkgizmo.c index 69544c7abb..b0b921f536 100644 --- a/gtk/gtkgizmo.c +++ b/gtk/gtkgizmo.c @@ -84,7 +84,7 @@ gtk_gizmo_class_init (GtkGizmoClass *klass) static void gtk_gizmo_init (GtkGizmo *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); } GtkWidget * diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index b71037f734..bbe935f2a7 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -312,7 +312,7 @@ gtk_gl_area_real_create_context (GtkGLArea *area) GError *error = NULL; GdkGLContext *context; - context = gdk_surface_create_gl_context (gtk_widget_get_window (widget), &error); + context = gdk_surface_create_gl_context (gtk_widget_get_surface (widget), &error); if (error != NULL) { gtk_gl_area_set_error (area, error); @@ -958,7 +958,7 @@ gtk_gl_area_init (GtkGLArea *area) { GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); - gtk_widget_set_has_window (GTK_WIDGET (area), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (area), FALSE); priv->auto_render = TRUE; priv->needs_render = TRUE; diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 2fe3024e5b..674ba18025 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -1729,7 +1729,7 @@ gtk_grid_init (GtkGrid *grid) { GtkGridPrivate *priv = gtk_grid_get_instance_private (grid); - gtk_widget_set_has_window (GTK_WIDGET (grid), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (grid), FALSE); priv->children = NULL; priv->orientation = GTK_ORIENTATION_HORIZONTAL; diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index 1778c1b9be..8f66a80b87 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -1778,7 +1778,7 @@ gtk_header_bar_realize (GtkWidget *widget) G_CALLBACK (_gtk_header_bar_update_window_buttons), widget); g_signal_connect_swapped (settings, "notify::gtk-decoration-layout", G_CALLBACK (_gtk_header_bar_update_window_buttons), widget); - g_signal_connect_swapped (_gtk_widget_get_window (widget), "notify::state", + g_signal_connect_swapped (_gtk_widget_get_surface (widget), "notify::state", G_CALLBACK (surface_state_changed), widget); _gtk_header_bar_update_window_buttons (GTK_HEADER_BAR (widget)); } @@ -1791,7 +1791,7 @@ gtk_header_bar_unrealize (GtkWidget *widget) settings = gtk_widget_get_settings (widget); g_signal_handlers_disconnect_by_func (settings, _gtk_header_bar_update_window_buttons, widget); - g_signal_handlers_disconnect_by_func (_gtk_widget_get_window (widget), surface_state_changed, widget); + g_signal_handlers_disconnect_by_func (_gtk_widget_get_surface (widget), surface_state_changed, widget); GTK_WIDGET_CLASS (gtk_header_bar_parent_class)->unrealize (widget); } @@ -1803,7 +1803,7 @@ surface_state_changed (GtkWidget *widget) GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (bar); GdkSurfaceState changed, new_state; - new_state = gdk_surface_get_state (_gtk_widget_get_window (widget)); + new_state = gdk_surface_get_state (_gtk_widget_get_surface (widget)); changed = new_state ^ priv->state; priv->state = new_state; @@ -1977,7 +1977,7 @@ gtk_header_bar_init (GtkHeaderBar *bar) priv = gtk_header_bar_get_instance_private (bar); - gtk_widget_set_has_window (GTK_WIDGET (bar), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (bar), FALSE); priv->title = NULL; priv->subtitle = NULL; diff --git a/gtk/gtkicon.c b/gtk/gtkicon.c index 2611230060..b6225fe0e9 100644 --- a/gtk/gtkicon.c +++ b/gtk/gtkicon.c @@ -87,7 +87,7 @@ gtk_icon_class_init (GtkIconClass *klass) static void gtk_icon_init (GtkIcon *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->image = GTK_CSS_IMAGE_BUILTIN_NONE; } diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index ff065d6cb8..e90e68b8a7 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -925,7 +925,7 @@ gtk_icon_view_init (GtkIconView *icon_view) icon_view->priv->mouse_x = -1; icon_view->priv->mouse_y = -1; - gtk_widget_set_has_window (GTK_WIDGET (icon_view), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (icon_view), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE); icon_view->priv->item_orientation = GTK_ORIENTATION_VERTICAL; @@ -6719,7 +6719,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view, item->cell_area.height + icon_view->priv->item_padding * 2 }; - surface = gdk_surface_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (icon_view)), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (GTK_WIDGET (icon_view)), CAIRO_CONTENT_COLOR_ALPHA, rect.width, rect.height); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 863f88aebd..5c008e2785 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -296,7 +296,7 @@ gtk_image_init (GtkImage *image) GtkCssNode *widget_node; widget_node = gtk_widget_get_css_node (GTK_WIDGET (image)); - gtk_widget_set_has_window (GTK_WIDGET (image), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (image), FALSE); priv->icon_helper = gtk_icon_helper_new (widget_node, GTK_WIDGET (image)); priv->keep_aspect_ratio = TRUE; diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c index 4f8f461782..792477a468 100644 --- a/gtk/gtkimcontextime.c +++ b/gtk/gtkimcontextime.c @@ -266,7 +266,7 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context)); context_ime = GTK_IM_CONTEXT_IME (context); toplevel = gtk_widget_get_toplevel (widget); - client_window = gtk_widget_get_window (toplevel); + client_window = gtk_widget_get_surface (toplevel); if (client_window) { diff --git a/gtk/gtkimcontextquartz.c b/gtk/gtkimcontextquartz.c index 267af4bf46..6bc7821d87 100644 --- a/gtk/gtkimcontextquartz.c +++ b/gtk/gtkimcontextquartz.c @@ -260,7 +260,7 @@ quartz_set_client_window (GtkIMContext *context, GtkWidget *widget) GTK_NOTE (MISC, g_print ("quartz_set_client_window: %p\n", widget)); - qc->client_window = gtk_widget_get_parent_window (widget); + qc->client_window = gtk_widget_get_parent_surface (widget); } static void diff --git a/gtk/gtkimcontextxim.c b/gtk/gtkimcontextxim.c index eaabcba056..815229ee4f 100644 --- a/gtk/gtkimcontextxim.c +++ b/gtk/gtkimcontextxim.c @@ -586,7 +586,7 @@ gtk_im_context_xim_set_client_widget (GtkIMContext *context, GdkSurface *surface = NULL; if (widget != NULL) - surface = gtk_widget_get_window (gtk_widget_get_toplevel (widget)); + surface = gtk_widget_get_surface (gtk_widget_get_toplevel (widget)); set_ic_client_window (context_xim, surface); } @@ -1613,9 +1613,9 @@ on_status_toplevel_configure (GtkWidget *toplevel, if (status_window->window) { - height = DisplayHeight(GDK_SURFACE_XDISPLAY (gtk_widget_get_window (toplevel)), 0); + height = DisplayHeight(GDK_SURFACE_XDISPLAY (gtk_widget_get_surface (toplevel)), 0); - gdk_surface_get_frame_extents (gtk_widget_get_window (toplevel), &rect); + gdk_surface_get_frame_extents (gtk_widget_get_surface (toplevel), &rect); gtk_widget_get_preferred_size ( (status_window->window), &requisition, NULL); if (rect.y + rect.height + requisition.height < height) diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c index c8d330bbaa..8bff84442c 100644 --- a/gtk/gtkinvisible.c +++ b/gtk/gtkinvisible.c @@ -106,7 +106,7 @@ gtk_invisible_init (GtkInvisible *invisible) invisible->priv = gtk_invisible_get_instance_private (invisible); priv = invisible->priv; - gtk_widget_set_has_window (GTK_WIDGET (invisible), TRUE); + gtk_widget_set_has_surface (GTK_WIDGET (invisible), TRUE); _gtk_widget_set_is_toplevel (GTK_WIDGET (invisible), TRUE); g_object_ref_sink (invisible); @@ -225,8 +225,8 @@ gtk_invisible_realize (GtkWidget *widget) gtk_widget_set_realized (widget, TRUE); window = gdk_surface_new_temp (gtk_widget_get_display (widget)); - gtk_widget_set_window (widget, window); - gtk_widget_register_window (widget, window); + gtk_widget_set_surface (widget, window); + gtk_widget_register_surface (widget, window); } static void diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index ba41f68f81..951f392060 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1273,7 +1273,7 @@ gtk_label_init (GtkLabel *label) { GtkLabelPrivate *priv = gtk_label_get_instance_private (label); - gtk_widget_set_has_window (GTK_WIDGET (label), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (label), FALSE); priv->width_chars = -1; priv->max_width_chars = -1; diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index c7fe6c20b2..24e8a02826 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -694,7 +694,7 @@ gtk_layout_init (GtkLayout *layout) { GtkLayoutPrivate *priv; - gtk_widget_set_has_window (GTK_WIDGET (layout), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (layout), FALSE); layout->priv = gtk_layout_get_instance_private (layout); priv = layout->priv; diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index f8193239ba..2e3a783265 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -1067,7 +1067,7 @@ gtk_level_bar_init (GtkLevelBar *self) priv->inverted = FALSE; - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); priv->trough_widget = gtk_gizmo_new ("trough", gtk_level_bar_measure_trough, diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index f0778b9b72..a0c9440eed 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -612,7 +612,7 @@ gtk_list_box_init (GtkListBox *box) GtkListBoxPrivate *priv = BOX_PRIV (box); GtkWidget *widget = GTK_WIDGET (box); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); priv->selection_mode = GTK_SELECTION_SINGLE; priv->activate_single_click = TRUE; diff --git a/gtk/gtkmagnifier.c b/gtk/gtkmagnifier.c index c69b3cbdee..fbcab5733c 100644 --- a/gtk/gtkmagnifier.c +++ b/gtk/gtkmagnifier.c @@ -319,7 +319,7 @@ _gtk_magnifier_init (GtkMagnifier *magnifier) priv = _gtk_magnifier_get_instance_private (magnifier); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); priv->magnification = 1; priv->resize = FALSE; } diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index ffad69b6aa..8e54c00d8d 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1374,9 +1374,9 @@ synth_crossing (GtkWidget *widget, gdk_event_set_device (event, gdk_event_get_device (source)); gdk_event_set_source_device (event, gdk_event_get_source_device (source)); - event->any.surface = g_object_ref (gtk_widget_get_window (toplevel)); + event->any.surface = g_object_ref (gtk_widget_get_surface (toplevel)); if (other_widget) - event->crossing.child_surface = g_object_ref (gtk_widget_get_window (other_widget)); + event->crossing.child_surface = g_object_ref (gtk_widget_get_surface (other_widget)); if (enter) gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_PRELIGHT, FALSE); diff --git a/gtk/gtkmediacontrols.c b/gtk/gtkmediacontrols.c index a55475e662..f590a434f6 100644 --- a/gtk/gtkmediacontrols.c +++ b/gtk/gtkmediacontrols.c @@ -294,7 +294,7 @@ static void gtk_media_controls_init (GtkMediaControls *controls) { gtk_widget_init_template (GTK_WIDGET (controls)); - gtk_widget_set_has_window (GTK_WIDGET (controls), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (controls), FALSE); } /** diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index d3c1643e7e..d004672c05 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1491,7 +1491,7 @@ associate_menu_grab_transfer_window (GtkMenu *menu) GdkSurface *toplevel_window; GdkSurface *transfer_window; - toplevel_window = gtk_widget_get_window (priv->toplevel); + toplevel_window = gtk_widget_get_surface (priv->toplevel); transfer_window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); if (toplevel_window == NULL || transfer_window == NULL) @@ -1595,7 +1595,7 @@ gtk_menu_popup_internal (GtkMenu *menu, if (xgrab_shell && xgrab_shell != widget) { - if (popup_grab_on_window (gtk_widget_get_window (xgrab_shell), pointer)) + if (popup_grab_on_window (gtk_widget_get_surface (xgrab_shell), pointer)) { _gtk_menu_shell_set_grab_device (GTK_MENU_SHELL (xgrab_shell), pointer); GTK_MENU_SHELL (xgrab_shell)->priv->have_xgrab = TRUE; @@ -1693,7 +1693,7 @@ gtk_menu_popup_internal (GtkMenu *menu, gtk_widget_show (priv->toplevel); if (xgrab_shell == widget) - popup_grab_on_window (gtk_widget_get_window (widget), pointer); /* Should always succeed */ + popup_grab_on_window (gtk_widget_get_surface (widget), pointer); /* Should always succeed */ gtk_grab_add (GTK_WIDGET (menu)); @@ -2524,7 +2524,7 @@ menu_grab_transfer_window_get (GtkMenu *menu) if (!window) { window = gdk_surface_new_temp (gtk_widget_get_display (GTK_WIDGET (menu))); - gtk_widget_register_window (GTK_WIDGET (menu), window); + gtk_widget_register_surface (GTK_WIDGET (menu), window); gdk_surface_show (window); @@ -2542,11 +2542,11 @@ menu_grab_transfer_window_destroy (GtkMenu *menu) { GdkSurface *widget_window; - gtk_widget_unregister_window (GTK_WIDGET (menu), window); + gtk_widget_unregister_surface (GTK_WIDGET (menu), window); gdk_surface_destroy (window); g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), NULL); - widget_window = gtk_widget_get_window (GTK_WIDGET (menu)); + widget_window = gtk_widget_get_surface (GTK_WIDGET (menu)); g_object_set_data (G_OBJECT (widget_window), I_("gdk-attached-grab-surface"), window); } } @@ -2956,7 +2956,7 @@ pointer_in_menu_window (GtkWidget *widget, GtkMenuShell *menu_shell; gint window_x, window_y; - gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel), &window_x, &window_y); gtk_widget_get_allocation (widget, &allocation); @@ -3194,7 +3194,7 @@ gtk_menu_scroll_by (GtkMenu *menu, if ((priv->scroll_offset >= 0) && (offset < 0)) offset = 0; - view_height = gdk_surface_get_height (gtk_widget_get_window (widget)); + view_height = gdk_surface_get_height (gtk_widget_get_surface (widget)); if (priv->scroll_offset == 0 && view_height >= priv->requested_height) @@ -3258,7 +3258,7 @@ get_arrows_sensitive_area (GtkMenu *menu, &bottom_arrow_height, NULL, NULL, NULL); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); width = gdk_surface_get_width (window); height = gdk_surface_get_height (window); @@ -3297,7 +3297,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu, menu_shell = GTK_MENU_SHELL (menu); - gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel), &top_x, &top_y); x -= top_x; y -= top_y; @@ -3509,7 +3509,7 @@ pointer_on_menu_widget (GtkMenu *menu, gint window_x, window_y; gtk_widget_get_allocation (GTK_WIDGET (menu), &allocation); - gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel), &window_x, &window_y); if (x_root >= window_x && x_root < window_x + allocation.width && @@ -3598,7 +3598,7 @@ gtk_menu_captured_event (GtkWidget *widget, y_diff = y_root - priv->drag_start_y; offset = priv->initial_drag_offset - y_diff; - view_height = gdk_surface_get_height (gtk_widget_get_window (widget)); + view_height = gdk_surface_get_height (gtk_widget_get_surface (widget)); get_arrows_border (menu, &arrow_border); if (priv->upper_arrow_visible) @@ -4000,8 +4000,8 @@ gtk_menu_position (GtkMenu *menu, } else if (priv->widget) { - rect_window = gtk_widget_get_window (priv->widget); - gtk_widget_get_window_allocation (priv->widget, &rect); + rect_window = gtk_widget_get_surface (priv->widget); + gtk_widget_get_surface_allocation (priv->widget, &rect); text_direction = gtk_widget_get_direction (priv->widget); } else if (!priv->position_func) @@ -4022,7 +4022,7 @@ gtk_menu_position (GtkMenu *menu, { rect = (GdkRectangle) { 0, 0, 1, 1 }; - rect_window = gtk_widget_get_window (attach_widget); + rect_window = gtk_widget_get_surface (attach_widget); gdk_surface_get_device_position (rect_window, grab_device, &rect.x, &rect.y, NULL); text_direction = gtk_widget_get_direction (attach_widget); @@ -4058,7 +4058,7 @@ gtk_menu_position (GtkMenu *menu, menu_anchor = get_horizontally_flipped_anchor (menu_anchor); } - toplevel = gtk_widget_get_window (priv->toplevel); + toplevel = gtk_widget_get_surface (priv->toplevel); gdk_surface_set_transient_for (toplevel, rect_window); @@ -4187,7 +4187,7 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell, &child_offset, &child_height, &last_child)) { y = priv->scroll_offset; - height = gdk_surface_get_height (gtk_widget_get_window (widget)); + height = gdk_surface_get_height (gtk_widget_get_surface (widget)); if (child_offset < y) { diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 353e4795e6..6df94a0dca 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -670,7 +670,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item) priv = gtk_menu_item_get_instance_private (menu_item); menu_item->priv = priv; - gtk_widget_set_has_window (GTK_WIDGET (menu_item), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (menu_item), FALSE); g_signal_connect (menu_item, "notify::parent", G_CALLBACK (gtk_menu_item_parent_cb), NULL); @@ -1406,7 +1406,7 @@ gtk_menu_item_real_popup_submenu (GtkWidget *widget, /* Position the submenu at the menu item if it is mapped. * Otherwise, position the submenu at the pointer device. */ - if (gtk_widget_get_window (widget)) + if (gtk_widget_get_surface (widget)) { switch (priv->submenu_placement) { diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index 01dc5ff72e..e0a58ec1a8 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -408,7 +408,7 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell) menu_shell->priv = gtk_menu_shell_get_instance_private (menu_shell); menu_shell->priv->take_focus = TRUE; - gtk_widget_set_has_window (GTK_WIDGET (menu_shell), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (menu_shell), FALSE); } static void diff --git a/gtk/gtkmnemonichash.c b/gtk/gtkmnemonichash.c index bd5ea6200c..4a87f0c3e7 100644 --- a/gtk/gtkmnemonichash.c +++ b/gtk/gtkmnemonichash.c @@ -124,7 +124,7 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash, for (list = targets; list; list = list->next) { widget = GTK_WIDGET (list->data); - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); if (gtk_widget_is_sensitive (widget) && gtk_widget_get_mapped (widget) && diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index f66724de3f..96533a2b89 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1046,7 +1046,7 @@ gtk_notebook_init (GtkNotebook *notebook) GdkContentFormats *targets; gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE); - gtk_widget_set_has_window (GTK_WIDGET (notebook), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (notebook), FALSE); notebook->priv = gtk_notebook_get_instance_private (notebook); priv = notebook->priv; @@ -4171,7 +4171,7 @@ gtk_notebook_remove_tab_label (GtkNotebook *notebook, page->mnemonic_activate_signal); page->mnemonic_activate_signal = 0; - if (gtk_widget_get_window (page->tab_label) != gtk_widget_get_window (GTK_WIDGET (notebook)) || + if (gtk_widget_get_surface (page->tab_label) != gtk_widget_get_surface (GTK_WIDGET (notebook)) || !NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)) { GtkWidget *parent; diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index fca3fb6098..d12381bd84 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -842,7 +842,7 @@ gtk_overlay_class_init (GtkOverlayClass *klass) static void gtk_overlay_init (GtkOverlay *overlay) { - gtk_widget_set_has_window (GTK_WIDGET (overlay), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (overlay), FALSE); } static void diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 8c1da9fbcd..62cd9d8088 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1497,7 +1497,7 @@ gtk_paned_init (GtkPaned *paned) GtkPanedPrivate *priv; GtkGesture *gesture; - gtk_widget_set_has_window (GTK_WIDGET (paned), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (paned), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (paned), TRUE); paned->priv = gtk_paned_get_instance_private (paned); diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 6ff6932846..da0fd38b77 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -237,7 +237,7 @@ gtk_path_bar_init (GtkPathBar *path_bar) g_signal_connect_swapped (path_bar->priv->down_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_down), path_bar); - gtk_widget_set_has_window (GTK_WIDGET (path_bar), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (path_bar), FALSE); context = gtk_widget_get_style_context (GTK_WIDGET (path_bar)); gtk_style_context_add_class (context, "path-bar"); diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 3d22f05305..0d26728cb3 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -273,7 +273,7 @@ gtk_popover_init (GtkPopover *popover) GtkStyleContext *context; widget = GTK_WIDGET (popover); - gtk_widget_set_has_window (widget, TRUE); + gtk_widget_set_has_surface (widget, TRUE); popover->priv = gtk_popover_get_instance_private (popover); popover->priv->modal = TRUE; popover->priv->tick_id = 0; @@ -389,7 +389,7 @@ gtk_popover_hide_internal (GtkPopover *popover) if (gtk_widget_get_realized (widget)) { cairo_region_t *region = cairo_region_create (); - gdk_surface_input_shape_combine_region (gtk_widget_get_window (widget), + gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget), region, 0, 0); cairo_region_destroy (region); } @@ -473,7 +473,7 @@ gtk_popover_realize (GtkWidget *widget) GtkAllocation allocation; GdkSurface *window; - gtk_widget_get_window_allocation (widget, &allocation); + gtk_widget_get_surface_allocation (widget, &allocation); /* We want to use subsurfaces for popovers, so they can extend outside * the main window, but for that, we first need to have clean subsurface @@ -490,17 +490,17 @@ gtk_popover_realize (GtkWidget *widget) &allocation); gdk_surface_set_transient_for (window, - gtk_widget_get_window (toplevel)); + gtk_widget_get_surface (toplevel)); } else #endif { - window = gdk_surface_new_child (gtk_widget_get_parent_window (widget), + window = gdk_surface_new_child (gtk_widget_get_parent_surface (widget), &allocation); } - gtk_widget_set_window (widget, window); - gtk_widget_register_window (widget, window); + gtk_widget_set_surface (widget, window); + gtk_widget_register_surface (widget, window); gtk_widget_set_realized (widget, TRUE); } @@ -746,7 +746,7 @@ gtk_popover_map (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_popover_parent_class)->map (widget); - gdk_surface_show (gtk_widget_get_window (widget)); + gdk_surface_show (gtk_widget_get_surface (widget)); gtk_popover_update_position (GTK_POPOVER (widget)); gtk_window_set_default (priv->window, priv->default_widget); @@ -759,7 +759,7 @@ gtk_popover_unmap (GtkWidget *widget) priv->button_pressed = FALSE; - gdk_surface_hide (gtk_widget_get_window (widget)); + gdk_surface_hide (gtk_widget_get_surface (widget)); GTK_WIDGET_CLASS (gtk_popover_parent_class)->unmap (widget); if (gtk_window_get_default_widget (priv->window) == priv->default_widget) @@ -826,7 +826,7 @@ gtk_popover_get_gap_coords (GtkPopover *popover, gtk_widget_translate_coordinates (priv->widget, GTK_WIDGET (priv->window), rect.x, rect.y, &rect.x, &rect.y); - gdk_surface_get_origin (gtk_widget_get_window (GTK_WIDGET (popover)), + gdk_surface_get_origin (gtk_widget_get_surface (GTK_WIDGET (popover)), &win_x, &win_y); rect.x -= win_x; rect.y -= win_y; @@ -1026,7 +1026,7 @@ gtk_popover_update_shape (GtkPopover *popover) return; #endif - win = gtk_widget_get_window (widget); + win = gtk_widget_get_surface (widget); surface = gdk_surface_create_similar_surface (win, CAIRO_CONTENT_COLOR_ALPHA, @@ -1043,7 +1043,7 @@ gtk_popover_update_shape (GtkPopover *popover) gtk_widget_shape_combine_region (widget, region); cairo_region_destroy (region); - gdk_surface_set_child_shapes (gtk_widget_get_window (widget)); + gdk_surface_set_child_shapes (gtk_widget_get_surface (widget)); } static void @@ -1362,8 +1362,8 @@ gtk_popover_size_allocate (GtkWidget *widget, if (gtk_widget_get_realized (widget)) { GtkAllocation a; - gtk_widget_get_window_allocation (widget, &a); - gdk_surface_move_resize (gtk_widget_get_window (widget), + gtk_widget_get_surface_allocation (widget, &a); + gdk_surface_move_resize (gtk_widget_get_surface (widget), a.x, a.y, a.width, a.height); gtk_popover_update_shape (popover); } @@ -1500,7 +1500,7 @@ gtk_popover_show (GtkWidget *widget) priv->state = STATE_SHOWN; if (gtk_widget_get_realized (widget)) - gdk_surface_input_shape_combine_region (gtk_widget_get_window (widget), + gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget), NULL, 0, 0); } diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c index c649c12ac9..db7247e0e4 100644 --- a/gtk/gtkprintoperation-win32.c +++ b/gtk/gtkprintoperation-win32.c @@ -659,7 +659,7 @@ static HWND get_parent_hwnd (GtkWidget *widget) { gtk_widget_realize (widget); - return gdk_win32_surface_get_handle (gtk_widget_get_window (widget)); + return gdk_win32_surface_get_handle (gtk_widget_get_surface (widget)); } static void @@ -1343,7 +1343,7 @@ plug_grab_notify (GtkWidget *widget, gboolean was_grabbed, GtkPrintOperation *op) { - EnableWindow (GetAncestor (GDK_SURFACE_HWND (gtk_widget_get_window (widget)), GA_ROOT), + EnableWindow (GetAncestor (GDK_SURFACE_HWND (gtk_widget_get_surface (widget)), GA_ROOT), was_grabbed); } @@ -1371,7 +1371,7 @@ pageDlgProc (HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) gtk_container_add (GTK_CONTAINER (plug), op->priv->custom_widget); gtk_widget_show (op->priv->custom_widget); gtk_widget_show (plug); - gdk_surface_focus (gtk_widget_get_window (plug), GDK_CURRENT_TIME); + gdk_surface_focus (gtk_widget_get_surface (plug), GDK_CURRENT_TIME); /* This dialog is modal, so we grab the embed widget */ gtk_grab_add (plug); diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index c4f8e80473..2a9a877f9c 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -778,7 +778,7 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog) page_name_func, NULL, NULL); /* Preview drawing area has no window */ - gtk_widget_set_has_window (priv->page_layout_preview, FALSE); + gtk_widget_set_has_surface (priv->page_layout_preview, FALSE); /* Load backends */ load_print_backends (dialog); diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index aff253c159..a3d7f7ebcb 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -481,7 +481,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar) priv->text = NULL; priv->fraction = 0.0; - gtk_widget_set_has_window (GTK_WIDGET (pbar), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (pbar), FALSE); _gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar)); diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index ba37dbee34..eb58677aa4 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -535,7 +535,7 @@ gtk_range_init (GtkRange *range) { GtkRangePrivate *priv = gtk_range_get_instance_private (range); - gtk_widget_set_has_window (GTK_WIDGET (range), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (range), FALSE); priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->adjustment = NULL; diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index 8fc7219403..1b67c2337e 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -123,7 +123,7 @@ gtk_revealer_init (GtkRevealer *revealer) priv->current_pos = 0.0; priv->target_pos = 0.0; - gtk_widget_set_has_window ((GtkWidget*) revealer, FALSE); + gtk_widget_set_has_surface ((GtkWidget*) revealer, FALSE); } static void diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 131c197c50..7aef93f62f 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -248,7 +248,7 @@ gtk_scrollbar_init (GtkScrollbar *self) { GtkScrollbarPrivate *priv = gtk_scrollbar_get_instance_private (self); - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); priv->orientation = GTK_ORIENTATION_HORIZONTAL; diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index bce856969d..496c5eed95 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1913,7 +1913,7 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window) scrolled_window->priv = priv = gtk_scrolled_window_get_instance_private (scrolled_window); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); gtk_widget_set_can_focus (widget, TRUE); /* Instantiated by gtk_scrolled_window_set_[hv]adjustment diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c index e968bb4a31..cd5af76fce 100644 --- a/gtk/gtkseparator.c +++ b/gtk/gtkseparator.c @@ -119,7 +119,7 @@ gtk_separator_init (GtkSeparator *separator) priv->orientation = GTK_ORIENTATION_HORIZONTAL; - gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (separator), FALSE); _gtk_orientable_set_style_classes (GTK_ORIENTABLE (separator)); } diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c index 2a305a0920..7964f5e8e2 100644 --- a/gtk/gtkseparatortoolitem.c +++ b/gtk/gtkseparatortoolitem.c @@ -114,7 +114,7 @@ gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item) priv = separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item); priv->draw = TRUE; - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); } static void diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c index 4a11d296ef..c38feb14e5 100644 --- a/gtk/gtkshortcutsshortcut.c +++ b/gtk/gtkshortcutsshortcut.c @@ -720,7 +720,7 @@ gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass) static void gtk_shortcuts_shortcut_init (GtkShortcutsShortcut *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_HORIZONTAL, diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 05b52e8c79..109a2fd1f1 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -833,7 +833,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) { GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button); - gtk_widget_set_has_window (GTK_WIDGET (spin_button), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (spin_button), FALSE); priv->adjustment = NULL; priv->timer = 0; diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c index 97239649f6..800a3ed9f8 100644 --- a/gtk/gtkspinner.c +++ b/gtk/gtkspinner.c @@ -208,7 +208,7 @@ gtk_spinner_class_init (GtkSpinnerClass *klass) static void gtk_spinner_init (GtkSpinner *spinner) { - gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (spinner), FALSE); } /** diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index a14f4730d5..22efd3250e 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2152,7 +2152,7 @@ gtk_stack_init (GtkStack *stack) { GtkStackPrivate *priv = gtk_stack_get_instance_private (stack); - gtk_widget_set_has_window (GTK_WIDGET (stack), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (stack), FALSE); priv->vhomogeneous = TRUE; priv->hhomogeneous = TRUE; diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c index 2c7566e61f..000e87bf9c 100644 --- a/gtk/gtkstackswitcher.c +++ b/gtk/gtkstackswitcher.c @@ -87,7 +87,7 @@ gtk_stack_switcher_init (GtkStackSwitcher *switcher) GtkStyleContext *context; GtkStackSwitcherPrivate *priv; - gtk_widget_set_has_window (GTK_WIDGET (switcher), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (switcher), FALSE); priv = gtk_stack_switcher_get_instance_private (switcher); diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index fc0336cbb2..2c9dfaaee6 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -226,7 +226,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar) { GtkStatusbarPrivate *priv; - gtk_widget_set_has_window (GTK_WIDGET (statusbar), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (statusbar), FALSE); statusbar->priv = gtk_statusbar_get_instance_private (statusbar); priv = statusbar->priv; diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index d665ef3dfc..7189437d11 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -623,7 +623,7 @@ gtk_switch_init (GtkSwitch *self) GtkSwitchPrivate *priv = gtk_switch_get_instance_private (self); GtkGesture *gesture; - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE); gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self)); diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 74ca454e5a..3d28902d78 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -233,7 +233,7 @@ _gtk_text_util_create_drag_icon (GtkWidget *widget, pixmap_width = layout_width / PANGO_SCALE; pixmap_height = layout_height / PANGO_SCALE; - surface = gdk_surface_create_similar_surface (gtk_widget_get_window (widget), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget), CAIRO_CONTENT_COLOR_ALPHA, pixmap_width, pixmap_height); cr = cairo_create (surface); @@ -342,7 +342,7 @@ _gtk_text_util_create_rich_drag_icon (GtkWidget *widget, layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH); layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT); - surface = gdk_surface_create_similar_surface (gtk_widget_get_window (widget), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget), CAIRO_CONTENT_COLOR_ALPHA, layout_width, layout_height); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 40ee965dfe..bd91df47f2 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1629,7 +1629,7 @@ gtk_text_view_init (GtkTextView *text_view) text_view->priv = gtk_text_view_get_instance_private (text_view); priv = text_view->priv; - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); gtk_widget_set_can_focus (widget, TRUE); context = gtk_widget_get_style_context (GTK_WIDGET (text_view)); @@ -8746,7 +8746,7 @@ gtk_text_view_do_popup (GtkTextView *text_view, &iter_location.y); gtk_menu_popup_at_rect (GTK_MENU (priv->popup_menu), - gtk_widget_get_window (GTK_WIDGET (text_view)), + gtk_widget_get_surface (GTK_WIDGET (text_view)), &iter_location, GDK_GRAVITY_SOUTH_EAST, GDK_GRAVITY_NORTH_WEST, diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 6549b680ba..60dd8bfc6f 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -566,7 +566,7 @@ gtk_toolbar_init (GtkToolbar *toolbar) priv = toolbar->priv; gtk_widget_set_can_focus (widget, FALSE); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->style = DEFAULT_TOOLBAR_STYLE; diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 3fe220782a..5b325f233d 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -614,9 +614,9 @@ get_bounding_box (GtkWidget *widget, gint x3, y3; gint x4, y4; - window = gtk_widget_get_parent_window (widget); + window = gtk_widget_get_parent_surface (widget); if (window == NULL) - window = gtk_widget_get_window (widget); + window = gtk_widget_get_surface (widget); gtk_widget_get_allocation (widget, &allocation); @@ -1052,7 +1052,7 @@ _gtk_tooltip_focus_in (GtkWidget *widget) tooltip->keyboard_widget = g_object_ref (widget); - gdk_surface_get_device_position (gtk_widget_get_window (widget), + gdk_surface_get_device_position (gtk_widget_get_surface (widget), device, &x, &y, NULL); return_value = gtk_tooltip_run_requery (&widget, tooltip, &x, &y); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index d0f477eeea..68613ea597 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1707,7 +1707,7 @@ gtk_tree_view_init (GtkTreeView *tree_view) priv->event_last_x = -10000; priv->event_last_y = -10000; - gtk_widget_set_has_window (GTK_WIDGET (tree_view), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (tree_view), FALSE); gtk_tree_view_do_set_vadjustment (tree_view, NULL); gtk_tree_view_do_set_hadjustment (tree_view, NULL); @@ -2270,14 +2270,14 @@ gtk_tree_view_unrealize (GtkWidget *widget) if (priv->drag_surface) { - gtk_widget_unregister_window (widget, priv->drag_surface); + gtk_widget_unregister_surface (widget, priv->drag_surface); gdk_surface_destroy (priv->drag_surface); priv->drag_surface = NULL; } if (priv->drag_highlight_window) { - gtk_widget_unregister_window (widget, priv->drag_highlight_window); + gtk_widget_unregister_surface (widget, priv->drag_highlight_window); gdk_surface_destroy (priv->drag_highlight_window); priv->drag_highlight_window = NULL; } @@ -3200,7 +3200,7 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view) tree_view->priv->cur_reorder->left_column); } tree_view->priv->drag_column = NULL; - gtk_widget_unregister_window (widget, tree_view->priv->drag_surface); + gtk_widget_unregister_surface (widget, tree_view->priv->drag_surface); gdk_surface_destroy (tree_view->priv->drag_surface); tree_view->priv->drag_surface = NULL; @@ -3644,7 +3644,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) if (tree_view->priv->drag_highlight_window) { - gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); gdk_surface_destroy (tree_view->priv->drag_highlight_window); } @@ -3652,13 +3652,13 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) gtk_widget_get_allocation (button, &drag_allocation); width = drag_allocation.width; height = drag_allocation.height; - tree_view->priv->drag_highlight_window = gdk_surface_new_child (gtk_widget_get_window (widget), + tree_view->priv->drag_highlight_window = gdk_surface_new_child (gtk_widget_get_surface (widget), &(GdkRectangle){ tree_view->priv->drag_column_x, 0, drag_allocation.width, drag_allocation.height}); - gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_ORIGINAL; } @@ -3697,13 +3697,13 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) { if (tree_view->priv->drag_highlight_window) { - gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); gdk_surface_destroy (tree_view->priv->drag_highlight_window); } tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); - gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height); @@ -3767,13 +3767,13 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) { if (tree_view->priv->drag_highlight_window) { - gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); gdk_surface_destroy (tree_view->priv->drag_highlight_window); } tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); - gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height); @@ -5714,7 +5714,7 @@ gtk_tree_view_key_press (GtkWidget *widget, new_event = gdk_event_copy ((GdkEvent *) event); g_object_unref (((GdkEventKey *) new_event)->any.surface); ((GdkEventKey *) new_event)->any.surface = - g_object_ref (gtk_widget_get_window (search_window)); + g_object_ref (gtk_widget_get_surface (search_window)); gtk_widget_realize (search_window); popup_menu_id = g_signal_connect (tree_view->priv->search_entry, @@ -9575,14 +9575,14 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gtk_widget_get_allocation (button, &button_allocation); button_allocation.y = 0; - tree_view->priv->drag_surface = gdk_surface_new_child (gtk_widget_get_window (GTK_WIDGET (tree_view)), + tree_view->priv->drag_surface = gdk_surface_new_child (gtk_widget_get_surface (GTK_WIDGET (tree_view)), &button_allocation); - gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_surface); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_surface); /* Kids, don't try this at home */ g_object_ref (button); gtk_container_remove (GTK_CONTAINER (tree_view), button); - gtk_widget_set_parent_window (button, tree_view->priv->drag_surface); + gtk_widget_set_parent_surface (button, tree_view->priv->drag_surface); gtk_widget_set_parent (button, GTK_WIDGET (tree_view)); g_object_unref (button); @@ -10610,7 +10610,7 @@ send_focus_change (GtkWidget *widget, /* Skip non-master keyboards that haven't * selected for events from this surface */ - surface = gtk_widget_get_window (widget); + surface = gtk_widget_get_surface (widget); if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && !gdk_surface_get_device_events (surface, dev)) continue; @@ -13866,7 +13866,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view)); - surface = gdk_surface_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (tree_view)), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (GTK_WIDGET (tree_view)), CAIRO_CONTENT_COLOR, bin_window_width + 2, background_area.height + 2); @@ -14280,7 +14280,7 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, GdkDisplay *display; GdkMonitor *monitor; GdkRectangle workarea; - GdkSurface *tree_window = gtk_widget_get_window (GTK_WIDGET (tree_view)); + GdkSurface *tree_window = gtk_widget_get_surface (GTK_WIDGET (tree_view)); GtkRequisition requisition; gtk_widget_realize (search_window); diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c index eb13ead95e..36f51bc7be 100644 --- a/gtk/gtkvideo.c +++ b/gtk/gtkvideo.c @@ -103,7 +103,7 @@ gtk_video_realize (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_video_parent_class)->realize (widget); if (self->media_stream) - gtk_media_stream_realize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self))); + gtk_media_stream_realize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self))); if (self->file) gtk_media_file_set_file (GTK_MEDIA_FILE (self->media_stream), self->file); @@ -115,7 +115,7 @@ gtk_video_unrealize (GtkWidget *widget) GtkVideo *self = GTK_VIDEO (widget); if (self->media_stream) - gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self))); + gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self))); GTK_WIDGET_CLASS (gtk_video_parent_class)->unrealize (widget); } @@ -280,7 +280,7 @@ static void gtk_video_init (GtkVideo *self) { gtk_widget_init_template (GTK_WIDGET (self)); - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->motion_controller = gtk_event_controller_motion_new (GTK_WIDGET (self)); g_signal_connect (self->motion_controller, "motion", G_CALLBACK (gtk_video_motion), self); @@ -518,7 +518,7 @@ gtk_video_set_media_stream (GtkVideo *self, gtk_video_notify_cb, self); if (gtk_widget_get_realized (GTK_WIDGET (self))) - gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self))); + gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self))); g_object_unref (self->media_stream); self->media_stream = NULL; } @@ -527,7 +527,7 @@ gtk_video_set_media_stream (GtkVideo *self, { self->media_stream = g_object_ref (stream); if (gtk_widget_get_realized (GTK_WIDGET (self))) - gtk_media_stream_realize (stream, gtk_widget_get_window (GTK_WIDGET (self))); + gtk_media_stream_realize (stream, gtk_widget_get_surface (GTK_WIDGET (self))); g_signal_connect (self->media_stream, "notify", G_CALLBACK (gtk_video_notify_cb), diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 3343586480..e16a5a48c3 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -358,7 +358,7 @@ gtk_viewport_init (GtkViewport *viewport) widget = GTK_WIDGET (viewport); - gtk_widget_set_has_window (widget, FALSE); + gtk_widget_set_has_surface (widget, FALSE); priv->shadow_type = GTK_SHADOW_IN; priv->hadjustment = NULL; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 0712185ab1..ae6c377d78 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2622,7 +2622,7 @@ gtk_widget_get_property (GObject *object, g_value_set_string (value, g_object_get_qdata (object, quark_tooltip_markup)); break; case PROP_WINDOW: - g_value_set_object (value, _gtk_widget_get_window (widget)); + g_value_set_object (value, _gtk_widget_get_surface (widget)); break; case PROP_HALIGN: g_value_set_enum (value, gtk_widget_get_halign (widget)); @@ -3304,7 +3304,7 @@ gtk_widget_unparent (GtkWidget *widget) * an embedded GtkWindow the window will become toplevel again and hierarchy-changed * will fire again for the new subhierarchy. */ - gtk_widget_set_parent_window (widget, NULL); + gtk_widget_set_parent_surface (widget, NULL); g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]); g_object_thaw_notify (G_OBJECT (widget)); @@ -3550,7 +3550,7 @@ gtk_widget_map (GtkWidget *widget) update_cursor_on_state_change (widget); - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) gtk_widget_queue_draw (widget); gtk_widget_pop_verify_invariants (widget); @@ -3574,7 +3574,7 @@ gtk_widget_unmap (GtkWidget *widget) g_object_ref (widget); gtk_widget_push_verify_invariants (widget); - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) gtk_widget_queue_draw (widget); _gtk_tooltip_hide (widget); @@ -3886,7 +3886,7 @@ gtk_widget_realize (GtkWidget *widget) gtk_widget_push_verify_invariants (widget); /* - if (GTK_IS_CONTAINER (widget) && _gtk_widget_get_has_window (widget)) + if (GTK_IS_CONTAINER (widget) && _gtk_widget_get_has_surface (widget)) g_message ("gtk_widget_realize(%s)", G_OBJECT_TYPE_NAME (widget)); */ @@ -3969,7 +3969,7 @@ gtk_widget_unrealize (GtkWidget *widget) * for a windowed widget. */ void -gtk_widget_get_window_allocation (GtkWidget *widget, +gtk_widget_get_surface_allocation (GtkWidget *widget, GtkAllocation *allocation) { GtkWidget *parent; @@ -3977,7 +3977,7 @@ gtk_widget_get_window_allocation (GtkWidget *widget, /* Don't consider the parent == widget case here. */ parent = _gtk_widget_get_parent (widget); - while (parent && !_gtk_widget_get_has_window (parent)) + while (parent && !_gtk_widget_get_has_surface (parent)) parent = _gtk_widget_get_parent (parent); g_assert (GTK_IS_WINDOW (parent) || GTK_IS_POPOVER (parent)); @@ -4052,7 +4052,7 @@ gtk_widget_queue_draw (GtkWidget *widget) parent = _gtk_widget_get_parent (widget); rect = &widget->priv->clip; - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) gtk_widget_queue_draw_area (parent ? parent : widget, rect->x, rect->y, rect->width, rect->height); else @@ -4215,7 +4215,7 @@ gtk_widget_get_frame_clock (GtkWidget *widget) * reparenting windows and widgets. */ GtkWidget *toplevel = _gtk_widget_get_toplevel (widget); - GdkSurface *window = _gtk_widget_get_window (toplevel); + GdkSurface *window = _gtk_widget_get_surface (toplevel); g_assert (window != NULL); return gdk_surface_get_frame_clock (window); @@ -4304,7 +4304,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget, if (!_gtk_widget_get_parent (widget)) { - g_assert (_gtk_widget_get_has_window (widget)); + g_assert (_gtk_widget_get_has_surface (widget)); region2 = cairo_region_copy (region); windowed_parent = widget; goto invalidate; @@ -4321,7 +4321,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget, /* Look for the parent with a window and invalidate @region in there. */ windowed_parent = widget; - while (windowed_parent != NULL && !_gtk_widget_get_has_window (windowed_parent)) + while (windowed_parent != NULL && !_gtk_widget_get_has_surface (windowed_parent)) windowed_parent = _gtk_widget_get_parent (windowed_parent); g_assert (windowed_parent != NULL); @@ -4338,7 +4338,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget, /* At this point, x and y are relative to the windowed parent's origin, * but the window of the parent spans over its entire allocation, so we need * to account for border and padding manually. The values returned from - * gtk_widget_get_window_allocation, which should've been used to size and position + * gtk_widget_get_surface_allocation, which should've been used to size and position * @parent's window, do not include widget margins nor css margins. */ parent_style = gtk_css_node_get_style (windowed_parent->priv->cssnode); @@ -4352,7 +4352,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget, invalidate: gtk_debug_updates_add (windowed_parent, region2); - gdk_surface_invalidate_region (_gtk_widget_get_window (widget), region2, TRUE); + gdk_surface_invalidate_region (_gtk_widget_get_surface (widget), region2, TRUE); cairo_region_destroy (region2); @@ -4547,7 +4547,7 @@ gtk_widget_size_allocate (GtkWidget *widget, real_allocation.height = 0; } - if (G_UNLIKELY (_gtk_widget_get_has_window (widget))) + if (G_UNLIKELY (_gtk_widget_get_has_surface (widget))) { real_allocation.width = MAX (1, real_allocation.width); real_allocation.height = MAX (1, real_allocation.height); @@ -4570,11 +4570,11 @@ gtk_widget_size_allocate (GtkWidget *widget, /* Still have to move the window... */ if (_gtk_widget_get_realized (widget) && - _gtk_widget_get_has_window (widget)) + _gtk_widget_get_has_surface (widget)) { GtkAllocation window_alloc; - gtk_widget_get_window_allocation (widget, &window_alloc); + gtk_widget_get_surface_allocation (widget, &window_alloc); gdk_surface_move_resize (priv->window, window_alloc.x, window_alloc.y, window_alloc.width, window_alloc.height); @@ -4884,11 +4884,11 @@ gtk_widget_real_size_allocate (GtkWidget *widget, GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); if (_gtk_widget_get_realized (widget) && - _gtk_widget_get_has_window (widget)) + _gtk_widget_get_has_surface (widget)) { GtkAllocation window_alloc; - gtk_widget_get_window_allocation (widget, &window_alloc); + gtk_widget_get_surface_allocation (widget, &window_alloc); gdk_surface_move_resize (priv->window, window_alloc.x, window_alloc.y, window_alloc.width, window_alloc.height); @@ -6019,7 +6019,7 @@ gtk_widget_intersect (GtkWidget *widget, return_val = gdk_rectangle_intersect (&priv->allocation, area, dest); - if (return_val && intersection && _gtk_widget_get_has_window (widget)) + if (return_val && intersection && _gtk_widget_get_has_surface (widget)) { intersection->x -= priv->allocation.x; intersection->y -= priv->allocation.y; @@ -6989,13 +6989,13 @@ gtk_widget_is_visible (GtkWidget *widget) } /** - * gtk_widget_set_has_window: + * gtk_widget_set_has_surface: * @widget: a #GtkWidget * @has_window: whether or not @widget has a window. * * Specifies whether @widget has a #GdkSurface of its own. Note that * all realized widgets have a non-%NULL “window” pointer - * (gtk_widget_get_window() never returns a %NULL window when a widget + * (gtk_widget_get_surface() never returns a %NULL window when a widget * is realized), but for many of them it’s actually the #GdkSurface of * one of its parent widgets. Widgets that do not create a %window for * themselves in #GtkWidget::realize must announce this by @@ -7005,7 +7005,7 @@ gtk_widget_is_visible (GtkWidget *widget) * and they should call it in their init() function. **/ void -gtk_widget_set_has_window (GtkWidget *widget, +gtk_widget_set_has_surface (GtkWidget *widget, gboolean has_window) { g_return_if_fail (GTK_IS_WIDGET (widget)); @@ -7019,16 +7019,16 @@ gtk_widget_set_has_window (GtkWidget *widget, } /** - * gtk_widget_get_has_window: + * gtk_widget_get_has_surface: * @widget: a #GtkWidget * * Determines whether @widget has a #GdkSurface of its own. See - * gtk_widget_set_has_window(). + * gtk_widget_set_has_surface(). * * Returns: %TRUE if @widget has a window, %FALSE otherwise **/ gboolean -gtk_widget_get_has_window (GtkWidget *widget) +gtk_widget_get_has_surface (GtkWidget *widget) { g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); @@ -8058,7 +8058,7 @@ gtk_widget_create_pango_layout (GtkWidget *widget, } /** - * gtk_widget_set_parent_window: + * gtk_widget_set_parent_surface: * @widget: a #GtkWidget. * @parent_window: the new parent window. * @@ -8072,7 +8072,7 @@ gtk_widget_create_pango_layout (GtkWidget *widget, * window is realized. */ void -gtk_widget_set_parent_window (GtkWidget *widget, +gtk_widget_set_parent_surface (GtkWidget *widget, GdkSurface *parent_window) { GdkSurface *old_parent_window; @@ -8095,7 +8095,7 @@ gtk_widget_set_parent_window (GtkWidget *widget, } /** - * gtk_widget_get_parent_window: + * gtk_widget_get_parent_surface: * @widget: a #GtkWidget. * * Gets @widget’s parent window, or %NULL if it does not have one. @@ -8104,7 +8104,7 @@ gtk_widget_set_parent_window (GtkWidget *widget, * if it does not have a parent window. **/ GdkSurface * -gtk_widget_get_parent_window (GtkWidget *widget) +gtk_widget_get_parent_surface (GtkWidget *widget) { GtkWidgetPrivate *priv; GdkSurface *parent_window; @@ -8246,7 +8246,7 @@ gtk_widget_get_scale_factor (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), 1); if (_gtk_widget_get_realized (widget)) - return gdk_surface_get_scale_factor (_gtk_widget_get_window (widget)); + return gdk_surface_get_scale_factor (_gtk_widget_get_surface (widget)); toplevel = _gtk_widget_get_toplevel (widget); if (toplevel && toplevel != widget) @@ -8860,7 +8860,7 @@ gtk_widget_constructed (GObject *object) if (!widget->priv->no_window_set) { - g_warning ("%s does not call gtk_widget_set_has_window() in its init function", G_OBJECT_TYPE_NAME (widget)); + g_warning ("%s does not call gtk_widget_set_has_surface() in its init function", G_OBJECT_TYPE_NAME (widget)); } } @@ -9148,7 +9148,7 @@ gtk_widget_real_map (GtkWidget *widget) GtkWidget *p; priv->mapped = TRUE; - if (_gtk_widget_get_has_window (widget)) + if (_gtk_widget_get_has_surface (widget)) gdk_surface_show (priv->window); for (p = gtk_widget_get_first_child (widget); @@ -9181,7 +9181,7 @@ gtk_widget_real_unmap (GtkWidget *widget) GtkWidget *child; priv->mapped = FALSE; - if (_gtk_widget_get_has_window (widget)) + if (_gtk_widget_get_has_surface (widget)) gdk_surface_hide (priv->window); for (child = gtk_widget_get_first_child (widget); @@ -9210,12 +9210,12 @@ gtk_widget_real_realize (GtkWidget *widget) { GtkWidgetPrivate *priv = widget->priv; - g_assert (!_gtk_widget_get_has_window (widget)); + g_assert (!_gtk_widget_get_has_surface (widget)); gtk_widget_set_realized (widget, TRUE); if (priv->parent) { - priv->window = gtk_widget_get_parent_window (widget); + priv->window = gtk_widget_get_parent_surface (widget); g_object_ref (priv->window); } } @@ -9243,9 +9243,9 @@ gtk_widget_real_unrealize (GtkWidget *widget) gtk_widget_forall (widget, (GtkCallback)gtk_widget_unrealize, NULL); - if (_gtk_widget_get_has_window (widget)) + if (_gtk_widget_get_has_surface (widget)) { - gtk_widget_unregister_window (widget, priv->window); + gtk_widget_unregister_surface (widget, priv->window); gdk_surface_destroy (priv->window); priv->window = NULL; } @@ -9738,7 +9738,7 @@ gtk_widget_shape_combine_region (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); /* set_shape doesn't work on widgets without GDK surface */ - g_return_if_fail (_gtk_widget_get_has_window (widget)); + g_return_if_fail (_gtk_widget_get_has_surface (widget)); priv = widget->priv; @@ -9835,7 +9835,7 @@ gtk_widget_input_shape_combine_region (GtkWidget *widget, { g_return_if_fail (GTK_IS_WIDGET (widget)); /* set_shape doesn't work on widgets without GDK surface */ - g_return_if_fail (_gtk_widget_get_has_window (widget)); + g_return_if_fail (_gtk_widget_get_has_surface (widget)); if (region == NULL) g_object_set_qdata (G_OBJECT (widget), quark_input_shape_info, NULL); @@ -12096,7 +12096,7 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget) } /** - * gtk_widget_set_window: + * gtk_widget_set_surface: * @widget: a #GtkWidget * @window: (transfer full): a #GdkSurface * @@ -12104,16 +12104,16 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget) * widget’s #GtkWidget::realize implementation. The %window passed is * usually either new window created with gdk_surface_new(), or the * window of its parent widget as returned by - * gtk_widget_get_parent_window(). + * gtk_widget_get_parent_surface(). * * Widgets must indicate whether they will create their own #GdkSurface - * by calling gtk_widget_set_has_window(). This is usually done in the + * by calling gtk_widget_set_has_surface(). This is usually done in the * widget’s init() function. * * Note that this function does not add any reference to @window. */ void -gtk_widget_set_window (GtkWidget *widget, +gtk_widget_set_surface (GtkWidget *widget, GdkSurface *window) { GtkWidgetPrivate *priv; @@ -12132,21 +12132,21 @@ gtk_widget_set_window (GtkWidget *widget, } /** - * gtk_widget_register_window: + * gtk_widget_register_surface: * @widget: a #GtkWidget * @window: a #GdkSurface * * Registers a #GdkSurface with the widget and sets it up so that - * the widget receives events for it. Call gtk_widget_unregister_window() + * the widget receives events for it. Call gtk_widget_unregister_surface() * when destroying the window. * * Before 3.8 you needed to call gdk_surface_set_user_data() directly to set - * this up. This is now deprecated and you should use gtk_widget_register_window() + * this up. This is now deprecated and you should use gtk_widget_register_surface() * instead. Old code will keep working as is, although some new features like * transparency might not work perfectly. */ void -gtk_widget_register_window (GtkWidget *widget, +gtk_widget_register_surface (GtkWidget *widget, GdkSurface *window) { GtkWidgetPrivate *priv; @@ -12165,16 +12165,16 @@ gtk_widget_register_window (GtkWidget *widget, } /** - * gtk_widget_unregister_window: + * gtk_widget_unregister_surface: * @widget: a #GtkWidget * @window: a #GdkSurface * * Unregisters a #GdkSurface from the widget that was previously set up with - * gtk_widget_register_window(). You need to call this when the window is + * gtk_widget_register_surface(). You need to call this when the window is * no longer used by the widget, such as when you destroy it. */ void -gtk_widget_unregister_window (GtkWidget *widget, +gtk_widget_unregister_surface (GtkWidget *widget, GdkSurface *window) { GtkWidgetPrivate *priv; @@ -12192,7 +12192,7 @@ gtk_widget_unregister_window (GtkWidget *widget, } /** - * gtk_widget_get_window: + * gtk_widget_get_surface: * @widget: a #GtkWidget * * Returns the widget’s window if it is realized, %NULL otherwise @@ -12200,7 +12200,7 @@ gtk_widget_unregister_window (GtkWidget *widget, * Returns: (transfer none) (nullable): @widget’s window. */ GdkSurface* -gtk_widget_get_window (GtkWidget *widget) +gtk_widget_get_surface (GtkWidget *widget) { g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); @@ -12368,7 +12368,7 @@ gtk_widget_get_opacity (GtkWidget *widget) * * fevent->focus_change.type = GDK_FOCUS_CHANGE; * fevent->focus_change.in = TRUE; - * fevent->focus_change.window = _gtk_widget_get_window (widget); + * fevent->focus_change.window = _gtk_widget_get_surface (widget); * if (fevent->focus_change.window != NULL) * g_object_ref (fevent->focus_change.window); * diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index ea0549072f..ae7f83b10f 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -578,10 +578,10 @@ GDK_AVAILABLE_IN_ALL gboolean gtk_widget_is_visible (GtkWidget *widget); GDK_AVAILABLE_IN_ALL -void gtk_widget_set_has_window (GtkWidget *widget, +void gtk_widget_set_has_surface (GtkWidget *widget, gboolean has_window); GDK_AVAILABLE_IN_ALL -gboolean gtk_widget_get_has_window (GtkWidget *widget); +gboolean gtk_widget_get_has_surface (GtkWidget *widget); GDK_AVAILABLE_IN_ALL gboolean gtk_widget_is_toplevel (GtkWidget *widget); @@ -602,10 +602,10 @@ GDK_AVAILABLE_IN_ALL GtkWidget * gtk_widget_get_parent (GtkWidget *widget); GDK_AVAILABLE_IN_ALL -void gtk_widget_set_parent_window (GtkWidget *widget, +void gtk_widget_set_parent_surface (GtkWidget *widget, GdkSurface *parent_window); GDK_AVAILABLE_IN_ALL -GdkSurface * gtk_widget_get_parent_window (GtkWidget *widget); +GdkSurface * gtk_widget_get_parent_surface (GtkWidget *widget); GDK_AVAILABLE_IN_ALL void gtk_widget_set_child_visible (GtkWidget *widget, @@ -614,15 +614,15 @@ GDK_AVAILABLE_IN_ALL gboolean gtk_widget_get_child_visible (GtkWidget *widget); GDK_AVAILABLE_IN_ALL -void gtk_widget_set_window (GtkWidget *widget, +void gtk_widget_set_surface (GtkWidget *widget, GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkSurface * gtk_widget_get_window (GtkWidget *widget); +GdkSurface * gtk_widget_get_surface (GtkWidget *widget); GDK_AVAILABLE_IN_ALL -void gtk_widget_register_window (GtkWidget *widget, +void gtk_widget_register_surface (GtkWidget *widget, GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gtk_widget_unregister_window (GtkWidget *widget, +void gtk_widget_unregister_surface (GtkWidget *widget, GdkSurface *window); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkwidgetfocus.c b/gtk/gtkwidgetfocus.c index 40990007e6..99c010e11d 100644 --- a/gtk/gtkwidgetfocus.c +++ b/gtk/gtkwidgetfocus.c @@ -299,13 +299,13 @@ focus_sort_left_right (GtkWidget *widget, } else { - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) compare_info.y = allocation.y + allocation.height / 2; else compare_info.y = allocation.height / 2; } - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) compare_info.x = (direction == GTK_DIR_RIGHT) ? allocation.x : allocation.x + allocation.width; else compare_info.x = (direction == GTK_DIR_RIGHT) ? 0 : allocation.width; @@ -398,13 +398,13 @@ focus_sort_up_down (GtkWidget *widget, } else { - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) compare_info.x = allocation.x + allocation.width / 2; else compare_info.x = allocation.width / 2; } - if (!_gtk_widget_get_has_window (widget)) + if (!_gtk_widget_get_has_surface (widget)) compare_info.y = (direction == GTK_DIR_DOWN) ? allocation.y : allocation.y + allocation.height; else compare_info.y = (direction == GTK_DIR_DOWN) ? 0 : + allocation.height; diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index d774599d89..ec5e45805b 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -315,7 +315,7 @@ void gtk_widget_get_outer_allocation (GtkWidget *wi void gtk_widget_get_own_allocation (GtkWidget *widget, GtkAllocation *allocation); -void gtk_widget_get_window_allocation (GtkWidget *widget, +void gtk_widget_get_surface_allocation (GtkWidget *widget, GtkAllocation *allocation); @@ -371,7 +371,7 @@ _gtk_widget_is_drawable (GtkWidget *widget) } static inline gboolean -_gtk_widget_get_has_window (GtkWidget *widget) +_gtk_widget_get_has_surface (GtkWidget *widget) { return !widget->priv->no_window; } @@ -430,7 +430,7 @@ _gtk_widget_peek_request_cache (GtkWidget *widget) } static inline GdkSurface * -_gtk_widget_get_window (GtkWidget *widget) +_gtk_widget_get_surface (GtkWidget *widget) { return widget->priv->window; } diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index f36da9651f..b68e4f9090 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1407,9 +1407,9 @@ gtk_window_titlebar_action (GtkWindow *window, _gtk_window_toggle_maximized (window); } else if (g_str_equal (action, "lower")) - gdk_surface_lower (_gtk_widget_get_window (GTK_WIDGET (window))); + gdk_surface_lower (_gtk_widget_get_surface (GTK_WIDGET (window))); else if (g_str_equal (action, "minimize")) - gdk_surface_iconify (_gtk_widget_get_window (GTK_WIDGET (window))); + gdk_surface_iconify (_gtk_widget_get_surface (GTK_WIDGET (window))); else if (g_str_equal (action, "menu")) gtk_window_do_popup (window, (GdkEventButton*) event); else @@ -1482,7 +1482,7 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, event_widget = gtk_get_event_widget ((GdkEvent *) event); if (region == GTK_WINDOW_REGION_TITLE) - gdk_surface_raise (_gtk_widget_get_window (widget)); + gdk_surface_raise (_gtk_widget_get_surface (widget)); switch (region) { @@ -1524,7 +1524,7 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); gdk_event_get_root_coords (event, &x_root, &y_root); - gdk_surface_begin_resize_drag_for_device (_gtk_widget_get_window (widget), + gdk_surface_begin_resize_drag_for_device (_gtk_widget_get_surface (widget), (GdkSurfaceEdge) region, gdk_event_get_device ((GdkEvent *) event), GDK_BUTTON_PRIMARY, @@ -1632,10 +1632,10 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y); - gdk_surface_get_root_coords (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_get_root_coords (_gtk_widget_get_surface (GTK_WIDGET (window)), start_x, start_y, &x_root, &y_root); - gdk_surface_begin_move_drag_for_device (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_begin_move_drag_for_device (_gtk_widget_get_surface (GTK_WIDGET (window)), gtk_gesture_get_device (GTK_GESTURE (gesture)), gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)), x_root, y_root, @@ -1730,7 +1730,7 @@ edge_under_coordinates (GtkWindow *window, priv->maximized) return FALSE; - supports_edge_constraints = gdk_surface_supports_edge_constraints (_gtk_widget_get_window (GTK_WIDGET (window))); + supports_edge_constraints = gdk_surface_supports_edge_constraints (_gtk_widget_get_surface (GTK_WIDGET (window))); constraints = constraints_for_edge (edge); if (!supports_edge_constraints && priv->tiled) @@ -1888,7 +1888,7 @@ gtk_window_init (GtkWindow *window) window->priv = gtk_window_get_instance_private (window); priv = window->priv; - gtk_widget_set_has_window (widget, TRUE); + gtk_widget_set_has_surface (widget, TRUE); _gtk_widget_set_is_toplevel (widget, TRUE); _gtk_widget_set_anchored (widget, TRUE); @@ -2559,7 +2559,7 @@ gtk_window_set_title_internal (GtkWindow *window, priv->title = new_title; if (_gtk_widget_get_realized (widget)) - gdk_surface_set_title (_gtk_widget_get_window (widget), new_title != NULL ? new_title : ""); + gdk_surface_set_title (_gtk_widget_get_surface (widget), new_title != NULL ? new_title : ""); if (update_titlebar && GTK_IS_HEADER_BAR (priv->title_box)) gtk_header_bar_set_title (GTK_HEADER_BAR (priv->title_box), new_title != NULL ? new_title : ""); @@ -2646,7 +2646,7 @@ gtk_window_set_role (GtkWindow *window, priv->wm_role = new_role; if (_gtk_widget_get_realized (widget)) - gdk_surface_set_role (_gtk_widget_get_window (widget), priv->wm_role); + gdk_surface_set_role (_gtk_widget_get_surface (widget), priv->wm_role); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ROLE]); } @@ -2687,7 +2687,7 @@ gtk_window_set_startup_id (GtkWindow *window, GdkSurface *gdk_surface; guint32 timestamp = extract_time_from_startup_id (priv->startup_id); - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); #ifdef GDK_WINDOWING_X11 if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE(gdk_surface)) @@ -3237,7 +3237,7 @@ gtk_window_set_modal (GtkWindow *window, /* adjust desired modality state */ if (_gtk_widget_get_realized (widget)) - gdk_surface_set_modal_hint (_gtk_widget_get_window (widget), priv->modal); + gdk_surface_set_modal_hint (_gtk_widget_get_surface (widget), priv->modal); if (gtk_widget_get_visible (widget)) { @@ -3367,8 +3367,8 @@ gtk_window_transient_parent_realized (GtkWidget *parent, GtkWidget *window) { if (_gtk_widget_get_realized (window)) - gdk_surface_set_transient_for (_gtk_widget_get_window (window), - _gtk_widget_get_window (parent)); + gdk_surface_set_transient_for (_gtk_widget_get_surface (window), + _gtk_widget_get_surface (parent)); } static void @@ -3376,7 +3376,7 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent, GtkWidget *window) { if (_gtk_widget_get_realized (window)) - gdk_surface_set_transient_for (_gtk_widget_get_window (window), NULL); + gdk_surface_set_transient_for (_gtk_widget_get_surface (window), NULL); } static void @@ -3706,7 +3706,7 @@ gtk_window_set_type_hint (GtkWindow *window, priv->type_hint = hint; - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (gdk_surface) gdk_surface_set_type_hint (gdk_surface, hint); @@ -3755,7 +3755,7 @@ gtk_window_set_skip_taskbar_hint (GtkWindow *window, { priv->skips_taskbar = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_surface_set_skip_taskbar_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_skip_taskbar_hint (_gtk_widget_get_surface (GTK_WIDGET (window)), priv->skips_taskbar); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_TASKBAR_HINT]); } @@ -3804,7 +3804,7 @@ gtk_window_set_skip_pager_hint (GtkWindow *window, { priv->skips_pager = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_surface_set_skip_pager_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_skip_pager_hint (_gtk_widget_get_surface (GTK_WIDGET (window)), priv->skips_pager); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_PAGER_HINT]); } @@ -3850,7 +3850,7 @@ gtk_window_set_urgency_hint (GtkWindow *window, { priv->urgent = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_surface_set_urgency_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_urgency_hint (_gtk_widget_get_surface (GTK_WIDGET (window)), priv->urgent); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_URGENCY_HINT]); } @@ -3896,7 +3896,7 @@ gtk_window_set_accept_focus (GtkWindow *window, { priv->accept_focus = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_surface_set_accept_focus (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_accept_focus (_gtk_widget_get_surface (GTK_WIDGET (window)), priv->accept_focus); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ACCEPT_FOCUS]); } @@ -3943,7 +3943,7 @@ gtk_window_set_focus_on_map (GtkWindow *window, { priv->focus_on_map = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_surface_set_focus_on_map (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_focus_on_map (_gtk_widget_get_surface (GTK_WIDGET (window)), priv->focus_on_map); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_ON_MAP]); } @@ -4304,7 +4304,7 @@ gtk_window_set_decorated (GtkWindow *window, priv->decorated = setting; - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (gdk_surface) { if (priv->decorated) @@ -4375,7 +4375,7 @@ gtk_window_set_deletable (GtkWindow *window, priv->deletable = setting; - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (gdk_surface) { if (priv->deletable) @@ -4498,7 +4498,7 @@ gtk_window_realize_icon (GtkWindow *window) GList *icon_list; widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); g_return_if_fail (gdk_surface != NULL); @@ -5474,8 +5474,8 @@ gtk_window_get_size (GtkWindow *window, if (_gtk_widget_get_mapped (GTK_WIDGET (window))) { - w = gdk_surface_get_width (_gtk_widget_get_window (GTK_WIDGET (window))); - h = gdk_surface_get_height (_gtk_widget_get_window (GTK_WIDGET (window))); + w = gdk_surface_get_width (_gtk_widget_get_surface (GTK_WIDGET (window))); + h = gdk_surface_get_height (_gtk_widget_get_surface (GTK_WIDGET (window))); } else { @@ -5670,7 +5670,7 @@ gtk_window_move (GtkWindow *window, * the same as the position being changed by the window * manager. */ - gdk_surface_move (_gtk_widget_get_window (GTK_WIDGET (window)), x, y); + gdk_surface_move (_gtk_widget_get_surface (GTK_WIDGET (window)), x, y); } else { @@ -5740,7 +5740,7 @@ gtk_window_get_position (GtkWindow *window, priv = window->priv; widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); if (priv->gravity == GDK_GRAVITY_STATIC) { @@ -6194,7 +6194,7 @@ gtk_window_map (GtkWidget *widget) gtk_widget_get_child_visible (priv->title_box)) gtk_widget_map (priv->title_box); - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); if (priv->maximize_initially) gdk_surface_maximize (gdk_surface); @@ -6285,7 +6285,7 @@ gtk_window_unmap (GtkWidget *widget) return; } - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget); gdk_surface_withdraw (gdk_surface); @@ -6293,7 +6293,7 @@ gtk_window_unmap (GtkWidget *widget) while (priv->configure_request_count > 0) { priv->configure_request_count--; - gdk_surface_thaw_toplevel_updates (_gtk_widget_get_window (widget)); + gdk_surface_thaw_toplevel_updates (_gtk_widget_get_surface (widget)); } priv->configure_notify_received = FALSE; @@ -6354,7 +6354,7 @@ gtk_window_guess_default_size (GtkWindow *window, widget = GTK_WIDGET (window); display = gtk_widget_get_display (widget); - gdkwindow = _gtk_widget_get_window (widget); + gdkwindow = _gtk_widget_get_surface (widget); if (gdkwindow) monitor = gdk_display_get_monitor_at_surface (display, gdkwindow); @@ -6405,7 +6405,7 @@ gtk_window_get_remembered_size (GtkWindow *window, *width = 0; *height = 0; - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (gdk_surface) { *width = gdk_surface_get_width (gdk_surface); @@ -6676,7 +6676,7 @@ update_shadow_width (GtkWindow *window, { GdkSurface *gdk_surface; - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (gdk_surface) gdk_surface_set_shadow_width (gdk_surface, @@ -6765,7 +6765,7 @@ update_opaque_region (GtkWindow *window, opaque_region = NULL; } - gdk_surface_set_opaque_region (_gtk_widget_get_window (widget), opaque_region); + gdk_surface_set_opaque_region (_gtk_widget_get_surface (widget), opaque_region); cairo_region_destroy (opaque_region); } @@ -6865,9 +6865,9 @@ gtk_window_realize (GtkWidget *widget) } } - gtk_widget_set_window (widget, gdk_surface); + gtk_widget_set_surface (widget, gdk_surface); g_signal_connect_swapped (gdk_surface, "notify::state", G_CALLBACK (surface_state_changed), widget); - gtk_widget_register_window (widget, gdk_surface); + gtk_widget_register_surface (widget, gdk_surface); gtk_widget_set_realized (widget, TRUE); if (priv->renderer == NULL) @@ -6876,7 +6876,7 @@ gtk_window_realize (GtkWidget *widget) if (priv->transient_parent && _gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent))) gdk_surface_set_transient_for (gdk_surface, - _gtk_widget_get_window (GTK_WIDGET (priv->transient_parent))); + _gtk_widget_get_surface (GTK_WIDGET (priv->transient_parent))); gdk_surface_set_type_hint (gdk_surface, priv->type_hint); @@ -7001,7 +7001,7 @@ gtk_window_unrealize (GtkWidget *widget) gsk_renderer_unrealize (priv->renderer); g_clear_object (&priv->renderer); - g_signal_handlers_disconnect_by_func (_gtk_widget_get_window (widget), + g_signal_handlers_disconnect_by_func (_gtk_widget_get_surface (widget), G_CALLBACK (surface_state_changed), widget); @@ -7162,7 +7162,7 @@ _gtk_window_set_allocation (GtkWindow *window, if (!_gtk_widget_is_toplevel (widget) && _gtk_widget_get_realized (widget)) { - gdk_surface_move_resize (_gtk_widget_get_window (widget), + gdk_surface_move_resize (_gtk_widget_get_surface (widget), allocation->x, allocation->y, allocation->width, allocation->height); } @@ -7207,7 +7207,7 @@ gtk_window_configure_event (GtkWidget *widget, if (!_gtk_widget_is_toplevel (widget)) return FALSE; - if (_gtk_widget_get_window (widget) != event->any.surface) + if (_gtk_widget_get_surface (widget) != event->any.surface) return TRUE; /* If this is a gratuitous ConfigureNotify that's already @@ -7242,7 +7242,7 @@ gtk_window_configure_event (GtkWidget *widget, { priv->configure_request_count -= 1; - gdk_surface_thaw_toplevel_updates (_gtk_widget_get_window (widget)); + gdk_surface_thaw_toplevel_updates (_gtk_widget_get_surface (widget)); } /* @@ -7288,7 +7288,7 @@ surface_state_changed (GtkWidget *widget) GdkSurfaceState new_surface_state; GdkSurfaceState changed_mask; - new_surface_state = gdk_surface_get_state (_gtk_widget_get_window (widget)); + new_surface_state = gdk_surface_get_state (_gtk_widget_get_surface (widget)); changed_mask = new_surface_state ^ priv->state; priv->state = new_surface_state; @@ -7610,7 +7610,7 @@ gtk_window_event (GtkWidget *widget, * the window being unmapped. more details can be found in: * http://bugzilla.gnome.org/show_bug.cgi?id=316180 */ - gdk_surface_hide (_gtk_widget_get_window (widget)); + gdk_surface_hide (_gtk_widget_get_surface (widget)); } } else if (event_type == GDK_CONFIGURE) @@ -7657,7 +7657,7 @@ do_focus_change (GtkWidget *widget, /* Skip non-master keyboards that haven't * selected for events from this window */ - window = _gtk_widget_get_window (widget); + window = _gtk_widget_get_surface (widget); if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && window && !gdk_surface_get_device_events (window, dev)) continue; @@ -7697,7 +7697,7 @@ gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window) GdkDevice *dev = gdk_seat_get_pointer (s->data); GdkModifierType mask; - gdk_device_get_state (dev, _gtk_widget_get_window (GTK_WIDGET (window)), + gdk_device_get_state (dev, _gtk_widget_get_surface (GTK_WIDGET (window)), NULL, &mask); if (window->priv->mnemonic_modifier == (mask & gtk_accelerator_get_default_mod_mask ())) { @@ -8072,7 +8072,7 @@ gtk_window_get_state (GtkWindow *window) GdkSurfaceState state; GdkSurface *gdk_surface; - gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); state = 0; @@ -8284,7 +8284,7 @@ static void gtk_window_do_popup (GtkWindow *window, GdkEventButton *event) { - if (!gdk_surface_show_window_menu (_gtk_widget_get_window (GTK_WIDGET (window)), + if (!gdk_surface_show_window_menu (_gtk_widget_get_surface (GTK_WIDGET (window)), (GdkEvent *) event)) gtk_window_do_popup_fallback (window, event); } @@ -8542,7 +8542,7 @@ gtk_window_compute_configure_request (GtkWindow *window, g_assert (_gtk_widget_get_mapped (parent_widget)); /* established earlier */ - gdk_surface = _gtk_widget_get_window (parent_widget); + gdk_surface = _gtk_widget_get_surface (parent_widget); monitor = gdk_display_get_monitor_at_surface (priv->display, gdk_surface); gdk_surface_get_origin (gdk_surface, &ox, &oy); @@ -8683,7 +8683,7 @@ gtk_window_move_resize (GtkWindow *window) widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); info = gtk_window_get_geometry_info (window, TRUE); configure_request_size_changed = FALSE; @@ -9363,7 +9363,7 @@ gtk_window_present_with_time (GtkWindow *window, if (gtk_widget_get_visible (widget)) { - gdk_surface = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_surface (widget); g_assert (gdk_surface != NULL); @@ -9421,7 +9421,7 @@ gtk_window_iconify (GtkWindow *window) window->priv->iconify_initially = TRUE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_iconify (toplevel); @@ -9448,7 +9448,7 @@ gtk_window_deiconify (GtkWindow *window) window->priv->iconify_initially = FALSE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_deiconify (toplevel); @@ -9479,7 +9479,7 @@ gtk_window_stick (GtkWindow *window) window->priv->stick_initially = TRUE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_stick (toplevel); @@ -9507,7 +9507,7 @@ gtk_window_unstick (GtkWindow *window) window->priv->stick_initially = FALSE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_unstick (toplevel); @@ -9541,7 +9541,7 @@ gtk_window_maximize (GtkWindow *window) window->priv->maximize_initially = TRUE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_maximize (toplevel); @@ -9569,7 +9569,7 @@ gtk_window_unmaximize (GtkWindow *window) window->priv->maximize_initially = FALSE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_unmaximize (toplevel); @@ -9598,7 +9598,7 @@ gtk_window_fullscreen (GtkWindow *window) window->priv->fullscreen_initially = TRUE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_fullscreen (toplevel); @@ -9652,7 +9652,7 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window, priv->fullscreen_initially = TRUE; - toplevel = _gtk_widget_get_window (widget); + toplevel = _gtk_widget_get_surface (widget); if (toplevel != NULL) gdk_surface_fullscreen_on_monitor (toplevel, monitor); @@ -9682,7 +9682,7 @@ gtk_window_unfullscreen (GtkWindow *window) unset_fullscreen_monitor (window); window->priv->fullscreen_initially = FALSE; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_unfullscreen (toplevel); @@ -9726,7 +9726,7 @@ gtk_window_set_keep_above (GtkWindow *window, window->priv->above_initially = setting; window->priv->below_initially &= !setting; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_set_keep_above (toplevel, setting); @@ -9770,7 +9770,7 @@ gtk_window_set_keep_below (GtkWindow *window, window->priv->below_initially = setting; window->priv->above_initially &= !setting; - toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); + toplevel = _gtk_widget_get_surface (GTK_WIDGET (window)); if (toplevel != NULL) gdk_surface_set_keep_below (toplevel, setting); @@ -9906,7 +9906,7 @@ gtk_window_begin_resize_drag (GtkWindow *window, widget = GTK_WIDGET (window); g_return_if_fail (gtk_widget_get_visible (widget)); - toplevel = _gtk_widget_get_window (widget); + toplevel = _gtk_widget_get_surface (widget); gdk_surface_begin_resize_drag (toplevel, edge, button, @@ -9943,7 +9943,7 @@ gtk_window_begin_move_drag (GtkWindow *window, widget = GTK_WIDGET (window); g_return_if_fail (gtk_widget_get_visible (widget)); - toplevel = _gtk_widget_get_window (widget); + toplevel = _gtk_widget_get_surface (widget); gdk_surface_begin_move_drag (toplevel, button, @@ -10024,7 +10024,7 @@ gtk_window_set_theme_variant (GtkWindow *window) "gtk-application-prefer-dark-theme", &dark_theme_requested, NULL); - gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); if (GDK_IS_X11_SURFACE (gdk_surface)) gdk_x11_surface_set_theme_variant (gdk_surface, @@ -10658,7 +10658,7 @@ ensure_state_flag_backdrop (GtkWidget *widget) GdkSurface *window; gboolean window_focused = TRUE; - window = _gtk_widget_get_window (widget); + window = _gtk_widget_get_surface (widget); window_focused = gdk_surface_get_state (window) & GDK_SURFACE_STATE_FOCUSED; @@ -11114,7 +11114,7 @@ gtk_window_export_handle (GtkWindow *window, #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); char *handle_str; guint32 xid = (guint32) gdk_x11_surface_get_xid (gdk_surface); @@ -11127,7 +11127,7 @@ gtk_window_export_handle (GtkWindow *window, #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); WaylandSurfaceHandleExportedData *data; data = g_new0 (WaylandSurfaceHandleExportedData, 1); @@ -11161,7 +11161,7 @@ gtk_window_unexport_handle (GtkWindow *window) #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); gdk_wayland_surface_unexport_handle (gdk_surface); } @@ -11397,7 +11397,7 @@ update_cursor (GtkWindow *toplevel, break; } - gdk_surface_set_device_cursor (gtk_widget_get_window (GTK_WIDGET (toplevel)), + gdk_surface_set_device_cursor (gtk_widget_get_surface (GTK_WIDGET (toplevel)), device, cursor); g_list_free (widgets); } diff --git a/gtk/inspector/gtkstackcombo.c b/gtk/inspector/gtkstackcombo.c index 7bbaa1b8cd..a5a257ed36 100644 --- a/gtk/inspector/gtkstackcombo.c +++ b/gtk/inspector/gtkstackcombo.c @@ -48,7 +48,7 @@ G_DEFINE_TYPE (GtkStackCombo, gtk_stack_combo, GTK_TYPE_WIDGET) static void gtk_stack_combo_init (GtkStackCombo *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->stack = NULL; self->combo = GTK_COMBO_BOX (gtk_combo_box_text_new ()); diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c index 9b4410ec1a..0097433526 100644 --- a/gtk/inspector/inspect-button.c +++ b/gtk/inspector/inspect-button.c @@ -115,7 +115,7 @@ find_widget_at_pointer (GdkDevice *device) { double x, y; - gdk_surface_get_device_position_double (gtk_widget_get_window (widget), + gdk_surface_get_device_position_double (gtk_widget_get_surface (widget), device, &x, &y, NULL); widget = inspector_pick (widget, x, y); @@ -175,7 +175,7 @@ on_inspect_widget (GtkWidget *button, { GtkWidget *widget; - gdk_surface_raise (gtk_widget_get_window (GTK_WIDGET (iw))); + gdk_surface_raise (gtk_widget_get_surface (GTK_WIDGET (iw))); clear_flash (iw); @@ -234,7 +234,7 @@ deemphasize_window (GtkWidget *window) cairo_region_destroy (region); } else - gdk_surface_lower (gtk_widget_get_window (window)); + gdk_surface_lower (gtk_widget_get_surface (window)); } static void @@ -249,7 +249,7 @@ reemphasize_window (GtkWidget *window) gtk_widget_input_shape_combine_region (window, NULL); } else - gdk_surface_raise (gtk_widget_get_window (window)); + gdk_surface_raise (gtk_widget_get_surface (window)); } static gboolean @@ -320,7 +320,7 @@ gtk_inspector_on_inspect (GtkWidget *button, display = gdk_display_get_default (); cursor = gdk_cursor_new_from_name ("crosshair", NULL); status = gdk_seat_grab (gdk_display_get_default_seat (display), - gtk_widget_get_window (iw->invisible), + gtk_widget_get_surface (iw->invisible), GDK_SEAT_CAPABILITY_ALL_POINTING, TRUE, cursor, NULL, prepare_inspect_func, NULL); g_object_unref (cursor); diff --git a/gtk/inspector/rendernodeview.c b/gtk/inspector/rendernodeview.c index 51e7e0edfd..cbd5d2ec3f 100644 --- a/gtk/inspector/rendernodeview.c +++ b/gtk/inspector/rendernodeview.c @@ -337,7 +337,7 @@ gtk_render_node_view_class_init (GtkRenderNodeViewClass *klass) static void gtk_render_node_view_init (GtkRenderNodeView *view) { - gtk_widget_set_has_window (GTK_WIDGET (view), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (view), FALSE); } GtkWidget * |