diff options
56 files changed, 933 insertions, 933 deletions
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index eea8e368b9..e5c06ac5e9 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -3642,9 +3642,9 @@ gtk_tree_view_get_visible_rect gtk_tree_view_get_visible_range gtk_tree_view_convert_bin_window_to_tree_coords gtk_tree_view_convert_bin_window_to_widget_coords -gtk_tree_view_convert_tree_to_bin_surface_coords +gtk_tree_view_convert_tree_to_bin_window_coords gtk_tree_view_convert_tree_to_widget_coords -gtk_tree_view_convert_widget_to_bin_surface_coords +gtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_widget_to_tree_coords gtk_tree_view_enable_model_drag_dest gtk_tree_view_enable_model_drag_source diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index f5359d8318..cc3bc37100 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -34,7 +34,7 @@ -(BOOL)windowShouldClose:(id)sender { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkEvent *event; event = gdk_event_new (GDK_DELETE); @@ -49,14 +49,14 @@ -(void)windowWillMiniaturize:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; _gdk_quartz_surface_detach_from_parent (window); } -(void)windowDidMiniaturize:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); @@ -64,7 +64,7 @@ -(void)windowDidDeminiaturize:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; _gdk_quartz_surface_attach_to_parent (window); @@ -73,7 +73,7 @@ -(void)windowDidBecomeKey:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED); _gdk_quartz_events_update_focus_window (window, TRUE); @@ -81,7 +81,7 @@ -(void)windowDidResignKey:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; _gdk_quartz_events_update_focus_window (window, FALSE); gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0); @@ -89,7 +89,7 @@ -(void)windowDidBecomeMain:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; if (![self isVisible]) { @@ -108,7 +108,7 @@ { GdkSurface *window; - window = [[self contentView] gdkWindow]; + window = [[self contentView] gdkSurface]; _gdk_quartz_surface_did_resign_main (window); } @@ -154,7 +154,7 @@ -(void)checkSendEnterNotify { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); /* When a new window has been created, and the mouse @@ -186,7 +186,7 @@ -(void)windowDidMove:(NSNotification *)aNotification { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkEvent *event; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -218,7 +218,7 @@ -(void)windowDidResize:(NSNotification *)aNotification { NSRect content_rect = [self contentRectForFrameRect:[self frame]]; - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkEvent *event; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; @@ -273,7 +273,7 @@ -(BOOL)canBecomeMainWindow { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); switch (impl->type_hint) @@ -302,7 +302,7 @@ -(BOOL)canBecomeKeyWindow { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!window->accept_focus) @@ -340,7 +340,7 @@ - (void)showAndMakeKey:(BOOL)makeKey { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); inShowOrHide = YES; @@ -357,7 +357,7 @@ - (void)hide { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); inShowOrHide = YES; @@ -369,7 +369,7 @@ - (BOOL)trackManualMove { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); NSPoint currentLocation; NSPoint newOrigin; @@ -587,7 +587,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) current_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT, NULL); update_context_from_dragging_info (sender); - window = [[self contentView] gdkWindow]; + window = [[self contentView] gdkSurface]; current_context->display = gdk_surface_get_display (window); @@ -626,7 +626,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) GdkEvent *event; event = gdk_event_new (GDK_DRAG_LEAVE); - event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); + event->dnd.window = g_object_ref ([[self contentView] gdkSurface]); event->dnd.send_event = FALSE; event->dnd.context = g_object_ref (current_context); event->dnd.time = GDK_CURRENT_TIME; @@ -653,7 +653,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy); event = gdk_event_new (GDK_DRAG_MOTION); - event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); + event->dnd.window = g_object_ref ([[self contentView] gdkSurface]); event->dnd.send_event = FALSE; event->dnd.context = g_object_ref (current_context); event->dnd.time = GDK_CURRENT_TIME; @@ -681,7 +681,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy); event = gdk_event_new (GDK_DROP_START); - event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); + event->dnd.window = g_object_ref ([[self contentView] gdkSurface]); event->dnd.send_event = FALSE; event->dnd.context = g_object_ref (current_context); event->dnd.time = GDK_CURRENT_TIME; @@ -715,7 +715,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) g_assert (_gdk_quartz_drag_source_context != NULL); event = gdk_event_new (GDK_DROP_FINISHED); - event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); + event->dnd.window = g_object_ref ([[self contentView] gdkSurface]); event->dnd.send_event = FALSE; event->dnd.context = g_object_ref (_gdk_quartz_drag_source_context); @@ -772,7 +772,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) is_fullscreen = (([self styleMask] & NSFullScreenWindowMask) != 0); if (was_fullscreen != is_fullscreen) - _gdk_quartz_surface_update_fullscreen_state ([[self contentView] gdkWindow]); + _gdk_quartz_surface_update_fullscreen_state ([[self contentView] gdkSurface]); } #endif @@ -780,7 +780,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen { NSRect rect; - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); /* Allow the window to move up "shadow_top" more than normally allowed @@ -797,7 +797,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) defaultFrame:(NSRect)newFrame { NSRect screenFrame = [[self screen] visibleFrame]; - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; @@ -811,7 +811,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) toFrame:(NSRect)newFrame { - GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkSurface]; GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 39d3821406..6e9a8a7f5e 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -555,7 +555,7 @@ gdk_surface = window; } --(GdkSurface *)gdkWindow +-(GdkSurface *)gdkSurface { return gdk_surface; } diff --git a/gdk/quartz/GdkQuartzView.h b/gdk/quartz/GdkQuartzView.h index 01045dc613..24ce2fd7c3 100644 --- a/gdk/quartz/GdkQuartzView.h +++ b/gdk/quartz/GdkQuartzView.h @@ -42,7 +42,7 @@ } - (void)setGdkSurface: (GdkSurface *)window; -- (GdkSurface *)gdkWindow; +- (GdkSurface *)gdkSurface; - (NSTrackingRectTag)trackingRect; - (void)setNeedsInvalidateShadow: (BOOL)invalidate; diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index b1109b0bc3..f9178c3172 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -424,7 +424,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent, view = (GdkQuartzView *)[[nsevent window] contentView]; - toplevel = [view gdkWindow]; + toplevel = [view gdkSurface]; point = [nsevent locationInWindow]; view_point = [view convertPoint:point fromView:nil]; @@ -643,7 +643,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent) GdkSeat *seat; view = (GdkQuartzView *)[[nsevent window] contentView]; - window = [view gdkWindow]; + window = [view gdkSurface]; display = gdk_surface_get_display (window); diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c index 915edff0a0..73ef9ca422 100644 --- a/gdk/quartz/gdksurface-quartz.c +++ b/gdk/quartz/gdksurface-quartz.c @@ -1306,7 +1306,7 @@ update_toplevel_order (void) if (![[nswindow contentView] isKindOfClass:[GdkQuartzView class]]) continue; - window = [(GdkQuartzView *)[nswindow contentView] gdkWindow]; + window = [(GdkQuartzView *)[nswindow contentView] gdkSurface]; toplevels = g_list_prepend (toplevels, window); } diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index 12e754325f..5fa66dd8d9 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -615,7 +615,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) wcl.style |= CS_OWNDC; if (0 == klassTOPLEVEL) { - wcl.lpszClassName = L"gdkWindowToplevel"; + wcl.lpszClassName = L"gdkSurfaceToplevel"; ONCE_PER_CLASS (); klassTOPLEVEL = RegisterClassExW (&wcl); @@ -630,7 +630,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) { if (klassTEMPSHADOW == 0) { - wcl.lpszClassName = L"gdkWindowTempShadow"; + wcl.lpszClassName = L"gdkSurfaceTempShadow"; wcl.style |= CS_SAVEBITS; wcl.style |= 0x00020000; /* CS_DROPSHADOW */ @@ -644,7 +644,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) { if (klassTEMP == 0) { - wcl.lpszClassName = L"gdkWindowTemp"; + wcl.lpszClassName = L"gdkSurfaceTemp"; wcl.style |= CS_SAVEBITS; ONCE_PER_CLASS (); klassTEMP = RegisterClassExW (&wcl); @@ -2716,7 +2716,7 @@ get_functions_quark () static GQuark quark = 0; if (!quark) - quark = g_quark_from_static_string ("gdk-window-functions"); + quark = g_quark_from_static_string ("gdk-surface-functions"); return quark; } @@ -3363,7 +3363,7 @@ RegisterGdkDumbClass () wcl.hbrBackground = NULL; wcl.hCursor = LoadCursor (NULL, IDC_ARROW); wcl.style |= CS_OWNDC; - wcl.lpszClassName = L"gdkWindowDumb"; + wcl.lpszClassName = L"gdkSurfaceDumb"; if (klassDUMB == 0) klassDUMB = RegisterClassExW (&wcl); diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 60da5f2926..d3d3e3f00d 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -4042,7 +4042,7 @@ get_move_resize_data (GdkDisplay *display, static GQuark move_resize_quark = 0; if (!move_resize_quark) - move_resize_quark = g_quark_from_static_string ("gdk-window-moveresize"); + move_resize_quark = g_quark_from_static_string ("gdk-surface-moveresize"); mv_resize = g_object_get_qdata (G_OBJECT (display), move_resize_quark); diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c index 09896408bd..5e3b763d10 100644 --- a/gsk/gskbroadwayrenderer.c +++ b/gsk/gskbroadwayrenderer.c @@ -24,7 +24,7 @@ G_DEFINE_TYPE (GskBroadwayRenderer, gsk_broadway_renderer, GSK_TYPE_RENDERER) static gboolean gsk_broadway_renderer_realize (GskRenderer *self, - GdkSurface *window, + GdkSurface *surface, GError **error) { return TRUE; @@ -42,17 +42,17 @@ gsk_broadway_renderer_begin_draw_frame (GskRenderer *renderer, { cairo_region_t *region; GdkDrawingContext *result; - cairo_rectangle_int_t whole_window; - GdkSurface *window; + cairo_rectangle_int_t whole_surface; + GdkSurface *surface; - window = gsk_renderer_get_surface (renderer); - whole_window = (cairo_rectangle_int_t) { + surface = gsk_renderer_get_surface (renderer); + whole_surface = (cairo_rectangle_int_t) { 0, 0, - gdk_surface_get_width (window), - gdk_surface_get_height (window) + gdk_surface_get_width (surface), + gdk_surface_get_height (surface) }; - region = cairo_region_create_rectangle (&whole_window); - result = gdk_surface_begin_draw_frame (window, NULL, region); + region = cairo_region_create_rectangle (&whole_surface); + result = gdk_surface_begin_draw_frame (surface, NULL, region); cairo_region_destroy (region); return result; @@ -686,12 +686,12 @@ static void gsk_broadway_renderer_render (GskRenderer *self, GskRenderNode *root) { - GdkSurface *window = gsk_renderer_get_surface (self); + GdkSurface *surface = gsk_renderer_get_surface (self); GArray *nodes = g_array_new (FALSE, FALSE, sizeof(guint32)); GPtrArray *node_textures = g_ptr_array_new_with_free_func (g_object_unref); gsk_broadway_renderer_add_node (self, nodes, node_textures, root, 0, 0); - gdk_broadway_surface_set_nodes (window, nodes, node_textures); + gdk_broadway_surface_set_nodes (surface, nodes, node_textures); g_array_unref (nodes); g_ptr_array_unref (node_textures); } diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c index 12cbe1cae8..1d30a1004a 100644 --- a/gsk/gskcairorenderer.c +++ b/gsk/gskcairorenderer.c @@ -32,7 +32,7 @@ G_DEFINE_TYPE (GskCairoRenderer, gsk_cairo_renderer, GSK_TYPE_RENDERER) static gboolean gsk_cairo_renderer_realize (GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, GError **error) { return TRUE; @@ -99,7 +99,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer, GskRenderNode *root) { GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer); - GdkSurface *window = gsk_renderer_get_surface (renderer); + GdkSurface *surface = gsk_renderer_get_surface (renderer); cairo_t *cr; @@ -114,7 +114,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer, cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_rectangle (cr, 0, 0, - gdk_surface_get_width (window), gdk_surface_get_height (window)); + gdk_surface_get_width (surface), gdk_surface_get_height (surface)); cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5); cairo_stroke (cr); cairo_restore (cr); diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index 7b67e9ce4f..a10ac097e9 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -69,7 +69,7 @@ typedef struct GskScalingFilter min_filter; GskScalingFilter mag_filter; - GdkSurface *window; + GdkSurface *surface; GdkDrawingContext *drawing_context; GskRenderNode *root_node; GdkDisplay *display; @@ -84,7 +84,7 @@ typedef struct G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT) enum { - PROP_WINDOW = 1, + PROP_SURFACE = 1, PROP_DISPLAY, PROP_DRAWING_CONTEXT, @@ -98,7 +98,7 @@ static GParamSpec *gsk_renderer_properties[N_PROPS]; static gboolean gsk_renderer_real_realize (GskRenderer *self, - GdkSurface *window, + GdkSurface *surface, GError **error) { GSK_RENDERER_WARN_NOT_IMPLEMENTED_METHOD (self, realize); @@ -126,9 +126,9 @@ gsk_renderer_real_begin_draw_frame (GskRenderer *self, { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - return gdk_surface_begin_draw_frame (priv->window, - NULL, - region); + return gdk_surface_begin_draw_frame (priv->surface, + NULL, + region); } static void @@ -137,8 +137,8 @@ gsk_renderer_real_end_draw_frame (GskRenderer *self, { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - gdk_surface_end_draw_frame (priv->window, - context); + gdk_surface_end_draw_frame (priv->surface, + context); } static void @@ -155,7 +155,7 @@ gsk_renderer_real_create_cairo_surface (GskRenderer *self, int height) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - int scale_factor = priv->window ? gdk_surface_get_scale_factor (priv->window) : 1; + int scale_factor = priv->surface ? gdk_surface_get_scale_factor (priv->surface) : 1; int real_width = width * scale_factor; int real_height = height * scale_factor; @@ -215,8 +215,8 @@ gsk_renderer_get_property (GObject *gobject, switch (prop_id) { - case PROP_WINDOW: - g_value_set_object (value, priv->window); + case PROP_SURFACE: + g_value_set_object (value, priv->surface); break; case PROP_DRAWING_CONTEXT: @@ -282,10 +282,10 @@ gsk_renderer_class_init (GskRendererClass *klass) G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); - gsk_renderer_properties[PROP_WINDOW] = - g_param_spec_object ("window", - "Window", - "The window associated to the renderer", + gsk_renderer_properties[PROP_SURFACE] = + g_param_spec_object ("surface", + "Surface", + "The surface associated to the renderer", GDK_TYPE_SURFACE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); @@ -331,7 +331,7 @@ gsk_renderer_get_surface (GskRenderer *renderer) g_return_val_if_fail (GSK_IS_RENDERER (renderer), NULL); - return priv->window; + return priv->surface; } /*< private > @@ -409,7 +409,7 @@ gsk_renderer_is_realized (GskRenderer *renderer) /** * gsk_renderer_realize: * @renderer: a #GskRenderer - * @window: the #GdkSurface renderer will be used on + * @surface: the #GdkSurface renderer will be used on * @error: return location for an error * * Creates the resources needed by the @renderer to render the scene @@ -417,21 +417,21 @@ gsk_renderer_is_realized (GskRenderer *renderer) */ gboolean gsk_renderer_realize (GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, GError **error) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer); g_return_val_if_fail (GSK_IS_RENDERER (renderer), FALSE); g_return_val_if_fail (!gsk_renderer_is_realized (renderer), FALSE); - g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - priv->window = g_object_ref (window); + priv->surface = g_object_ref (surface); - if (!GSK_RENDERER_GET_CLASS (renderer)->realize (renderer, window, error)) + if (!GSK_RENDERER_GET_CLASS (renderer)->realize (renderer, surface, error)) { - g_clear_object (&priv->window); + g_clear_object (&priv->surface); return FALSE; } @@ -625,9 +625,9 @@ get_renderer_for_name (const char *renderer_name) } static GType -get_renderer_for_display (GdkSurface *window) +get_renderer_for_display (GdkSurface *surface) { - GdkDisplay *display = gdk_surface_get_display (window); + GdkDisplay *display = gdk_surface_get_display (surface); const char *renderer_name; renderer_name = g_object_get_data (G_OBJECT (display), "gsk-renderer"); @@ -635,7 +635,7 @@ get_renderer_for_display (GdkSurface *window) } static GType -get_renderer_for_env_var (GdkSurface *window) +get_renderer_for_env_var (GdkSurface *surface) { static GType env_var_type = G_TYPE_NONE; @@ -649,18 +649,18 @@ get_renderer_for_env_var (GdkSurface *window) } static GType -get_renderer_for_backend (GdkSurface *window) +get_renderer_for_backend (GdkSurface *surface) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_SURFACE (window)) + if (GDK_IS_X11_SURFACE (surface)) return GSK_TYPE_GL_RENDERER; #endif #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_SURFACE (window)) + if (GDK_IS_WAYLAND_SURFACE (surface)) return GSK_TYPE_GL_RENDERER; #endif #ifdef GDK_WINDOWING_BROADWAY - if (GDK_IS_BROADWAY_SURFACE (window)) + if (GDK_IS_BROADWAY_SURFACE (surface)) return GSK_TYPE_BROADWAY_RENDERER; #endif @@ -668,14 +668,14 @@ get_renderer_for_backend (GdkSurface *window) } static GType -get_renderer_fallback (GdkSurface *window) +get_renderer_fallback (GdkSurface *surface) { return GSK_TYPE_CAIRO_RENDERER; } static struct { gboolean verbose; - GType (* get_renderer) (GdkSurface *window); + GType (* get_renderer) (GdkSurface *surface); } renderer_possibilities[] = { { TRUE, get_renderer_for_display }, { TRUE, get_renderer_for_env_var }, @@ -685,16 +685,16 @@ static struct { /** * gsk_renderer_new_for_surface: - * @window: a #GdkSurface + * @surface: a #GdkSurface * - * Creates an appropriate #GskRenderer instance for the given @window. + * Creates an appropriate #GskRenderer instance for the given @surface. * * The renderer will be realized when it is returned. * * Returns: (transfer full) (nullable): a #GskRenderer */ GskRenderer * -gsk_renderer_new_for_surface (GdkSurface *window) +gsk_renderer_new_for_surface (GdkSurface *surface) { GType renderer_type; GskRenderer *renderer; @@ -702,11 +702,11 @@ gsk_renderer_new_for_surface (GdkSurface *window) gboolean verbose = FALSE; guint i; - g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); for (i = 0; i < G_N_ELEMENTS (renderer_possibilities); i++) { - renderer_type = renderer_possibilities[i].get_renderer (window); + renderer_type = renderer_possibilities[i].get_renderer (surface); if (renderer_type == G_TYPE_INVALID) continue; @@ -715,25 +715,25 @@ gsk_renderer_new_for_surface (GdkSurface *window) */ verbose |= renderer_possibilities[i].verbose; renderer = g_object_new (renderer_type, - "display", gdk_surface_get_display (window), + "display", gdk_surface_get_display (surface), NULL); - if (gsk_renderer_realize (renderer, window, &error)) + if (gsk_renderer_realize (renderer, surface, &error)) { if (verbose || GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER)) { - g_print ("Using renderer of type '%s' for window '%s'\n", + g_print ("Using renderer of type '%s' for surface '%s'\n", G_OBJECT_TYPE_NAME (renderer), - G_OBJECT_TYPE_NAME (window)); + G_OBJECT_TYPE_NAME (surface)); } return renderer; } if (verbose || GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER)) { - g_print ("Failed to realize renderer of type '%s' for window '%s': %s\n", + g_print ("Failed to realize renderer of type '%s' for surface '%s': %s\n", G_OBJECT_TYPE_NAME (renderer), - G_OBJECT_TYPE_NAME (window), + G_OBJECT_TYPE_NAME (surface), error->message); } g_object_unref (renderer); @@ -780,17 +780,17 @@ gsk_renderer_begin_draw_frame (GskRenderer *renderer, #ifdef G_ENABLE_DEBUG if (GSK_RENDERER_DEBUG_CHECK (renderer, FULL_REDRAW)) { - cairo_region_t *full_window; + cairo_region_t *full_surface; - full_window = cairo_region_create_rectangle (&(GdkRectangle) { + full_surface = cairo_region_create_rectangle (&(GdkRectangle) { 0, 0, - gdk_surface_get_width (priv->window), - gdk_surface_get_height (priv->window) + gdk_surface_get_width (priv->surface), + gdk_surface_get_height (priv->surface) }); - priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, full_window); + priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, full_surface); - cairo_region_destroy (full_window); + cairo_region_destroy (full_surface); } else #endif diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h index 0c867f9b4a..1809afce20 100644 --- a/gsk/gskrenderer.h +++ b/gsk/gskrenderer.h @@ -39,17 +39,17 @@ GDK_AVAILABLE_IN_ALL GType gsk_renderer_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL -GskRenderer * gsk_renderer_new_for_surface (GdkSurface *window); +GskRenderer * gsk_renderer_new_for_surface (GdkSurface *surface); GDK_AVAILABLE_IN_ALL -GdkSurface * gsk_renderer_get_surface (GskRenderer *renderer); +GdkSurface * gsk_renderer_get_surface (GskRenderer *renderer); GDK_AVAILABLE_IN_ALL GdkDisplay * gsk_renderer_get_display (GskRenderer *renderer); GDK_AVAILABLE_IN_ALL gboolean gsk_renderer_realize (GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, GError **error); GDK_AVAILABLE_IN_ALL void gsk_renderer_unrealize (GskRenderer *renderer); diff --git a/gsk/gskrendererprivate.h b/gsk/gskrendererprivate.h index c6b29f4242..085cacc28d 100644 --- a/gsk/gskrendererprivate.h +++ b/gsk/gskrendererprivate.h @@ -39,7 +39,7 @@ struct _GskRendererClass GObjectClass parent_class; gboolean (* realize) (GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, GError **error); void (* unrealize) (GskRenderer *renderer); diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c index 2a990a685f..0a629eefb7 100644 --- a/gtk/a11y/gtkentryaccessible.c +++ b/gtk/a11y/gtkentryaccessible.c @@ -956,8 +956,8 @@ gtk_entry_accessible_get_character_extents (AtkText *text, PangoRectangle char_rect; gchar *entry_text; gint index, x_layout, y_layout; - GdkSurface *window; - gint x_window, y_window; + GdkSurface *surface; + gint x_surface, y_surface; GtkAllocation allocation; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); @@ -976,21 +976,21 @@ gtk_entry_accessible_get_character_extents (AtkText *text, _gtk_widget_get_allocation (widget, &allocation); - window = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - *x = x_window + allocation.x + x_layout + char_rect.x; - *y = y_window + allocation.y + y_layout + char_rect.y; + *x = x_surface + allocation.x + x_layout + char_rect.x; + *y = y_surface + allocation.y + y_layout + char_rect.y; *width = char_rect.width; *height = char_rect.height; if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - *x -= x_window; - *y -= y_window; + *x -= x_surface; + *y -= y_surface; } } @@ -1004,9 +1004,9 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text, GtkEntry *entry; gchar *text; gint index, x_layout, y_layout; - gint x_window, y_window; + gint x_surface, y_surface; gint x_local, y_local; - GdkSurface *window; + GdkSurface *surface; glong offset; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text)); @@ -1017,19 +1017,19 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text, gtk_entry_get_layout_offsets (entry, &x_layout, &y_layout); - window = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - x_local = x - x_layout - x_window; - y_local = y - y_layout - y_window; + x_local = x - x_layout - x_surface; + y_local = y - y_layout - y_surface; if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - x_local += x_window; - y_local += y_window; + x_local += x_surface; + y_local += y_surface; } if (!pango_layout_xy_to_index (gtk_entry_get_layout (entry), x_local * PANGO_SCALE, diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c index 754b7990a1..7361aa627e 100644 --- a/gtk/a11y/gtklabelaccessible.c +++ b/gtk/a11y/gtklabelaccessible.c @@ -995,8 +995,8 @@ gtk_label_accessible_get_character_extents (AtkText *text, PangoRectangle char_rect; const gchar *label_text; gint index, x_layout, y_layout; - GdkSurface *window; - gint x_window, y_window; + GdkSurface *surface; + gint x_surface, y_surface; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); if (widget == NULL) @@ -1010,21 +1010,21 @@ 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_surface (widget); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - *x = x_window + x_layout + char_rect.x; - *y = y_window + y_layout + char_rect.y; + *x = x_surface + x_layout + char_rect.x; + *y = y_surface + y_layout + char_rect.y; *width = char_rect.width; *height = char_rect.height; if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - *x -= x_window; - *y -= y_window; + *x -= x_surface; + *y -= y_surface; } } @@ -1038,9 +1038,9 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text, GtkLabel *label; const gchar *text; gint index, x_layout, y_layout; - gint x_window, y_window; + gint x_surface, y_surface; gint x_local, y_local; - GdkSurface *window; + GdkSurface *surface; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text)); if (widget == NULL) @@ -1050,19 +1050,19 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text, gtk_label_get_layout_offsets (label, &x_layout, &y_layout); - window = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - x_local = x - x_layout - x_window; - y_local = y - y_layout - y_window; + x_local = x - x_layout - x_surface; + y_local = y - y_layout - y_surface; if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - x_local += x_window; - y_local += y_window; + x_local += x_surface; + y_local += y_surface; } if (!pango_layout_xy_to_index (gtk_label_get_layout (label), diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c index 32ce984c7f..0fd83f95c7 100644 --- a/gtk/a11y/gtktextcellaccessible.c +++ b/gtk/a11y/gtktextcellaccessible.c @@ -479,24 +479,24 @@ add_attr (PangoAttrList *attr_list, static void get_origins (GtkWidget *widget, - gint *x_window, - gint *y_window, + gint *x_surface, + gint *y_surface, gint *x_toplevel, gint *y_toplevel) { - GdkSurface *window; + GdkSurface *surface; - window = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, x_window, y_window); - window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); - gdk_surface_get_origin (window, x_toplevel, y_toplevel); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, x_surface, y_surface); + surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); + gdk_surface_get_origin (surface, x_toplevel, y_toplevel); if (GTK_IS_TREE_VIEW (widget)) { - gtk_tree_view_convert_widget_to_bin_surface_coords (GTK_TREE_VIEW (widget), - *x_window, *y_window, - x_window, y_window); - gtk_tree_view_convert_widget_to_bin_surface_coords (GTK_TREE_VIEW (widget), + gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget), + *x_surface, *y_surface, + x_surface, y_surface); + gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget), *x_toplevel, *y_toplevel, x_toplevel, y_toplevel); } @@ -523,7 +523,7 @@ gtk_text_cell_accessible_get_character_extents (AtkText *text, gfloat xalign, yalign; gint x_offset, y_offset, index; gint xpad, ypad; - gint x_window, y_window, x_toplevel, y_toplevel; + gint x_surface, y_surface, x_toplevel, y_toplevel; if (!GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_text) { @@ -568,10 +568,10 @@ gtk_text_cell_accessible_get_character_extents (AtkText *text, gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (gtk_renderer), &xpad, &ypad); - get_origins (widget, &x_window, &y_window, &x_toplevel, &y_toplevel); + get_origins (widget, &x_surface, &y_surface, &x_toplevel, &y_toplevel); - *x = (char_rect.x / PANGO_SCALE) + x_offset + rendered_rect.x + xpad + x_window; - *y = (char_rect.y / PANGO_SCALE) + y_offset + rendered_rect.y + ypad + y_window; + *x = (char_rect.x / PANGO_SCALE) + x_offset + rendered_rect.x + xpad + x_surface; + *y = (char_rect.y / PANGO_SCALE) + y_offset + rendered_rect.y + ypad + y_surface; *height = char_rect.height / PANGO_SCALE; *width = char_rect.width / PANGO_SCALE; @@ -609,7 +609,7 @@ gtk_text_cell_accessible_get_offset_at_point (AtkText *text, gfloat xalign, yalign; gint x_offset, y_offset, index; gint xpad, ypad; - gint x_window, y_window, x_toplevel, y_toplevel; + gint x_surface, y_surface, x_toplevel, y_toplevel; gint x_temp, y_temp; gboolean ret; @@ -649,10 +649,10 @@ gtk_text_cell_accessible_get_offset_at_point (AtkText *text, gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (gtk_renderer), &xpad, &ypad); - get_origins (widget, &x_window, &y_window, &x_toplevel, &y_toplevel); + get_origins (widget, &x_surface, &y_surface, &x_toplevel, &y_toplevel); - x_temp = x - (x_offset + rendered_rect.x + xpad) - x_window; - y_temp = y - (y_offset + rendered_rect.y + ypad) - y_window; + x_temp = x - (x_offset + rendered_rect.x + xpad) - x_surface; + y_temp = y - (y_offset + rendered_rect.y + ypad) - y_surface; if (coords == ATK_XY_WINDOW) { x_temp += x_toplevel; diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c index 3445a36308..3d46ed1ba0 100644 --- a/gtk/a11y/gtktextviewaccessible.c +++ b/gtk/a11y/gtktextviewaccessible.c @@ -444,9 +444,9 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, { GtkTextView *view; GtkTextIter iter; - gint x_widget, y_widget, x_window, y_window, buff_x, buff_y; + gint x_widget, y_widget, x_surface, y_surface, buff_x, buff_y; GtkWidget *widget; - GdkSurface *window; + GdkSurface *surface; GdkRectangle rect; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); @@ -454,8 +454,8 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, return -1; view = GTK_TEXT_VIEW (widget); - window = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_widget, &y_widget); + surface = gtk_widget_get_surface (widget); + gdk_surface_get_origin (surface, &x_widget, &y_widget); if (coords == ATK_XY_SCREEN) { @@ -464,11 +464,11 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, } else if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); - x = x - x_widget + x_window; - y = y - y_widget + y_window; + x = x - x_widget + x_surface; + y = y - y_widget + y_surface; } else return -1; @@ -506,8 +506,8 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, GtkTextIter iter; GtkWidget *widget; GdkRectangle rectangle; - GdkSurface *window; - gint x_widget, y_widget, x_window, y_window; + GdkSurface *surface; + gint x_widget, y_widget, x_surface, y_surface; *x = 0; *y = 0; @@ -523,11 +523,11 @@ 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_surface (widget); - if (window == NULL) + surface = gtk_widget_get_surface (widget); + if (surface == NULL) return; - gdk_surface_get_origin (window, &x_widget, &y_widget); + gdk_surface_get_origin (surface, &x_widget, &y_widget); *height = rectangle.height; *width = rectangle.width; @@ -536,10 +536,10 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, rectangle.x, rectangle.y, x, y); if (coords == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (window); - gdk_surface_get_origin (window, &x_window, &y_window); - *x += x_widget - x_window; - *y += y_widget - y_window; + surface = gdk_surface_get_toplevel (surface); + gdk_surface_get_origin (surface, &x_surface, &y_surface); + *x += x_widget - x_surface; + *y += y_widget - y_surface; } else if (coords == ATK_XY_SCREEN) { diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index 4c97e67830..f32acee10b 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -546,7 +546,7 @@ gtk_tree_view_accessible_ref_accessible_at_point (AtkComponent *component, tree_view = GTK_TREE_VIEW (widget); atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y, &bx, &by); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &bx, &by); if (!gtk_tree_view_get_path_at_pos (tree_view, bx - x_pos, by - y_pos, &path, &column, NULL, NULL)) @@ -1090,17 +1090,17 @@ gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent, tree_view = GTK_TREE_VIEW (widget); gtk_tree_view_accessible_get_cell_area (parent, cell, &cell_rect); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, 0, &w_x, &w_y); if (coord_type != ATK_XY_WINDOW) { - GdkSurface *window; + GdkSurface *surface; gint x_toplevel, y_toplevel; - window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); - gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); + surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); + gdk_surface_get_origin (surface, &x_toplevel, &y_toplevel); w_x += x_toplevel; w_y += y_toplevel; @@ -1443,7 +1443,7 @@ is_cell_showing (GtkTreeView *tree_view, tree_cell_rect->height = cell_rect->height; gtk_tree_view_get_visible_rect (tree_view, visible_rect); - gtk_tree_view_convert_tree_to_bin_surface_coords (tree_view, visible_rect->x, + gtk_tree_view_convert_tree_to_bin_window_coords (tree_view, visible_rect->x, visible_rect->y, &bx, &by); if (((tree_cell_rect->x + tree_cell_rect->width) < bx) || diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c index 4f80a852ca..2a32fe6bf6 100644 --- a/gtk/a11y/gtkwidgetaccessible.c +++ b/gtk/a11y/gtkwidgetaccessible.c @@ -562,8 +562,8 @@ gtk_widget_accessible_get_extents (AtkComponent *component, gint *height, AtkCoordType coord_type) { - GdkSurface *window; - gint x_window, y_window; + GdkSurface *surface; + gint x_surface, y_surface; gint x_toplevel, y_toplevel; GtkWidget *widget; GtkAllocation allocation; @@ -586,22 +586,22 @@ gtk_widget_accessible_get_extents (AtkComponent *component, { *x = allocation.x; *y = allocation.y; - window = gtk_widget_get_parent_surface (widget); + surface = gtk_widget_get_parent_surface (widget); } else { *x = 0; *y = 0; - window = gtk_widget_get_surface (widget); + surface = gtk_widget_get_surface (widget); } - gdk_surface_get_origin (window, &x_window, &y_window); - *x += x_window; - *y += y_window; + gdk_surface_get_origin (surface, &x_surface, &y_surface); + *x += x_surface; + *y += y_surface; if (coord_type == ATK_XY_WINDOW) { - window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); - gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); + surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget)); + gdk_surface_get_origin (surface, &x_toplevel, &y_toplevel); *x -= x_toplevel; *y -= y_toplevel; @@ -663,9 +663,9 @@ gtk_widget_accessible_set_extents (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkSurface *window = gtk_widget_get_surface (widget); + GdkSurface *surface = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_current, &y_current); + gdk_surface_get_origin (surface, &x_current, &y_current); x_current += x; y_current += y; if (x_current < 0 || y_current < 0) @@ -703,9 +703,9 @@ gtk_widget_accessible_set_position (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkSurface *window = gtk_widget_get_surface (widget); + GdkSurface *surface = gtk_widget_get_surface (widget); - gdk_surface_get_origin (window, &x_current, &y_current); + gdk_surface_get_origin (surface, &x_current, &y_current); x_current += x; y_current += y; if (x_current < 0 || y_current < 0) diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c index 3b072ca981..aeb0ee961d 100644 --- a/gtk/a11y/gtkwindowaccessible.c +++ b/gtk/a11y/gtkwindowaccessible.c @@ -368,7 +368,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, AtkCoordType coord_type) { GtkWidget *widget; - GdkSurface *window; + GdkSurface *surface; GdkRectangle rect; gint x_toplevel, y_toplevel; @@ -385,11 +385,11 @@ gtk_window_accessible_get_extents (AtkComponent *component, return; } - window = gtk_widget_get_surface (widget); - if (window == NULL) + surface = gtk_widget_get_surface (widget); + if (surface == NULL) return; - gdk_surface_get_frame_extents (window, &rect); + gdk_surface_get_frame_extents (surface, &rect); *width = rect.width; *height = rect.height; @@ -404,7 +404,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, *y = rect.y; if (coord_type == ATK_XY_WINDOW) { - gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); + gdk_surface_get_origin (surface, &x_toplevel, &y_toplevel); *x -= x_toplevel; *y -= y_toplevel; } @@ -416,7 +416,7 @@ gtk_window_accessible_get_size (AtkComponent *component, gint *height) { GtkWidget *widget; - GdkSurface *window; + GdkSurface *surface; GdkRectangle rect; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component)); @@ -432,11 +432,11 @@ gtk_window_accessible_get_size (AtkComponent *component, return; } - window = gtk_widget_get_surface (widget); - if (window == NULL) + surface = gtk_widget_get_surface (widget); + if (surface == NULL) return; - gdk_surface_get_frame_extents (window, &rect); + gdk_surface_get_frame_extents (surface, &rect); *width = rect.width; *height = rect.height; diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index 1703e99760..5a937ee4a7 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -440,7 +440,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, GtkWidget *editable; gboolean is_editable; GdkDevice *device, *pointer; - GdkSurface *window; + GdkSurface *surface; celltext = GTK_CELL_RENDERER_TEXT (cell); accel = GTK_CELL_RENDERER_ACCEL (cell); @@ -451,14 +451,14 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, if (!is_editable) return NULL; - window = gtk_widget_get_surface (gtk_widget_get_toplevel (widget)); + surface = gtk_widget_get_surface (gtk_widget_get_toplevel (widget)); if (event) device = gdk_event_get_device (event); else device = gtk_get_current_event_device (); - if (!device || !window) + if (!device || !surface) return NULL; if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) @@ -466,7 +466,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, else pointer = device; - if (gdk_seat_grab (gdk_device_get_seat (pointer), window, + if (gdk_seat_grab (gdk_device_get_seat (pointer), surface, GDK_SEAT_CAPABILITY_ALL, FALSE, NULL, event, NULL, NULL) != GDK_GRAB_SUCCESS) return NULL; diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index 25e763f998..fdd2ed4d90 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -348,10 +348,10 @@ static NSWindow * get_toplevel_nswindow (GtkWidget *widget) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - GdkSurface *window = gtk_widget_get_surface (toplevel); + GdkSurface *surface = gtk_widget_get_surface (toplevel); - if (gtk_widget_is_toplevel (toplevel) && window) - return [gdk_quartz_surface_get_nsview (window) window]; + if (gtk_widget_is_toplevel (toplevel) && surface) + return [gdk_quartz_surface_get_nsview (surface) surface]; else return NULL; } @@ -633,52 +633,52 @@ gtk_drag_find_widget (GtkWidget *widget, if (gtk_widget_get_parent (widget)) { gint tx, ty; - GdkSurface *window = gtk_widget_get_surface (widget); - GdkSurface *parent_window; + GdkSurface *surface = gtk_widget_get_surface (widget); + GdkSurface *parent_surface; GtkAllocation allocation; - parent_window = gtk_widget_get_surface (gtk_widget_get_parent (widget)); + parent_surface = gtk_widget_get_surface (gtk_widget_get_parent (widget)); /* Compute the offset from allocation-relative to - * window-relative coordinates. + * surface-relative coordinates. */ gtk_widget_get_allocation (widget, &allocation); - allocation_to_window_x = allocation.x; - allocation_to_window_y = allocation.y; + allocation_to_surface_x = allocation.x; + allocation_to_surface_y = allocation.y; if (gtk_widget_get_has_surface (widget)) { - /* The allocation is relative to the parent window for - * window widgets, not to widget->window. + /* The allocation is relative to the parent surface for + * surface widgets, not to widget->surface. */ - gdk_surface_get_position (window, &tx, &ty); + gdk_surface_get_position (surface, &tx, &ty); - allocation_to_window_x -= tx; - allocation_to_window_y -= ty; + allocation_to_surface_x -= tx; + allocation_to_surface_y -= ty; } - new_allocation.x = 0 + allocation_to_window_x; - new_allocation.y = 0 + allocation_to_window_y; + new_allocation.x = 0 + allocation_to_surface_x; + new_allocation.y = 0 + allocation_to_surface_y; - while (window && window != parent_window) + while (surface && surface != parent_surface) { - GdkRectangle window_rect = { 0, 0, 0, 0 }; + GdkRectangle surface_rect = { 0, 0, 0, 0 }; - window_rect.width = gdk_surface_get_width (window); - window_rect.height = gdk_surface_get_height (window); + surface_rect.width = gdk_surface_get_width (surface); + surface_rect.height = gdk_surface_get_height (surface); - gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation); + gdk_rectangle_intersect (&new_allocation, &surface_rect, &new_allocation); - gdk_surface_get_position (window, &tx, &ty); + gdk_surface_get_position (surface, &tx, &ty); new_allocation.x += tx; x_offset += tx; new_allocation.y += ty; y_offset += ty; - window = gdk_surface_get_parent (window); + surface = gdk_surface_get_parent (surface); } - if (!window) /* Window and widget heirarchies didn't match. */ + if (!surface) /* Surface and widget heirarchies didn't match. */ return; } @@ -725,8 +725,8 @@ gtk_drag_find_widget (GtkWidget *widget, { data->found = data->callback (widget, data->context, - data->x - x_offset - allocation_to_window_x, - data->y - y_offset - allocation_to_window_y, + data->x - x_offset - allocation_to_surface_x, + data->y - y_offset - allocation_to_surface_y, data->time); /* If so, send a "drag-leave" to the last widget */ if (data->found) @@ -1089,12 +1089,12 @@ gtk_drag_begin_idle (gpointer arg) return G_SOURCE_REMOVE; } -/* Fake protocol to let us call GdkNSView gdkWindow without including +/* Fake protocol to let us call GdkNSView gdkSurface without including * gdk/GdkNSView.h (which we can’t because it pulls in the internal-only * gdksurface.h). */ @protocol GdkNSView -- (GdkSurface *)gdkWindow; +- (GdkSurface *)gdkSurface; @end GdkDragContext * @@ -1109,7 +1109,7 @@ gtk_drag_begin_internal (GtkWidget *widget, { GtkDragSourceInfo *info; GdkDevice *pointer; - GdkSurface *window; + GdkSurface *surface; GdkDragContext *context; NSWindow *nswindow = get_toplevel_nswindow (widget); NSPoint point = {0, 0}; @@ -1119,12 +1119,12 @@ gtk_drag_begin_internal (GtkWidget *widget, if ((x != -1 && y != -1) || event) { - GdkSurface *window; + GdkSurface *surface; gdouble dx, dy; if (x != -1 && y != -1) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - window = gtk_widget_get_surface (toplevel); + surface = gtk_widget_get_surface (toplevel); gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y); gdk_surface_get_root_coords (gtk_widget_get_surface (toplevel), x, y, &x, &y); @@ -1139,23 +1139,23 @@ gtk_drag_begin_internal (GtkWidget *widget, * toplevel GdkSurface, which should be the GdkSurface backing * nswindow. Then, we convert to the NSWindow coordinate system. */ - window = event->any.surface; - GdkSurface *toplevel = gdk_surface_get_toplevel (window); + surface = event->any.surface; + GdkSurface *toplevel = gdk_surface_get_toplevel (surface); - while (window != toplevel) + while (surface != toplevel) { double old_x = dx; double old_y = dy; - gdk_surface_coords_to_parent (window, old_x, old_y, + gdk_surface_coords_to_parent (surface, old_x, old_y, &dx, &dy); - window = gdk_surface_get_parent (window); + surface = gdk_surface_get_parent (surface); } } time = (double)gdk_event_get_time (event); } point.x = dx; - point.y = gdk_surface_get_height (window) - dy; + point.y = gdk_surface_get_height (surface) - dy; } nstime = [[NSDate dateWithTimeIntervalSince1970: time / 1000] timeIntervalSinceReferenceDate]; @@ -1169,10 +1169,10 @@ gtk_drag_begin_internal (GtkWidget *widget, clickCount: 1 pressure: 0.0 ]; - window = [(id<GdkNSView>)[nswindow contentView] gdkWindow]; + surface = [(id<GdkNSView>)[nswindow contentView] gdkSurface]; g_return_val_if_fail (nsevent != NULL, NULL); - context = gdk_drag_begin (window, g_list_copy (target_list->list)); + context = gdk_drag_begin (surface, g_list_copy (target_list->list)); g_return_val_if_fail (context != NULL, NULL); info = gtk_drag_get_source_info (context, TRUE); diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 05189ea9cc..80c8c73e13 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -428,7 +428,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, case GDK_DRAG_MOTION: case GDK_DROP_START: { - GdkSurface *window; + GdkSurface *surface; gint tx, ty; double x_root, y_root; gboolean found; @@ -445,9 +445,9 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, } } - window = gtk_widget_get_surface (toplevel); + surface = gtk_widget_get_surface (toplevel); - gdk_surface_get_position (window, &tx, &ty); + gdk_surface_get_position (surface, &tx, &ty); gdk_event_get_root_coords (event, &x_root, &y_root); found = gtk_drag_find_widget (toplevel, @@ -1114,7 +1114,7 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context, gtk_widget_set_size_request (info->icon_window, 24, 24); gtk_style_context_remove_class (gtk_widget_get_style_context (info->icon_window), "background"); - gtk_window_set_hardcoded_window (GTK_WINDOW (info->icon_window), + gtk_window_set_hardcoded_surface (GTK_WINDOW (info->icon_window), gdk_drag_context_get_drag_surface (context)); gtk_widget_show (info->icon_window); } diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 63e7bec3c8..f9571b9ccb 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1372,7 +1372,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) GdkDisplay *display; GdkMonitor *monitor; GdkRectangle area; - GdkSurface *window; + GdkSurface *surface; GtkRequisition popup_req; GtkRequisition entry_req; GtkRequisition tree_req; @@ -1382,9 +1382,9 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) GtkTreeViewColumn *action_column; gint action_height; - window = gtk_widget_get_surface (completion->priv->entry); + surface = gtk_widget_get_surface (completion->priv->entry); - if (!window) + if (!surface) return; if (!completion->priv->filter_model) @@ -1394,7 +1394,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) gtk_widget_get_preferred_size (completion->priv->entry, &entry_req, NULL); - gdk_surface_get_origin (window, &x, &y); + gdk_surface_get_origin (surface, &x, &y); x += allocation.x; y += allocation.y + (allocation.height - entry_req.height) / 2; @@ -1415,7 +1415,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) gtk_widget_realize (completion->priv->tree_view); display = gtk_widget_get_display (GTK_WIDGET (completion->priv->entry)); - monitor = gdk_display_get_monitor_at_surface (display, window); + monitor = gdk_display_get_monitor_at_surface (display, surface); gdk_monitor_get_workarea (monitor, &area); if (height == 0) @@ -1478,7 +1478,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) static void prepare_popup_func (GdkSeat *seat, - GdkSurface *window, + GdkSurface *surface, gpointer user_data) { GtkEntryCompletion *completion = user_data; diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 48e36aca71..a90fd70cb9 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -599,21 +599,21 @@ _gtk_gesture_cancel_all (GtkGesture *gesture) } static gboolean -gesture_within_window (GtkGesture *gesture, - GdkSurface *parent) +gesture_within_surface (GtkGesture *gesture, + GdkSurface *parent) { - GdkSurface *window; + GdkSurface *surface; GtkWidget *widget; widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)); - window = gtk_widget_get_surface (widget); + surface = gtk_widget_get_surface (widget); - while (window) + while (surface) { - if (window == parent) + if (surface == parent) return TRUE; - window = gdk_surface_get_parent (window); + surface = gdk_surface_get_parent (surface); } return FALSE; @@ -743,7 +743,7 @@ gtk_gesture_handle_event (GtkEventController *controller, GdkSurface *surface = NULL; gdk_event_get_grab_surface (event, &surface); - if (!surface || !gesture_within_window (gesture, surface)) + if (!surface || !gesture_within_surface (gesture, surface)) _gtk_gesture_cancel_all (gesture); return FALSE; diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c index 792477a468..a3c8150a1a 100644 --- a/gtk/gtkimcontextime.c +++ b/gtk/gtkimcontextime.c @@ -261,19 +261,19 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, { GtkIMContextIME *context_ime; GtkWidget *toplevel; - GdkSurface *client_window; + GdkSurface *client_surface; 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_surface (toplevel); + client_surface = gtk_widget_get_surface (toplevel); - if (client_window) + if (client_surface) { HIMC himc; HWND hwnd; - hwnd = gdk_win32_surface_get_impl_hwnd (client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (client_surface); himc = ImmGetContext (hwnd); if (himc) { @@ -289,7 +289,7 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, gtk_im_context_ime_focus_out (context); } - context_ime->client_window = client_window; + context_ime->client_surface = client_surface; } static gunichar @@ -377,7 +377,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context, if (!context_ime->focus) return FALSE; - if (!GDK_IS_SURFACE (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_surface)) return FALSE; gdk_event_get_keyval ((GdkEvent *) event, &keyval); @@ -427,10 +427,10 @@ gtk_im_context_ime_reset (GtkIMContext *context) HWND hwnd; HIMC himc; - if (!context_ime->client_window) + if (!context_ime->client_surface) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -459,9 +459,9 @@ get_utf8_preedit_string (GtkIMContextIME *context_ime, gint *pos_ret) if (pos_ret) *pos_ret = 0; - if (!context_ime->client_window) + if (!context_ime->client_surface) return g_strdup (""); - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return g_strdup (""); @@ -520,9 +520,9 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const gchar *utf8str) HWND hwnd; HIMC himc; - if (!context_ime->client_window) + if (!context_ime->client_surface) return attrs; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return attrs; @@ -654,18 +654,18 @@ gtk_im_context_ime_focus_in (GtkIMContext *context) HWND hwnd; HIMC himc; - if (!GDK_IS_SURFACE (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_surface)) return; /* swtich current context */ context_ime->focus = TRUE; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; - toplevel = gdk_surface_get_toplevel (context_ime->client_window); + toplevel = gdk_surface_get_toplevel (context_ime->client_surface); if (GDK_IS_SURFACE (toplevel)) { gdk_surface_add_filter (toplevel, @@ -680,7 +680,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context) } /* trace reparenting (probably no need) */ - gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget); + gdk_surface_get_user_data (context_ime->client_surface, (gpointer) & widget); if (GTK_IS_WIDGET (widget)) { g_signal_connect (widget, "hierarchy-changed", @@ -725,13 +725,13 @@ gtk_im_context_ime_focus_out (GtkIMContext *context) HWND hwnd; HIMC himc; - if (!GDK_IS_SURFACE (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_surface)) return; /* swtich current context */ context_ime->focus = FALSE; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -778,7 +778,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context) } /* remove signal handler */ - gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget); + gdk_surface_get_user_data (context_ime->client_surface, (gpointer) & widget); if (GTK_IS_WIDGET (widget)) { g_signal_handlers_disconnect_by_func @@ -787,7 +787,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context) } /* remove event fileter */ - toplevel = gdk_surface_get_toplevel (context_ime->client_window); + toplevel = gdk_surface_get_toplevel (context_ime->client_surface); if (GDK_IS_SURFACE (toplevel)) { gdk_surface_remove_filter (toplevel, @@ -822,15 +822,15 @@ gtk_im_context_ime_set_cursor_location (GtkIMContext *context, if (area) context_ime->cursor_location = *area; - if (!context_ime->client_window) + if (!context_ime->client_surface) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; - get_window_position (context_ime->client_window, &wx, &wy); + get_window_position (context_ime->client_surface, &wx, &wy); cf.dwStyle = CFS_POINT; cf.ptCurrentPos.x = wx + context_ime->cursor_location.x; cf.ptCurrentPos.y = wy + context_ime->cursor_location.y; @@ -855,7 +855,7 @@ gtk_im_context_ime_set_use_preedit (GtkIMContext *context, HWND hwnd; HIMC himc; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -886,14 +886,14 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context) g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context)); context_ime = GTK_IM_CONTEXT_IME (context); - if (!context_ime->client_window) + if (!context_ime->client_surface) return; - gdk_surface_get_user_data (context_ime->client_window, (gpointer) &widget); + gdk_surface_get_user_data (context_ime->client_surface, (gpointer) &widget); if (!GTK_IS_WIDGET (widget)) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -1009,7 +1009,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, if (!context_ime->focus) return retval; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return retval; @@ -1021,7 +1021,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, gint wx = 0, wy = 0; CANDIDATEFORM cf; - get_window_position (context_ime->client_window, &wx, &wy); + get_window_position (context_ime->client_surface, &wx, &wy); /* FIXME! */ { HWND hwnd_top; @@ -1030,7 +1030,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, hwnd_top = gdk_win32_surface_get_impl_hwnd (gdk_surface_get_toplevel - (context_ime->client_window)); + (context_ime->client_surface)); GetWindowRect (hwnd_top, &rc); pt.x = wx; pt.y = wy; @@ -1127,19 +1127,19 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, * x and y must be initialized to 0. */ static void -get_window_position (GdkSurface *win, gint *x, gint *y) +get_window_position (GdkSurface *surface, gint *x, gint *y) { GdkSurface *parent, *toplevel; gint wx, wy; - g_return_if_fail (GDK_IS_SURFACE (win)); + g_return_if_fail (GDK_IS_SURFACE (surface)); g_return_if_fail (x && y); - gdk_surface_get_position (win, &wx, &wy); + gdk_surface_get_position (surface, &wx, &wy); *x += wx; *y += wy; - parent = gdk_surface_get_parent (win); - toplevel = gdk_surface_get_toplevel (win); + parent = gdk_surface_get_parent (surface); + toplevel = gdk_surface_get_toplevel (surface); if (parent && parent != toplevel) get_window_position (parent, x, y); @@ -1159,12 +1159,12 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context_ime)); - if (!context_ime->client_window) + if (!context_ime->client_surface) return; if (!context_ime->focus) return; - new_toplevel = gdk_surface_get_toplevel (context_ime->client_window); + new_toplevel = gdk_surface_get_toplevel (context_ime->client_surface); if (context_ime->toplevel == new_toplevel) return; diff --git a/gtk/gtkimcontextime.h b/gtk/gtkimcontextime.h index 4fe5b9e141..55ca6d57a5 100644 --- a/gtk/gtkimcontextime.h +++ b/gtk/gtkimcontextime.h @@ -36,7 +36,7 @@ struct _GtkIMContextIME { GtkIMContext object; - GdkSurface *client_window; + GdkSurface *client_surface; GdkSurface *toplevel; guint use_preedit : 1; guint preediting : 1; diff --git a/gtk/gtkimcontextquartz.c b/gtk/gtkimcontextquartz.c index 6bc7821d87..d35a8e3998 100644 --- a/gtk/gtkimcontextquartz.c +++ b/gtk/gtkimcontextquartz.c @@ -37,7 +37,7 @@ typedef struct _GtkIMContextQuartz { GtkIMContext parent; GtkIMContext *slave; - GdkSurface *client_window; + GdkSurface *client_surface; gchar *preedit_str; unsigned int cursor_index; unsigned int selected_len; @@ -110,25 +110,25 @@ quartz_get_preedit_string (GtkIMContext *context, static gboolean output_result (GtkIMContext *context, - GdkSurface *win) + GdkSurface *surface) { GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gboolean retval = FALSE; gchar *fixed_str, *marked_str; - fixed_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_INSERT_TEXT)); - marked_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_MARKED_TEXT)); + fixed_str = g_strdup (g_object_get_data (G_OBJECT (surface), TIC_INSERT_TEXT)); + marked_str = g_strdup (g_object_get_data (G_OBJECT (surface), TIC_MARKED_TEXT)); if (fixed_str) { GTK_NOTE (MISC, g_print ("tic-insert-text: %s\n", fixed_str)); g_free (qc->preedit_str); qc->preedit_str = NULL; - g_object_set_data (G_OBJECT (win), TIC_INSERT_TEXT, NULL); + g_object_set_data (G_OBJECT (surface), TIC_INSERT_TEXT, NULL); g_signal_emit_by_name (context, "commit", fixed_str); g_signal_emit_by_name (context, "preedit_changed"); unsigned int filtered = - GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (win), + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (surface), GIC_FILTER_KEY)); GTK_NOTE (MISC, g_print ("filtered, %d\n", filtered)); if (filtered) @@ -140,14 +140,14 @@ output_result (GtkIMContext *context, { GTK_NOTE (MISC, g_print ("tic-marked-text: %s\n", marked_str)); qc->cursor_index = - GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (win), + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (surface), TIC_SELECTED_POS)); qc->selected_len = - GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (win), + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (surface), TIC_SELECTED_LEN)); g_free (qc->preedit_str); qc->preedit_str = g_strdup (marked_str); - g_object_set_data (G_OBJECT (win), TIC_MARKED_TEXT, NULL); + g_object_set_data (G_OBJECT (surface), TIC_MARKED_TEXT, NULL); g_signal_emit_by_name (context, "preedit_changed"); retval = TRUE; } @@ -168,17 +168,17 @@ quartz_filter_keypress (GtkIMContext *context, GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gboolean retval; NSView *nsview; - GdkSurface *win; + GdkSurface *surface; GTK_NOTE (MISC, g_print ("quartz_filter_keypress\n")); - if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_surface)) return FALSE; - nsview = gdk_quartz_surface_get_nsview (qc->client_window); - win = (GdkSurface *)[ (GdkQuartzView *)nsview gdkWindow]; - GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n", - qc->client_window, win, nsview)); + nsview = gdk_quartz_surface_get_nsview (qc->client_surface); + surface = (GdkSurface *)[ (GdkQuartzView *)nsview gdkSurface]; + GTK_NOTE (MISC, g_print ("client_surface: %p, win: %p, nsview: %p\n", + qc->client_surface, surface, nsview)); NSEvent *nsevent = gdk_quartz_event_get_nsevent ((GdkEvent *)event); @@ -186,7 +186,7 @@ quartz_filter_keypress (GtkIMContext *context, { if (event->hardware_keycode == 0 && event->keyval == 0xffffff) /* update text input changes by mouse events */ - return output_result (context, win); + return output_result (context, surface); else return gtk_im_context_filter_keypress (qc->slave, event); } @@ -200,7 +200,7 @@ quartz_filter_keypress (GtkIMContext *context, NSEventType etype = [nsevent type]; if (etype == NSKeyDown) { - g_object_set_data (G_OBJECT (win), TIC_IN_KEY_DOWN, + g_object_set_data (G_OBJECT (surface), TIC_IN_KEY_DOWN, GUINT_TO_POINTER (TRUE)); [nsview keyDown: nsevent]; } @@ -208,8 +208,8 @@ quartz_filter_keypress (GtkIMContext *context, if (event->hardware_keycode == 102 || event->hardware_keycode == 104) return FALSE; - retval = output_result(context, win); - g_object_set_data (G_OBJECT (win), TIC_IN_KEY_DOWN, + retval = output_result(context, surface); + g_object_set_data (G_OBJECT (surface), TIC_IN_KEY_DOWN, GUINT_TO_POINTER (FALSE)); GTK_NOTE (MISC, g_print ("quartz_filter_keypress done\n")); @@ -221,13 +221,13 @@ discard_preedit (GtkIMContext *context) { GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); - if (!qc->client_window) + if (!qc->client_surface) return; - if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_surface)) return; - NSView *nsview = gdk_quartz_surface_get_nsview (qc->client_window); + NSView *nsview = gdk_quartz_surface_get_nsview (qc->client_surface); if (!nsview) return; @@ -254,13 +254,13 @@ quartz_reset (GtkIMContext *context) } static void -quartz_set_client_window (GtkIMContext *context, GtkWidget *widget) +quartz_set_client_surface (GtkIMContext *context, GtkWidget *widget) { GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); - GTK_NOTE (MISC, g_print ("quartz_set_client_window: %p\n", widget)); + GTK_NOTE (MISC, g_print ("quartz_set_client_surface: %p\n", widget)); - qc->client_window = gtk_widget_get_parent_surface (widget); + qc->client_surface = gtk_widget_get_parent_surface (widget); } static void @@ -290,11 +290,11 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area) GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gint x, y; NSView *nsview; - GdkSurface *win; + GdkSurface *surface; GTK_NOTE (MISC, g_print ("quartz_set_cursor_location\n")); - if (!qc->client_window) + if (!qc->client_surface) return; if (!qc->focused) @@ -305,17 +305,17 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area) qc->cursor_rect->width = area->width; qc->cursor_rect->height = area->height; - gdk_surface_get_origin (qc->client_window, &x, &y); + gdk_surface_get_origin (qc->client_surface, &x, &y); qc->cursor_rect->x = area->x + x; qc->cursor_rect->y = area->y + y; - if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_surface)) return; - nsview = gdk_quartz_surface_get_nsview (qc->client_window); - win = (GdkSurface *)[ (GdkQuartzView*)nsview gdkWindow]; - g_object_set_data (G_OBJECT (win), GIC_CURSOR_RECT, qc->cursor_rect); + nsview = gdk_quartz_surface_get_nsview (qc->client_surface); + surface = (GdkSurface *)[ (GdkQuartzView*)nsview gdkSurface]; + g_object_set_data (G_OBJECT (surface), GIC_CURSOR_RECT, qc->cursor_rect); } static void @@ -358,7 +358,7 @@ gtk_im_context_quartz_class_init (GtkIMContextQuartzClass *class) klass->get_preedit_string = quartz_get_preedit_string; klass->filter_keypress = quartz_filter_keypress; klass->reset = quartz_reset; - klass->set_client_widget = quartz_set_client_window; + klass->set_client_widget = quartz_set_client_surface; klass->focus_in = quartz_focus_in; klass->focus_out = quartz_focus_out; klass->set_cursor_location = quartz_set_cursor_location; diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 134e7e3083..83a7836c00 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -1022,9 +1022,9 @@ check_emoji (GtkIMContextSimple *context_simple, } static void -beep_window (GdkSurface *window) +beep_surface (GdkSurface *surface) { - GdkDisplay *display = gdk_surface_get_display (window); + GdkDisplay *display = gdk_surface_get_display (surface); gboolean beep; g_object_get (gtk_settings_get_for_display (display), @@ -1032,7 +1032,7 @@ beep_window (GdkSurface *window) NULL); if (beep) - gdk_surface_beep (window); + gdk_surface_beep (surface); } static gboolean @@ -1074,7 +1074,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple, priv->compose_buffer[0] = 0; if (n_compose > 1) /* Invalid sequence */ { - beep_window (gdk_event_get_surface ((GdkEvent *) event)); + beep_surface (gdk_event_get_surface ((GdkEvent *) event)); return TRUE; } @@ -1102,8 +1102,8 @@ is_hex_keyval (guint keyval) static guint canonical_hex_keyval (GdkEventKey *event) { - GdkSurface *window = gdk_event_get_surface ((GdkEvent *) event); - GdkKeymap *keymap = gdk_display_get_keymap (gdk_surface_get_display (window)); + GdkSurface *surface = gdk_event_get_surface ((GdkEvent *) event); + GdkKeymap *keymap = gdk_display_get_keymap (gdk_surface_get_display (surface)); guint keyval, event_keyval; guint *keyvals = NULL; gint n_vals = 0; @@ -1162,8 +1162,8 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, { GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context); GtkIMContextSimplePrivate *priv = context_simple->priv; - GdkSurface *window = gdk_event_get_surface ((GdkEvent *) event); - GdkDisplay *display = gdk_surface_get_display (window); + GdkSurface *surface = gdk_event_get_surface ((GdkEvent *) event); + GdkDisplay *display = gdk_surface_get_display (surface); GdkKeymap *keymap = gdk_display_get_keymap (display); GSList *tmp_list; int n_compose = 0; @@ -1213,7 +1213,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, else if (priv->in_hex_sequence) { /* invalid hex sequence */ - beep_window (window); + beep_surface (surface); priv->tentative_match = 0; priv->in_hex_sequence = FALSE; @@ -1321,7 +1321,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, { /* invalid hex sequence */ if (n_compose > 0) - beep_window (window); + beep_surface (surface); priv->tentative_match = 0; priv->in_hex_sequence = FALSE; @@ -1370,7 +1370,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, else if (!is_end) { /* non-hex character in hex sequence */ - beep_window (window); + beep_surface (surface); return TRUE; } } @@ -1385,7 +1385,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, } else { - beep_window (window); + beep_surface (surface); return TRUE; } } @@ -1394,7 +1394,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, if (n_compose == MAX(GTK_MAX_COMPOSE_LEN + 1, 9)) { - beep_window (window); + beep_surface (surface); priv->tentative_match = 0; priv->in_hex_sequence = FALSE; priv->in_emoji_sequence = FALSE; @@ -1423,7 +1423,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, else { /* invalid hex sequence */ - beep_window (window); + beep_surface (surface); priv->tentative_match = 0; priv->in_hex_sequence = FALSE; @@ -1433,7 +1433,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, } else if ((priv->in_hex_sequence && !check_hex (context_simple, n_compose)) || (priv->in_emoji_sequence && !check_emoji (context_simple, n_compose))) - beep_window (window); + beep_surface (surface); g_signal_emit_by_name (context_simple, "preedit-changed"); diff --git a/gtk/gtkimcontextxim.c b/gtk/gtkimcontextxim.c index 815229ee4f..e8b398c304 100644 --- a/gtk/gtkimcontextxim.c +++ b/gtk/gtkimcontextxim.c @@ -37,8 +37,8 @@ struct _GtkIMContextXIM gchar *locale; gchar *mb_charset; - GdkSurface *client_window; - Window client_window_xid; + GdkSurface *client_surface; + Window client_surface_xid; GtkWidget *client_widget; /* The status window for this input context; we claim the @@ -122,8 +122,8 @@ static void gtk_im_context_xim_get_preedit_string (GtkIMContext *co gint *cursor_pos); static void reinitialize_ic (GtkIMContextXIM *context_xim); -static void set_ic_client_window (GtkIMContextXIM *context_xim, - GdkSurface *client_window); +static void set_ic_client_surface (GtkIMContextXIM *context_xim, + GdkSurface *client_surface); static void setup_styles (GtkXIMInfo *info); @@ -307,7 +307,7 @@ xim_info_display_closed (GdkDisplay *display, info->ics = NULL; for (tmp_list = ics; tmp_list; tmp_list = tmp_list->next) - set_ic_client_window (tmp_list->data, NULL); + set_ic_client_surface (tmp_list->data, NULL); g_slist_free (ics); @@ -397,12 +397,12 @@ xim_destroy_callback (XIM xim, } static GtkXIMInfo * -get_im (GdkSurface *client_window, +get_im (GdkSurface *client_surface, const char *locale) { GSList *tmp_list; GtkXIMInfo *info; - GdkDisplay *display = gdk_surface_get_display (client_window); + GdkDisplay *display = gdk_surface_get_display (client_surface); info = NULL; tmp_list = open_ims; @@ -513,7 +513,7 @@ gtk_im_context_xim_finalize (GObject *obj) } } - set_ic_client_window (context_xim, NULL); + set_ic_client_surface (context_xim, NULL); g_free (context_xim->locale); g_free (context_xim->mb_charset); @@ -545,31 +545,31 @@ reinitialize_ic (GtkIMContextXIM *context_xim) } static void -set_ic_client_window (GtkIMContextXIM *context_xim, - GdkSurface *client_window) +set_ic_client_surface (GtkIMContextXIM *context_xim, + GdkSurface *client_surface) { reinitialize_ic (context_xim); - if (context_xim->client_window) + if (context_xim->client_surface) { context_xim->im_info->ics = g_slist_remove (context_xim->im_info->ics, context_xim); context_xim->im_info = NULL; } - context_xim->client_window = client_window; - context_xim->client_window_xid = None; + context_xim->client_surface = client_surface; + context_xim->client_surface_xid = None; - if (context_xim->client_window) + if (context_xim->client_surface) { GdkSurface *native; - context_xim->im_info = get_im (context_xim->client_window, context_xim->locale); + context_xim->im_info = get_im (context_xim->client_surface, context_xim->locale); context_xim->im_info->ics = g_slist_prepend (context_xim->im_info->ics, context_xim); - for (native = client_window; native; native = gdk_surface_get_parent (native)) + for (native = client_surface; native; native = gdk_surface_get_parent (native)) { if (gdk_surface_has_native (native)) { - context_xim->client_window_xid = gdk_x11_surface_get_xid (native); + context_xim->client_surface_xid = gdk_x11_surface_get_xid (native); break; } } @@ -588,7 +588,7 @@ gtk_im_context_xim_set_client_widget (GtkIMContext *context, if (widget != NULL) surface = gtk_widget_get_surface (gtk_widget_get_toplevel (widget)); - set_ic_client_window (context_xim, surface); + set_ic_client_surface (context_xim, surface); } static char * @@ -657,7 +657,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context, xevent.keycode = gdk_event_get_scancode ((GdkEvent *) event); xevent.same_screen = True; - if (XFilterEvent ((XEvent *)&xevent, context_xim->client_window_xid)) + if (XFilterEvent ((XEvent *)&xevent, context_xim->client_surface_xid)) return TRUE; if (state & @@ -1373,7 +1373,7 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim) xic = XCreateIC (context_xim->im_info->im, XNInputStyle, im_style, - XNClientWindow, context_xim->client_window_xid, + XNClientWindow, context_xim->client_surface_xid, name1, list1, name2, list2, NULL); @@ -1427,7 +1427,7 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim) * calling ::focus-in and ::focus-out at the right time. * * The toplevel is computed by walking up the GdkSurface - * hierarchy from context->client_window until we find a + * hierarchy from context->client_surface until we find a * window that is owned by some widget, and then calling * gtk_widget_get_toplevel() on that widget. This should * handle both cases where we might have GdkSurfaces without widgets, @@ -1546,13 +1546,13 @@ widget_for_window (GdkSurface *window) return NULL; } -/* Called when context_xim->client_window changes; takes care of +/* Called when context_xim->client_surface changes; takes care of * removing and/or setting up our watches for the toplevel */ static void update_client_widget (GtkIMContextXIM *context_xim) { - GtkWidget *new_client_widget = widget_for_window (context_xim->client_window); + GtkWidget *new_client_widget = widget_for_window (context_xim->client_surface); if (new_client_widget != context_xim->client_widget) { diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c index 8bff84442c..9b9b454f4b 100644 --- a/gtk/gtkinvisible.c +++ b/gtk/gtkinvisible.c @@ -220,13 +220,13 @@ gtk_invisible_get_display (GtkInvisible *invisible) static void gtk_invisible_realize (GtkWidget *widget) { - GdkSurface *window; + GdkSurface *surface; gtk_widget_set_realized (widget, TRUE); - window = gdk_surface_new_temp (gtk_widget_get_display (widget)); - gtk_widget_set_surface (widget, window); - gtk_widget_register_surface (widget, window); + surface = gdk_surface_new_temp (gtk_widget_get_display (widget)); + gtk_widget_set_surface (widget, surface); + gtk_widget_register_surface (widget, surface); } static void diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 8e54c00d8d..5971346a5a 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1177,7 +1177,7 @@ rewrite_events_translate (GdkSurface *old_surface, static GdkEvent * rewrite_event_for_surface (GdkEvent *event, - GdkSurface *new_surface) + GdkSurface *new_surface) { event = gdk_event_copy (event); @@ -1903,7 +1903,7 @@ typedef struct gboolean was_grabbed; gboolean is_grabbed; gboolean from_grab; - GList *notified_windows; + GList *notified_surfaces; GdkDevice *device; } GrabNotifyInfo; @@ -1917,46 +1917,46 @@ synth_crossing_for_grab_notify (GtkWidget *from, while (devices) { GdkDevice *device = devices->data; - GdkSurface *from_window, *to_window; + GdkSurface *from_surface, *to_surface; /* Do not propagate events more than once to - * the same windows if non-multidevice aware. + * the same surfaces if non-multidevice aware. */ if (!from) - from_window = NULL; + from_surface = NULL; else { - from_window = _gtk_widget_get_device_window (from, device); + from_surface = _gtk_widget_get_device_surface (from, device); - if (from_window && - !gdk_surface_get_support_multidevice (from_window) && - g_list_find (info->notified_windows, from_window)) - from_window = NULL; + if (from_surface && + !gdk_surface_get_support_multidevice (from_surface) && + g_list_find (info->notified_surfaces, from_surface)) + from_surface = NULL; } if (!to) - to_window = NULL; + to_surface = NULL; else { - to_window = _gtk_widget_get_device_window (to, device); + to_surface = _gtk_widget_get_device_surface (to, device); - if (to_window && - !gdk_surface_get_support_multidevice (to_window) && - g_list_find (info->notified_windows, to_window)) - to_window = NULL; + if (to_surface && + !gdk_surface_get_support_multidevice (to_surface) && + g_list_find (info->notified_surfaces, to_surface)) + to_surface = NULL; } - if (from_window || to_window) + if (from_surface || to_surface) { - _gtk_widget_synthesize_crossing ((from_window) ? from : NULL, - (to_window) ? to : NULL, + _gtk_widget_synthesize_crossing ((from_surface) ? from : NULL, + (to_surface) ? to : NULL, device, mode); - if (from_window) - info->notified_windows = g_list_prepend (info->notified_windows, from_window); + if (from_surface) + info->notified_surfaces = g_list_prepend (info->notified_surfaces, from_surface); - if (to_window) - info->notified_windows = g_list_prepend (info->notified_windows, to_window); + if (to_surface) + info->notified_surfaces = g_list_prepend (info->notified_surfaces, to_surface); } devices = devices->next; @@ -1995,7 +1995,7 @@ gtk_grab_notify_foreach (GtkWidget *child, } if (info->device && - _gtk_widget_get_device_window (child, info->device)) + _gtk_widget_get_device_surface (child, info->device)) { /* Device specified and is on widget */ devices = g_list_prepend (NULL, info->device); @@ -2069,7 +2069,7 @@ gtk_grab_notify (GtkWindowGroup *group, g_object_unref (toplevel); } - g_list_free (info.notified_windows); + g_list_free (info.notified_surfaces); g_object_unref (group); } diff --git a/gtk/gtkmediastream.c b/gtk/gtkmediastream.c index 594a29b92c..9153c700c6 100644 --- a/gtk/gtkmediastream.c +++ b/gtk/gtkmediastream.c @@ -129,13 +129,13 @@ gtk_media_stream_default_update_audio (GtkMediaStream *self, static void gtk_media_stream_default_realize (GtkMediaStream *self, - GdkSurface *window) + GdkSurface *surface) { } static void gtk_media_stream_default_unrealize (GtkMediaStream *self, - GdkSurface *window) + GdkSurface *surface) { } @@ -856,54 +856,54 @@ gtk_media_stream_set_volume (GtkMediaStream *self, /** * gtk_media_stream_realize: * @self: a #GtkMediaStream - * @window: a #GdkSurface + * @surface: a #GdkSurface * * Called by users to attach the media stream to a #GdkSurface they manage. - * The stream can then access the resources of @window for its rendering + * The stream can then access the resources of @surface for its rendering * purposes. In particular, media streams might want to create * #GdkGLContexts or sync to the #GdkFrameClock. * * Whoever calls this function is responsible for calling - * gtk_media_stream_unrealize() before either the stream or @window get + * gtk_media_stream_unrealize() before either the stream or @surface get * destroyed. * * Multiple calls to this function may happen from different users of the - * video, even with the same @window. Each of these calls must be followed + * video, even with the same @surface. Each of these calls must be followed * by its own call to gtk_media_stream_unrealize(). * * It is not required to call this function to make a media stream work. **/ void gtk_media_stream_realize (GtkMediaStream *self, - GdkSurface *window) + GdkSurface *surface) { g_return_if_fail (GTK_IS_MEDIA_STREAM (self)); - g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (GDK_IS_SURFACE (surface)); g_object_ref (self); - g_object_ref (window); + g_object_ref (surface); - GTK_MEDIA_STREAM_GET_CLASS (self)->realize (self, window); + GTK_MEDIA_STREAM_GET_CLASS (self)->realize (self, surface); } /** * gtk_media_stream_unrealize: * @self: a #GtkMediaStream previously realized - * @window: the #GdkSurface the stream was realized with + * @surface: the #GdkSurface the stream was realized with * * Undoes a previous call to gtk_media_stream_realize() and causes - * the stream to release all resources it had allocated from @window. + * the stream to release all resources it had allocated from @surface. **/ void gtk_media_stream_unrealize (GtkMediaStream *self, - GdkSurface *window) + GdkSurface *surface) { g_return_if_fail (GTK_IS_MEDIA_STREAM (self)); - g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (GDK_IS_SURFACE (surface)); - GTK_MEDIA_STREAM_GET_CLASS (self)->unrealize (self, window); + GTK_MEDIA_STREAM_GET_CLASS (self)->unrealize (self, surface); - g_object_unref (window); + g_object_unref (surface); g_object_unref (self); } diff --git a/gtk/gtkmediastream.h b/gtk/gtkmediastream.h index aa1ba62add..9f17a6638a 100644 --- a/gtk/gtkmediastream.h +++ b/gtk/gtkmediastream.h @@ -45,9 +45,9 @@ struct _GtkMediaStreamClass gboolean muted, double volume); void (* realize) (GtkMediaStream *self, - GdkSurface *window); + GdkSurface *surface); void (* unrealize) (GtkMediaStream *self, - GdkSurface *window); + GdkSurface *surface); /* Padding for future expansion */ void (*_gtk_reserved1) (void); @@ -110,10 +110,10 @@ void gtk_media_stream_set_volume (GtkMediaStream double volume); GDK_AVAILABLE_IN_ALL void gtk_media_stream_realize (GtkMediaStream *self, - GdkSurface *window); + GdkSurface *surface); GDK_AVAILABLE_IN_ALL void gtk_media_stream_unrealize (GtkMediaStream *self, - GdkSurface *window); + GdkSurface *surface); /* for implementations only */ GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index d004672c05..22f86a1e51 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -298,8 +298,8 @@ static void gtk_menu_position (GtkMenu *menu, static void gtk_menu_remove (GtkContainer *menu, GtkWidget *widget); -static void menu_grab_transfer_window_destroy (GtkMenu *menu); -static GdkSurface *menu_grab_transfer_window_get (GtkMenu *menu); +static void menu_grab_transfer_surface_destroy (GtkMenu *menu); +static GdkSurface *menu_grab_transfer_surface_get (GtkMenu *menu); static gboolean gtk_menu_real_can_activate_accel (GtkWidget *widget, guint signal_id); @@ -1162,7 +1162,7 @@ gtk_menu_init (GtkMenu *menu) } static void -moved_to_rect_cb (GdkSurface *window, +moved_to_rect_cb (GdkSurface *surface, const GdkRectangle *flipped_rect, const GdkRectangle *final_rect, gboolean flipped_x, @@ -1470,14 +1470,14 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell, } static gboolean -popup_grab_on_window (GdkSurface *window, - GdkDevice *pointer) +popup_grab_on_surface (GdkSurface *surface, + GdkDevice *pointer) { GdkGrabStatus status; GdkSeat *seat; seat = gdk_device_get_seat (pointer); - status = gdk_seat_grab (seat, window, + status = gdk_seat_grab (seat, surface, GDK_SEAT_CAPABILITY_ALL, TRUE, NULL, NULL, NULL, NULL); @@ -1485,19 +1485,19 @@ popup_grab_on_window (GdkSurface *window, } static void -associate_menu_grab_transfer_window (GtkMenu *menu) +associate_menu_grab_transfer_surface (GtkMenu *menu) { GtkMenuPrivate *priv = menu->priv; - GdkSurface *toplevel_window; - GdkSurface *transfer_window; + GdkSurface *toplevel_surface; + GdkSurface *transfer_surface; - toplevel_window = gtk_widget_get_surface (priv->toplevel); - transfer_window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); + toplevel_surface = gtk_widget_get_surface (priv->toplevel); + transfer_surface = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-surface"); - if (toplevel_window == NULL || transfer_window == NULL) + if (toplevel_surface == NULL || transfer_surface == NULL) return; - g_object_set_data (G_OBJECT (toplevel_window), I_("gdk-attached-grab-surface"), transfer_window); + g_object_set_data (G_OBJECT (toplevel_surface), I_("gdk-attached-grab-surface"), transfer_surface); } static void @@ -1595,7 +1595,7 @@ gtk_menu_popup_internal (GtkMenu *menu, if (xgrab_shell && xgrab_shell != widget) { - if (popup_grab_on_window (gtk_widget_get_surface (xgrab_shell), pointer)) + if (popup_grab_on_surface (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; @@ -1603,11 +1603,11 @@ gtk_menu_popup_internal (GtkMenu *menu, } else { - GdkSurface *transfer_window; + GdkSurface *transfer_surface; xgrab_shell = widget; - transfer_window = menu_grab_transfer_window_get (menu); - if (popup_grab_on_window (transfer_window, pointer)) + transfer_surface = menu_grab_transfer_surface_get (menu); + if (popup_grab_on_surface (transfer_surface, pointer)) { _gtk_menu_shell_set_grab_device (GTK_MENU_SHELL (xgrab_shell), pointer); GTK_MENU_SHELL (xgrab_shell)->priv->have_xgrab = TRUE; @@ -1621,7 +1621,7 @@ gtk_menu_popup_internal (GtkMenu *menu, * we just abort here. Presumably the user will try again. */ menu_shell->priv->parent_menu_shell = NULL; - menu_grab_transfer_window_destroy (menu); + menu_grab_transfer_surface_destroy (menu); return; } @@ -1680,7 +1680,7 @@ gtk_menu_popup_internal (GtkMenu *menu, */ gtk_menu_position (menu, TRUE); - associate_menu_grab_transfer_window (menu); + associate_menu_grab_transfer_surface (menu); gtk_menu_scroll_to (menu, priv->scroll_offset); @@ -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_surface (widget), pointer); /* Should always succeed */ + popup_grab_on_surface (gtk_widget_get_surface (widget), pointer); /* Should always succeed */ gtk_grab_add (GTK_WIDGET (menu)); @@ -1761,7 +1761,7 @@ gtk_menu_popup_for_device (GtkMenu *menu, g_return_if_fail (GTK_IS_MENU (menu)); priv = menu->priv; - priv->rect_window = NULL; + priv->rect_surface = NULL; priv->widget = NULL; gtk_menu_popup_internal (menu, @@ -1861,7 +1861,7 @@ get_device_for_event (const GdkEvent *event) /** * gtk_menu_popup_at_rect: * @menu: the #GtkMenu to pop up - * @rect_window: (not nullable): the #GdkSurface @rect is relative to + * @rect_surface: (not nullable): the #GdkSurface @rect is relative to * @rect: (not nullable): the #GdkRectangle to align @menu with * @rect_anchor: the point on @rect to align with @menu's anchor point * @menu_anchor: the point on @menu to align with @rect's anchor point @@ -1874,7 +1874,7 @@ get_device_for_event (const GdkEvent *event) * handle more common cases for popping up menus. * * @menu will be positioned at @rect, aligning their anchor points. @rect is - * relative to the top-left corner of @rect_window. @rect_anchor and + * relative to the top-left corner of @rect_surface. @rect_anchor and * @menu_anchor determine anchor points on @rect and @menu to pin together. * @menu can optionally be offset by #GtkMenu:rect-anchor-dx and * #GtkMenu:rect-anchor-dy. @@ -1889,7 +1889,7 @@ get_device_for_event (const GdkEvent *event) */ void gtk_menu_popup_at_rect (GtkMenu *menu, - GdkSurface *rect_window, + GdkSurface *rect_surface, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity menu_anchor, @@ -1902,11 +1902,11 @@ gtk_menu_popup_at_rect (GtkMenu *menu, guint32 activate_time = GDK_CURRENT_TIME; g_return_if_fail (GTK_IS_MENU (menu)); - g_return_if_fail (GDK_IS_SURFACE (rect_window)); + g_return_if_fail (GDK_IS_SURFACE (rect_surface)); g_return_if_fail (rect); priv = menu->priv; - priv->rect_window = rect_window; + priv->rect_surface = rect_surface; priv->rect = *rect; priv->widget = NULL; priv->rect_anchor = rect_anchor; @@ -1989,7 +1989,7 @@ gtk_menu_popup_at_widget (GtkMenu *menu, g_return_if_fail (GTK_IS_WIDGET (widget)); priv = menu->priv; - priv->rect_window = NULL; + priv->rect_surface = NULL; priv->widget = widget; priv->rect_anchor = widget_anchor; priv->menu_anchor = menu_anchor; @@ -2054,7 +2054,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu, const GdkEvent *trigger_event) { GdkEvent *current_event = NULL; - GdkSurface *rect_window = NULL; + GdkSurface *rect_surface = NULL; GdkDevice *device = NULL; GdkRectangle rect = { 0, 0, 1, 1 }; @@ -2068,9 +2068,9 @@ gtk_menu_popup_at_pointer (GtkMenu *menu, if (trigger_event) { - rect_window = gdk_event_get_surface (trigger_event); + rect_surface = gdk_event_get_surface (trigger_event); - if (rect_window) + if (rect_surface) { device = get_device_for_event (trigger_event); @@ -2078,14 +2078,14 @@ gtk_menu_popup_at_pointer (GtkMenu *menu, device = gdk_device_get_associated_device (device); if (device) - gdk_surface_get_device_position (rect_window, device, &rect.x, &rect.y, NULL); + gdk_surface_get_device_position (rect_surface, device, &rect.x, &rect.y, NULL); } } else g_warning ("no trigger event for menu popup"); gtk_menu_popup_at_rect (menu, - rect_window, + rect_surface, &rect, GDK_GRAVITY_SOUTH_EAST, GDK_GRAVITY_NORTH_WEST, @@ -2205,7 +2205,7 @@ gtk_menu_popdown (GtkMenu *menu) _gtk_menu_shell_set_grab_device (menu_shell, NULL); - menu_grab_transfer_window_destroy (menu); + menu_grab_transfer_surface_destroy (menu); } /** @@ -2518,36 +2518,36 @@ gtk_menu_focus (GtkWidget *widget, * about the “grab transfer window” */ static GdkSurface * -menu_grab_transfer_window_get (GtkMenu *menu) +menu_grab_transfer_surface_get (GtkMenu *menu) { - GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); - if (!window) + GdkSurface *surface = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-surface"); + if (!surface) { - window = gdk_surface_new_temp (gtk_widget_get_display (GTK_WIDGET (menu))); - gtk_widget_register_surface (GTK_WIDGET (menu), window); + surface = gdk_surface_new_temp (gtk_widget_get_display (GTK_WIDGET (menu))); + gtk_widget_register_surface (GTK_WIDGET (menu), surface); - gdk_surface_show (window); + gdk_surface_show (surface); - g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), window); + g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-surface"), surface); } - return window; + return surface; } static void -menu_grab_transfer_window_destroy (GtkMenu *menu) +menu_grab_transfer_surface_destroy (GtkMenu *menu) { - GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); - if (window) + GdkSurface *surface = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-surface"); + if (surface) { - GdkSurface *widget_window; + GdkSurface *widget_surface; - 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); + gtk_widget_unregister_surface (GTK_WIDGET (menu), surface); + gdk_surface_destroy (surface); + g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-surface"), NULL); - widget_window = gtk_widget_get_surface (GTK_WIDGET (menu)); - g_object_set_data (G_OBJECT (widget_window), I_("gdk-attached-grab-surface"), window); + widget_surface = gtk_widget_get_surface (GTK_WIDGET (menu)); + g_object_set_data (G_OBJECT (widget_surface), I_("gdk-attached-grab-surface"), surface); } } @@ -2556,7 +2556,7 @@ gtk_menu_unrealize (GtkWidget *widget) { GtkMenu *menu = GTK_MENU (widget); - menu_grab_transfer_window_destroy (menu); + menu_grab_transfer_surface_destroy (menu); GTK_WIDGET_CLASS (gtk_menu_parent_class)->unrealize (widget); } @@ -2943,9 +2943,9 @@ static void gtk_menu_measure (GtkWidget *widget, } static gboolean -pointer_in_menu_window (GtkWidget *widget, - gdouble x_root, - gdouble y_root) +pointer_in_menu_surface (GtkWidget *widget, + gdouble x_root, + gdouble y_root) { GtkMenu *menu = GTK_MENU (widget); GtkMenuPrivate *priv = menu->priv; @@ -2954,20 +2954,20 @@ pointer_in_menu_window (GtkWidget *widget, if (gtk_widget_get_mapped (priv->toplevel)) { GtkMenuShell *menu_shell; - gint window_x, window_y; + gint surface_x, surface_y; gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel), - &window_x, &window_y); + &surface_x, &surface_y); gtk_widget_get_allocation (widget, &allocation); - if (x_root >= window_x && x_root < window_x + allocation.width && - y_root >= window_y && y_root < window_y + allocation.height) + if (x_root >= surface_x && x_root < surface_x + allocation.width && + y_root >= surface_y && y_root < surface_y + allocation.height) return TRUE; menu_shell = GTK_MENU_SHELL (widget); if (GTK_IS_MENU (menu_shell->priv->parent_menu_shell)) - return pointer_in_menu_window (menu_shell->priv->parent_menu_shell, + return pointer_in_menu_surface (menu_shell->priv->parent_menu_shell, x_root, y_root); } @@ -2999,7 +2999,7 @@ gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, * menu_shell->window. */ if (GTK_IS_MENU_SHELL (event_widget) && - pointer_in_menu_window (GTK_WIDGET (menu), button_event->x_root, button_event->y_root)) + pointer_in_menu_surface (GTK_WIDGET (menu), button_event->x_root, button_event->y_root)) { gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); return; @@ -3038,7 +3038,7 @@ gtk_menu_released_cb (GtkGestureMultiPress *gesture, * was clicked (see comment in gtk_menu_pressed_cb()). */ if (GTK_IS_MENU_SHELL (gtk_get_event_widget ((GdkEvent *) event)) && - pointer_in_menu_window (GTK_WIDGET (menu), button_event->x_root, button_event->y_root)) + pointer_in_menu_surface (GTK_WIDGET (menu), button_event->x_root, button_event->y_root)) { /* Ugly: make sure menu_shell->button gets reset to 0 when we * bail out early here so it is in a consistent state for the @@ -3242,7 +3242,7 @@ get_arrows_sensitive_area (GtkMenu *menu, { GtkMenuPrivate *priv = menu->priv; GtkWidget *widget = GTK_WIDGET (menu); - GdkSurface *window; + GdkSurface *surface; gint width, height; gint win_x, win_y; gint top_arrow_height, bottom_arrow_height; @@ -3258,11 +3258,11 @@ get_arrows_sensitive_area (GtkMenu *menu, &bottom_arrow_height, NULL, NULL, NULL); - window = gtk_widget_get_surface (widget); - width = gdk_surface_get_width (window); - height = gdk_surface_get_height (window); + surface = gtk_widget_get_surface (widget); + width = gdk_surface_get_width (surface); + height = gdk_surface_get_height (surface); - gdk_surface_get_position (window, &win_x, &win_y); + gdk_surface_get_position (surface, &win_x, &win_y); if (upper) { @@ -3506,14 +3506,14 @@ pointer_on_menu_widget (GtkMenu *menu, { GtkMenuPrivate *priv = menu->priv; GtkAllocation allocation; - gint window_x, window_y; + gint surface_x, surface_y; gtk_widget_get_allocation (GTK_WIDGET (menu), &allocation); gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel), - &window_x, &window_y); + &surface_x, &surface_y); - if (x_root >= window_x && x_root < window_x + allocation.width && - y_root >= window_y && y_root < window_y + allocation.height) + if (x_root >= surface_x && x_root < surface_x + allocation.width && + y_root >= surface_y && y_root < surface_y + allocation.height) return TRUE; return FALSE; @@ -3977,7 +3977,7 @@ gtk_menu_position (GtkMenu *menu, gboolean set_scroll_offset) { GtkMenuPrivate *priv = menu->priv; - GdkSurface *rect_window = NULL; + GdkSurface *rect_surface = NULL; GdkRectangle rect; GtkTextDirection text_direction = GTK_TEXT_DIR_NONE; GdkGravity rect_anchor; @@ -3993,14 +3993,14 @@ gtk_menu_position (GtkMenu *menu, rect_anchor_dx = priv->rect_anchor_dx; rect_anchor_dy = priv->rect_anchor_dy; - if (priv->rect_window) + if (priv->rect_surface) { - rect_window = priv->rect_window; + rect_surface = priv->rect_surface; rect = priv->rect; } else if (priv->widget) { - rect_window = gtk_widget_get_surface (priv->widget); + rect_surface = gtk_widget_get_surface (priv->widget); gtk_widget_get_surface_allocation (priv->widget, &rect); text_direction = gtk_widget_get_direction (priv->widget); } @@ -4022,8 +4022,8 @@ gtk_menu_position (GtkMenu *menu, { rect = (GdkRectangle) { 0, 0, 1, 1 }; - rect_window = gtk_widget_get_surface (attach_widget); - gdk_surface_get_device_position (rect_window, grab_device, + rect_surface = gtk_widget_get_surface (attach_widget); + gdk_surface_get_device_position (rect_surface, grab_device, &rect.x, &rect.y, NULL); text_direction = gtk_widget_get_direction (attach_widget); rect_anchor = GDK_GRAVITY_SOUTH_EAST; @@ -4035,7 +4035,7 @@ gtk_menu_position (GtkMenu *menu, } } - if (!rect_window) + if (!rect_surface) { gtk_menu_position_legacy (menu, set_scroll_offset); return; @@ -4060,7 +4060,7 @@ gtk_menu_position (GtkMenu *menu, toplevel = gtk_widget_get_surface (priv->toplevel); - gdk_surface_set_transient_for (toplevel, rect_window); + gdk_surface_set_transient_for (toplevel, rect_surface); g_signal_handlers_disconnect_by_func (toplevel, moved_to_rect_cb, menu); diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h index 1eb9dfeaa6..c62c7e5fa9 100644 --- a/gtk/gtkmenu.h +++ b/gtk/gtkmenu.h @@ -154,7 +154,7 @@ void gtk_menu_popup_for_device (GtkMenu *menu, guint32 activate_time); GDK_AVAILABLE_IN_ALL void gtk_menu_popup_at_rect (GtkMenu *menu, - GdkSurface *rect_window, + GdkSurface *rect_surface, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity menu_anchor, diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h index 28ca2a6187..e6b929119c 100644 --- a/gtk/gtkmenuprivate.h +++ b/gtk/gtkmenuprivate.h @@ -53,7 +53,7 @@ struct _GtkMenuPrivate gint position_x; gint position_y; - GdkSurface *rect_window; + GdkSurface *rect_surface; GdkRectangle rect; GtkWidget *widget; GdkGravity rect_anchor; diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index e0a58ec1a8..352107cacb 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -598,13 +598,13 @@ gtk_menu_shell_event (GtkWidget *widget, { GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget); GtkMenuShellPrivate *priv = menu_shell->priv; - GdkSurface *window; + GdkSurface *surface; if (gdk_event_get_event_type (event) == GDK_GRAB_BROKEN) { - gdk_event_get_grab_surface (event, &window); + gdk_event_get_grab_surface (event, &surface); - if (priv->have_xgrab && window == NULL) + if (priv->have_xgrab && surface == NULL) { /* Unset the active menu item so gtk_menu_popdown() doesn't see it. */ gtk_menu_shell_deselect (menu_shell); diff --git a/gtk/gtkmnemonichash.c b/gtk/gtkmnemonichash.c index 4a87f0c3e7..03488e2887 100644 --- a/gtk/gtkmnemonichash.c +++ b/gtk/gtkmnemonichash.c @@ -111,7 +111,7 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash, { GSList *list, *targets; GtkWidget *widget, *chosen_widget; - GdkSurface *window; + GdkSurface *surface; gboolean overloaded; targets = g_hash_table_lookup (mnemonic_hash->hash, @@ -124,11 +124,11 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash, for (list = targets; list; list = list->next) { widget = GTK_WIDGET (list->data); - window = gtk_widget_get_surface (widget); + surface = gtk_widget_get_surface (widget); if (gtk_widget_is_sensitive (widget) && gtk_widget_get_mapped (widget) && - window && gdk_surface_is_viewable (window)) + surface && gdk_surface_is_viewable (surface)) { if (chosen_widget) { diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index f6faecc3e6..5bc8614a7f 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -390,7 +390,7 @@ gtk_popover_hide_internal (GtkPopover *popover) { cairo_region_t *region = cairo_region_create (); gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget), - region, 0, 0); + region, 0, 0); cairo_region_destroy (region); } } @@ -471,7 +471,7 @@ static void gtk_popover_realize (GtkWidget *widget) { GtkAllocation allocation; - GdkSurface *window; + GdkSurface *surface; gtk_widget_get_surface_allocation (widget, &allocation); @@ -486,21 +486,21 @@ gtk_popover_realize (GtkWidget *widget) g_assert (GTK_IS_WINDOW (toplevel)); - window = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (toplevel), - &allocation); + surface = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (toplevel), + &allocation); - gdk_surface_set_transient_for (window, - gtk_widget_get_surface (toplevel)); + gdk_surface_set_transient_for (surface, + gtk_widget_get_surface (toplevel)); } else #endif { - window = gdk_surface_new_child (gtk_widget_get_parent_surface (widget), - &allocation); + surface = gdk_surface_new_child (gtk_widget_get_parent_surface (widget), + &allocation); } - gtk_widget_set_surface (widget, window); - gtk_widget_register_surface (widget, window); + gtk_widget_set_surface (widget, surface); + gtk_widget_register_surface (widget, surface); gtk_widget_set_realized (widget, TRUE); } @@ -827,7 +827,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_surface (GTK_WIDGET (popover)), - &win_x, &win_y); + &win_x, &win_y); rect.x -= win_x; rect.y -= win_y; } @@ -1016,9 +1016,9 @@ static void gtk_popover_update_shape (GtkPopover *popover) { GtkWidget *widget = GTK_WIDGET (popover); - cairo_surface_t *surface; + cairo_surface_t *cairo_surface; cairo_region_t *region; - GdkSurface *win; + GdkSurface *surface; cairo_t *cr; #ifdef GDK_WINDOWING_WAYLAND @@ -1026,19 +1026,19 @@ gtk_popover_update_shape (GtkPopover *popover) return; #endif - win = gtk_widget_get_surface (widget); - surface = - gdk_surface_create_similar_surface (win, + surface = gtk_widget_get_surface (widget); + cairo_surface = + gdk_surface_create_similar_surface (surface, CAIRO_CONTENT_COLOR_ALPHA, - gdk_surface_get_width (win), - gdk_surface_get_height (win)); + gdk_surface_get_width (surface), + gdk_surface_get_height (surface)); - cr = cairo_create (surface); + cr = cairo_create (cairo_surface); gtk_popover_fill_border_path (popover, cr); cairo_destroy (cr); - region = gdk_cairo_region_create_from_surface (surface); - cairo_surface_destroy (surface); + region = gdk_cairo_region_create_from_surface (cairo_surface); + cairo_surface_destroy (cairo_surface); gtk_widget_input_shape_combine_region (widget, region); cairo_region_destroy (region); @@ -1501,7 +1501,7 @@ gtk_popover_show (GtkWidget *widget) if (gtk_widget_get_realized (widget)) gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget), - NULL, 0, 0); + NULL, 0, 0); } static void diff --git a/gtk/gtkquartz.c b/gtk/gtkquartz.c index 1df4c1341d..301b3f94d2 100644 --- a/gtk/gtkquartz.c +++ b/gtk/gtkquartz.c @@ -25,7 +25,7 @@ static gboolean _cairo_surface_extents (cairo_surface_t *surface, - GdkRectangle *extents) + GdkRectangle *extents) { double x1, x2, y1, y2; cairo_t *cr; diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h index bde46f363c..6edfdc1529 100644 --- a/gtk/gtktextview.h +++ b/gtk/gtktextview.h @@ -275,11 +275,11 @@ void gtk_text_view_get_line_at_y (GtkTextView *text_view GDK_AVAILABLE_IN_ALL void gtk_text_view_buffer_to_surface_coords (GtkTextView *text_view, - GtkTextWindowType win, - gint buffer_x, - gint buffer_y, - gint *window_x, - gint *window_y); + GtkTextWindowType win, + gint buffer_x, + gint buffer_y, + gint *window_x, + gint *window_y); GDK_AVAILABLE_IN_ALL void gtk_text_view_window_to_buffer_coords (GtkTextView *text_view, GtkTextWindowType win, diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 5b325f233d..1f789404f1 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -109,7 +109,7 @@ struct _GtkTooltip gdouble last_x; gdouble last_y; - GdkSurface *last_window; + GdkSurface *last_surface; guint timeout_id; guint browse_mode_timeout_id; @@ -136,11 +136,11 @@ static void gtk_tooltip_window_hide (GtkWidget *widget, static void gtk_tooltip_display_closed (GdkDisplay *display, gboolean was_error, GtkTooltip *tooltip); -static void gtk_tooltip_set_last_window (GtkTooltip *tooltip, - GdkSurface *window); +static void gtk_tooltip_set_last_surface (GtkTooltip *tooltip, + GdkSurface *surface); static void gtk_tooltip_handle_event_internal (GdkEventType event_type, - GdkSurface *window, + GdkSurface *surface, gdouble dx, gdouble dy); @@ -181,7 +181,7 @@ gtk_tooltip_init (GtkTooltip *tooltip) tooltip->tooltip_widget = NULL; - tooltip->last_window = NULL; + tooltip->last_surface = NULL; tooltip->window = gtk_tooltip_window_new (); g_signal_connect (tooltip->window, "hide", @@ -207,7 +207,7 @@ gtk_tooltip_dispose (GObject *object) } gtk_tooltip_set_custom (tooltip, NULL); - gtk_tooltip_set_last_window (tooltip, NULL); + gtk_tooltip_set_last_surface (tooltip, NULL); if (tooltip->window) { @@ -386,16 +386,16 @@ void gtk_tooltip_trigger_tooltip_query (GdkDisplay *display) { gint x, y; - GdkSurface *window; + GdkSurface *surface; GdkDevice *device; /* Trigger logic as if the mouse moved */ device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); - window = gdk_device_get_surface_at_position (device, &x, &y); - if (!window) + surface = gdk_device_get_surface_at_position (device, &x, &y); + if (!surface) return; - gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, window, x, y); + gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, surface, x, y); } static void @@ -408,26 +408,26 @@ gtk_tooltip_window_hide (GtkWidget *widget, } GtkWidget * -_gtk_widget_find_at_coords (GdkSurface *window, - gint window_x, - gint window_y, +_gtk_widget_find_at_coords (GdkSurface *surface, + gint surface_x, + gint surface_y, gint *widget_x, gint *widget_y) { GtkWidget *event_widget; GtkWidget *picked_widget; - g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); - gdk_surface_get_user_data (window, (void **)&event_widget); + gdk_surface_get_user_data (surface, (void **)&event_widget); if (!event_widget) return NULL; - picked_widget = gtk_widget_pick (event_widget, window_x, window_y); + picked_widget = gtk_widget_pick (event_widget, surface_x, surface_y); if (picked_widget != NULL) - gtk_widget_translate_coordinates (event_widget, picked_widget, window_x, window_y, widget_x, widget_y); + gtk_widget_translate_coordinates (event_widget, picked_widget, surface_x, surface_y, widget_x, widget_y); return picked_widget; } @@ -436,7 +436,7 @@ _gtk_widget_find_at_coords (GdkSurface *window, * allocation relative (x, y) of the returned widget. */ static GtkWidget * -find_topmost_widget_coords (GdkSurface *window, +find_topmost_widget_coords (GdkSurface *surface, gdouble dx, gdouble dy, gint *x, @@ -447,7 +447,7 @@ find_topmost_widget_coords (GdkSurface *window, GtkWidget *tmp; /* Returns coordinates relative to tmp's allocation. */ - tmp = _gtk_widget_find_at_coords (window, dx, dy, &tx, &ty); + tmp = _gtk_widget_find_at_coords (surface, dx, dy, &tx, &ty); if (!tmp) return NULL; @@ -517,26 +517,26 @@ gtk_tooltip_display_closed (GdkDisplay *display, } static void -gtk_tooltip_set_last_window (GtkTooltip *tooltip, - GdkSurface *window) +gtk_tooltip_set_last_surface (GtkTooltip *tooltip, + GdkSurface *surface) { GtkWidget *window_widget = NULL; - if (tooltip->last_window == window) + if (tooltip->last_surface == surface) return; - if (tooltip->last_window) - g_object_remove_weak_pointer (G_OBJECT (tooltip->last_window), - (gpointer *) &tooltip->last_window); + if (tooltip->last_surface) + g_object_remove_weak_pointer (G_OBJECT (tooltip->last_surface), + (gpointer *) &tooltip->last_surface); - tooltip->last_window = window; + tooltip->last_surface = surface; - if (tooltip->last_window) - g_object_add_weak_pointer (G_OBJECT (tooltip->last_window), - (gpointer *) &tooltip->last_window); + if (tooltip->last_surface) + g_object_add_weak_pointer (G_OBJECT (tooltip->last_surface), + (gpointer *) &tooltip->last_surface); - if (window) - gdk_surface_get_user_data (window, (gpointer *) &window_widget); + if (surface) + gdk_surface_get_user_data (surface, (gpointer *) &window_widget); if (window_widget) window_widget = gtk_widget_get_toplevel (window_widget); @@ -606,7 +606,7 @@ get_bounding_box (GtkWidget *widget, { GtkWidget *toplevel; GtkAllocation allocation; - GdkSurface *window; + GdkSurface *surface; gint x, y; gint w, h; gint x1, y1; @@ -614,9 +614,9 @@ get_bounding_box (GtkWidget *widget, gint x3, y3; gint x4, y4; - window = gtk_widget_get_parent_surface (widget); - if (window == NULL) - window = gtk_widget_get_surface (widget); + surface = gtk_widget_get_parent_surface (widget); + if (surface == NULL) + surface = gtk_widget_get_surface (widget); gtk_widget_get_allocation (widget, &allocation); @@ -646,10 +646,10 @@ get_bounding_box (GtkWidget *widget, h -= border.top + border.bottom; } - gdk_surface_get_root_coords (window, x, y, &x1, &y1); - gdk_surface_get_root_coords (window, x + w, y, &x2, &y2); - gdk_surface_get_root_coords (window, x, y + h, &x3, &y3); - gdk_surface_get_root_coords (window, x + w, y + h, &x4, &y4); + gdk_surface_get_root_coords (surface, x, y, &x1, &y1); + gdk_surface_get_root_coords (surface, x + w, y, &x2, &y2); + gdk_surface_get_root_coords (surface, x, y + h, &x3, &y3); + gdk_surface_get_root_coords (surface, x + w, y + h, &x4, &y4); #define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) #define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) @@ -847,7 +847,7 @@ static void gtk_tooltip_show_tooltip (GdkDisplay *display) { gint x, y; - GdkSurface *window; + GdkSurface *surface; GtkWidget *tooltip_widget; GtkTooltip *tooltip; gboolean return_value = FALSE; @@ -864,20 +864,20 @@ gtk_tooltip_show_tooltip (GdkDisplay *display) GdkDevice *device; gint tx, ty; - window = tooltip->last_window; + surface = tooltip->last_surface; - if (!GDK_IS_SURFACE (window)) + if (!GDK_IS_SURFACE (surface)) return; device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); - gdk_surface_get_device_position (window, device, &x, &y, NULL); + gdk_surface_get_device_position (surface, device, &x, &y, NULL); - gdk_surface_get_root_coords (window, x, y, &tx, &ty); + gdk_surface_get_root_coords (surface, x, y, &tx, &ty); tooltip->last_x = tx; tooltip->last_y = ty; - tooltip_widget = _gtk_widget_find_at_coords (window, x, y, &x, &y); + tooltip_widget = _gtk_widget_find_at_coords (surface, x, y, &x, &y); } if (!tooltip_widget) @@ -1189,7 +1189,7 @@ _gtk_tooltip_handle_event (GdkEvent *event) static void gtk_tooltip_handle_event_internal (GdkEventType event_type, - GdkSurface *window, + GdkSurface *surface, gdouble dx, gdouble dy) { @@ -1198,12 +1198,12 @@ gtk_tooltip_handle_event_internal (GdkEventType event_type, GdkDisplay *display; GtkTooltip *current_tooltip; - has_tooltip_widget = find_topmost_widget_coords (window, dx, dy, &x, &y); - display = gdk_surface_get_display (window); + has_tooltip_widget = find_topmost_widget_coords (surface, dx, dy, &x, &y); + display = gdk_surface_get_display (surface); current_tooltip = g_object_get_qdata (G_OBJECT (display), quark_current_tooltip); if (current_tooltip) - gtk_tooltip_set_last_window (current_tooltip, window); + gtk_tooltip_set_last_surface (current_tooltip, surface); if (current_tooltip && current_tooltip->keyboard_mode_enabled) { @@ -1291,7 +1291,7 @@ gtk_tooltip_handle_event_internal (GdkEventType event_type, G_CALLBACK (gtk_tooltip_display_closed), current_tooltip); - gtk_tooltip_set_last_window (current_tooltip, window); + gtk_tooltip_set_last_surface (current_tooltip, surface); gtk_tooltip_start_delay (display); } diff --git a/gtk/gtktooltipprivate.h b/gtk/gtktooltipprivate.h index 34f37934f4..682da12ab6 100644 --- a/gtk/gtktooltipprivate.h +++ b/gtk/gtktooltipprivate.h @@ -37,9 +37,9 @@ void _gtk_tooltip_toggle_keyboard_mode (GtkWidget *widget); void _gtk_tooltip_handle_event (GdkEvent *event); void _gtk_tooltip_hide (GtkWidget *widget); -GtkWidget * _gtk_widget_find_at_coords (GdkSurface *window, - gint window_x, - gint window_y, +GtkWidget * _gtk_widget_find_at_coords (GdkSurface *surface, + gint surface_x, + gint surface_y, gint *widget_x, gint *widget_y); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 4dedb1c044..9547052721 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -101,7 +101,7 @@ * Several functions are available for converting between the different * coordinate systems. The most common translations are between widget and bin * window coordinates and between bin window and tree coordinates. For the - * former you can use gtk_tree_view_convert_widget_to_bin_surface_coords() + * former you can use gtk_tree_view_convert_widget_to_bin_window_coords() * (and vice versa), for the latter gtk_tree_view_convert_bin_window_to_tree_coords() * (and vice versa). * @@ -390,7 +390,7 @@ struct _GtkTreeViewPrivate /* Interactive Header reordering */ GdkSurface *drag_surface; - GdkSurface *drag_highlight_window; + GdkSurface *drag_highlight_surface; GtkTreeViewColumn *drag_column; gint drag_column_x; @@ -2275,11 +2275,11 @@ gtk_tree_view_unrealize (GtkWidget *widget) priv->drag_surface = NULL; } - if (priv->drag_highlight_window) + if (priv->drag_highlight_surface) { - gtk_widget_unregister_surface (widget, priv->drag_highlight_window); - gdk_surface_destroy (priv->drag_highlight_window); - priv->drag_highlight_window = NULL; + gtk_widget_unregister_surface (widget, priv->drag_highlight_surface); + gdk_surface_destroy (priv->drag_highlight_surface); + priv->drag_highlight_surface = NULL; } GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->unrealize (widget); @@ -2791,7 +2791,7 @@ gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, /* Because grab_focus can cause reentrancy, we delay grab_focus until after * we're done handling the button press. */ - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y, + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &bin_x, &bin_y); gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); @@ -3036,7 +3036,7 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture, return; } - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y, + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, &bin_x, &bin_y); tree_view->priv->press_start_x = tree_view->priv->rubber_band_x = bin_x; tree_view->priv->press_start_y = tree_view->priv->rubber_band_y = bin_y; @@ -3210,8 +3210,8 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view) tree_view->priv->column_drag_info = NULL; tree_view->priv->cur_reorder = NULL; - if (tree_view->priv->drag_highlight_window) - gdk_surface_hide (tree_view->priv->drag_highlight_window); + if (tree_view->priv->drag_highlight_surface) + gdk_surface_hide (tree_view->priv->drag_highlight_surface); /* Reset our flags */ tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_UNSET; @@ -3641,23 +3641,23 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) GtkAllocation drag_allocation; GtkWidget *button; - if (tree_view->priv->drag_highlight_window) + if (tree_view->priv->drag_highlight_surface) { - gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_surface_destroy (tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); + gdk_surface_destroy (tree_view->priv->drag_highlight_surface); } button = gtk_tree_view_column_get_button (tree_view->priv->drag_column); 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_surface (widget), + tree_view->priv->drag_highlight_surface = 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_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_ORIGINAL; } @@ -3694,15 +3694,15 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) /* Create the new window */ if (tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW) { - if (tree_view->priv->drag_highlight_window) + if (tree_view->priv->drag_highlight_surface) { - gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_surface_destroy (tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); + gdk_surface_destroy (tree_view->priv->drag_highlight_surface); } - tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), + tree_view->priv->drag_highlight_surface = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); - gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height); @@ -3720,7 +3720,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) } tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_ARROW; - gdk_surface_move (tree_view->priv->drag_highlight_window, x, y); + gdk_surface_move (tree_view->priv->drag_highlight_surface, x, y); } else if (arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT || arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT) @@ -3759,15 +3759,15 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) if (tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT && tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT) { - if (tree_view->priv->drag_highlight_window) + if (tree_view->priv->drag_highlight_surface) { - gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_surface_destroy (tree_view->priv->drag_highlight_window); + gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); + gdk_surface_destroy (tree_view->priv->drag_highlight_surface); } - tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), + tree_view->priv->drag_highlight_surface = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); - gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); + gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_surface); mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height); @@ -3791,17 +3791,17 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) } tree_view->priv->drag_column_surface_state = arrow_type; - gdk_surface_move (tree_view->priv->drag_highlight_window, x, y); + gdk_surface_move (tree_view->priv->drag_highlight_surface, x, y); } else { g_warning (G_STRLOC"Invalid GtkTreeViewColumnReorder struct"); - gdk_surface_hide (tree_view->priv->drag_highlight_window); + gdk_surface_hide (tree_view->priv->drag_highlight_surface); return; } - gdk_surface_show (tree_view->priv->drag_highlight_window); - gdk_surface_raise (tree_view->priv->drag_highlight_window); + gdk_surface_show (tree_view->priv->drag_highlight_surface); + gdk_surface_raise (tree_view->priv->drag_highlight_surface); } static gboolean @@ -3865,13 +3865,13 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture)); gtk_gesture_get_point (tree_view->priv->drag_gesture, sequence, NULL, &py); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, py, - NULL, &y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, py, + NULL, &y); } else { y = tree_view->priv->event_last_y; - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, y, NULL, &y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, y, NULL, &y); } y += tree_view->priv->dy; @@ -4117,8 +4117,8 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) NULL, &offset_y); gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), NULL, &start_y); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, start_y, - NULL, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, start_y, + NULL, &bin_y); bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy); _gtk_rbtree_find_offset (tree_view->priv->tree, MIN (tree_view->priv->press_start_y, bin_y), &start_tree, &start_node); @@ -4276,8 +4276,8 @@ gtk_tree_view_update_rubber_band (GtkTreeView *tree_view) &offset_x, &offset_y); gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), &start_x, &start_y); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y, - &bin_x, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, + &bin_x, &bin_y); bin_y += tree_view->priv->dy; x = MAX (bin_x + offset_x, 0); @@ -4315,8 +4315,8 @@ gtk_tree_view_snapshot_rubber_band (GtkTreeView *tree_view, &offset_x, &offset_y); gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), &start_x, &start_y); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y, - &bin_x, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, + &bin_x, &bin_y); bin_x = MAX (0, bin_x + offset_x); bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy); @@ -4425,8 +4425,8 @@ gtk_tree_view_motion_controller_motion (GtkEventControllerMotion *controller, gtk_gesture_is_active (tree_view->priv->multipress_gesture)) node = NULL; - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y, - &bin_x, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, + &bin_x, &bin_y); new_y = MAX (0, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, bin_y)); _gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); @@ -5216,8 +5216,8 @@ gtk_tree_view_snapshot (GtkWidget *widget, gtk_snapshot_pop (snapshot); #if 0 - Thyis clearly does not work. priv->drag_highlight_window is potentially a toplevel... - if (tree_view->priv->drag_highlight_window) + Thyis clearly does not work. priv->drag_highlight_surface is potentially a toplevel... + if (tree_view->priv->drag_highlight_surface) { GdkRGBA color; @@ -5230,8 +5230,8 @@ gtk_tree_view_snapshot (GtkWidget *widget, gdk_cairo_set_source_rgba (cr, &color); cairo_rectangle (cr, 1, 1, - gdk_surface_get_width (tree_view->priv->drag_highlight_window) - 2, - gdk_surface_get_height (tree_view->priv->drag_highlight_window) - 2); + gdk_surface_get_width (tree_view->priv->drag_highlight_surface) - 2, + gdk_surface_get_height (tree_view->priv->drag_highlight_surface) - 2); cairo_stroke (cr); } else @@ -7059,8 +7059,8 @@ drag_scan_timeout (gpointer data) seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (tree_view))); gdk_surface_get_device_position (tree_view->priv->bin_window, - gdk_seat_get_pointer (seat), - &x, &y, &state); + gdk_seat_get_pointer (seat), + &x, &y, &state); gtk_tree_view_get_visible_rect (tree_view, &visible_rect); @@ -7421,8 +7421,8 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view) gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->multipress_gesture), GTK_EVENT_SEQUENCE_DENIED); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y, - &bin_x, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, + &bin_x, &bin_y); gtk_tree_view_get_path_at_pos (tree_view, bin_x, bin_y, &path, NULL, NULL, NULL); @@ -9565,7 +9565,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, button_allocation.y = 0; tree_view->priv->drag_surface = gdk_surface_new_child (gtk_widget_get_surface (GTK_WIDGET (tree_view)), - &button_allocation); + &button_allocation); gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_surface); /* Kids, don't try this at home */ @@ -12740,7 +12740,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, * Finds the path at the point (@x, @y), relative to bin_window coordinates. * That is, @x and @y are relative to an events coordinates. Widget-relative * coordinates must be converted using - * gtk_tree_view_convert_widget_to_bin_surface_coords(). It is primarily for + * gtk_tree_view_convert_widget_to_bin_window_coords(). It is primarily for * things like popup menus. If @path is non-%NULL, then it will be filled * with the #GtkTreePath at that point. This path should be freed with * gtk_tree_path_free(). If @column is non-%NULL, then it will be filled @@ -12752,7 +12752,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, * * For converting widget coordinates (eg. the ones you get from * GtkWidget::query-tooltip), please see - * gtk_tree_view_convert_widget_to_bin_surface_coords(). + * gtk_tree_view_convert_widget_to_bin_window_coords(). * * Returns: %TRUE if a row exists at that coordinate. **/ @@ -13081,7 +13081,7 @@ gtk_tree_view_get_background_area (GtkTreeView *tree_view, * * Fills @visible_rect with the currently-visible region of the * buffer, in tree coordinates. Convert to bin_window coordinates with - * gtk_tree_view_convert_tree_to_bin_surface_coords(). + * gtk_tree_view_convert_tree_to_bin_window_coords(). * Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire * scrollable area of the tree. **/ @@ -13128,9 +13128,9 @@ gtk_tree_view_convert_widget_to_tree_coords (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, - wx, wy, - &x, &y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, + wx, wy, + &x, &y); gtk_tree_view_convert_bin_window_to_tree_coords (tree_view, x, y, tx, ty); @@ -13158,16 +13158,16 @@ gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - gtk_tree_view_convert_tree_to_bin_surface_coords (tree_view, - tx, ty, - &x, &y); + gtk_tree_view_convert_tree_to_bin_window_coords (tree_view, + tx, ty, + &x, &y); gtk_tree_view_convert_bin_window_to_widget_coords (tree_view, x, y, wx, wy); } /** - * gtk_tree_view_convert_widget_to_bin_surface_coords: + * gtk_tree_view_convert_widget_to_bin_window_coords: * @tree_view: a #GtkTreeView * @wx: X coordinate relative to the widget * @wy: Y coordinate relative to the widget @@ -13177,7 +13177,7 @@ gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view, * Converts widget coordinates to coordinates for the bin_window. **/ void -gtk_tree_view_convert_widget_to_bin_surface_coords (GtkTreeView *tree_view, +gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view, gint wx, gint wy, gint *bx, @@ -13217,7 +13217,7 @@ gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view, } /** - * gtk_tree_view_convert_tree_to_bin_surface_coords: + * gtk_tree_view_convert_tree_to_bin_window_coords: * @tree_view: a #GtkTreeView * @tx: tree X coordinate * @ty: tree Y coordinate @@ -13228,7 +13228,7 @@ gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view, * to bin_window coordinates. **/ void -gtk_tree_view_convert_tree_to_bin_surface_coords (GtkTreeView *tree_view, +gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view, gint tx, gint ty, gint *bx, @@ -13352,11 +13352,11 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view, * * The @x and @y coordinate that are provided must be relative to bin_window * coordinates. Widget-relative coordinates must be converted using - * gtk_tree_view_convert_widget_to_bin_surface_coords(). + * gtk_tree_view_convert_widget_to_bin_window_coords(). * * For converting widget coordinates (eg. the ones you get from * GtkWidget::query-tooltip), please see - * gtk_tree_view_convert_widget_to_bin_surface_coords(). + * gtk_tree_view_convert_widget_to_bin_window_coords(). * * The @path, @column, @cell_x and @cell_y arguments will be filled in * likewise as for gtk_tree_view_get_path_at_pos(). Please see @@ -13736,8 +13736,8 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view, * in the bottom fourth, drop after that row; if in the middle, * and the row has children, drop into the row. */ - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, drag_x, drag_y, - &bin_x, &bin_y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, drag_x, drag_y, + &bin_x, &bin_y); if (!gtk_tree_view_get_path_at_pos (tree_view, bin_x, @@ -13856,9 +13856,9 @@ 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_surface (GTK_WIDGET (tree_view)), - CAIRO_CONTENT_COLOR, - bin_window_width + 2, - background_area.height + 2); + CAIRO_CONTENT_COLOR, + bin_window_width + 2, + background_area.height + 2); snapshot = gtk_snapshot_new (NULL, FALSE, NULL, "TreeView DragIcon"); @@ -14269,13 +14269,13 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, GdkDisplay *display; GdkMonitor *monitor; GdkRectangle workarea; - GdkSurface *tree_window = gtk_widget_get_surface (GTK_WIDGET (tree_view)); + GdkSurface *tree_surface = gtk_widget_get_surface (GTK_WIDGET (tree_view)); GtkRequisition requisition; gtk_widget_realize (search_window); display = gtk_widget_get_display (GTK_WIDGET (tree_view)); - monitor = gdk_display_get_monitor_at_surface (display, tree_window); + monitor = gdk_display_get_monitor_at_surface (display, tree_surface); monitor = gdk_display_get_monitor (display, 0); gdk_monitor_get_workarea (monitor, &workarea); @@ -15445,8 +15445,8 @@ gtk_tree_view_get_tooltip_context (GtkTreeView *tree_view, } else { - gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, *x, *y, - x, y); + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, *x, *y, + x, y); if (!gtk_tree_view_get_path_at_pos (tree_view, *x, *y, &tmppath, NULL, NULL, NULL)) diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h index de8f86c4bd..61348106b1 100644 --- a/gtk/gtktreeview.h +++ b/gtk/gtktreeview.h @@ -459,7 +459,7 @@ void gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view, gint *wx, gint *wy); GDK_AVAILABLE_IN_ALL -void gtk_tree_view_convert_widget_to_bin_surface_coords (GtkTreeView *tree_view, +void gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view, gint wx, gint wy, gint *bx, @@ -471,7 +471,7 @@ void gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view, gint *wx, gint *wy); GDK_AVAILABLE_IN_ALL -void gtk_tree_view_convert_tree_to_bin_surface_coords (GtkTreeView *tree_view, +void gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view, gint tx, gint ty, gint *bx, diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 257b0e7b98..b551edb018 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -6977,11 +6977,11 @@ gtk_widget_is_visible (GtkWidget *widget) /** * gtk_widget_set_has_surface: * @widget: a #GtkWidget - * @has_surface: whether or not @widget has a window. + * @has_surface: whether or not @widget has a surface. * * Specifies whether @widget has a #GdkSurface of its own. Note that * all realized widgets have a non-%NULL “window” pointer - * (gtk_widget_get_surface() never returns a %NULL window when a widget + * (gtk_widget_get_surface() never returns a %NULL surface 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 @@ -7011,7 +7011,7 @@ gtk_widget_set_has_surface (GtkWidget *widget, * Determines whether @widget has a #GdkSurface of its own. See * gtk_widget_set_has_surface(). * - * Returns: %TRUE if @widget has a window, %FALSE otherwise + * Returns: %TRUE if @widget has a surface, %FALSE otherwise **/ gboolean gtk_widget_get_has_surface (GtkWidget *widget) @@ -9296,30 +9296,30 @@ gtk_widget_adjust_baseline_request (GtkWidget *widget, } static gboolean -is_my_window (GtkWidget *widget, - GdkSurface *window) +is_my_surface (GtkWidget *widget, + GdkSurface *surface) { gpointer user_data; - if (!window) + if (!surface) return FALSE; - gdk_surface_get_user_data (window, &user_data); + gdk_surface_get_user_data (surface, &user_data); return (user_data == widget); } /* - * _gtk_widget_get_device_window: + * _gtk_widget_get_device_surface: * @widget: a #GtkWidget * @device: a #GdkDevice * - * Returns: (nullable): the window of @widget that @device is in, or %NULL + * Returns: (nullable): the surface of @widget that @device is in, or %NULL */ GdkSurface * -_gtk_widget_get_device_window (GtkWidget *widget, - GdkDevice *device) +_gtk_widget_get_device_surface (GtkWidget *widget, + GdkDevice *device) { - GdkSurface *window; + GdkSurface *surface; g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); @@ -9327,9 +9327,9 @@ _gtk_widget_get_device_window (GtkWidget *widget, if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) return NULL; - window = gdk_device_get_last_event_surface (device); - if (window && is_my_window (widget, window)) - return window; + surface = gdk_device_get_last_event_surface (device); + if (surface && is_my_surface (widget, surface)) + return surface; else return NULL; } @@ -9339,7 +9339,7 @@ _gtk_widget_get_device_window (GtkWidget *widget, * @widget: a #GtkWidget * * Returns the list of pointer #GdkDevices that are currently - * on top of any window belonging to @widget. Free the list + * on top of any surface belonging to @widget. Free the list * with g_list_free(), the elements are owned by GTK+ and must * not be freed. */ @@ -9359,14 +9359,14 @@ _gtk_widget_list_devices (GtkWidget *widget) seat = gdk_display_get_default_seat (gtk_widget_get_display (widget)); device = gdk_seat_get_pointer (seat); - if (is_my_window (widget, gdk_device_get_last_event_surface (device))) + if (is_my_surface (widget, gdk_device_get_last_event_surface (device))) result = g_list_prepend (result, device); devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL_POINTING); for (l = devices; l; l = l->next) { device = l->data; - if (is_my_window (widget, gdk_device_get_last_event_surface (device))) + if (is_my_surface (widget, gdk_device_get_last_event_surface (device))) result = g_list_prepend (result, device); } g_list_free (devices); @@ -9450,32 +9450,32 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, GdkDevice *device, GdkCrossingMode mode) { - GdkSurface *from_window = NULL, *to_window = NULL; + GdkSurface *from_surface = NULL, *to_surface = NULL; g_return_if_fail (from != NULL || to != NULL); if (from != NULL) { - from_window = _gtk_widget_get_device_window (from, device); + from_surface = _gtk_widget_get_device_surface (from, device); - if (!from_window) - from_window = from->priv->surface; + if (!from_surface) + from_surface = from->priv->surface; } if (to != NULL) { - to_window = _gtk_widget_get_device_window (to, device); + to_surface = _gtk_widget_get_device_surface (to, device); - if (!to_window) - to_window = to->priv->surface; + if (!to_surface) + to_surface = to->priv->surface; } - if (from_window == NULL && to_window == NULL) + if (from_surface == NULL && to_surface == NULL) ; - else if (from_window != NULL && to_window == NULL) + else if (from_surface != NULL && to_surface == NULL) { GList *from_ancestors = NULL, *list; - GdkSurface *from_ancestor = from_window; + GdkSurface *from_ancestor = from_surface; while (from_ancestor != NULL) { @@ -9485,7 +9485,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, from_ancestors = g_list_prepend (from_ancestors, from_ancestor); } - synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, + synth_crossing (from, GDK_LEAVE_NOTIFY, from_surface, device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { @@ -9497,10 +9497,10 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, g_list_free (from_ancestors); } - else if (from_window == NULL && to_window != NULL) + else if (from_surface == NULL && to_surface != NULL) { GList *to_ancestors = NULL, *list; - GdkSurface *to_ancestor = to_window; + GdkSurface *to_ancestor = to_surface; while (to_ancestor != NULL) { @@ -9517,24 +9517,24 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); } - synth_crossing (to, GDK_ENTER_NOTIFY, to_window, + synth_crossing (to, GDK_ENTER_NOTIFY, to_surface, device, mode, GDK_NOTIFY_ANCESTOR); g_list_free (to_ancestors); } - else if (from_window == to_window) + else if (from_surface == to_surface) ; else { GList *from_ancestors = NULL, *to_ancestors = NULL, *list; - GdkSurface *from_ancestor = from_window, *to_ancestor = to_window; + GdkSurface *from_ancestor = from_surface, *to_ancestor = to_surface; while (from_ancestor != NULL || to_ancestor != NULL) { if (from_ancestor != NULL) { from_ancestor = gdk_surface_get_parent (from_ancestor); - if (from_ancestor == to_window) + if (from_ancestor == to_surface) break; if (from_ancestor) from_ancestors = g_list_prepend (from_ancestors, from_ancestor); @@ -9542,26 +9542,26 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, if (to_ancestor != NULL) { to_ancestor = gdk_surface_get_parent (to_ancestor); - if (to_ancestor == from_window) + if (to_ancestor == from_surface) break; if (to_ancestor) to_ancestors = g_list_prepend (to_ancestors, to_ancestor); } } - if (to_ancestor == from_window) + if (to_ancestor == from_surface) { if (mode != GDK_CROSSING_GTK_UNGRAB) - synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, + synth_crossing (from, GDK_LEAVE_NOTIFY, from_surface, device, mode, GDK_NOTIFY_INFERIOR); for (list = to_ancestors; list; list = list->next) synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); - synth_crossing (to, GDK_ENTER_NOTIFY, to_window, + synth_crossing (to, GDK_ENTER_NOTIFY, to_surface, device, mode, GDK_NOTIFY_ANCESTOR); } - else if (from_ancestor == to_window) + else if (from_ancestor == to_surface) { - synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, + synth_crossing (from, GDK_LEAVE_NOTIFY, from_surface, device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { @@ -9569,7 +9569,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, device, mode, GDK_NOTIFY_VIRTUAL); } if (mode != GDK_CROSSING_GTK_GRAB) - synth_crossing (to, GDK_ENTER_NOTIFY, to_window, + synth_crossing (to, GDK_ENTER_NOTIFY, to_surface, device, mode, GDK_NOTIFY_INFERIOR); } else @@ -9582,7 +9582,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, to_ancestors = g_list_delete_link (to_ancestors, to_ancestors); } - synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, + synth_crossing (from, GDK_LEAVE_NOTIFY, from_surface, device, mode, GDK_NOTIFY_NONLINEAR); for (list = g_list_last (from_ancestors); list; list = list->prev) @@ -9595,7 +9595,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); } - synth_crossing (to, GDK_ENTER_NOTIFY, to_window, + synth_crossing (to, GDK_ENTER_NOTIFY, to_surface, device, mode, GDK_NOTIFY_NONLINEAR); } g_list_free (from_ancestors); @@ -9656,17 +9656,17 @@ gtk_widget_propagate_state (GtkWidget *widget, for (d = devices; d; d = d->next) { - GdkSurface *window; + GdkSurface *surface; GdkDevice *device; device = d->data; - window = _gtk_widget_get_device_window (widget, device); + surface = _gtk_widget_get_device_surface (widget, device); /* Do not propagate more than once to the - * same window if non-multidevice aware. + * same surface if non-multidevice aware. */ - if (!gdk_surface_get_support_multidevice (window) && - g_list_find (event_surfaces, window)) + if (!gdk_surface_get_support_multidevice (surface) && + g_list_find (event_surfaces, surface)) continue; if (!gtk_widget_is_sensitive (widget)) @@ -9676,7 +9676,7 @@ gtk_widget_propagate_state (GtkWidget *widget, _gtk_widget_synthesize_crossing (NULL, widget, d->data, GDK_CROSSING_STATE_CHANGED); - event_surfaces = g_list_prepend (event_surfaces, window); + event_surfaces = g_list_prepend (event_surfaces, surface); } g_list_free (event_surfaces); @@ -12133,7 +12133,7 @@ gtk_widget_set_surface (GtkWidget *widget, */ void gtk_widget_register_surface (GtkWidget *widget, - GdkSurface *surface) + GdkSurface *surface) { GtkWidgetPrivate *priv; gpointer user_data; @@ -12161,7 +12161,7 @@ gtk_widget_register_surface (GtkWidget *widget, */ void gtk_widget_unregister_surface (GtkWidget *widget, - GdkSurface *surface) + GdkSurface *surface) { GtkWidgetPrivate *priv; gpointer user_data; @@ -12354,9 +12354,9 @@ 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_surface (widget); - * if (fevent->focus_change.window != NULL) - * g_object_ref (fevent->focus_change.window); + * fevent->focus_change.surface = _gtk_widget_get_surface (widget); + * if (fevent->focus_change.surface != NULL) + * g_object_ref (fevent->focus_change.surface); * * gtk_widget_send_focus_change (widget, fevent); * diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index dbe9ded71d..0c50bb2ca8 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -217,10 +217,10 @@ void _gtk_widget_grab_notify (GtkWidget *widget, void _gtk_widget_propagate_display_changed (GtkWidget *widget, GdkDisplay *previous_display); -void _gtk_widget_set_device_window (GtkWidget *widget, +void _gtk_widget_set_device_surface (GtkWidget *widget, GdkDevice *device, GdkSurface *pointer_window); -GdkSurface * _gtk_widget_get_device_window (GtkWidget *widget, +GdkSurface * _gtk_widget_get_device_surface (GtkWidget *widget, GdkDevice *device); GList * _gtk_widget_list_devices (GtkWidget *widget); @@ -315,7 +315,7 @@ void gtk_widget_get_own_allocation (GtkWidget *wi GtkAllocation *allocation); void gtk_widget_get_surface_allocation (GtkWidget *widget, - GtkAllocation *allocation); + GtkAllocation *allocation); GtkWidget * gtk_widget_common_ancestor (GtkWidget *widget_a, diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b68e4f9090..c5ef1ec4f3 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -280,7 +280,7 @@ struct _GtkWindowPrivate GtkGesture *multipress_gesture; GtkGesture *drag_gesture; - GdkSurface *hardcoded_window; + GdkSurface *hardcoded_surface; GtkCssNode *decoration_node; @@ -439,7 +439,7 @@ static gint gtk_window_key_release_event (GtkWidget *widget, GdkEventKey *event); static void gtk_window_focus_in (GtkWidget *widget); static void gtk_window_focus_out (GtkWidget *widget); -static void surface_state_changed (GtkWidget *widget); +static void surface_state_changed (GtkWidget *widget); static void gtk_window_remove (GtkContainer *container, GtkWidget *widget); static void gtk_window_check_resize (GtkContainer *container); @@ -526,7 +526,7 @@ static void gtk_window_do_popup (GtkWindow *window, GdkEventButton *event); static void gtk_window_style_updated (GtkWidget *widget); static void gtk_surface_state_flags_changed (GtkWidget *widget, - GtkStateFlags previous_state); + GtkStateFlags previous_state); static GSList *toplevel_list = NULL; static guint window_signals[LAST_SIGNAL] = { 0 }; @@ -1525,11 +1525,11 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, gdk_event_get_root_coords (event, &x_root, &y_root); gdk_surface_begin_resize_drag_for_device (_gtk_widget_get_surface (widget), - (GdkSurfaceEdge) region, - gdk_event_get_device ((GdkEvent *) event), - GDK_BUTTON_PRIMARY, - x_root, y_root, - gdk_event_get_time (event)); + (GdkSurfaceEdge) region, + gdk_event_get_device ((GdkEvent *) event), + GDK_BUTTON_PRIMARY, + x_root, y_root, + gdk_event_get_time (event)); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->drag_gesture)); @@ -1633,13 +1633,13 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y); gdk_surface_get_root_coords (_gtk_widget_get_surface (GTK_WIDGET (window)), - start_x, start_y, &x_root, &y_root); + start_x, start_y, &x_root, &y_root); 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, - gtk_get_current_event_time ()); + gtk_gesture_get_device (GTK_GESTURE (gesture)), + gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)), + x_root, y_root, + gtk_get_current_event_time ()); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->multipress_gesture)); @@ -2684,14 +2684,14 @@ gtk_window_set_startup_id (GtkWindow *window, if (_gtk_widget_get_realized (widget)) { - GdkSurface *gdk_surface; + GdkSurface *surface; guint32 timestamp = extract_time_from_startup_id (priv->startup_id); - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); #ifdef GDK_WINDOWING_X11 - if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE(gdk_surface)) - gdk_x11_surface_set_user_time (gdk_surface, timestamp); + if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE(surface)) + gdk_x11_surface_set_user_time (surface, timestamp); #endif /* Here we differentiate real and "fake" startup notification IDs, @@ -2701,7 +2701,7 @@ gtk_window_set_startup_id (GtkWindow *window, gtk_window_present_with_time (window, timestamp); else { - gdk_surface_set_startup_id (gdk_surface, priv->startup_id); + gdk_surface_set_startup_id (surface, priv->startup_id); /* If window is mapped, terminate the startup-notification too */ if (_gtk_widget_get_mapped (widget) && !disable_startup_notification) @@ -3695,7 +3695,7 @@ gtk_window_set_type_hint (GtkWindow *window, GdkSurfaceTypeHint hint) { GtkWindowPrivate *priv; - GdkSurface *gdk_surface; + GdkSurface *surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -3706,9 +3706,9 @@ gtk_window_set_type_hint (GtkWindow *window, priv->type_hint = hint; - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (gdk_surface) - gdk_surface_set_type_hint (gdk_surface, hint); + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + if (surface) + gdk_surface_set_type_hint (surface, hint); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_TYPE_HINT]); @@ -4291,7 +4291,7 @@ gtk_window_set_decorated (GtkWindow *window, gboolean setting) { GtkWindowPrivate *priv; - GdkSurface *gdk_surface; + GdkSurface *surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -4304,18 +4304,18 @@ gtk_window_set_decorated (GtkWindow *window, priv->decorated = setting; - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (gdk_surface) + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + if (surface) { if (priv->decorated) { if (priv->client_decorated) - gdk_surface_set_decorations (gdk_surface, 0); + gdk_surface_set_decorations (surface, 0); else - gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL); + gdk_surface_set_decorations (surface, GDK_DECOR_ALL); } else - gdk_surface_set_decorations (gdk_surface, 0); + gdk_surface_set_decorations (surface, 0); } update_window_buttons (window); @@ -4362,7 +4362,7 @@ gtk_window_set_deletable (GtkWindow *window, gboolean setting) { GtkWindowPrivate *priv; - GdkSurface *gdk_surface; + GdkSurface *surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -4375,14 +4375,14 @@ gtk_window_set_deletable (GtkWindow *window, priv->deletable = setting; - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (gdk_surface) + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + if (surface) { if (priv->deletable) - gdk_surface_set_functions (gdk_surface, + gdk_surface_set_functions (surface, GDK_FUNC_ALL); else - gdk_surface_set_functions (gdk_surface, + gdk_surface_set_functions (surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE); } @@ -4494,13 +4494,13 @@ gtk_window_realize_icon (GtkWindow *window) GtkWindowPrivate *priv = window->priv; GtkWidget *widget; GtkWindowIconInfo *info; - GdkSurface *gdk_surface; + GdkSurface *surface; GList *icon_list; widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); - g_return_if_fail (gdk_surface != NULL); + g_return_if_fail (surface != NULL); /* no point setting an icon on override-redirect */ if (priv->type == GTK_WINDOW_POPUP) @@ -4553,7 +4553,7 @@ gtk_window_realize_icon (GtkWindow *window) info->realized = TRUE; - gdk_surface_set_icon_list (gdk_surface, icon_list); + gdk_surface_set_icon_list (surface, icon_list); if (GTK_IS_HEADER_BAR (priv->title_box)) _gtk_header_bar_update_window_icon (GTK_HEADER_BAR (priv->title_box), window); @@ -5734,13 +5734,13 @@ gtk_window_get_position (GtkWindow *window, { GtkWindowPrivate *priv; GtkWidget *widget; - GdkSurface *gdk_surface; + GdkSurface *surface; g_return_if_fail (GTK_IS_WINDOW (window)); priv = window->priv; widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); if (priv->gravity == GDK_GRAVITY_STATIC) { @@ -5753,7 +5753,7 @@ gtk_window_get_position (GtkWindow *window, * do. We should likely be consistent about whether we get * the client-side info or the server-side info. */ - gdk_surface_get_origin (gdk_surface, root_x, root_y); + gdk_surface_get_origin (surface, root_x, root_y); } else { @@ -5777,7 +5777,7 @@ gtk_window_get_position (GtkWindow *window, if (_gtk_widget_get_mapped (widget)) { - gdk_surface_get_frame_extents (gdk_surface, &frame_extents); + gdk_surface_get_frame_extents (surface, &frame_extents); x = frame_extents.x; y = frame_extents.y; gtk_window_get_size (window, &w, &h); @@ -6175,7 +6175,7 @@ gtk_window_map (GtkWidget *widget) GtkWidget *child; GtkWindow *window = GTK_WINDOW (widget); GtkWindowPrivate *priv = window->priv; - GdkSurface *gdk_surface; + GdkSurface *surface; if (!_gtk_widget_is_toplevel (widget)) { @@ -6194,36 +6194,36 @@ gtk_window_map (GtkWidget *widget) gtk_widget_get_child_visible (priv->title_box)) gtk_widget_map (priv->title_box); - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); if (priv->maximize_initially) - gdk_surface_maximize (gdk_surface); + gdk_surface_maximize (surface); else - gdk_surface_unmaximize (gdk_surface); + gdk_surface_unmaximize (surface); if (priv->stick_initially) - gdk_surface_stick (gdk_surface); + gdk_surface_stick (surface); else - gdk_surface_unstick (gdk_surface); + gdk_surface_unstick (surface); if (priv->iconify_initially) - gdk_surface_iconify (gdk_surface); + gdk_surface_iconify (surface); else - gdk_surface_deiconify (gdk_surface); + gdk_surface_deiconify (surface); if (priv->fullscreen_initially) { if (priv->initial_fullscreen_monitor) - gdk_surface_fullscreen_on_monitor (gdk_surface, priv->initial_fullscreen_monitor); + gdk_surface_fullscreen_on_monitor (surface, priv->initial_fullscreen_monitor); else - gdk_surface_fullscreen (gdk_surface); + gdk_surface_fullscreen (surface); } else - gdk_surface_unfullscreen (gdk_surface); + gdk_surface_unfullscreen (surface); - gdk_surface_set_keep_above (gdk_surface, priv->above_initially); + gdk_surface_set_keep_above (surface, priv->above_initially); - gdk_surface_set_keep_below (gdk_surface, priv->below_initially); + gdk_surface_set_keep_below (surface, priv->below_initially); if (priv->type == GTK_WINDOW_TOPLEVEL) gtk_window_set_theme_variant (window); @@ -6232,7 +6232,7 @@ gtk_window_map (GtkWidget *widget) priv->need_default_size = FALSE; priv->need_default_position = FALSE; - gdk_surface_show (gdk_surface); + gdk_surface_show (surface); if (!disable_startup_notification && priv->type != GTK_WINDOW_POPUP) @@ -6276,7 +6276,7 @@ gtk_window_unmap (GtkWidget *widget) GtkWindowPrivate *priv = window->priv; GtkWidget *child; GtkWindowGeometryInfo *info; - GdkSurface *gdk_surface; + GdkSurface *surface; GdkSurfaceState state; if (!_gtk_widget_is_toplevel (GTK_WIDGET (widget))) @@ -6285,10 +6285,10 @@ gtk_window_unmap (GtkWidget *widget) return; } - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget); - gdk_surface_withdraw (gdk_surface); + gdk_surface_withdraw (surface); while (priv->configure_request_count > 0) { @@ -6310,7 +6310,7 @@ gtk_window_unmap (GtkWidget *widget) info->position_constraints_changed = FALSE; } - state = gdk_surface_get_state (gdk_surface); + state = gdk_surface_get_state (surface); priv->iconify_initially = (state & GDK_SURFACE_STATE_ICONIFIED) != 0; priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0; priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0; @@ -6347,17 +6347,17 @@ gtk_window_guess_default_size (GtkWindow *window, { GtkWidget *widget; GdkDisplay *display; - GdkSurface *gdkwindow; + GdkSurface *surface; GdkMonitor *monitor; GdkRectangle workarea; int minimum, natural; widget = GTK_WIDGET (window); display = gtk_widget_get_display (widget); - gdkwindow = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); - if (gdkwindow) - monitor = gdk_display_get_monitor_at_surface (display, gdkwindow); + if (surface) + monitor = gdk_display_get_monitor_at_surface (display, surface); else monitor = gdk_display_get_monitor (display, 0); @@ -6400,16 +6400,16 @@ gtk_window_get_remembered_size (GtkWindow *window, int *height) { GtkWindowGeometryInfo *info; - GdkSurface *gdk_surface; + GdkSurface *surface; *width = 0; *height = 0; - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (gdk_surface) + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + if (surface) { - *width = gdk_surface_get_width (gdk_surface); - *height = gdk_surface_get_height (gdk_surface); + *width = gdk_surface_get_width (surface); + *height = gdk_surface_get_height (surface); return; } @@ -6674,16 +6674,16 @@ static void update_shadow_width (GtkWindow *window, GtkBorder *border) { - GdkSurface *gdk_surface; + GdkSurface *surface; - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (gdk_surface) - gdk_surface_set_shadow_width (gdk_surface, - border->left, - border->right, - border->top, - border->bottom); + if (surface) + gdk_surface_set_shadow_width (surface, + border->left, + border->right, + border->top, + border->bottom); } static void @@ -6793,7 +6793,7 @@ gtk_window_realize (GtkWidget *widget) GtkAllocation allocation; GtkAllocation child_allocation; GtkWindow *window; - GdkSurface *gdk_surface; + GdkSurface *surface; GtkBorder window_border; GtkWindowPrivate *priv; @@ -6827,11 +6827,11 @@ gtk_window_realize (GtkWidget *widget) g_return_if_fail (!_gtk_widget_get_realized (widget)); } - if (priv->hardcoded_window) + if (priv->hardcoded_surface) { - gdk_surface = priv->hardcoded_window; + surface = priv->hardcoded_surface; _gtk_widget_get_allocation (widget, &allocation); - gdk_surface_resize (gdk_surface, allocation.width, allocation.height); + gdk_surface_resize (surface, allocation.width, allocation.height); } else { @@ -6840,23 +6840,23 @@ gtk_window_realize (GtkWidget *widget) switch (priv->type) { case GTK_WINDOW_TOPLEVEL: - gdk_surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget), - allocation.width, - allocation.height); + surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget), + allocation.width, + allocation.height); break; case GTK_WINDOW_POPUP: #ifdef GDK_WINDOWING_WAYLAND if (priv->use_subsurface && GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget))) { - gdk_surface = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (widget), - &allocation); + surface = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (widget), + &allocation); } else #endif { - gdk_surface = gdk_surface_new_popup (gtk_widget_get_display (widget), - &allocation); + surface = gdk_surface_new_popup (gtk_widget_get_display (widget), + &allocation); } break; default: @@ -6865,78 +6865,78 @@ gtk_window_realize (GtkWidget *widget) } } - gtk_widget_set_surface (widget, gdk_surface); - g_signal_connect_swapped (gdk_surface, "notify::state", G_CALLBACK (surface_state_changed), widget); - gtk_widget_register_surface (widget, gdk_surface); + gtk_widget_set_surface (widget, surface); + g_signal_connect_swapped (surface, "notify::state", G_CALLBACK (surface_state_changed), widget); + gtk_widget_register_surface (widget, surface); gtk_widget_set_realized (widget, TRUE); if (priv->renderer == NULL) - priv->renderer = gsk_renderer_new_for_surface (gdk_surface); + priv->renderer = gsk_renderer_new_for_surface (surface); if (priv->transient_parent && _gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent))) - gdk_surface_set_transient_for (gdk_surface, - _gtk_widget_get_surface (GTK_WIDGET (priv->transient_parent))); + gdk_surface_set_transient_for (surface, + _gtk_widget_get_surface (GTK_WIDGET (priv->transient_parent))); - gdk_surface_set_type_hint (gdk_surface, priv->type_hint); + gdk_surface_set_type_hint (surface, priv->type_hint); if (priv->title) - gdk_surface_set_title (gdk_surface, priv->title); + gdk_surface_set_title (surface, priv->title); if (priv->wm_role) - gdk_surface_set_role (gdk_surface, priv->wm_role); + gdk_surface_set_role (surface, priv->wm_role); if (!priv->decorated || priv->client_decorated) - gdk_surface_set_decorations (gdk_surface, 0); + gdk_surface_set_decorations (surface, 0); #ifdef GDK_WINDOWING_WAYLAND - if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (gdk_surface)) - gdk_wayland_surface_announce_csd (gdk_surface); + if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (surface)) + gdk_wayland_surface_announce_csd (surface); #endif if (!priv->deletable) - gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE); + gdk_surface_set_functions (surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE); if (gtk_window_get_skip_pager_hint (window)) - gdk_surface_set_skip_pager_hint (gdk_surface, TRUE); + gdk_surface_set_skip_pager_hint (surface, TRUE); if (gtk_window_get_skip_taskbar_hint (window)) - gdk_surface_set_skip_taskbar_hint (gdk_surface, TRUE); + gdk_surface_set_skip_taskbar_hint (surface, TRUE); if (gtk_window_get_accept_focus (window)) - gdk_surface_set_accept_focus (gdk_surface, TRUE); + gdk_surface_set_accept_focus (surface, TRUE); else - gdk_surface_set_accept_focus (gdk_surface, FALSE); + gdk_surface_set_accept_focus (surface, FALSE); if (gtk_window_get_focus_on_map (window)) - gdk_surface_set_focus_on_map (gdk_surface, TRUE); + gdk_surface_set_focus_on_map (surface, TRUE); else - gdk_surface_set_focus_on_map (gdk_surface, FALSE); + gdk_surface_set_focus_on_map (surface, FALSE); if (priv->modal) - gdk_surface_set_modal_hint (gdk_surface, TRUE); + gdk_surface_set_modal_hint (surface, TRUE); else - gdk_surface_set_modal_hint (gdk_surface, FALSE); + gdk_surface_set_modal_hint (surface, FALSE); if (priv->startup_id) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_SURFACE (gdk_surface)) + if (GDK_IS_X11_SURFACE (surface)) { guint32 timestamp = extract_time_from_startup_id (priv->startup_id); if (timestamp != GDK_CURRENT_TIME) - gdk_x11_surface_set_user_time (gdk_surface, timestamp); + gdk_x11_surface_set_user_time (surface, timestamp); } #endif if (!startup_id_is_fake (priv->startup_id)) - gdk_surface_set_startup_id (gdk_surface, priv->startup_id); + gdk_surface_set_startup_id (surface, priv->startup_id); } #ifdef GDK_WINDOWING_X11 if (priv->initial_timestamp != GDK_CURRENT_TIME) { - if (GDK_IS_X11_SURFACE (gdk_surface)) - gdk_x11_surface_set_user_time (gdk_surface, priv->initial_timestamp); + if (GDK_IS_X11_SURFACE (surface)) + gdk_x11_surface_set_user_time (surface, priv->initial_timestamp); } #endif @@ -7007,7 +7007,7 @@ gtk_window_unrealize (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget); - priv->hardcoded_window = NULL; + priv->hardcoded_surface = NULL; } static void @@ -7163,8 +7163,8 @@ _gtk_window_set_allocation (GtkWindow *window, if (!_gtk_widget_is_toplevel (widget) && _gtk_widget_get_realized (widget)) { gdk_surface_move_resize (_gtk_widget_get_surface (widget), - allocation->x, allocation->y, - allocation->width, allocation->height); + allocation->x, allocation->y, + allocation->width, allocation->height); } *allocation_out = child_allocation; @@ -7652,23 +7652,23 @@ do_focus_change (GtkWidget *widget, { GdkDevice *dev = d->data; GdkEvent *fevent; - GdkSurface *window; + GdkSurface *surface; /* Skip non-master keyboards that haven't - * selected for events from this window + * selected for events from this surface */ - window = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && - window && !gdk_surface_get_device_events (window, dev)) + surface && !gdk_surface_get_device_events (surface, dev)) continue; fevent = gdk_event_new (GDK_FOCUS_CHANGE); gdk_event_set_display (fevent, gtk_widget_get_display (widget)); fevent->any.type = GDK_FOCUS_CHANGE; - fevent->any.surface = window; - if (window) - g_object_ref (window); + fevent->any.surface = surface; + if (surface) + g_object_ref (surface); fevent->focus_change.in = in; gdk_event_set_device (fevent, dev); @@ -7992,7 +7992,7 @@ gtk_window_real_set_focus (GtkWindow *window, static void gtk_surface_state_flags_changed (GtkWidget *widget, - GtkStateFlags previous_state) + GtkStateFlags previous_state) { GtkWindow *window = GTK_WINDOW (widget); GtkWindowPrivate *priv = window->priv; @@ -8070,14 +8070,14 @@ static GdkSurfaceState gtk_window_get_state (GtkWindow *window) { GdkSurfaceState state; - GdkSurface *gdk_surface; + GdkSurface *surface; - gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window)); + surface = gtk_widget_get_surface (GTK_WIDGET (window)); state = 0; - if (gdk_surface) - state = gdk_surface_get_state (gdk_surface); + if (surface) + state = gdk_surface_get_state (surface); return state; } @@ -8285,7 +8285,7 @@ gtk_window_do_popup (GtkWindow *window, GdkEventButton *event) { if (!gdk_surface_show_window_menu (_gtk_widget_get_surface (GTK_WIDGET (window)), - (GdkEvent *) event)) + (GdkEvent *) event)) gtk_window_do_popup_fallback (window, event); } @@ -8535,17 +8535,17 @@ gtk_window_compute_configure_request (GtkWindow *window, case GTK_WIN_POS_CENTER_ON_PARENT: { GtkAllocation allocation; - GdkSurface *gdk_surface; + GdkSurface *surface; GdkMonitor *monitor; GdkRectangle area; gint ox, oy; g_assert (_gtk_widget_get_mapped (parent_widget)); /* established earlier */ - gdk_surface = _gtk_widget_get_surface (parent_widget); - monitor = gdk_display_get_monitor_at_surface (priv->display, gdk_surface); + surface = _gtk_widget_get_surface (parent_widget); + monitor = gdk_display_get_monitor_at_surface (priv->display, surface); - gdk_surface_get_origin (gdk_surface, &ox, &oy); + gdk_surface_get_origin (surface, &ox, &oy); _gtk_widget_get_allocation (parent_widget, &allocation); x = ox + (allocation.width - w) / 2; @@ -8672,7 +8672,7 @@ gtk_window_move_resize (GtkWindow *window) GtkWidget *widget; GtkWindowGeometryInfo *info; GdkGeometry new_geometry; - GdkSurface *gdk_surface; + GdkSurface *surface; guint new_flags; GdkRectangle new_request; gboolean configure_request_size_changed; @@ -8683,7 +8683,7 @@ gtk_window_move_resize (GtkWindow *window) widget = GTK_WIDGET (window); - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); info = gtk_window_get_geometry_info (window, TRUE); configure_request_size_changed = FALSE; @@ -8851,12 +8851,12 @@ gtk_window_move_resize (GtkWindow *window) /* Set hints if necessary */ if (hints_changed) - gdk_surface_set_geometry_hints (gdk_surface, - &new_geometry, - new_flags); + gdk_surface_set_geometry_hints (surface, + &new_geometry, + new_flags); - current_width = gdk_surface_get_width (gdk_surface); - current_height = gdk_surface_get_height (gdk_surface); + current_width = gdk_surface_get_width (surface); + current_height = gdk_surface_get_height (surface); /* handle resizing/moving and widget tree allocation */ @@ -8952,14 +8952,14 @@ gtk_window_move_resize (GtkWindow *window) /* Now send the configure request */ if (configure_request_pos_changed) { - gdk_surface_move_resize (gdk_surface, - new_request.x, new_request.y, - new_request.width, new_request.height); + gdk_surface_move_resize (surface, + new_request.x, new_request.y, + new_request.width, new_request.height); } else /* only size changed */ { - gdk_surface_resize (gdk_surface, - new_request.width, new_request.height); + gdk_surface_resize (surface, + new_request.width, new_request.height); } if (priv->type == GTK_WINDOW_POPUP) @@ -8980,7 +8980,7 @@ gtk_window_move_resize (GtkWindow *window) /* Increment the number of have-not-yet-received-notify requests */ priv->configure_request_count += 1; - gdk_surface_freeze_toplevel_updates (gdk_surface); + gdk_surface_freeze_toplevel_updates (surface); /* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new * configure event in response to our resizing request. @@ -9008,8 +9008,8 @@ gtk_window_move_resize (GtkWindow *window) */ if (configure_request_pos_changed) { - gdk_surface_move (gdk_surface, - new_request.x, new_request.y); + gdk_surface_move (surface, + new_request.x, new_request.y); } gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, current_height, @@ -9101,7 +9101,7 @@ gtk_window_constrain_size (GtkWindow *window, geometry_flags = flags; gdk_surface_constrain_size (geometry, geometry_flags, width, height, - new_width, new_height); + new_width, new_height); } /* For non-resizable windows, make sure the given width/height fits @@ -9354,7 +9354,7 @@ gtk_window_present_with_time (GtkWindow *window, { GtkWindowPrivate *priv; GtkWidget *widget; - GdkSurface *gdk_surface; + GdkSurface *surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9363,17 +9363,17 @@ gtk_window_present_with_time (GtkWindow *window, if (gtk_widget_get_visible (widget)) { - gdk_surface = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); - g_assert (gdk_surface != NULL); + g_assert (surface != NULL); - gdk_surface_show (gdk_surface); + gdk_surface_show (surface); /* Translate a timestamp of GDK_CURRENT_TIME appropriately */ if (timestamp == GDK_CURRENT_TIME) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_SURFACE(gdk_surface)) + if (GDK_IS_X11_SURFACE(surface)) { GdkDisplay *display; @@ -9385,7 +9385,7 @@ gtk_window_present_with_time (GtkWindow *window, timestamp = gtk_get_current_event_time (); } - gdk_surface_focus (gdk_surface, timestamp); + gdk_surface_focus (surface, timestamp); } else { @@ -10017,17 +10017,17 @@ static void gtk_window_set_theme_variant (GtkWindow *window) { #ifdef GDK_WINDOWING_X11 - GdkSurface *gdk_surface; + GdkSurface *surface; gboolean dark_theme_requested; g_object_get (gtk_settings_get_for_display (window->priv->display), "gtk-application-prefer-dark-theme", &dark_theme_requested, NULL); - gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window)); + surface = _gtk_widget_get_surface (GTK_WIDGET (window)); - if (GDK_IS_X11_SURFACE (gdk_surface)) - gdk_x11_surface_set_theme_variant (gdk_surface, + if (GDK_IS_X11_SURFACE (surface)) + gdk_x11_surface_set_theme_variant (surface, dark_theme_requested ? "dark" : NULL); #endif } @@ -10655,14 +10655,14 @@ gtk_window_set_has_user_ref_count (GtkWindow *window, static void ensure_state_flag_backdrop (GtkWidget *widget) { - GdkSurface *window; - gboolean window_focused = TRUE; + GdkSurface *surface; + gboolean surface_focused = TRUE; - window = _gtk_widget_get_surface (widget); + surface = _gtk_widget_get_surface (widget); - window_focused = gdk_surface_get_state (window) & GDK_SURFACE_STATE_FOCUSED; + surface_focused = gdk_surface_get_state (surface) & GDK_SURFACE_STATE_FOCUSED; - if (!window_focused) + if (!surface_focused) gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE); else gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP); @@ -11073,15 +11073,15 @@ gtk_window_set_use_subsurface (GtkWindow *window, } void -gtk_window_set_hardcoded_window (GtkWindow *window, - GdkSurface *gdk_surface) +gtk_window_set_hardcoded_surface (GtkWindow *window, + GdkSurface *surface) { GtkWindowPrivate *priv = window->priv; g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (!_gtk_widget_get_realized (GTK_WIDGET (window))); - g_set_object (&priv->hardcoded_window, gdk_surface); + g_set_object (&priv->hardcoded_surface, surface); } #ifdef GDK_WINDOWING_WAYLAND @@ -11093,8 +11093,8 @@ typedef struct { static void wayland_surface_handle_exported (GdkSurface *window, - const char *wayland_handle_str, - gpointer user_data) + const char *wayland_handle_str, + gpointer user_data) { WaylandSurfaceHandleExportedData *data = user_data; char *handle_str; @@ -11114,9 +11114,9 @@ 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_surface (GTK_WIDGET (window)); + GdkSurface *surface = gtk_widget_get_surface (GTK_WIDGET (window)); char *handle_str; - guint32 xid = (guint32) gdk_x11_surface_get_xid (gdk_surface); + guint32 xid = (guint32) gdk_x11_surface_get_xid (surface); handle_str = g_strdup_printf ("x11:%x", xid); callback (window, handle_str, user_data); @@ -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_surface (GTK_WIDGET (window)); + GdkSurface *surface = gtk_widget_get_surface (GTK_WIDGET (window)); WaylandSurfaceHandleExportedData *data; data = g_new0 (WaylandSurfaceHandleExportedData, 1); @@ -11135,10 +11135,10 @@ gtk_window_export_handle (GtkWindow *window, data->callback = callback; data->user_data = user_data; - if (!gdk_wayland_surface_export_handle (gdk_surface, - wayland_surface_handle_exported, - data, - g_free)) + if (!gdk_wayland_surface_export_handle (surface, + wayland_surface_handle_exported, + data, + g_free)) { g_free (data); return FALSE; @@ -11161,9 +11161,9 @@ 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_surface (GTK_WIDGET (window)); + GdkSurface *surface = gtk_widget_get_surface (GTK_WIDGET (window)); - gdk_wayland_surface_unexport_handle (gdk_surface); + gdk_wayland_surface_unexport_handle (surface); } #endif } @@ -11398,7 +11398,7 @@ update_cursor (GtkWindow *toplevel, } gdk_surface_set_device_cursor (gtk_widget_get_surface (GTK_WIDGET (toplevel)), - device, cursor); + device, cursor); g_list_free (widgets); } diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h index 95f80f1acd..658f79f628 100644 --- a/gtk/gtkwindowprivate.h +++ b/gtk/gtkwindowprivate.h @@ -115,8 +115,8 @@ GdkTexture * gtk_window_get_icon_for_size (GtkWindow *window, void gtk_window_set_use_subsurface (GtkWindow *window, gboolean use_subsurface); -void gtk_window_set_hardcoded_window (GtkWindow *window, - GdkSurface *gdk_surface); +void gtk_window_set_hardcoded_surface (GtkWindow *window, + GdkSurface *surface); GdkDisplay *gtk_window_get_display (GtkWindow *window); diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 4db6523296..bf297d9b53 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -95,7 +95,7 @@ init_version (GtkInspectorGeneral *gen) { const char *backend; GdkDisplay *display; - GdkSurface *window; + GdkSurface *surface; GskRenderer *gsk_renderer; const char *renderer; @@ -128,8 +128,8 @@ init_version (GtkInspectorGeneral *gen) #endif backend = "Unknown"; - window = gdk_surface_new_toplevel (display, 10, 10); - gsk_renderer = gsk_renderer_new_for_surface (window); + surface = gdk_surface_new_toplevel (display, 10, 10); + gsk_renderer = gsk_renderer_new_for_surface (surface); if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskVulkanRenderer") == 0) renderer = "Vulkan"; else if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskGLRenderer") == 0) @@ -141,7 +141,7 @@ init_version (GtkInspectorGeneral *gen) gsk_renderer_unrealize (gsk_renderer); g_object_unref (gsk_renderer); - gdk_surface_destroy (window); + gdk_surface_destroy (surface); gtk_label_set_text (GTK_LABEL (gen->priv->gtk_version), GTK_VERSION); gtk_label_set_text (GTK_LABEL (gen->priv->gdk_backend), backend); @@ -384,13 +384,13 @@ static void init_vulkan (GtkInspectorGeneral *gen) { #ifdef GDK_RENDERING_VULKAN - GdkSurface *window; + GdkSurface *surface; GdkVulkanContext *context; GdkDisplay *display = gdk_display_get_default (); - window = gdk_surface_new_toplevel (display, 10, 10); - context = gdk_surface_create_vulkan_context (window, NULL); - gdk_surface_destroy (window); + surface = gdk_surface_new_toplevel (display, 10, 10); + context = gdk_surface_create_vulkan_context (surface, NULL); + gdk_surface_destroy (surface); if (context) { diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c index 0097433526..6f1efa1506 100644 --- a/gtk/inspector/inspect-button.c +++ b/gtk/inspector/inspect-button.c @@ -80,28 +80,28 @@ static GtkWidget * find_widget_at_pointer (GdkDevice *device) { GtkWidget *widget = NULL; - GdkSurface *pointer_window; + GdkSurface *pointer_surface; - pointer_window = gdk_device_get_surface_at_position (device, NULL, NULL); + pointer_surface = gdk_device_get_surface_at_position (device, NULL, NULL); - if (pointer_window) + if (pointer_surface) { gpointer widget_ptr; - gdk_surface_get_user_data (pointer_window, &widget_ptr); + gdk_surface_get_user_data (pointer_surface, &widget_ptr); widget = widget_ptr; if (!GTK_IS_WINDOW (widget)) { while (TRUE) { - GdkSurface *parent = gdk_surface_get_parent (pointer_window); + GdkSurface *parent = gdk_surface_get_parent (pointer_surface); if (!parent) break; - pointer_window = parent; - gdk_surface_get_user_data (pointer_window, &widget_ptr); + pointer_surface = parent; + gdk_surface_get_user_data (pointer_surface, &widget_ptr); widget = widget_ptr; if (GTK_IS_WINDOW (widget)) @@ -295,10 +295,10 @@ property_query_event (GtkWidget *widget, static void prepare_inspect_func (GdkSeat *seat, - GdkSurface *window, + GdkSurface *surface, gpointer user_data) { - gdk_surface_show (window); + gdk_surface_show (surface); } diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index 470f47ff05..8fae2630d0 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -1066,7 +1066,7 @@ void gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, GtkWidget *widget, GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node) @@ -1084,8 +1084,8 @@ gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, recording = gtk_inspector_render_recording_new (gdk_frame_clock_get_frame_time (frame_clock), gsk_renderer_get_profiler (renderer), &(GdkRectangle) { 0, 0, - gdk_surface_get_width (window), - gdk_surface_get_height (window) }, + gdk_surface_get_width (surface), + gdk_surface_get_height (surface) }, region, clip, node); diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h index 585046aa68..03adf058a3 100644 --- a/gtk/inspector/recorder.h +++ b/gtk/inspector/recorder.h @@ -54,7 +54,7 @@ void gtk_inspector_recorder_set_debug_nodes (GtkInspectorRec void gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, GtkWidget *widget, GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node); diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index fb4bdcb392..8ebcd6f31c 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -372,7 +372,7 @@ gtk_inspector_window_get_for_display (GdkDisplay *display) void gtk_inspector_record_render (GtkWidget *widget, GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node) @@ -390,7 +390,7 @@ gtk_inspector_record_render (GtkWidget *widget, gtk_inspector_recorder_record_render (GTK_INSPECTOR_RECORDER (iw->widget_recorder), widget, renderer, - window, + surface, region, context, node); diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h index 3919114729..812ec06340 100644 --- a/gtk/inspector/window.h +++ b/gtk/inspector/window.h @@ -109,7 +109,7 @@ void gtk_inspector_window_rescan (GtkWidget *iw); gboolean gtk_inspector_is_recording (GtkWidget *widget); void gtk_inspector_record_render (GtkWidget *widget, GskRenderer *renderer, - GdkSurface *window, + GdkSurface *surface, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node); |