diff options
author | Alexander Larsson <alexl@redhat.com> | 2018-03-20 12:05:26 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2018-03-20 12:05:26 +0100 |
commit | 9a7e721181ce714ab248429dc1258984b9e10748 (patch) | |
tree | 73d69b5c298d61cc9c045bed3bc7e54dde4aa15c /gdk | |
parent | 890080ebf7a12199d5500fbbf6a0daf06cc2d35f (diff) | |
download | gtk+-9a7e721181ce714ab248429dc1258984b9e10748.tar.gz |
GdkSurface: Rename various functions and variables
This is an automatic rename of various things related
to the window->surface rename.
Public symbols changed by this is:
GDK_MODE_WINDOW
gdk_device_get_window_at_position
gdk_device_get_window_at_position_double
gdk_device_get_last_event_window
gdk_display_get_monitor_at_window
gdk_drag_context_get_source_window
gdk_drag_context_get_dest_window
gdk_drag_context_get_drag_window
gdk_draw_context_get_window
gdk_drawing_context_get_window
gdk_gl_context_get_window
gdk_synthesize_window_state
gdk_surface_get_window_type
gdk_x11_display_set_window_scale
gsk_renderer_new_for_window
gsk_renderer_get_window
gtk_text_view_buffer_to_window_coords
gtk_tree_view_convert_widget_to_bin_window_coords
gtk_tree_view_convert_tree_to_bin_window_coords
The commands that generated this are:
git sed -f g "GDK window" "GDK surface"
git sed -f g window_impl surface_impl
(cd gdk; git sed -f g impl_window impl_surface)
git sed -f g WINDOW_IMPL SURFACE_IMPL
git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE
git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface
git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface
git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface
git sed -f g gsk_renderer_get_window gsk_renderer_get_surface
git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface
(cd gdk; git sed -f g window_type surface_type)
git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type
git sed -f g window_at_position surface_at_position
git sed -f g event_window event_surface
git sed -f g window_coord surface_coord
git sed -f g window_state surface_state
git sed -f g window_cursor surface_cursor
git sed -f g window_scale surface_scale
git sed -f g window_events surface_events
git sed -f g monitor_at_window monitor_at_surface
git sed -f g window_under_pointer surface_under_pointer
(cd gdk; git sed -f g for_window for_surface)
git sed -f g window_anchor surface_anchor
git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL
git sed -f g native_window native_surface
git sed -f g source_window source_surface
git sed -f g dest_window dest_surface
git sed -f g drag_window drag_surface
git sed -f g input_window input_surface
git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
Diffstat (limited to 'gdk')
86 files changed, 1550 insertions, 1550 deletions
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c index 8158871b64..baff0c0360 100644 --- a/gdk/broadway/gdkdevice-broadway.c +++ b/gdk/broadway/gdkdevice-broadway.c @@ -33,7 +33,7 @@ static void gdk_broadway_device_get_state (GdkDevice *device, GdkSurface *window, gdouble *axes, GdkModifierType *mask); -static void gdk_broadway_device_set_window_cursor (GdkDevice *device, +static void gdk_broadway_device_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor); static void gdk_broadway_device_warp (GdkDevice *device, @@ -56,12 +56,12 @@ static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device, guint32 time_); static void gdk_broadway_device_ungrab (GdkDevice *device, guint32 time_); -static GdkSurface * gdk_broadway_device_window_at_position (GdkDevice *device, +static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); -static void gdk_broadway_device_select_window_events (GdkDevice *device, +static void gdk_broadway_device_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask); @@ -75,13 +75,13 @@ gdk_broadway_device_class_init (GdkBroadwayDeviceClass *klass) device_class->get_history = gdk_broadway_device_get_history; device_class->get_state = gdk_broadway_device_get_state; - device_class->set_window_cursor = gdk_broadway_device_set_window_cursor; + device_class->set_surface_cursor = gdk_broadway_device_set_surface_cursor; device_class->warp = gdk_broadway_device_warp; device_class->query_state = gdk_broadway_device_query_state; device_class->grab = gdk_broadway_device_grab; device_class->ungrab = gdk_broadway_device_ungrab; - device_class->window_at_position = gdk_broadway_device_window_at_position; - device_class->select_window_events = gdk_broadway_device_select_window_events; + device_class->surface_at_position = gdk_broadway_device_surface_at_position; + device_class->select_surface_events = gdk_broadway_device_select_surface_events; } static void @@ -124,7 +124,7 @@ gdk_broadway_device_get_state (GdkDevice *device, } static void -gdk_broadway_device_set_window_cursor (GdkDevice *device, +gdk_broadway_device_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -230,7 +230,7 @@ _gdk_broadway_surface_grab_check_destroy (GdkSurface *window) /* Make sure there is no lasting grab in this native window */ grab = _gdk_display_get_last_device_grab (display, d->data); - if (grab && grab->native_window == window) + if (grab && grab->native_surface == window) { grab->serial_end = grab->serial_start; grab->implicit_ungrab = TRUE; @@ -312,7 +312,7 @@ gdk_broadway_device_ungrab (GdkDevice *device, } static GdkSurface * -gdk_broadway_device_window_at_position (GdkDevice *device, +gdk_broadway_device_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -326,7 +326,7 @@ gdk_broadway_device_window_at_position (GdkDevice *device, } static void -gdk_broadway_device_select_window_events (GdkDevice *device, +gdk_broadway_device_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index 61860f5011..80c9975254 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -520,7 +520,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class) object_class->dispose = gdk_broadway_display_dispose; object_class->finalize = gdk_broadway_display_finalize; - display_class->window_type = GDK_TYPE_BROADWAY_SURFACE; + display_class->surface_type = GDK_TYPE_BROADWAY_SURFACE; display_class->get_name = gdk_broadway_display_get_name; display_class->beep = gdk_broadway_display_beep; @@ -534,7 +534,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class) display_class->get_next_serial = gdk_broadway_display_get_next_serial; display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete; - display_class->create_window_impl = _gdk_broadway_display_create_window_impl; + display_class->create_surface_impl = _gdk_broadway_display_create_surface_impl; display_class->get_keymap = _gdk_broadway_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list; display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target; diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h index 8f1a9237eb..b899517cd2 100644 --- a/gdk/broadway/gdkprivate-broadway.h +++ b/gdk/broadway/gdkprivate-broadway.h @@ -99,7 +99,7 @@ void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display, void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); -void _gdk_broadway_display_create_window_impl (GdkDisplay *display, +void _gdk_broadway_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index 30777d8756..0d71b59e50 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -46,7 +46,7 @@ /* Forward declarations */ static void gdk_surface_impl_broadway_finalize (GObject *object); -#define WINDOW_IS_TOPLEVEL(window) \ +#define SURFACE_IS_TOPLEVEL(window) \ (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) struct _GdkBroadwaySurface { @@ -123,7 +123,7 @@ queue_flush (GdkSurface *window) static void gdk_surface_impl_broadway_init (GdkSurfaceImplBroadway *impl) { - impl->toplevel_window_type = -1; + impl->toplevel_surface_type = -1; } static void @@ -195,7 +195,7 @@ on_frame_clock_after_paint (GdkFrameClock *clock, static void connect_frame_clock (GdkSurface *window) { - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) { GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window); @@ -205,7 +205,7 @@ connect_frame_clock (GdkSurface *window) } void -_gdk_broadway_display_create_window_impl (GdkDisplay *display, +_gdk_broadway_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -223,12 +223,12 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display, window->y, window->width, window->height, - window->window_type == GDK_SURFACE_TEMP); + window->surface_type == GDK_SURFACE_TEMP); g_hash_table_insert (broadway_display->id_ht, GINT_TO_POINTER(impl->id), window); impl->wrapper = window; - g_assert (window->window_type == GDK_SURFACE_TOPLEVEL || - window->window_type == GDK_SURFACE_TEMP); + g_assert (window->surface_type == GDK_SURFACE_TOPLEVEL || + window->surface_type == GDK_SURFACE_TEMP); g_assert (window->parent == NULL); broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl); @@ -687,7 +687,7 @@ gdk_broadway_surface_set_icon_name (GdkSurface *window, const gchar *name) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"), @@ -698,7 +698,7 @@ static void gdk_broadway_surface_iconify (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -706,7 +706,7 @@ static void gdk_broadway_surface_deiconify (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -714,7 +714,7 @@ static void gdk_broadway_surface_stick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -723,7 +723,7 @@ static void gdk_broadway_surface_unstick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -737,7 +737,7 @@ gdk_broadway_surface_maximize (GdkSurface *window) GdkRectangle geom; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); @@ -747,7 +747,7 @@ gdk_broadway_surface_maximize (GdkSurface *window) impl->maximized = TRUE; - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); impl->pre_maximize_x = window->x; impl->pre_maximize_y = window->y; @@ -769,7 +769,7 @@ gdk_broadway_surface_unmaximize (GdkSurface *window) GdkSurfaceImplBroadway *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); @@ -779,7 +779,7 @@ gdk_broadway_surface_unmaximize (GdkSurface *window) impl->maximized = FALSE; - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); gdk_surface_move_resize (window, impl->pre_maximize_x, @@ -792,7 +792,7 @@ static void gdk_broadway_surface_fullscreen (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -801,7 +801,7 @@ static void gdk_broadway_surface_unfullscreen (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -813,7 +813,7 @@ gdk_broadway_surface_set_keep_above (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -824,7 +824,7 @@ gdk_broadway_surface_set_keep_below (GdkSurface *window, gboolean setting) g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -833,7 +833,7 @@ static GdkSurface * gdk_broadway_surface_get_group (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return NULL; return window; @@ -850,7 +850,7 @@ gdk_broadway_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -862,7 +862,7 @@ gdk_broadway_surface_get_decorations (GdkSurface *window, gboolean result = FALSE; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return FALSE; return result; @@ -875,7 +875,7 @@ gdk_broadway_surface_set_functions (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -1264,7 +1264,7 @@ gdk_broadway_surface_begin_resize_drag (GdkSurface *window, impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (impl->maximized) @@ -1304,7 +1304,7 @@ gdk_broadway_surface_begin_move_drag (GdkSurface *window, impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (impl->maximized) @@ -1342,7 +1342,7 @@ gdk_broadway_surface_set_opacity (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (opacity < 0) diff --git a/gdk/broadway/gdksurface-broadway.h b/gdk/broadway/gdksurface-broadway.h index 00fa539645..b859ffc591 100644 --- a/gdk/broadway/gdksurface-broadway.h +++ b/gdk/broadway/gdksurface-broadway.h @@ -61,7 +61,7 @@ struct _GdkSurfaceImplBroadway int pre_maximize_width; int pre_maximize_height; - gint8 toplevel_window_type; + gint8 toplevel_surface_type; gboolean dirty; gboolean last_synced; diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h index 58a027129e..a2b4b27a93 100644 --- a/gdk/gdk-private.h +++ b/gdk/gdk-private.h @@ -23,7 +23,7 @@ gboolean gdk_surface_supports_edge_constraints (GdkSurface *window); void gdk_surface_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy); diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c index 4f9148972f..6c9e28726e 100644 --- a/gdk/gdkcairo.c +++ b/gdk/gdkcairo.c @@ -241,7 +241,7 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface, * gdk_cairo_surface_create_from_pixbuf: * @pixbuf: a #GdkPixbuf * @scale: the scale of the new surface, or 0 to use same as @window - * @for_window: (allow-none): The window this will be drawn to, or %NULL + * @for_surface: (allow-none): The window this will be drawn to, or %NULL * * Creates an image surface with the same contents as * the pixbuf. @@ -251,14 +251,14 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface, cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, int scale, - GdkSurface *for_window) + GdkSurface *for_surface) { cairo_format_t format; cairo_surface_t *surface; g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); g_return_val_if_fail (scale >= 0, NULL); - g_return_val_if_fail (for_window == NULL || GDK_IS_SURFACE (for_window), NULL); + g_return_val_if_fail (for_surface == NULL || GDK_IS_SURFACE (for_surface), NULL); if (gdk_pixbuf_get_n_channels (pixbuf) == 3) format = CAIRO_FORMAT_RGB24; @@ -266,7 +266,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, format = CAIRO_FORMAT_ARGB32; surface = - gdk_surface_create_similar_image_surface (for_window, + gdk_surface_create_similar_image_surface (for_surface, format, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index dddd91a3ff..a6de1055f6 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -58,7 +58,7 @@ cairo_region_t * GDK_AVAILABLE_IN_ALL cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, int scale, - GdkSurface *for_window); + GdkSurface *for_surface); GDK_AVAILABLE_IN_ALL void gdk_cairo_draw_from_gl (cairo_t *cr, GdkSurface *window, diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index df6992b67f..82c39aa44b 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -594,7 +594,7 @@ gdk_device_get_position (GdkDevice *device, /** - * gdk_device_get_window_at_position_double: + * gdk_device_get_surface_at_position_double: * @device: pointer #GdkDevice to query info to. * @win_x: (out) (allow-none): return location for the X coordinate of the device location, * relative to the window origin, or %NULL. @@ -613,7 +613,7 @@ gdk_device_get_position (GdkDevice *device, * device position, or %NULL. **/ GdkSurface * -gdk_device_get_window_at_position_double (GdkDevice *device, +gdk_device_get_surface_at_position_double (GdkDevice *device, gdouble *win_x, gdouble *win_y) { @@ -625,7 +625,7 @@ gdk_device_get_window_at_position_double (GdkDevice *device, g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE || gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL); - window = _gdk_device_window_at_position (device, &tmp_x, &tmp_y, NULL, FALSE); + window = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL, FALSE); /* This might need corrections, as the native window returned may contain client side children */ @@ -643,7 +643,7 @@ gdk_device_get_window_at_position_double (GdkDevice *device, } /** - * gdk_device_get_window_at_position: + * gdk_device_get_surface_at_position: * @device: pointer #GdkDevice to query info to. * @win_x: (out) (allow-none): return location for the X coordinate of the device location, * relative to the window origin, or %NULL. @@ -661,7 +661,7 @@ gdk_device_get_window_at_position_double (GdkDevice *device, * device position, or %NULL. **/ GdkSurface * -gdk_device_get_window_at_position (GdkDevice *device, +gdk_device_get_surface_at_position (GdkDevice *device, gint *win_x, gint *win_y) { @@ -669,7 +669,7 @@ gdk_device_get_window_at_position (GdkDevice *device, GdkSurface *window; window = - gdk_device_get_window_at_position_double (device, &tmp_x, &tmp_y); + gdk_device_get_surface_at_position_double (device, &tmp_x, &tmp_y); if (win_x) *win_x = round (tmp_x); @@ -1566,7 +1566,7 @@ find_axis_info (GArray *array, } gboolean -_gdk_device_translate_window_coord (GdkDevice *device, +_gdk_device_translate_surface_coord (GdkDevice *device, GdkSurface *window, guint index_, gdouble value, @@ -1765,13 +1765,13 @@ _gdk_device_query_state (GdkDevice *device, } GdkSurface * -_gdk_device_window_at_position (GdkDevice *device, +_gdk_device_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - return GDK_DEVICE_GET_CLASS (device)->window_at_position (device, + return GDK_DEVICE_GET_CLASS (device)->surface_at_position (device, win_x, win_y, mask, @@ -1779,7 +1779,7 @@ _gdk_device_window_at_position (GdkDevice *device, } /** - * gdk_device_get_last_event_window: + * gdk_device_get_last_event_surface: * @device: a #GdkDevice, with a source other than %GDK_SOURCE_KEYBOARD * * Gets information about which window the given pointer device is in, based on events @@ -1791,7 +1791,7 @@ _gdk_device_window_at_position (GdkDevice *device, * Returns: (transfer none) (allow-none): the last window the device */ GdkSurface * -gdk_device_get_last_event_window (GdkDevice *device) +gdk_device_get_last_event_surface (GdkDevice *device) { GdkDisplay *display; GdkPointerSurfaceInfo *info; @@ -1802,7 +1802,7 @@ gdk_device_get_last_event_window (GdkDevice *device) display = gdk_device_get_display (device); info = _gdk_display_get_pointer_info (display, device); - return info->window_under_pointer; + return info->surface_under_pointer; } /** diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h index 67f7de0712..044b790448 100644 --- a/gdk/gdkdevice.h +++ b/gdk/gdkdevice.h @@ -73,7 +73,7 @@ typedef enum * @GDK_MODE_DISABLED: the device is disabled and will not report any events. * @GDK_MODE_SCREEN: the device is enabled. The device’s coordinate space * maps to the entire screen. - * @GDK_MODE_WINDOW: the device is enabled. The device’s coordinate space + * @GDK_MODE_SURFACE: the device is enabled. The device’s coordinate space * is mapped to a single window. The manner in which this window * is chosen is undefined, but it will typically be the same * way in which the focus window for key events is determined. @@ -84,7 +84,7 @@ typedef enum { GDK_MODE_DISABLED, GDK_MODE_SCREEN, - GDK_MODE_WINDOW + GDK_MODE_SURFACE } GdkInputMode; /** @@ -172,7 +172,7 @@ void gdk_device_get_position (GdkDevice *device, gint *y); GDK_AVAILABLE_IN_ALL GdkSurface * - gdk_device_get_window_at_position + gdk_device_get_surface_at_position (GdkDevice *device, gint *win_x, gint *win_y); @@ -182,7 +182,7 @@ void gdk_device_get_position_double (GdkDevice *device, gdouble *y); GDK_AVAILABLE_IN_ALL GdkSurface * - gdk_device_get_window_at_position_double + gdk_device_get_surface_at_position_double (GdkDevice *device, gdouble *win_x, gdouble *win_y); @@ -242,7 +242,7 @@ void gdk_device_warp (GdkDevice *device, gint y); GDK_AVAILABLE_IN_ALL -GdkSurface *gdk_device_get_last_event_window (GdkDevice *device); +GdkSurface *gdk_device_get_last_event_surface (GdkDevice *device); GDK_AVAILABLE_IN_ALL const gchar *gdk_device_get_vendor_id (GdkDevice *device); diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h index 130a77b97b..69b50d537e 100644 --- a/gdk/gdkdeviceprivate.h +++ b/gdk/gdkdeviceprivate.h @@ -82,7 +82,7 @@ struct _GdkDeviceClass gdouble *axes, GdkModifierType *mask); - void (* set_window_cursor) (GdkDevice *device, + void (* set_surface_cursor) (GdkDevice *device, GdkSurface *window, GdkCursor *cursor); @@ -107,12 +107,12 @@ struct _GdkDeviceClass void (*ungrab) (GdkDevice *device, guint32 time_); - GdkSurface * (* window_at_position) (GdkDevice *device, + GdkSurface * (* surface_at_position) (GdkDevice *device, double *win_x, double *win_y, GdkModifierType *mask, gboolean get_toplevel); - void (* select_window_events) (GdkDevice *device, + void (* select_surface_events) (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask); }; @@ -138,7 +138,7 @@ void _gdk_device_get_axis_info (GdkDevice *device, void _gdk_device_set_keys (GdkDevice *device, guint num_keys); -gboolean _gdk_device_translate_window_coord (GdkDevice *device, +gboolean _gdk_device_translate_surface_coord (GdkDevice *device, GdkSurface *window, guint index, gdouble value, @@ -174,7 +174,7 @@ void _gdk_device_query_state (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); -GdkSurface * _gdk_device_window_at_position (GdkDevice *device, +GdkSurface * _gdk_device_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index 2e9f0abd23..fad14e6be8 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -171,7 +171,7 @@ gdk_display_class_init (GdkDisplayClass *class) object_class->get_property = gdk_display_get_property; class->get_app_launch_context = gdk_display_real_get_app_launch_context; - class->window_type = GDK_TYPE_SURFACE; + class->surface_type = GDK_TYPE_SURFACE; class->opened = gdk_display_real_opened; class->make_default = gdk_display_real_make_default; @@ -328,7 +328,7 @@ gdk_display_class_init (GdkDisplayClass *class) static void free_pointer_info (GdkPointerSurfaceInfo *info) { - g_clear_object (&info->window_under_pointer); + g_clear_object (&info->surface_under_pointer); g_slice_free (GdkPointerSurfaceInfo, info); } @@ -336,7 +336,7 @@ static void free_device_grab (GdkDeviceGrabInfo *info) { g_object_unref (info->window); - g_object_unref (info->native_window); + g_object_unref (info->native_surface); g_free (info); } @@ -560,7 +560,7 @@ GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display, GdkDevice *device, GdkSurface *window, - GdkSurface *native_window, + GdkSurface *native_surface, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -574,7 +574,7 @@ _gdk_display_add_device_grab (GdkDisplay *display, info = g_new0 (GdkDeviceGrabInfo, 1); info->window = g_object_ref (window); - info->native_window = g_object_ref (native_window); + info->native_surface = g_object_ref (native_surface); info->serial_start = serial_start; info->serial_end = G_MAXULONG; info->owner_events = owner_events; @@ -630,7 +630,7 @@ get_current_toplevel (GdkDisplay *display, gdouble x, y; GdkModifierType state; - pointer_window = _gdk_device_window_at_position (device, &x, &y, &state, TRUE); + pointer_window = _gdk_device_surface_at_position (device, &x, &y, &state, TRUE); if (pointer_window != NULL && (GDK_SURFACE_DESTROYED (pointer_window) || @@ -672,8 +672,8 @@ switch_to_pointer_grab (GdkDisplay *display, { /* !owner_event Grabbing a window that we're not inside, current status is now NULL (i.e. outside grabbed window) */ - if (!grab->owner_events && info->window_under_pointer != grab->window) - _gdk_display_set_window_under_pointer (display, device, NULL); + if (!grab->owner_events && info->surface_under_pointer != grab->window) + _gdk_display_set_surface_under_pointer (display, device, NULL); } grab->activated = TRUE; @@ -697,7 +697,7 @@ switch_to_pointer_grab (GdkDisplay *display, if (new_toplevel) { /* w is now toplevel and x,y in toplevel coords */ - _gdk_display_set_window_under_pointer (display, device, new_toplevel); + _gdk_display_set_surface_under_pointer (display, device, new_toplevel); info->toplevel_x = x; info->toplevel_y = y; info->state = state; @@ -706,8 +706,8 @@ switch_to_pointer_grab (GdkDisplay *display, if (grab == NULL) /* Ungrabbed, send events */ { - /* We're now ungrabbed, update the window_under_pointer */ - _gdk_display_set_window_under_pointer (display, device, new_toplevel); + /* We're now ungrabbed, update the surface_under_pointer */ + _gdk_display_set_surface_under_pointer (display, device, new_toplevel); } } @@ -1314,13 +1314,13 @@ _gdk_display_event_data_free (GdkDisplay *display, } void -_gdk_display_create_window_impl (GdkDisplay *display, +_gdk_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, GdkSurfaceAttr *attributes) { - GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display, + GDK_DISPLAY_GET_CLASS (display)->create_surface_impl (display, window, real_parent, event_mask, @@ -1330,7 +1330,7 @@ _gdk_display_create_window_impl (GdkDisplay *display, GdkSurface * _gdk_display_create_window (GdkDisplay *display) { - return g_object_new (GDK_DISPLAY_GET_CLASS (display)->window_type, + return g_object_new (GDK_DISPLAY_GET_CLASS (display)->surface_type, "display", display, NULL); } @@ -1673,7 +1673,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display, } /** - * gdk_display_get_monitor_at_window: + * gdk_display_get_monitor_at_surface: * @display: a #GdkDisplay * @window: a #GdkSurface * @@ -1684,7 +1684,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display, * Returns: (transfer none): the monitor with the largest overlap with @window */ GdkMonitor * -gdk_display_get_monitor_at_window (GdkDisplay *display, +gdk_display_get_monitor_at_surface (GdkDisplay *display, GdkSurface *window) { GdkRectangle win; @@ -1696,9 +1696,9 @@ gdk_display_get_monitor_at_window (GdkDisplay *display, g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); class = GDK_DISPLAY_GET_CLASS (display); - if (class->get_monitor_at_window) + if (class->get_monitor_at_surface) { - best = class->get_monitor_at_window (display, window); + best = class->get_monitor_at_surface (display, window); if (best) return best; diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 5d7d62158f..94e40f0164 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -116,7 +116,7 @@ GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display, int x, int y); GDK_AVAILABLE_IN_ALL -GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display, +GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display, GdkSurface *window); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index db52472a3c..f885f33400 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -41,7 +41,7 @@ typedef struct _GdkDisplayClass GdkDisplayClass; typedef struct { GdkSurface *window; - GdkSurface *native_window; + GdkSurface *native_surface; gulong serial_start; gulong serial_end; /* exclusive, i.e. not active on serial_end */ guint event_mask; @@ -63,7 +63,7 @@ typedef struct */ typedef struct { - GdkSurface *window_under_pointer; /* window that last got a normal enter event */ + GdkSurface *surface_under_pointer; /* window that last got a normal enter event */ gdouble toplevel_x, toplevel_y; guint32 state; guint32 button; @@ -114,7 +114,7 @@ struct _GdkDisplayClass { GObjectClass parent_class; - GType window_type; /* type for native windows for this display, set in class_init */ + GType surface_type; /* type for native windows for this display, set in class_init */ GType vk_context_type; /* type for GdkVulkanContext, must be set if vk_extension_name != NULL */ const char *vk_extension_name; /* Name of required windowing vulkan extension or %NULL (default) if Vulkan isn't supported */ @@ -140,7 +140,7 @@ struct _GdkDisplayClass GdkEvent *new_event); void (*event_data_free) (GdkDisplay *display, GdkEvent *event); - void (*create_window_impl) (GdkDisplay *display, + void (*create_surface_impl) (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -166,7 +166,7 @@ struct _GdkDisplayClass GdkMonitor * (*get_monitor) (GdkDisplay *display, int index); GdkMonitor * (*get_primary_monitor) (GdkDisplay *display); - GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display, + GdkMonitor * (*get_monitor_at_surface) (GdkDisplay *display, GdkSurface *window); gboolean (*get_setting) (GdkDisplay *display, const char *name, @@ -199,7 +199,7 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display, GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display, GdkDevice *device, GdkSurface *window, - GdkSurface *native_window, + GdkSurface *native_surface, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -230,7 +230,7 @@ void _gdk_display_event_data_copy (GdkDisplay *display GdkEvent *new_event); void _gdk_display_event_data_free (GdkDisplay *display, GdkEvent *event); -void _gdk_display_create_window_impl (GdkDisplay *display, +void _gdk_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 7d6d453d2f..219f759ef3 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -171,7 +171,7 @@ gdk_drag_context_get_selected_action (GdkDragContext *context) } /** - * gdk_drag_context_get_source_window: + * gdk_drag_context_get_source_surface: * @context: a #GdkDragContext * * Returns the #GdkSurface where the DND operation started. @@ -179,15 +179,15 @@ gdk_drag_context_get_selected_action (GdkDragContext *context) * Returns: (transfer none): a #GdkSurface **/ GdkSurface * -gdk_drag_context_get_source_window (GdkDragContext *context) +gdk_drag_context_get_source_surface (GdkDragContext *context) { g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); - return context->source_window; + return context->source_surface; } /** - * gdk_drag_context_get_dest_window: + * gdk_drag_context_get_dest_surface: * @context: a #GdkDragContext * * Returns the destination window for the DND operation. @@ -195,11 +195,11 @@ gdk_drag_context_get_source_window (GdkDragContext *context) * Returns: (transfer none): a #GdkSurface **/ GdkSurface * -gdk_drag_context_get_dest_window (GdkDragContext *context) +gdk_drag_context_get_dest_surface (GdkDragContext *context) { g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); - return context->dest_window; + return context->dest_surface; } /** @@ -315,11 +315,11 @@ gdk_drag_context_finalize (GObject *object) g_clear_object (&context->content); g_clear_pointer (&context->formats, gdk_content_formats_unref); - if (context->source_window) - g_object_unref (context->source_window); + if (context->source_surface) + g_object_unref (context->source_surface); - if (context->dest_window) - g_object_unref (context->dest_window); + if (context->dest_surface) + g_object_unref (context->dest_surface); G_OBJECT_CLASS (gdk_drag_context_parent_class)->finalize (object); } @@ -782,7 +782,7 @@ gdk_drop_read_finish (GdkDragContext *context, } /** - * gdk_drag_context_get_drag_window: + * gdk_drag_context_get_drag_surface: * @context: a #GdkDragContext * * Returns the window on which the drag icon should be rendered @@ -795,12 +795,12 @@ gdk_drop_read_finish (GdkDragContext *context, * Returns: (nullable) (transfer none): the drag window, or %NULL */ GdkSurface * -gdk_drag_context_get_drag_window (GdkDragContext *context) +gdk_drag_context_get_drag_surface (GdkDragContext *context) { g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); - if (GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_window) - return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_window (context); + if (GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_surface) + return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_surface (context); return NULL; } diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index bef1693bac..aaa49b5faf 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -98,9 +98,9 @@ GDK_AVAILABLE_IN_ALL GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context); GDK_AVAILABLE_IN_ALL -GdkSurface *gdk_drag_context_get_source_window (GdkDragContext *context); +GdkSurface *gdk_drag_context_get_source_surface (GdkDragContext *context); GDK_AVAILABLE_IN_ALL -GdkSurface *gdk_drag_context_get_dest_window (GdkDragContext *context); +GdkSurface *gdk_drag_context_get_dest_surface (GdkDragContext *context); /* Destination side */ GDK_AVAILABLE_IN_ALL @@ -147,7 +147,7 @@ void gdk_drag_drop_done (GdkDragContext *context, gboolean success); GDK_AVAILABLE_IN_ALL -GdkSurface *gdk_drag_context_get_drag_window (GdkDragContext *context); +GdkSurface *gdk_drag_context_get_drag_surface (GdkDragContext *context); GDK_AVAILABLE_IN_ALL void gdk_drag_context_set_hotspot (GdkDragContext *context, diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h index 3d3c292501..101ceed712 100644 --- a/gdk/gdkdndprivate.h +++ b/gdk/gdkdndprivate.h @@ -57,7 +57,7 @@ struct _GdkDragContextClass { GAsyncResult *result, GError **error); gboolean (*drop_status) (GdkDragContext *context); - GdkSurface* (*get_drag_window) (GdkDragContext *context); + GdkSurface* (*get_drag_surface) (GdkDragContext *context); void (*set_hotspot) (GdkDragContext *context, gint hot_x, gint hot_y); @@ -87,9 +87,9 @@ struct _GdkDragContext { GdkDisplay *display; gboolean is_source; - GdkSurface *source_window; - GdkSurface *dest_window; - GdkSurface *drag_window; + GdkSurface *source_surface; + GdkSurface *dest_surface; + GdkSurface *drag_surface; GdkContentProvider *content; GdkContentFormats *formats; diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 2c8ebe164b..bcd7004d8b 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -153,7 +153,7 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass) pspecs[PROP_WINDOW] = g_param_spec_object ("window", P_("Window"), - P_("The GDK window bound to the context"), + P_("The GDK surface bound to the context"), GDK_TYPE_SURFACE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | @@ -261,7 +261,7 @@ gdk_draw_context_get_display (GdkDrawContext *context) } /** - * gdk_draw_context_get_window: + * gdk_draw_context_get_surface: * @context: a #GdkDrawContext * * Retrieves the #GdkSurface used by the @context. @@ -269,7 +269,7 @@ gdk_draw_context_get_display (GdkDrawContext *context) * Returns: (nullable) (transfer none): a #GdkSurface or %NULL */ GdkSurface * -gdk_draw_context_get_window (GdkDrawContext *context) +gdk_draw_context_get_surface (GdkDrawContext *context) { GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context); diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h index e27d175a0b..70bc802c4a 100644 --- a/gdk/gdkdrawcontext.h +++ b/gdk/gdkdrawcontext.h @@ -40,7 +40,7 @@ GType gdk_draw_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context); GDK_AVAILABLE_IN_ALL -GdkSurface * gdk_draw_context_get_window (GdkDrawContext *context); +GdkSurface * gdk_draw_context_get_surface (GdkDrawContext *context); G_END_DECLS diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c index b47aaf35a4..3fe2e7153a 100644 --- a/gdk/gdkdrawingcontext.c +++ b/gdk/gdkdrawingcontext.c @@ -18,7 +18,7 @@ /** * SECTION:gdkdrawingcontext * @Title: GdkDrawingContext - * @Short_description: Drawing context for GDK windows + * @Short_description: Drawing context for GDK surfaces * * #GdkDrawingContext is an object that represents the current drawing * state of a #GdkSurface. @@ -291,7 +291,7 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context) } /** - * gdk_drawing_context_get_window: + * gdk_drawing_context_get_surface: * @context: a #GdkDrawingContext * * Retrieves the window that created the drawing @context. @@ -299,7 +299,7 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context) * Returns: (transfer none): a #GdkSurface */ GdkSurface * -gdk_drawing_context_get_window (GdkDrawingContext *context) +gdk_drawing_context_get_surface (GdkDrawingContext *context) { GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); diff --git a/gdk/gdkdrawingcontext.h b/gdk/gdkdrawingcontext.h index f010f11bb0..541e30bbe1 100644 --- a/gdk/gdkdrawingcontext.h +++ b/gdk/gdkdrawingcontext.h @@ -37,7 +37,7 @@ GDK_AVAILABLE_IN_ALL GType gdk_drawing_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL -GdkSurface * gdk_drawing_context_get_window (GdkDrawingContext *context); +GdkSurface * gdk_drawing_context_get_surface (GdkDrawingContext *context); GDK_AVAILABLE_IN_ALL GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index df304e2ff3..565721ad06 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -219,10 +219,10 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, { GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context); GdkGLContextProgram *program; - GdkSurface *window = gdk_gl_context_get_window (paint_context); - int window_scale = gdk_surface_get_scale_factor (window); - float w = gdk_surface_get_width (window) * window_scale; - float h = gdk_surface_get_height (window) * window_scale; + GdkSurface *window = gdk_gl_context_get_surface (paint_context); + int surface_scale = gdk_surface_get_scale_factor (window); + float w = gdk_surface_get_width (window) * surface_scale; + float h = gdk_surface_get_height (window) * surface_scale; int i; float *vertex_buffer_data; @@ -461,7 +461,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, GdkSurface *window; int unscaled_window_height; unsigned int texture_id; - int window_scale; + int surface_scale; double sx, sy; float umax, vmax; gboolean use_texture_rectangle; @@ -482,8 +482,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, /* Software fallback */ use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context); - window = gdk_gl_context_get_window (paint_context); - window_scale = gdk_surface_get_scale_factor (window); + window = gdk_gl_context_get_surface (paint_context); + surface_scale = gdk_surface_get_scale_factor (window); gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height); sx = sy = 1; @@ -512,8 +512,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, { cairo_region_get_rectangle (region, i, &rect); - glScissor (rect.x * window_scale, FLIP_Y ((rect.y + rect.height) * window_scale), - rect.width * window_scale, rect.height * window_scale); + glScissor (rect.x * surface_scale, FLIP_Y ((rect.y + rect.height) * surface_scale), + rect.width * surface_scale, rect.height * surface_scale); e = rect; e.x *= sx; @@ -546,8 +546,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, { GdkTexturedQuad quad = { - rect.x * window_scale, FLIP_Y(rect.y * window_scale), - (rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale), + rect.x * surface_scale, FLIP_Y(rect.y * surface_scale), + (rect.x + rect.width) * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale), 0, 0, umax, vmax, }; diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index c4dcab9b7e..69dc4976e1 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -265,7 +265,7 @@ gdk_gl_context_real_realize (GdkGLContext *self, static cairo_region_t * gdk_gl_context_real_get_damage (GdkGLContext *context) { - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); return cairo_region_create_rectangle (&(GdkRectangle) { 0, 0, @@ -295,7 +295,7 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context, cairo_region_union (region, damage); cairo_region_destroy (damage); - window = gdk_draw_context_get_window (draw_context); + window = gdk_draw_context_get_surface (draw_context); ww = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window); wh = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window); @@ -886,7 +886,7 @@ gdk_gl_context_get_display (GdkGLContext *context) } /** - * gdk_gl_context_get_window: + * gdk_gl_context_get_surface: * @context: a #GdkGLContext * * Retrieves the #GdkSurface used by the @context. @@ -894,11 +894,11 @@ gdk_gl_context_get_display (GdkGLContext *context) * Returns: (nullable) (transfer none): a #GdkSurface or %NULL */ GdkSurface * -gdk_gl_context_get_window (GdkGLContext *context) +gdk_gl_context_get_surface (GdkGLContext *context) { g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL); - return gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + return gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); } /** diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h index ae17936aa5..45d4f3d58a 100644 --- a/gdk/gdkglcontext.h +++ b/gdk/gdkglcontext.h @@ -45,7 +45,7 @@ GType gdk_gl_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context); GDK_AVAILABLE_IN_ALL -GdkSurface * gdk_gl_context_get_window (GdkGLContext *context); +GdkSurface * gdk_gl_context_get_surface (GdkGLContext *context); GDK_AVAILABLE_IN_ALL GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 490402f1ed..2e9d28dab4 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -93,7 +93,7 @@ gdk_gl_texture_download (GdkTexture *texture, { GdkSurface *window; - window = gdk_gl_context_get_window (self->context); + window = gdk_gl_context_get_surface (self->context); gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1, area->x, area->y, area->width, area->height); @@ -158,7 +158,7 @@ gdk_gl_texture_release (GdkGLTexture *self) cr = cairo_create (self->saved); - window = gdk_gl_context_get_window (self->context); + window = gdk_gl_context_get_surface (self->context); gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1, 0, 0, texture->width, texture->height); diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index c55353448a..1aae305feb 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -131,7 +131,7 @@ struct _GdkSurfaceAttr gint width; gint height; GdkSurfaceSurfaceClass wclass; - GdkSurfaceType window_type; + GdkSurfaceType surface_type; GdkSurfaceTypeHint type_hint; }; @@ -152,11 +152,11 @@ struct _GdkSurface gint y; GdkEventMask event_mask; - guint8 window_type; + guint8 surface_type; guint8 resize_count; - gint8 toplevel_window_type; + gint8 toplevel_surface_type; GList *children; GList children_list_node; @@ -212,7 +212,7 @@ struct _GdkSurface /* The GdkSurface that has the impl, ref:ed if another window. * This ref is required to keep the wrapper of the impl window alive * for as long as any GdkSurface references the impl. */ - GdkSurface *impl_window; + GdkSurface *impl_surface; guint update_and_descendants_freeze_count; @@ -244,7 +244,7 @@ struct _GdkSurface cairo_region_t *opaque_region; }; -#define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->window_type) +#define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->surface_type) #define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed) extern gint _gdk_screen_number; @@ -384,16 +384,16 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display, GdkEvent *event_in_queue, gulong serial, gboolean non_linear); -void _gdk_display_set_window_under_pointer (GdkDisplay *display, +void _gdk_display_set_surface_under_pointer (GdkDisplay *display, GdkDevice *device, GdkSurface *window); gboolean _gdk_surface_has_impl (GdkSurface *window); -GdkSurface * _gdk_surface_get_impl_window (GdkSurface *window); +GdkSurface * _gdk_surface_get_impl_surface (GdkSurface *window); void gdk_surface_destroy_notify (GdkSurface *window); -void gdk_synthesize_window_state (GdkSurface *window, +void gdk_synthesize_surface_state (GdkSurface *window, GdkSurfaceState unset_flags, GdkSurfaceState set_flags); diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c index eb77650288..b27282ce5f 100644 --- a/gdk/gdkmonitor.c +++ b/gdk/gdkmonitor.c @@ -34,7 +34,7 @@ * associated with a #GdkDisplay. GdkDisplay has APIs to enumerate * monitors with gdk_display_get_n_monitors() and gdk_display_get_monitor(), and * to find particular monitors with gdk_display_get_primary_monitor() or - * gdk_display_get_monitor_at_window(). + * gdk_display_get_monitor_at_surface(). */ /** diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index d37a5ac464..239ca6d304 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -88,7 +88,7 @@ * * GdkSurfaces have a pointer to the “impl window” they are in, i.e. * the topmost GdkSurface which have the same “impl” value. This is stored - * in impl_window, which is different from the window itself only for client + * in impl_surface, which is different from the window itself only for client * side windows. * All GdkSurfaces (native or not) track the position of the window in the parent * (x, y), the size of the window (width, height), the position of the window @@ -129,7 +129,7 @@ static void recompute_visible_regions (GdkSurface *private, static void gdk_surface_invalidate_in_parent (GdkSurface *private); static void update_cursor (GdkDisplay *display, GdkDevice *device); -static void impl_window_add_update_area (GdkSurface *impl_window, +static void impl_surface_add_update_area (GdkSurface *impl_surface, cairo_region_t *region); static void gdk_surface_invalidate_region_full (GdkSurface *window, const cairo_region_t *region, @@ -227,13 +227,13 @@ gdk_surface_init (GdkSurface *window) { /* 0-initialization is good for all other fields. */ - window->window_type = GDK_SURFACE_CHILD; + window->surface_type = GDK_SURFACE_CHILD; window->state = GDK_SURFACE_STATE_WITHDRAWN; window->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR; window->width = 1; window->height = 1; - window->toplevel_window_type = -1; + window->toplevel_surface_type = -1; window->children_list_node.data = window; window->device_cursor = g_hash_table_new_full (NULL, NULL, @@ -367,10 +367,10 @@ gdk_surface_finalize (GObject *object) window->impl = NULL; } - if (window->impl_window != window) + if (window->impl_surface != window) { - g_object_unref (window->impl_window); - window->impl_window = NULL; + g_object_unref (window->impl_surface); + window->impl_surface = NULL; } if (window->shape) @@ -455,25 +455,25 @@ gdk_surface_get_property (GObject *object, static gboolean gdk_surface_is_subsurface (GdkSurface *window) { - return window->window_type == GDK_SURFACE_SUBSURFACE; + return window->surface_type == GDK_SURFACE_SUBSURFACE; } static GdkSurface * -gdk_surface_get_impl_window (GdkSurface *window) +gdk_surface_get_impl_surface (GdkSurface *window) { - return window->impl_window; + return window->impl_surface; } GdkSurface * -_gdk_surface_get_impl_window (GdkSurface *window) +_gdk_surface_get_impl_surface (GdkSurface *window) { - return gdk_surface_get_impl_window (window); + return gdk_surface_get_impl_surface (window); } static gboolean gdk_surface_has_impl (GdkSurface *window) { - return window->impl_window == window; + return window->impl_surface == window; } static gboolean @@ -481,7 +481,7 @@ gdk_surface_is_toplevel (GdkSurface *window) { return window->parent == NULL || - window->parent->window_type == GDK_SURFACE_ROOT; + window->parent->surface_type == GDK_SURFACE_ROOT; } gboolean @@ -493,7 +493,7 @@ _gdk_surface_has_impl (GdkSurface *window) static gboolean gdk_surface_has_no_impl (GdkSurface *window) { - return window->impl_window != window; + return window->impl_surface != window; } static void @@ -609,9 +609,9 @@ should_apply_clip_as_shape (GdkSurface *window) /* Not for non-shaped toplevels */ (window->shape != NULL || window->applied_shape) && /* or for foreign windows */ - window->window_type != GDK_SURFACE_FOREIGN && + window->surface_type != GDK_SURFACE_FOREIGN && /* or for the root window */ - window->window_type != GDK_SURFACE_ROOT; + window->surface_type != GDK_SURFACE_ROOT; } static void @@ -695,9 +695,9 @@ recompute_visible_regions_internal (GdkSurface *private, /* Update absolute position */ if ((gdk_surface_has_impl (private) && - private->window_type != GDK_SURFACE_SUBSURFACE) || + private->surface_type != GDK_SURFACE_SUBSURFACE) || (gdk_surface_is_toplevel (private) && - private->window_type == GDK_SURFACE_SUBSURFACE)) + private->surface_type == GDK_SURFACE_SUBSURFACE)) { /* Native windows and toplevel subsurfaces start here */ private->abs_x = 0; @@ -752,7 +752,7 @@ recompute_visible_regions_internal (GdkSurface *private, /* Update all children, recursively (except for root, where children are not exact). */ if ((abs_pos_changed || clip_region_changed || recalculate_children) && - private->window_type != GDK_SURFACE_ROOT) + private->surface_type != GDK_SURFACE_ROOT) { for (l = private->children; l; l = l->next) { @@ -840,8 +840,8 @@ get_native_device_event_mask (GdkSurface *private, else event_mask = private->event_mask; - if (private->window_type == GDK_SURFACE_ROOT || - private->window_type == GDK_SURFACE_FOREIGN) + if (private->surface_type == GDK_SURFACE_ROOT || + private->surface_type == GDK_SURFACE_FOREIGN) return event_mask; else { @@ -902,19 +902,19 @@ gdk_surface_new (GdkDisplay *display, if (attributes->wclass == GDK_INPUT_ONLY) { /* Backwards compatiblity - we've always ignored - * attributes->window_type for input-only windows + * attributes->surface_type for input-only windows * before */ if (parent == NULL) - window->window_type = GDK_SURFACE_TEMP; + window->surface_type = GDK_SURFACE_TEMP; else - window->window_type = GDK_SURFACE_CHILD; + window->surface_type = GDK_SURFACE_CHILD; } else - window->window_type = attributes->window_type; + window->surface_type = attributes->surface_type; /* Sanity checks */ - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: @@ -941,7 +941,7 @@ gdk_surface_new (GdkDisplay *display, } break; default: - g_warning (G_STRLOC "cannot make windows of type %d", window->window_type); + g_warning (G_STRLOC "cannot make windows of type %d", window->surface_type); return NULL; } @@ -970,7 +970,7 @@ gdk_surface_new (GdkDisplay *display, } #ifdef GDK_WINDOWING_WAYLAND - if (window->window_type == GDK_SURFACE_SUBSURFACE) + if (window->surface_type == GDK_SURFACE_SUBSURFACE) native = TRUE; /* Always use native windows for subsurfaces as well */ #endif @@ -979,13 +979,13 @@ gdk_surface_new (GdkDisplay *display, event_mask = get_native_event_mask (window); /* Create the impl */ - _gdk_display_create_window_impl (display, window, parent, event_mask, attributes); - window->impl_window = window; + _gdk_display_create_surface_impl (display, window, parent, event_mask, attributes); + window->impl_surface = window; } else { - window->impl_window = g_object_ref (window->parent->impl_window); - window->impl = g_object_ref (window->impl_window->impl); + window->impl_surface = g_object_ref (window->parent->impl_surface); + window->impl = g_object_ref (window->impl_surface->impl); } recompute_visible_regions (window, FALSE); @@ -1020,7 +1020,7 @@ gdk_surface_new_toplevel (GdkDisplay *display, attr.y = 0; attr.width = width; attr.height = height; - attr.window_type = GDK_SURFACE_TOPLEVEL; + attr.surface_type = GDK_SURFACE_TOPLEVEL; return gdk_surface_new (display, NULL, &attr); } @@ -1049,7 +1049,7 @@ gdk_surface_new_popup (GdkDisplay *display, attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_SURFACE_TEMP; + attr.surface_type = GDK_SURFACE_TEMP; return gdk_surface_new (display, NULL, &attr); } @@ -1077,7 +1077,7 @@ gdk_surface_new_temp (GdkDisplay *display) attr.y = -100; attr.width = 10; attr.height = 10; - attr.window_type = GDK_SURFACE_TEMP; + attr.surface_type = GDK_SURFACE_TEMP; return gdk_surface_new (display, NULL, &attr); } @@ -1104,7 +1104,7 @@ gdk_surface_new_child (GdkSurface *parent, attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_SURFACE_CHILD; + attr.surface_type = GDK_SURFACE_CHILD; return gdk_surface_new (gdk_surface_get_display (parent), parent, &attr); } @@ -1117,10 +1117,10 @@ update_pointer_info_foreach (GdkDisplay *display, { GdkSurface *window = user_data; - if (pointer_info->window_under_pointer == window) + if (pointer_info->surface_under_pointer == window) { - g_object_unref (pointer_info->window_under_pointer); - pointer_info->window_under_pointer = NULL; + g_object_unref (pointer_info->surface_under_pointer); + pointer_info->surface_under_pointer = NULL; } } @@ -1181,7 +1181,7 @@ _gdk_surface_destroy_hierarchy (GdkSurface *window, display = gdk_surface_get_display (window); - switch (window->window_type) + switch (window->surface_type) { default: g_assert_not_reached (); @@ -1199,7 +1199,7 @@ _gdk_surface_destroy_hierarchy (GdkSurface *window, case GDK_SURFACE_TEMP: case GDK_SURFACE_FOREIGN: case GDK_SURFACE_SUBSURFACE: - if (window->window_type == GDK_SURFACE_FOREIGN && !foreign_destroy) + if (window->surface_type == GDK_SURFACE_FOREIGN && !foreign_destroy) { } else @@ -1233,7 +1233,7 @@ _gdk_surface_destroy_hierarchy (GdkSurface *window, gdk_surface_free_current_paint (window); - if (window->window_type == GDK_SURFACE_FOREIGN) + if (window->surface_type == GDK_SURFACE_FOREIGN) g_assert (window->children == NULL); else { @@ -1361,7 +1361,7 @@ gdk_surface_get_user_data (GdkSurface *window, } /** - * gdk_surface_get_window_type: + * gdk_surface_get_surface_type: * @window: a #GdkSurface * * Gets the type of the window. See #GdkSurfaceType. @@ -1369,7 +1369,7 @@ gdk_surface_get_user_data (GdkSurface *window, * Returns: type of window **/ GdkSurfaceType -gdk_surface_get_window_type (GdkSurface *window) +gdk_surface_get_surface_type (GdkSurface *window) { g_return_val_if_fail (GDK_IS_SURFACE (window), (GdkSurfaceType) -1); @@ -1490,8 +1490,8 @@ gdk_surface_get_toplevel (GdkSurface *window) { g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - while (window->window_type == GDK_SURFACE_CHILD || - window->window_type == GDK_SURFACE_SUBSURFACE) + while (window->surface_type == GDK_SURFACE_CHILD || + window->surface_type == GDK_SURFACE_SUBSURFACE) { if (gdk_surface_is_toplevel (window)) break; @@ -1614,7 +1614,7 @@ gdk_surface_is_visible (GdkSurface *window) * * Check if the window and all ancestors of the window are * mapped. (This is not necessarily "viewable" in the X sense, since - * we only check as far as we have GDK window parents, not to the root + * we only check as far as we have GDK surface parents, not to the root * window.) * * Returns: %TRUE if the window is viewable @@ -1665,7 +1665,7 @@ gdk_surface_get_content (GdkSurface *window) static cairo_surface_t * gdk_surface_ref_impl_surface (GdkSurface *window) { - return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_surface_get_impl_window (window)); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_surface_get_impl_surface (window)); } GdkGLContext * @@ -1682,7 +1682,7 @@ gdk_surface_get_paint_gl_context (GdkSurface *window, return NULL; } - if (window->impl_window->gl_paint_context == NULL) + if (window->impl_surface->gl_paint_context == NULL) { GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); @@ -1693,8 +1693,8 @@ gdk_surface_get_paint_gl_context (GdkSurface *window, return NULL; } - window->impl_window->gl_paint_context = - impl_class->create_gl_context (window->impl_window, + window->impl_surface->gl_paint_context = + impl_class->create_gl_context (window->impl_surface, TRUE, NULL, &internal_error); @@ -1703,19 +1703,19 @@ gdk_surface_get_paint_gl_context (GdkSurface *window, if (internal_error != NULL) { g_propagate_error (error, internal_error); - g_clear_object (&(window->impl_window->gl_paint_context)); + g_clear_object (&(window->impl_surface->gl_paint_context)); return NULL; } - gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_error); + gdk_gl_context_realize (window->impl_surface->gl_paint_context, &internal_error); if (internal_error != NULL) { g_propagate_error (error, internal_error); - g_clear_object (&(window->impl_window->gl_paint_context)); + g_clear_object (&(window->impl_surface->gl_paint_context)); return NULL; } - return window->impl_window->gl_paint_context; + return window->impl_surface->gl_paint_context; } /** @@ -1748,7 +1748,7 @@ gdk_surface_create_gl_context (GdkSurface *window, if (paint_context == NULL) return NULL; - return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window, + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_surface, FALSE, paint_context, error); @@ -1943,7 +1943,7 @@ gdk_surface_begin_draw_frame (GdkSurface *window, if (draw_context != NULL) { g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (draw_context), NULL); - g_return_val_if_fail (gdk_draw_context_get_window (draw_context) == window, NULL); + g_return_val_if_fail (gdk_draw_context_get_surface (draw_context) == window, NULL); } if (GDK_SURFACE_DESTROYED (window)) @@ -2046,9 +2046,9 @@ gdk_surface_get_current_paint_region (GdkSurface *window) { cairo_region_t *region; - if (window->impl_window->current_paint.region != NULL) + if (window->impl_surface->current_paint.region != NULL) { - region = cairo_region_copy (window->impl_window->current_paint.region); + region = cairo_region_copy (window->impl_surface->current_paint.region); cairo_region_translate (region, -window->abs_x, -window->abs_y); } else @@ -2150,13 +2150,13 @@ gdk_surface_clear_backing_region (GdkSurface *window) static cairo_surface_t * ref_window_surface (GdkSurface *window) { - if (window->impl_window->current_paint.surface) - return cairo_surface_reference (window->impl_window->current_paint.surface); + if (window->impl_surface->current_paint.surface) + return cairo_surface_reference (window->impl_surface->current_paint.surface); else return gdk_surface_ref_impl_surface (window); } -/* This is used in places like gdk_cairo_set_source_window and +/* This is used in places like gdk_cairo_set_source_surface and * other places to take "screenshots" of windows. Thus, we allow * it to be used outside of a begin_paint / end_paint. */ cairo_surface_t * @@ -2445,7 +2445,7 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock, window = GDK_SURFACE (data); g_return_if_fail (GDK_IS_SURFACE (window)); - g_return_if_fail (window->impl_window == window); + g_return_if_fail (window->impl_surface == window); if (GDK_SURFACE_DESTROYED (window)) return; @@ -2517,16 +2517,16 @@ gdk_surface_invalidate_rect (GdkSurface *window, } static void -impl_window_add_update_area (GdkSurface *impl_window, +impl_surface_add_update_area (GdkSurface *impl_surface, cairo_region_t *region) { - if (impl_window->update_area) - cairo_region_union (impl_window->update_area, region); + if (impl_surface->update_area) + cairo_region_union (impl_surface->update_area, region); else { - gdk_surface_add_update_window (impl_window); - impl_window->update_area = cairo_region_copy (region); - gdk_surface_schedule_update (impl_window); + gdk_surface_add_update_window (impl_surface); + impl_surface->update_area = cairo_region_copy (region); + gdk_surface_schedule_update (impl_surface); } } @@ -2547,7 +2547,7 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window, if (window->input_only || !window->viewable || cairo_region_is_empty (region) || - window->window_type == GDK_SURFACE_ROOT) + window->surface_type == GDK_SURFACE_ROOT) return; r.x = 0; @@ -2564,7 +2564,7 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window, if (gdk_surface_has_impl (window)) { - impl_window_add_update_area (window, visible_region); + impl_surface_add_update_area (window, visible_region); break; } else @@ -2697,19 +2697,19 @@ _gdk_surface_invalidate_for_expose (GdkSurface *window, cairo_region_t * gdk_surface_get_update_area (GdkSurface *window) { - GdkSurface *impl_window; + GdkSurface *impl_surface; cairo_region_t *tmp_region, *to_remove; g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - impl_window = gdk_surface_get_impl_window (window); + impl_surface = gdk_surface_get_impl_surface (window); - if (impl_window->update_area) + if (impl_surface->update_area) { tmp_region = cairo_region_copy (window->clip_region); /* Convert to impl coords */ cairo_region_translate (tmp_region, window->abs_x, window->abs_y); - cairo_region_intersect (tmp_region, impl_window->update_area); + cairo_region_intersect (tmp_region, impl_surface->update_area); if (cairo_region_is_empty (tmp_region)) { @@ -2730,16 +2730,16 @@ gdk_surface_get_update_area (GdkSurface *window) /* Remove from update_area */ cairo_region_translate (to_remove, window->abs_x, window->abs_y); - cairo_region_subtract (impl_window->update_area, to_remove); + cairo_region_subtract (impl_surface->update_area, to_remove); cairo_region_destroy (to_remove); - if (cairo_region_is_empty (impl_window->update_area)) + if (cairo_region_is_empty (impl_surface->update_area)) { - cairo_region_destroy (impl_window->update_area); - impl_window->update_area = NULL; + cairo_region_destroy (impl_surface->update_area); + impl_surface->update_area = NULL; - gdk_surface_remove_update_window ((GdkSurface *)impl_window); + gdk_surface_remove_update_window ((GdkSurface *)impl_surface); } return tmp_region; @@ -2783,12 +2783,12 @@ _gdk_surface_clear_update_area (GdkSurface *window) void gdk_surface_freeze_updates (GdkSurface *window) { - GdkSurface *impl_window; + GdkSurface *impl_surface; g_return_if_fail (GDK_IS_SURFACE (window)); - impl_window = gdk_surface_get_impl_window (window); - impl_window->update_freeze_count++; + impl_surface = gdk_surface_get_impl_surface (window); + impl_surface->update_freeze_count++; } /** @@ -2800,23 +2800,23 @@ gdk_surface_freeze_updates (GdkSurface *window) void gdk_surface_thaw_updates (GdkSurface *window) { - GdkSurface *impl_window; + GdkSurface *impl_surface; g_return_if_fail (GDK_IS_SURFACE (window)); - impl_window = gdk_surface_get_impl_window (window); + impl_surface = gdk_surface_get_impl_surface (window); - g_return_if_fail (impl_window->update_freeze_count > 0); + g_return_if_fail (impl_surface->update_freeze_count > 0); - if (--impl_window->update_freeze_count == 0) - gdk_surface_schedule_update (GDK_SURFACE (impl_window)); + if (--impl_surface->update_freeze_count == 0) + gdk_surface_schedule_update (GDK_SURFACE (impl_surface)); } void gdk_surface_freeze_toplevel_updates (GdkSurface *window) { g_return_if_fail (GDK_IS_SURFACE (window)); - g_return_if_fail (window->window_type != GDK_SURFACE_CHILD); + g_return_if_fail (window->surface_type != GDK_SURFACE_CHILD); window->update_and_descendants_freeze_count++; _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window)); @@ -2826,7 +2826,7 @@ void gdk_surface_thaw_toplevel_updates (GdkSurface *window) { g_return_if_fail (GDK_IS_SURFACE (window)); - g_return_if_fail (window->window_type != GDK_SURFACE_CHILD); + g_return_if_fail (window->surface_type != GDK_SURFACE_CHILD); g_return_if_fail (window->update_and_descendants_freeze_count > 0); window->update_and_descendants_freeze_count--; @@ -2977,7 +2977,7 @@ gdk_surface_constrain_size (GdkGeometry *geometry, * corner of @window. * * Returns: (nullable) (transfer none): The window underneath @device - * (as with gdk_device_get_window_at_position()), or %NULL if the + * (as with gdk_device_get_surface_at_position()), or %NULL if the * window is not known to GDK. **/ GdkSurface * @@ -3032,7 +3032,7 @@ gdk_surface_get_device_position_double (GdkSurface *window, * Use gdk_surface_get_device_position_double() if you need subpixel precision. * * Returns: (nullable) (transfer none): The window underneath @device - * (as with gdk_device_get_window_at_position()), or %NULL if the + * (as with gdk_device_get_surface_at_position()), or %NULL if the * window is not known to GDK. **/ GdkSurface * @@ -3110,8 +3110,8 @@ _gdk_surface_update_viewable (GdkSurface *window) { gboolean viewable; - if (window->window_type == GDK_SURFACE_FOREIGN || - window->window_type == GDK_SURFACE_ROOT) + if (window->surface_type == GDK_SURFACE_FOREIGN || + window->surface_type == GDK_SURFACE_ROOT) viewable = TRUE; else if (gdk_surface_is_toplevel (window) || window->parent->viewable) @@ -3146,7 +3146,7 @@ gdk_surface_show_internal (GdkSurface *window, gboolean raise) if (gdk_surface_has_impl (window)) { if (!was_mapped) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_WITHDRAWN, 0); } @@ -3197,7 +3197,7 @@ gdk_surface_show_internal (GdkSurface *window, gboolean raise) * * On the X11 platform, in Xlib terms, this function calls * XMapWindow() (it also updates some internal GDK state, which means - * that you can’t really use XMapWindow() directly on a GDK window). + * that you can’t really use XMapWindow() directly on a GDK surface). */ void gdk_surface_show_unraised (GdkSurface *window) @@ -3426,7 +3426,7 @@ gdk_surface_hide (GdkSurface *window) { if (GDK_SURFACE_IS_MAPPED (window)) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); } @@ -3532,7 +3532,7 @@ gdk_surface_withdraw (GdkSurface *window) } current_context = gdk_gl_context_get_current (); - if (current_context != NULL && gdk_gl_context_get_window (current_context) == window) + if (current_context != NULL && gdk_gl_context_get_surface (current_context) == window) gdk_gl_context_clear_current (); recompute_visible_regions (window, FALSE); @@ -3640,7 +3640,7 @@ gdk_surface_set_device_events (GdkSurface *window, native = gdk_surface_get_toplevel (window); device_mask = get_native_device_event_mask (window, device); - GDK_DEVICE_GET_CLASS (device)->select_window_events (device, native, device_mask); + GDK_DEVICE_GET_CLASS (device)->select_surface_events (device, native, device_mask); } /** @@ -3888,7 +3888,7 @@ gdk_surface_move_resize (GdkSurface *window, * @window: the #GdkSurface to move * @rect: (not nullable): the destination #GdkRectangle to align @window with * @rect_anchor: the point on @rect to align with @window's anchor point - * @window_anchor: the point on @window to align with @rect's anchor point + * @surface_anchor: the point on @window to align with @rect's anchor point * @anchor_hints: positioning hints to use when limited on space * @rect_anchor_dx: horizontal offset to shift @window, i.e. @rect's anchor * point @@ -3897,7 +3897,7 @@ gdk_surface_move_resize (GdkSurface *window, * Moves @window to @rect, aligning their anchor points. * * @rect is relative to the top-left corner of the window that @window is - * transient for. @rect_anchor and @window_anchor determine anchor points on + * transient for. @rect_anchor and @surface_anchor determine anchor points on * @rect and @window to pin together. @rect's anchor point can optionally be * offset by @rect_anchor_dx and @rect_anchor_dy, which is equivalent to * offsetting the position of @window. @@ -3916,7 +3916,7 @@ void gdk_surface_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy) @@ -3931,7 +3931,7 @@ gdk_surface_move_to_rect (GdkSurface *window, impl_class->move_to_rect (window, rect, rect_anchor, - window_anchor, + surface_anchor, anchor_hints, rect_anchor_dx, rect_anchor_dy); @@ -4037,9 +4037,9 @@ gdk_surface_set_cursor_internal (GdkSurface *window, g_assert (gdk_surface_get_display (window) == gdk_device_get_display (device)); - if (window->window_type == GDK_SURFACE_ROOT || - window->window_type == GDK_SURFACE_FOREIGN) - GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor); + if (window->surface_type == GDK_SURFACE_ROOT || + window->surface_type == GDK_SURFACE_FOREIGN) + GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, window, cursor); else { GdkPointerSurfaceInfo *pointer_info; @@ -4048,7 +4048,7 @@ gdk_surface_set_cursor_internal (GdkSurface *window, display = gdk_surface_get_display (window); pointer_info = _gdk_display_get_pointer_info (display, device); - if (_gdk_surface_event_parent_of (window, pointer_info->window_under_pointer)) + if (_gdk_surface_event_parent_of (window, pointer_info->surface_under_pointer)) update_cursor (display, device); } } @@ -4370,7 +4370,7 @@ gdk_surface_get_root_coords (GdkSurface *window, } impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); - impl_class->get_root_coords (window->impl_window, + impl_class->get_root_coords (window->impl_surface, x + window->abs_x, y + window->abs_y, root_x, root_y); @@ -4854,7 +4854,7 @@ get_event_toplevel (GdkSurface *window) GdkSurface *parent; while ((parent = window->parent) != NULL && - (parent->window_type != GDK_SURFACE_ROOT)) + (parent->surface_type != GDK_SURFACE_ROOT)) window = parent; return window; @@ -4889,7 +4889,7 @@ update_cursor (GdkDisplay *display, GdkCursor *cursor; pointer_info = _gdk_display_get_pointer_info (display, device); - pointer_window = pointer_info->window_under_pointer; + pointer_window = pointer_info->surface_under_pointer; /* We ignore the serials here and just pick the last grab we've sent, as that would shortly be used anyway. */ @@ -4913,7 +4913,7 @@ update_cursor (GdkDisplay *display, while (cursor_window->cursor == NULL && !g_hash_table_contains (cursor_window->device_cursor, device) && (parent = cursor_window->parent) != NULL && - parent->window_type != GDK_SURFACE_ROOT) + parent->surface_type != GDK_SURFACE_ROOT) cursor_window = parent; cursor = g_hash_table_lookup (cursor_window->device_cursor, device); @@ -4924,7 +4924,7 @@ update_cursor (GdkDisplay *display, /* Set all cursors on toplevel, otherwise its tricky to keep track of * which native window has what cursor set. */ toplevel = get_event_toplevel (pointer_window); - GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, toplevel, cursor); + GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, toplevel, cursor); } static gboolean @@ -4946,12 +4946,12 @@ point_in_window (GdkSurface *window, /* Same as point_in_window, except it also takes pass_through and its interaction with child windows into account */ static gboolean -point_in_input_window (GdkSurface *window, +point_in_input_surface (GdkSurface *window, gdouble x, gdouble y, - GdkSurface **input_window, - gdouble *input_window_x, - gdouble *input_window_y) + GdkSurface **input_surface, + gdouble *input_surface_x, + gdouble *input_surface_y) { GdkSurface *sub; double child_x, child_y; @@ -4962,11 +4962,11 @@ point_in_input_window (GdkSurface *window, if (!window->pass_through) { - if (input_window) + if (input_surface) { - *input_window = window; - *input_window_x = x; - *input_window_y = y; + *input_surface = window; + *input_surface_x = x; + *input_surface_y = y; } return TRUE; } @@ -4984,15 +4984,15 @@ point_in_input_window (GdkSurface *window, gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); - if (point_in_input_window (sub, child_x, child_y, - input_window, input_window_x, input_window_y)) + if (point_in_input_surface (sub, child_x, child_y, + input_surface, input_surface_x, input_surface_y)) { - if (input_window) + if (input_surface) gdk_surface_coords_to_parent (sub, - *input_window_x, - *input_window_y, - input_window_x, - input_window_y); + *input_surface_x, + *input_surface_y, + input_surface_x, + input_surface_y); return TRUE; } } @@ -5022,7 +5022,7 @@ _gdk_surface_find_child_at (GdkSurface *window, gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); - if (point_in_input_window (sub, child_x, child_y, + if (point_in_input_surface (sub, child_x, child_y, NULL, NULL, NULL)) return (GdkSurface *)sub; } @@ -5038,7 +5038,7 @@ _gdk_surface_find_descendant_at (GdkSurface *window, gdouble *found_x, gdouble *found_y) { - GdkSurface *sub, *input_window; + GdkSurface *sub, *input_surface; gdouble child_x, child_y; GList *l; gboolean found; @@ -5059,12 +5059,12 @@ _gdk_surface_find_descendant_at (GdkSurface *window, gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); - if (point_in_input_window (sub, child_x, child_y, - &input_window, &child_x, &child_y)) + if (point_in_input_surface (sub, child_x, child_y, + &input_surface, &child_x, &child_y)) { x = child_x; y = child_y; - window = input_window; + window = input_surface; found = TRUE; break; } @@ -5273,7 +5273,7 @@ _gdk_make_event (GdkSurface *window, } void -_gdk_display_set_window_under_pointer (GdkDisplay *display, +_gdk_display_set_surface_under_pointer (GdkDisplay *display, GdkDevice *device, GdkSurface *window) { @@ -5281,9 +5281,9 @@ _gdk_display_set_window_under_pointer (GdkDisplay *display, device_info = _gdk_display_get_pointer_info (display, device); - if (device_info->window_under_pointer) - g_object_unref (device_info->window_under_pointer); - device_info->window_under_pointer = window; + if (device_info->surface_under_pointer) + g_object_unref (device_info->surface_under_pointer); + device_info->surface_under_pointer = window; if (window) { @@ -5309,7 +5309,7 @@ gdk_surface_print (GdkSurface *window, int indent) { char *s; - const char *window_types[] = { + const char *surface_types[] = { "root", "toplevel", "child", @@ -5332,8 +5332,8 @@ gdk_surface_print (GdkSurface *window, #endif } - if (window->window_type != GDK_SURFACE_CHILD) - g_print (" %s", window_types[window->window_type]); + if (window->surface_type != GDK_SURFACE_CHILD) + g_print (" %s", surface_types[window->surface_type]); if (window->input_only) g_print (" input-only"); @@ -5382,7 +5382,7 @@ _gdk_windowing_got_event (GdkDisplay *display, GdkEvent *event, gulong serial) { - GdkSurface *event_window; + GdkSurface *event_surface; gboolean unlink_event = FALSE; GdkDeviceGrabInfo *button_release_grab; GdkPointerSurfaceInfo *pointer_info = NULL; @@ -5420,8 +5420,8 @@ _gdk_windowing_got_event (GdkDisplay *display, } } - event_window = event->any.window; - if (!event_window) + event_surface = event->any.window; + if (!event_surface) goto out; #ifdef DEBUG_WINDOW_PRINTING @@ -5429,17 +5429,17 @@ _gdk_windowing_got_event (GdkDisplay *display, (event->key.keyval == 0xa7 || event->key.keyval == 0xbd)) { - gdk_surface_print_tree (event_window, 0, event->key.keyval == 0xbd); + gdk_surface_print_tree (event_surface, 0, event->key.keyval == 0xbd); } #endif - if (event_window->window_type == GDK_SURFACE_ROOT) + if (event_surface->surface_type == GDK_SURFACE_ROOT) goto out; if (event->any.type == GDK_ENTER_NOTIFY) - _gdk_display_set_window_under_pointer (display, device, event_window); + _gdk_display_set_surface_under_pointer (display, device, event_surface); else if (event->any.type == GDK_LEAVE_NOTIFY) - _gdk_display_set_window_under_pointer (display, device, NULL); + _gdk_display_set_surface_under_pointer (display, device, NULL); if ((event->any.type == GDK_BUTTON_RELEASE || event->any.type == GDK_TOUCH_CANCEL || @@ -6760,7 +6760,7 @@ gdk_surface_get_unscaled_size (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); - if (window->impl_window == window) + if (window->impl_surface == window) { impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); @@ -6934,7 +6934,7 @@ gdk_surface_set_state (GdkSurface *window, * Non-toplevels do use the GDK_SURFACE_STATE_WITHDRAWN flag * internally so we needed to update window->state. */ - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: /* ? */ @@ -6949,7 +6949,7 @@ gdk_surface_set_state (GdkSurface *window, } void -gdk_synthesize_window_state (GdkSurface *window, +gdk_synthesize_surface_state (GdkSurface *window, GdkSurfaceState unset_flags, GdkSurfaceState set_flags) { diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index 9cc1b57030..0332544ff7 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -461,7 +461,7 @@ GdkSurface * gdk_surface_new_child (GdkSurface *parent, GDK_AVAILABLE_IN_ALL void gdk_surface_destroy (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkSurfaceType gdk_surface_get_window_type (GdkSurface *window); +GdkSurfaceType gdk_surface_get_surface_type (GdkSurface *window); GDK_AVAILABLE_IN_ALL gboolean gdk_surface_is_destroyed (GdkSurface *window); diff --git a/gdk/gdksurfaceimpl.c b/gdk/gdksurfaceimpl.c index f5c329688a..a228162330 100644 --- a/gdk/gdksurfaceimpl.c +++ b/gdk/gdksurfaceimpl.c @@ -40,7 +40,7 @@ gdk_surface_impl_beep (GdkSurface *window) } static GdkDisplay * -get_display_for_window (GdkSurface *primary, +get_display_for_surface (GdkSurface *primary, GdkSurface *secondary) { GdkDisplay *display = gdk_surface_get_display (primary); @@ -185,7 +185,7 @@ traverse_to_toplevel (GdkSurface *window, gdouble yf = y; while ((parent = window->parent) != NULL && - (gdk_surface_get_window_type (parent) != GDK_SURFACE_ROOT)) + (gdk_surface_get_surface_type (parent) != GDK_SURFACE_ROOT)) { gdk_surface_coords_to_parent (window, xf, yf, &xf, &yf); window = parent; @@ -200,7 +200,7 @@ static void gdk_surface_impl_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy) @@ -232,7 +232,7 @@ gdk_surface_impl_move_to_rect (GdkSurface *window, &root_rect.x, &root_rect.y); - display = get_display_for_window (window, window->transient_for); + display = get_display_for_surface (window, window->transient_for); monitor = get_monitor_for_rect (display, &root_rect); gdk_monitor_get_workarea (monitor, &bounds); @@ -244,7 +244,7 @@ gdk_surface_impl_move_to_rect (GdkSurface *window, root_rect.width, flipped_rect.width, get_anchor_x_sign (rect_anchor), - get_anchor_x_sign (window_anchor), + get_anchor_x_sign (surface_anchor), rect_anchor_dx, anchor_hints & GDK_ANCHOR_FLIP_X, &flipped_x); @@ -254,7 +254,7 @@ gdk_surface_impl_move_to_rect (GdkSurface *window, root_rect.height, flipped_rect.height, get_anchor_y_sign (rect_anchor), - get_anchor_y_sign (window_anchor), + get_anchor_y_sign (surface_anchor), rect_anchor_dy, anchor_hints & GDK_ANCHOR_FLIP_Y, &flipped_y); diff --git a/gdk/gdksurfaceimpl.h b/gdk/gdksurfaceimpl.h index 7a1dcb4bb0..66c07ef375 100644 --- a/gdk/gdksurfaceimpl.h +++ b/gdk/gdksurfaceimpl.h @@ -76,7 +76,7 @@ struct _GdkSurfaceImplClass void (* move_to_rect) (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy); diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index 6daf7c346c..fcb82f3b87 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -250,7 +250,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context, GError **error) { GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context); - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); VkSurfaceCapabilitiesKHR capabilities; VkCompositeAlphaFlagBitsKHR composite_alpha; VkSwapchainKHR new_swapchain; diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index 60067f5c7a..1a567cf8ad 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -58,7 +58,7 @@ { GdkSurface *window = [[self contentView] gdkWindow]; - gdk_synthesize_window_state (window, 0, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); } @@ -68,14 +68,14 @@ _gdk_quartz_surface_attach_to_parent (window); - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); } -(void)windowDidBecomeKey:(NSNotification *)aNotification { GdkSurface *window = [[self contentView] gdkWindow]; - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FOCUSED); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED); _gdk_quartz_events_update_focus_window (window, TRUE); } @@ -84,7 +84,7 @@ GdkSurface *window = [[self contentView] gdkWindow]; _gdk_quartz_events_update_focus_window (window, FALSE); - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FOCUSED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0); } -(void)windowDidBecomeMain:(NSNotification *)aNotification @@ -195,7 +195,7 @@ /* In case the window is changed when maximized remove the maximized state */ if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } @@ -226,7 +226,7 @@ /* see same in windowDidMove */ if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } @@ -311,7 +311,7 @@ /* Popup windows should not be able to get focused in the window * manager sense, it's only handled through grabs. */ - if (window->window_type == GDK_SURFACE_TEMP) + if (window->surface_type == GDK_SURFACE_TEMP) return NO; switch (impl->type_hint) @@ -726,7 +726,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) GList* windows, *list; gint gx, gy; - event->dnd.context->dest_window = NULL; + event->dnd.context->dest_surface = NULL; windows = get_toplevels (); _gdk_quartz_surface_nspoint_to_gdk_xy (aPoint, &gx, &gy); @@ -742,7 +742,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) wh = gdk_surface_get_height (win); if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh) - event->dnd.context->dest_window = win; + event->dnd.context->dest_surface = win; } } @@ -818,14 +818,14 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) if (maximized) { lastMaximizedFrame = newFrame; - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } else { lastUnmaximizedFrame = [nsWindow frame]; - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); } diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c index c42680e3ac..bc1ef6f6c5 100644 --- a/gdk/quartz/gdkdevice-core-quartz.c +++ b/gdk/quartz/gdkdevice-core-quartz.c @@ -47,7 +47,7 @@ static void gdk_quartz_device_core_get_state (GdkDevice *device, GdkSurface *window, gdouble *axes, GdkModifierType *mask); -static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device, +static void gdk_quartz_device_core_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor); static void gdk_quartz_device_core_warp (GdkDevice *device, @@ -71,12 +71,12 @@ static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device, guint32 time_); static void gdk_quartz_device_core_ungrab (GdkDevice *device, guint32 time_); -static GdkSurface * gdk_quartz_device_core_window_at_position (GdkDevice *device, +static GdkSurface * gdk_quartz_device_core_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); -static void gdk_quartz_device_core_select_window_events (GdkDevice *device, +static void gdk_quartz_device_core_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask); @@ -90,13 +90,13 @@ gdk_quartz_device_core_class_init (GdkQuartzDeviceCoreClass *klass) device_class->get_history = gdk_quartz_device_core_get_history; device_class->get_state = gdk_quartz_device_core_get_state; - device_class->set_window_cursor = gdk_quartz_device_core_set_window_cursor; + device_class->set_surface_cursor = gdk_quartz_device_core_set_surface_cursor; device_class->warp = gdk_quartz_device_core_warp; device_class->query_state = gdk_quartz_device_core_query_state; device_class->grab = gdk_quartz_device_core_grab; device_class->ungrab = gdk_quartz_device_core_ungrab; - device_class->window_at_position = gdk_quartz_device_core_window_at_position; - device_class->select_window_events = gdk_quartz_device_core_select_window_events; + device_class->surface_at_position = gdk_quartz_device_core_surface_at_position; + device_class->select_surface_events = gdk_quartz_device_core_select_surface_events; } static void @@ -163,7 +163,7 @@ translate_coords_to_child_coords (GdkSurface *parent, } static void -gdk_quartz_device_core_set_window_cursor (GdkDevice *device, +gdk_quartz_device_core_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -317,7 +317,7 @@ gdk_quartz_device_core_ungrab (GdkDevice *device, } static GdkSurface * -gdk_quartz_device_core_window_at_position (GdkDevice *device, +gdk_quartz_device_core_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -350,7 +350,7 @@ gdk_quartz_device_core_window_at_position (GdkDevice *device, } static void -gdk_quartz_device_core_select_window_events (GdkDevice *device, +gdk_quartz_device_core_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c index 1bfb4459dd..dc933f9106 100644 --- a/gdk/quartz/gdkdisplay-quartz.c +++ b/gdk/quartz/gdkdisplay-quartz.c @@ -215,7 +215,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class) object_class->finalize = gdk_quartz_display_finalize; object_class->dispose = gdk_quartz_display_dispose; - display_class->window_type = GDK_TYPE_QUARTZ_SURFACE; + display_class->surface_type = GDK_TYPE_QUARTZ_SURFACE; display_class->get_name = gdk_quartz_display_get_name; display_class->beep = gdk_quartz_display_beep; @@ -235,7 +235,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class) display_class->notify_startup_complete = gdk_quartz_display_notify_startup_complete; display_class->event_data_copy = _gdk_quartz_display_event_data_copy; display_class->event_data_free = _gdk_quartz_display_event_data_free; - display_class->create_window_impl = _gdk_quartz_display_create_window_impl; + display_class->create_surface_impl = _gdk_quartz_display_create_surface_impl; display_class->get_keymap = _gdk_quartz_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_quartz_display_text_property_to_utf8_list; display_class->utf8_to_string_target = _gdk_quartz_display_utf8_to_string_target; diff --git a/gdk/quartz/gdkdisplay-quartz.h b/gdk/quartz/gdkdisplay-quartz.h index 4e25106879..3799f54d61 100644 --- a/gdk/quartz/gdkdisplay-quartz.h +++ b/gdk/quartz/gdkdisplay-quartz.h @@ -62,7 +62,7 @@ void _gdk_quartz_display_get_maximal_cursor_size (GdkDisplay *display, /* Display methods - window */ void _gdk_quartz_display_before_process_all_updates (GdkDisplay *display); void _gdk_quartz_display_after_process_all_updates (GdkDisplay *display); -void _gdk_quartz_display_create_window_impl (GdkDisplay *display, +void _gdk_quartz_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c index 66b8d35c84..d1a7ec0936 100644 --- a/gdk/quartz/gdkdnd-quartz.c +++ b/gdk/quartz/gdkdnd-quartz.c @@ -48,7 +48,7 @@ _gdk_quartz_surface_drag_begin (GdkSurface *window, NULL); _gdk_quartz_drag_source_context->is_source = TRUE; - _gdk_quartz_drag_source_context->source_window = window; + _gdk_quartz_drag_source_context->source_surface = window; g_object_ref (window); _gdk_quartz_drag_source_context->targets = targets; diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index c85f071c18..f17f27c4a0 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -39,7 +39,7 @@ #define GRIP_HEIGHT 15 #define GDK_LION_RESIZE 5 -#define WINDOW_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) +#define SURFACE_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) /* This is the window corresponding to the key window */ static GdkSurface *current_keyboard_window; @@ -615,7 +615,7 @@ find_toplevel_under_pointer (GdkDisplay *display, info = _gdk_display_get_pointer_info (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer); toplevel = info->toplevel_under_pointer; - if (toplevel && WINDOW_IS_TOPLEVEL (toplevel)) + if (toplevel && SURFACE_IS_TOPLEVEL (toplevel)) get_window_point_from_screen_point (toplevel, screen_point, x, y); if (toplevel) @@ -701,7 +701,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent, */ grab = _gdk_display_get_last_device_grab (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer); - if (WINDOW_IS_TOPLEVEL (toplevel) && grab) + if (SURFACE_IS_TOPLEVEL (toplevel) && grab) { /* Implicit grabs do not go through XGrabPointer and thus the * event mask should not be checked. @@ -768,7 +768,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent, screen_point, &x_tmp, &y_tmp); if (toplevel_under_pointer - && WINDOW_IS_TOPLEVEL (toplevel_under_pointer)) + && SURFACE_IS_TOPLEVEL (toplevel_under_pointer)) { GdkSurfaceImplQuartz *toplevel_impl; @@ -1385,7 +1385,7 @@ test_resize (NSEvent *event, GdkSurface *toplevel, gint x, gint y) * dragging before GDK recognizes the grab. * * We perform this check for a button press of all buttons, because we - * do receive, for instance, a right mouse down event for a GDK window + * do receive, for instance, a right mouse down event for a GDK surface * for x-coordinate range [-3, 0], but we do not want to forward this * into GDK. Forwarding such events into GDK will confuse the pointer * window finding code, because there are no GdkSurfaces present in @@ -1493,7 +1493,7 @@ gdk_event_translate (GdkEvent *event, if ([(GdkQuartzNSWindow *)nswindow isInManualResizeOrMove]) return FALSE; - /* Find the right GDK window to send the event to, taking grabs and + /* Find the right GDK surface to send the event to, taking grabs and * event masks into consideration. */ window = find_window_for_ns_event (nsevent, &x, &y, &x_root, &y_root); @@ -1650,7 +1650,7 @@ gdk_event_translate (GdkEvent *event, break; #endif case NSMouseExited: - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) [[NSCursor arrowCursor] set]; /* fall through */ case NSMouseEntered: diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c index f3676cee47..915edff0a0 100644 --- a/gdk/quartz/gdksurface-quartz.c +++ b/gdk/quartz/gdksurface-quartz.c @@ -43,7 +43,7 @@ static gboolean in_process_all_updates = FALSE; static GSList *main_window_stack; -void _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl); +void _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *surface_impl); typedef struct { @@ -62,7 +62,7 @@ static FullscreenSavedGeometry *get_fullscreen_geometry (GdkSurface *window); static void update_toplevel_order (void); static void clear_toplevel_order (void); -#define WINDOW_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) +#define SURFACE_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) /* * GdkQuartzSurface @@ -114,13 +114,13 @@ gdk_quartz_surface_get_nswindow (GdkSurface *window) } static CGContextRef -gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window_impl, +gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *surface_impl, gboolean antialias) { CGContextRef cg_context; CGSize scale; - if (GDK_SURFACE_DESTROYED (window_impl->wrapper)) + if (GDK_SURFACE_DESTROYED (surface_impl->wrapper)) return NULL; /* Lock focus when not called as part of a drawRect call. This @@ -129,9 +129,9 @@ gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window_impl, * and for widgets that send fake expose events like the arrow * buttons in spinbuttons or the position marker in rulers. */ - if (window_impl->in_paint_rect_count == 0) + if (surface_impl->in_paint_rect_count == 0) { - if (![window_impl->view lockFocusIfCanDraw]) + if (![surface_impl->view lockFocusIfCanDraw]) return NULL; } @@ -149,17 +149,17 @@ gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window_impl, } static void -gdk_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *window_impl, +gdk_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *surface_impl, CGContextRef cg_context) { CGContextRestoreGState (cg_context); CGContextSetAllowsAntialiasing (cg_context, TRUE); /* See comment in gdk_quartz_surface_get_context(). */ - if (window_impl->in_paint_rect_count == 0) + if (surface_impl->in_paint_rect_count == 0) { - _gdk_quartz_surface_flush (window_impl); - [window_impl->view unlockFocus]; + _gdk_quartz_surface_flush (surface_impl); + [surface_impl->view unlockFocus]; } } @@ -180,7 +180,7 @@ check_grab_destroy (GdkSurface *window) GdkDeviceGrabInfo *grab; grab = _gdk_display_get_last_device_grab (display, l->data); - if (grab && grab->native_window == window) + if (grab && grab->native_surface == window) { /* Serials are always 0 in quartz, but for clarity: */ grab->serial_end = grab->serial_start; @@ -216,7 +216,7 @@ gdk_surface_impl_quartz_finalize (GObject *object) * done externally. */ void -_gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl) +_gdk_quartz_surface_flush (GdkSurfaceImplQuartz *surface_impl) { static struct timeval prev_tv; static gint intervals[4]; @@ -228,15 +228,15 @@ _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl) ms = (tv.tv_sec - prev_tv.tv_sec) * 1000 + (tv.tv_usec - prev_tv.tv_usec) / 1000; intervals[index++ % 4] = ms; - if (window_impl) + if (surface_impl) { ms = intervals[0] + intervals[1] + intervals[2] + intervals[3]; /* ~25Hz on average. */ if (ms > 4*40) { - if (window_impl) - [window_impl->toplevel flushWindow]; + if (surface_impl) + [surface_impl->toplevel flushWindow]; prev_tv = tv; } @@ -248,7 +248,7 @@ _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl) static cairo_user_data_key_t gdk_quartz_cairo_key; typedef struct { - GdkSurfaceImplQuartz *window_impl; + GdkSurfaceImplQuartz *surface_impl; CGContextRef cg_context; } GdkQuartzCairoSurfaceData; @@ -257,9 +257,9 @@ gdk_quartz_cairo_surface_destroy (void *data) { GdkQuartzCairoSurfaceData *surface_data = data; - surface_data->window_impl->cairo_surface = NULL; + surface_data->surface_impl->cairo_surface = NULL; - gdk_quartz_surface_release_context (surface_data->window_impl, + gdk_quartz_surface_release_context (surface_data->surface_impl, surface_data->cg_context); g_free (surface_data); @@ -280,7 +280,7 @@ gdk_quartz_create_cairo_surface (GdkSurfaceImplQuartz *impl, return NULL; surface_data = g_new (GdkQuartzCairoSurfaceData, 1); - surface_data->window_impl = impl; + surface_data->surface_impl = impl; surface_data->cg_context = cg_context; surface = cairo_quartz_surface_create_for_cg_context (cg_context, @@ -366,7 +366,7 @@ _gdk_quartz_surface_process_updates_recurse (GdkSurface *window, GdkSurface *toplevel; toplevel = gdk_surface_get_toplevel (window); - if (toplevel && WINDOW_IS_TOPLEVEL (toplevel)) + if (toplevel && SURFACE_IS_TOPLEVEL (toplevel)) { GdkSurfaceImplQuartz *toplevel_impl; NSWindow *nswindow; @@ -386,7 +386,7 @@ _gdk_quartz_surface_process_updates_recurse (GdkSurface *window, } } - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) gdk_quartz_surface_set_needs_display_in_region (window, region); else _gdk_surface_process_updates_recurse (window, region); @@ -664,7 +664,7 @@ _gdk_quartz_surface_did_become_main (GdkSurface *window) { main_window_stack = g_slist_remove (main_window_stack, window); - if (window->window_type != GDK_SURFACE_TEMP) + if (window->surface_type != GDK_SURFACE_TEMP) main_window_stack = g_slist_prepend (main_window_stack, window); clear_toplevel_order (); @@ -689,7 +689,7 @@ _gdk_quartz_surface_did_resign_main (GdkSurface *window) if (new_window && new_window != window && GDK_SURFACE_IS_MAPPED (new_window) && - WINDOW_IS_TOPLEVEL (new_window)) + SURFACE_IS_TOPLEVEL (new_window)) { GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (new_window->impl); @@ -728,7 +728,7 @@ get_nsscreen_for_point (gint x, gint y) } void -_gdk_quartz_display_create_window_impl (GdkDisplay *display, +_gdk_quartz_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -745,7 +745,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl); - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: @@ -764,7 +764,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, impl->view = NULL; - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: @@ -791,7 +791,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, window->width, window->height); - if (window->window_type == GDK_SURFACE_TEMP) + if (window->surface_type == GDK_SURFACE_TEMP) { style_mask = NSBorderlessWindowMask; } @@ -883,15 +883,15 @@ _gdk_quartz_surface_init_windowing (GdkDisplay *display) _gdk_root = _gdk_display_create_window (display); - _gdk_root->impl = g_object_new (_gdk_root_window_impl_quartz_get_type (), NULL); - _gdk_root->impl_window = _gdk_root; + _gdk_root->impl = g_object_new (_gdk_root_surface_impl_quartz_get_type (), NULL); + _gdk_root->impl_surface = _gdk_root; impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl); _gdk_quartz_screen_update_window_sizes (screen); _gdk_root->state = 0; /* We don't want GDK_SURFACE_STATE_WITHDRAWN here */ - _gdk_root->window_type = GDK_SURFACE_ROOT; + _gdk_root->surface_type = GDK_SURFACE_ROOT; _gdk_root->viewable = TRUE; impl->wrapper = _gdk_root; @@ -957,12 +957,12 @@ gdk_surface_quartz_show (GdkSurface *window, gboolean already_mapped) else focus_on_map = TRUE; - if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel) + if (SURFACE_IS_TOPLEVEL (window) && impl->toplevel) { gboolean make_key; make_key = (window->accept_focus && focus_on_map && - window->window_type != GDK_SURFACE_TEMP); + window->surface_type != GDK_SURFACE_TEMP); [(GdkQuartzNSWindow*)impl->toplevel showAndMakeKey:make_key]; clear_toplevel_order (); @@ -976,7 +976,7 @@ gdk_surface_quartz_show (GdkSurface *window, gboolean already_mapped) [impl->view setNeedsDisplay:YES]; - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_WITHDRAWN, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_WITHDRAWN, 0); if (window->state & GDK_SURFACE_STATE_MAXIMIZED) gdk_surface_maximize (window); @@ -1051,7 +1051,7 @@ gdk_surface_quartz_hide (GdkSurface *window) impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) { /* Update main window. */ main_window_stack = g_slist_remove (main_window_stack, window); @@ -1332,7 +1332,7 @@ gdk_surface_quartz_raise (GdkSurface *window) if (GDK_SURFACE_DESTROYED (window)) return; - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) { GdkSurfaceImplQuartz *impl; @@ -1363,7 +1363,7 @@ gdk_surface_quartz_lower (GdkSurface *window) if (GDK_SURFACE_DESTROYED (window)) return; - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) { GdkSurfaceImplQuartz *impl; @@ -1433,7 +1433,7 @@ gdk_surface_quartz_get_geometry (GdkSurface *window, if (height) *height = window->height; } - else if (WINDOW_IS_TOPLEVEL (window)) + else if (SURFACE_IS_TOPLEVEL (window)) { ns_rect = [impl->toplevel contentRectForFrameRect:[impl->toplevel frame]]; @@ -1636,7 +1636,7 @@ gdk_quartz_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; /* FIXME: Implement */ @@ -1652,7 +1652,7 @@ gdk_quartz_surface_set_geometry_hints (GdkSurface *window, g_return_if_fail (geometry != NULL); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -1739,7 +1739,7 @@ gdk_quartz_surface_set_title (GdkSurface *window, g_return_if_fail (title != NULL); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -1757,7 +1757,7 @@ gdk_quartz_surface_set_role (GdkSurface *window, const gchar *role) { if (GDK_SURFACE_DESTROYED (window) || - WINDOW_IS_TOPLEVEL (window)) + SURFACE_IS_TOPLEVEL (window)) return; /* FIXME: Implement */ @@ -1774,25 +1774,25 @@ static void gdk_quartz_surface_set_transient_for (GdkSurface *window, GdkSurface *parent) { - GdkSurfaceImplQuartz *window_impl; + GdkSurfaceImplQuartz *surface_impl; GdkSurfaceImplQuartz *parent_impl; if (GDK_SURFACE_DESTROYED (window) || GDK_SURFACE_DESTROYED (parent) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; - window_impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (!window_impl->toplevel) + surface_impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + if (!surface_impl->toplevel) return; GDK_QUARTZ_ALLOC_POOL; - if (window_impl->transient_for) + if (surface_impl->transient_for) { _gdk_quartz_surface_detach_from_parent (window); - g_object_unref (window_impl->transient_for); - window_impl->transient_for = NULL; + g_object_unref (surface_impl->transient_for); + surface_impl->transient_for = NULL; } parent_impl = GDK_SURFACE_IMPL_QUARTZ (parent->impl); @@ -1809,7 +1809,7 @@ gdk_quartz_surface_set_transient_for (GdkSurface *window, */ if (gdk_surface_get_type_hint (window) != GDK_SURFACE_TYPE_HINT_TOOLTIP) { - window_impl->transient_for = g_object_ref (parent); + surface_impl->transient_for = g_object_ref (parent); /* We only add the window if it is shown, otherwise it will * be shown unconditionally here. If it is not shown, the @@ -1871,10 +1871,10 @@ gdk_quartz_surface_focus (GdkSurface *window, impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; - if (window->accept_focus && window->window_type != GDK_SURFACE_TEMP) + if (window->accept_focus && window->surface_type != GDK_SURFACE_TEMP) { GDK_QUARTZ_ALLOC_POOL; [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; @@ -1884,7 +1884,7 @@ gdk_quartz_surface_focus (GdkSurface *window, } static gint -window_type_hint_to_level (GdkSurfaceTypeHint hint) +surface_type_hint_to_level (GdkSurfaceTypeHint hint) { /* the order in this switch statement corresponds to the actual * stacking order: the first group is top, the last group is bottom @@ -1925,7 +1925,7 @@ window_type_hint_to_level (GdkSurfaceTypeHint hint) } static gboolean -window_type_hint_to_shadow (GdkSurfaceTypeHint hint) +surface_type_hint_to_shadow (GdkSurfaceTypeHint hint) { switch (hint) { @@ -1955,7 +1955,7 @@ window_type_hint_to_shadow (GdkSurfaceTypeHint hint) } static gboolean -window_type_hint_to_hides_on_deactivate (GdkSurfaceTypeHint hint) +surface_type_hint_to_hides_on_deactivate (GdkSurfaceTypeHint hint) { switch (hint) { @@ -1981,7 +1981,7 @@ _gdk_quartz_surface_update_has_shadow (GdkSurfaceImplQuartz *impl) /* In case there is any shadow set we have to turn off the * NSWindow setHasShadow as the system drawn ones wont match our * window boundary anymore */ - has_shadow = (window_type_hint_to_shadow (impl->type_hint) && !impl->shadow_max); + has_shadow = (surface_type_hint_to_shadow (impl->type_hint) && !impl->shadow_max); [impl->toplevel setHasShadow: has_shadow]; } @@ -1993,7 +1993,7 @@ gdk_quartz_surface_set_type_hint (GdkSurface *window, GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2005,15 +2005,15 @@ gdk_quartz_surface_set_type_hint (GdkSurface *window, return; _gdk_quartz_surface_update_has_shadow (impl); - [impl->toplevel setLevel: window_type_hint_to_level (hint)]; - [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)]; + [impl->toplevel setLevel: surface_type_hint_to_level (hint)]; + [impl->toplevel setHidesOnDeactivate: surface_type_hint_to_hides_on_deactivate (hint)]; } static GdkSurfaceTypeHint gdk_quartz_surface_get_type_hint (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return GDK_SURFACE_TYPE_HINT_NORMAL; return GDK_SURFACE_IMPL_QUARTZ (window->impl)->type_hint; @@ -2024,7 +2024,7 @@ gdk_quartz_surface_set_modal_hint (GdkSurface *window, gboolean modal) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; /* FIXME: Implement */ @@ -2035,7 +2035,7 @@ gdk_quartz_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; /* FIXME: Implement */ @@ -2046,7 +2046,7 @@ gdk_quartz_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; /* FIXME: Implement */ @@ -2090,7 +2090,7 @@ gdk_quartz_surface_begin_move_drag (GdkSurface *window, GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2157,7 +2157,7 @@ gdk_quartz_surface_set_decorations (GdkSurface *window, NSView *old_view; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2243,11 +2243,11 @@ gdk_quartz_surface_set_decorations (GdkSurface *window, screen:screen]; _gdk_quartz_surface_update_has_shadow (impl); - [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)]; + [impl->toplevel setLevel: surface_type_hint_to_level (impl->type_hint)]; if (title) [impl->toplevel setTitle:title]; [impl->toplevel setBackgroundColor:bg]; - [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)]; + [impl->toplevel setHidesOnDeactivate: surface_type_hint_to_hides_on_deactivate (impl->type_hint)]; [impl->toplevel setContentView:old_view]; } @@ -2278,7 +2278,7 @@ gdk_quartz_surface_get_decorations (GdkSurface *window, GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return FALSE; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2351,7 +2351,7 @@ static void gdk_quartz_surface_stick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -2359,7 +2359,7 @@ static void gdk_quartz_surface_unstick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; } @@ -2370,7 +2370,7 @@ gdk_quartz_surface_maximize (GdkSurface *window) gboolean maximized; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2394,7 +2394,7 @@ gdk_quartz_surface_unmaximize (GdkSurface *window) gboolean maximized; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2417,7 +2417,7 @@ gdk_quartz_surface_iconify (GdkSurface *window) GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2433,7 +2433,7 @@ gdk_quartz_surface_iconify (GdkSurface *window) } else { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); } @@ -2445,7 +2445,7 @@ gdk_quartz_surface_deiconify (GdkSurface *window) GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2461,7 +2461,7 @@ gdk_quartz_surface_deiconify (GdkSurface *window) } else { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); } @@ -2483,7 +2483,7 @@ gdk_quartz_surface_fullscreen (GdkSurface *window) GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2498,7 +2498,7 @@ gdk_quartz_surface_unfullscreen (GdkSurface *window) GdkSurfaceImplQuartz *impl; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); @@ -2519,9 +2519,9 @@ _gdk_quartz_surface_update_fullscreen_state (GdkSurface *window) if (is_fullscreen != was_fullscreen) { if (is_fullscreen) - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); else - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } } @@ -2541,7 +2541,7 @@ gdk_quartz_surface_fullscreen (GdkSurface *window) NSRect frame; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; geometry = get_fullscreen_geometry (window); @@ -2575,7 +2575,7 @@ gdk_quartz_surface_fullscreen (GdkSurface *window) SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar); - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); } static void @@ -2585,7 +2585,7 @@ gdk_quartz_surface_unfullscreen (GdkSurface *window) FullscreenSavedGeometry *geometry; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; geometry = get_fullscreen_geometry (window); @@ -2606,7 +2606,7 @@ gdk_quartz_surface_unfullscreen (GdkSurface *window) [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; clear_toplevel_order (); - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } } @@ -2622,10 +2622,10 @@ gdk_quartz_surface_set_keep_above (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; - level = window_type_hint_to_level (gdk_surface_get_type_hint (window)); + level = surface_type_hint_to_level (gdk_surface_get_type_hint (window)); /* Adjust normal window level by one if necessary. */ [impl->toplevel setLevel: level + (setting ? 1 : 0)]; @@ -2641,10 +2641,10 @@ gdk_quartz_surface_set_keep_below (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; - level = window_type_hint_to_level (gdk_surface_get_type_hint (window)); + level = surface_type_hint_to_level (gdk_surface_get_type_hint (window)); /* Adjust normal window level by one if necessary. */ [impl->toplevel setLevel: level - (setting ? 1 : 0)]; @@ -2656,7 +2656,7 @@ gdk_quartz_surface_get_group (GdkSurface *window) g_return_val_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD, NULL); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return NULL; /* FIXME: Implement */ @@ -2684,10 +2684,10 @@ gdk_quartz_surface_set_opacity (GdkSurface *window, GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); g_return_if_fail (GDK_IS_SURFACE (window)); - g_return_if_fail (WINDOW_IS_TOPLEVEL (window)); + g_return_if_fail (SURFACE_IS_TOPLEVEL (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (opacity < 0) @@ -2708,10 +2708,10 @@ gdk_quartz_surface_set_shadow_width (GdkSurface *window, GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); g_return_if_fail (GDK_IS_SURFACE (window)); - g_return_if_fail (WINDOW_IS_TOPLEVEL (window)); + g_return_if_fail (SURFACE_IS_TOPLEVEL (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl->shadow_top = top; @@ -2877,14 +2877,14 @@ gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window, static CGContextRef -gdk_root_window_impl_quartz_get_context (GdkSurfaceImplQuartz *window, +gdk_root_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window, gboolean antialias) { CGColorSpaceRef colorspace; CGContextRef cg_context; - GdkSurfaceImplQuartz *window_impl = GDK_SURFACE_IMPL_QUARTZ (window); + GdkSurfaceImplQuartz *surface_impl = GDK_SURFACE_IMPL_QUARTZ (window); - if (GDK_SURFACE_DESTROYED (window_impl->wrapper)) + if (GDK_SURFACE_DESTROYED (surface_impl->wrapper)) return NULL; /* We do not have the notion of a root window on OS X. We fake this @@ -2900,30 +2900,30 @@ gdk_root_window_impl_quartz_get_context (GdkSurfaceImplQuartz *window, } static void -gdk_root_window_impl_quartz_release_context (GdkSurfaceImplQuartz *window, +gdk_root_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *window, CGContextRef cg_context) { CGContextRelease (cg_context); } static void -gdk_root_window_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass) +gdk_root_surface_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass) { GdkSurfaceImplQuartzClass *window_quartz_class = GDK_SURFACE_IMPL_QUARTZ_CLASS (klass); root_window_parent_class = g_type_class_peek_parent (klass); - window_quartz_class->get_context = gdk_root_window_impl_quartz_get_context; - window_quartz_class->release_context = gdk_root_window_impl_quartz_release_context; + window_quartz_class->get_context = gdk_root_surface_impl_quartz_get_context; + window_quartz_class->release_context = gdk_root_surface_impl_quartz_release_context; } static void -gdk_root_window_impl_quartz_init (GdkRootWindowImplQuartz *impl) +gdk_root_surface_impl_quartz_init (GdkRootWindowImplQuartz *impl) { } GType -_gdk_root_window_impl_quartz_get_type (void) +_gdk_root_surface_impl_quartz_get_type (void) { static GType object_type = 0; @@ -2934,12 +2934,12 @@ _gdk_root_window_impl_quartz_get_type (void) sizeof (GdkRootWindowImplQuartzClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gdk_root_window_impl_quartz_class_init, + (GClassInitFunc) gdk_root_surface_impl_quartz_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (GdkRootWindowImplQuartz), 0, /* n_preallocs */ - (GInstanceInitFunc) gdk_root_window_impl_quartz_init, + (GInstanceInitFunc) gdk_root_surface_impl_quartz_init, }; object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL_QUARTZ, diff --git a/gdk/quartz/gdksurface-quartz.h b/gdk/quartz/gdksurface-quartz.h index ca4dd0d249..74ccfc26a3 100644 --- a/gdk/quartz/gdksurface-quartz.h +++ b/gdk/quartz/gdksurface-quartz.h @@ -89,12 +89,12 @@ void gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window, typedef struct _GdkRootWindowImplQuartz GdkRootWindowImplQuartz; typedef struct _GdkRootWindowImplQuartzClass GdkRootWindowImplQuartzClass; -#define GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ (_gdk_root_window_impl_quartz_get_type ()) -#define GDK_ROOT_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartz)) -#define GDK_ROOT_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartzClass)) -#define GDK_IS_ROOT_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ)) -#define GDK_IS_ROOT_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ)) -#define GDK_ROOT_WINDOW_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartzClass)) +#define GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ (_gdk_root_surface_impl_quartz_get_type ()) +#define GDK_ROOT_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartz)) +#define GDK_ROOT_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartzClass)) +#define GDK_IS_ROOT_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ)) +#define GDK_IS_ROOT_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ)) +#define GDK_ROOT_SURFACE_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartzClass)) struct _GdkRootWindowImplQuartz { @@ -106,7 +106,7 @@ struct _GdkRootWindowImplQuartzClass GdkSurfaceImplQuartzClass parent_class; }; -GType _gdk_root_window_impl_quartz_get_type (void); +GType _gdk_root_surface_impl_quartz_get_type (void); GList *get_toplevels (void); diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index d4bbd2ef0d..725a991cd4 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -375,7 +375,7 @@ gdk_wayland_seat_find_pad (GdkWaylandSeat *seat, static gboolean -gdk_wayland_device_update_window_cursor (GdkDevice *device) +gdk_wayland_device_update_surface_cursor (GdkDevice *device) { GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device)); GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer; @@ -451,9 +451,9 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device) /* Queue timeout for next frame */ id = g_timeout_add (next_image_delay, - (GSourceFunc) gdk_wayland_device_update_window_cursor, + (GSourceFunc) gdk_wayland_device_update_surface_cursor, device); - g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor"); + g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_surface_cursor"); pointer->cursor_timeout_id = id; } else @@ -469,7 +469,7 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device) } static void -gdk_wayland_device_set_window_cursor (GdkDevice *device, +gdk_wayland_device_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -501,7 +501,7 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device, pointer->cursor = cursor; - gdk_wayland_device_update_window_cursor (device); + gdk_wayland_device_update_surface_cursor (device); } static void @@ -718,7 +718,7 @@ gdk_wayland_device_grab (GdkDevice *device, GdkSurface *prev_focus = gdk_wayland_device_get_focus (device); GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer; - if (gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP && + if (gdk_surface_get_surface_type (window) == GDK_SURFACE_TEMP && gdk_surface_is_visible (window)) { g_warning ("Window %p is already mapped at the time of grabbing. " @@ -758,7 +758,7 @@ gdk_wayland_device_grab (GdkDevice *device, if (cursor) wayland_seat->cursor = g_object_ref (cursor); - gdk_wayland_device_update_window_cursor (device); + gdk_wayland_device_update_surface_cursor (device); } return GDK_GRAB_SUCCESS; @@ -798,7 +798,7 @@ gdk_wayland_device_ungrab (GdkDevice *device, else { /* Device is a pointer */ - gdk_wayland_device_update_window_cursor (device); + gdk_wayland_device_update_surface_cursor (device); if (pointer->grab_window) _gdk_wayland_surface_set_grab_seat (pointer->grab_window, @@ -807,7 +807,7 @@ gdk_wayland_device_ungrab (GdkDevice *device, } static GdkSurface * -gdk_wayland_device_window_at_position (GdkDevice *device, +gdk_wayland_device_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -831,7 +831,7 @@ gdk_wayland_device_window_at_position (GdkDevice *device, } static void -gdk_wayland_device_select_window_events (GdkDevice *device, +gdk_wayland_device_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { @@ -844,13 +844,13 @@ gdk_wayland_device_class_init (GdkWaylandDeviceClass *klass) device_class->get_history = gdk_wayland_device_get_history; device_class->get_state = gdk_wayland_device_get_state; - device_class->set_window_cursor = gdk_wayland_device_set_window_cursor; + device_class->set_surface_cursor = gdk_wayland_device_set_surface_cursor; device_class->warp = gdk_wayland_device_warp; device_class->query_state = gdk_wayland_device_query_state; device_class->grab = gdk_wayland_device_grab; device_class->ungrab = gdk_wayland_device_ungrab; - device_class->window_at_position = gdk_wayland_device_window_at_position; - device_class->select_window_events = gdk_wayland_device_select_window_events; + device_class->surface_at_position = gdk_wayland_device_surface_at_position; + device_class->select_surface_events = gdk_wayland_device_select_surface_events; } static void @@ -1077,11 +1077,11 @@ data_device_enter (void *data, struct wl_data_offer *offer) { GdkWaylandSeat *seat = data; - GdkSurface *dest_window, *dnd_owner; + GdkSurface *dest_surface, *dnd_owner; - dest_window = wl_surface_get_user_data (surface); + dest_surface = wl_surface_get_user_data (surface); - if (!GDK_IS_SURFACE (dest_window)) + if (!GDK_IS_SURFACE (dest_surface)) return; GDK_DISPLAY_NOTE (seat->display, EVENTS, @@ -1089,7 +1089,7 @@ data_device_enter (void *data, data_device, serial, surface, wl_fixed_to_double (x), wl_fixed_to_double (y), offer)); /* Update pointer state, so device state queries work during DnD */ - seat->pointer_info.focus = g_object_ref (dest_window); + seat->pointer_info.focus = g_object_ref (dest_surface); seat->pointer_info.surface_x = wl_fixed_to_double (x); seat->pointer_info.surface_y = wl_fixed_to_double (y); @@ -1097,10 +1097,10 @@ data_device_enter (void *data, dnd_owner = seat->foreign_dnd_window; - _gdk_wayland_drag_context_set_source_window (seat->drop_context, dnd_owner); + _gdk_wayland_drag_context_set_source_surface (seat->drop_context, dnd_owner); - _gdk_wayland_drag_context_set_dest_window (seat->drop_context, - dest_window, serial); + _gdk_wayland_drag_context_set_dest_surface (seat->drop_context, + dest_surface, serial); _gdk_wayland_drag_context_set_coords (seat->drop_context, wl_fixed_to_double (x), wl_fixed_to_double (y)); @@ -1119,7 +1119,7 @@ data_device_leave (void *data, GDK_DISPLAY_NOTE (seat->display, EVENTS, g_message ("data device leave, data device %p", data_device)); - if (!gdk_drag_context_get_dest_window (seat->drop_context)) + if (!gdk_drag_context_get_dest_surface (seat->drop_context)) return; g_object_unref (seat->pointer_info.focus); @@ -1128,7 +1128,7 @@ data_device_leave (void *data, _gdk_wayland_drag_context_set_coords (seat->drop_context, -1, -1); _gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_LEAVE, GDK_CURRENT_TIME); - _gdk_wayland_drag_context_set_dest_window (seat->drop_context, NULL, 0); + _gdk_wayland_drag_context_set_dest_surface (seat->drop_context, NULL, 0); } static void @@ -1144,7 +1144,7 @@ data_device_motion (void *data, g_message ("data device motion, data_device = %p, time = %d, x = %f, y = %f", data_device, time, wl_fixed_to_double (x), wl_fixed_to_double (y))); - if (!gdk_drag_context_get_dest_window (seat->drop_context)) + if (!gdk_drag_context_get_dest_surface (seat->drop_context)) return; /* Update pointer state, so device state queries work during DnD */ @@ -1382,7 +1382,7 @@ pointer_handle_enter (void *data, event->crossing.focus = TRUE; event->crossing.state = 0; - gdk_wayland_device_update_window_cursor (seat->master_pointer); + gdk_wayland_device_update_surface_cursor (seat->master_pointer); get_coordinates (seat->master_pointer, &event->crossing.x, @@ -1430,7 +1430,7 @@ pointer_handle_leave (void *data, event->crossing.focus = TRUE; event->crossing.state = 0; - gdk_wayland_device_update_window_cursor (seat->master_pointer); + gdk_wayland_device_update_surface_cursor (seat->master_pointer); get_coordinates (seat->master_pointer, &event->crossing.x, @@ -3425,7 +3425,7 @@ tablet_tool_handle_proximity_out (void *data, gdk_wayland_pointer_stop_cursor_animation (&tablet->pointer_info); - gdk_wayland_device_update_window_cursor (tablet->master); + gdk_wayland_device_update_surface_cursor (tablet->master); g_object_unref (tablet->pointer_info.focus); tablet->pointer_info.focus = NULL; @@ -4343,7 +4343,7 @@ pointer_surface_update_scale (GdkDevice *device) pointer->current_output_scale = scale; - gdk_wayland_device_update_window_cursor (device); + gdk_wayland_device_update_surface_cursor (device); } static void @@ -4526,7 +4526,7 @@ gdk_wayland_seat_grab (GdkSeat *seat, gdk_wayland_seat_set_global_cursor (seat, cursor); g_set_object (&wayland_seat->cursor, cursor); - gdk_wayland_device_update_window_cursor (wayland_seat->master_pointer); + gdk_wayland_device_update_surface_cursor (wayland_seat->master_pointer); } if (wayland_seat->touch_master && @@ -4598,7 +4598,7 @@ gdk_wayland_seat_grab (GdkSeat *seat, evtime, FALSE); - gdk_wayland_device_update_window_cursor (tablet->master); + gdk_wayland_device_update_surface_cursor (tablet->master); } } @@ -4636,7 +4636,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat) focus, GDK_CROSSING_UNGRAB, GDK_CURRENT_TIME); - gdk_wayland_device_update_window_cursor (wayland_seat->master_pointer); + gdk_wayland_device_update_surface_cursor (wayland_seat->master_pointer); } if (wayland_seat->master_keyboard) @@ -4986,7 +4986,7 @@ gdk_wayland_seat_set_global_cursor (GdkSeat *seat, pointer = gdk_seat_get_pointer (seat); g_set_object (&wayland_seat->grab_cursor, cursor); - gdk_wayland_device_set_window_cursor (pointer, + gdk_wayland_device_set_surface_cursor (pointer, gdk_wayland_device_get_focus (pointer), NULL); } diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 36167d6304..3b57476ae9 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -916,7 +916,7 @@ gdk_wayland_display_get_monitor (GdkDisplay *display, } static GdkMonitor * -gdk_wayland_display_get_monitor_at_window (GdkDisplay *display, +gdk_wayland_display_get_monitor_at_surface (GdkDisplay *display, GdkSurface *window) { GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); @@ -953,7 +953,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) object_class->dispose = gdk_wayland_display_dispose; object_class->finalize = gdk_wayland_display_finalize; - display_class->window_type = gdk_wayland_surface_get_type (); + display_class->surface_type = gdk_wayland_surface_get_type (); #ifdef GDK_RENDERING_VULKAN display_class->vk_context_type = GDK_TYPE_WAYLAND_VULKAN_CONTEXT; @@ -973,7 +973,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) display_class->get_app_launch_context = _gdk_wayland_display_get_app_launch_context; display_class->get_next_serial = gdk_wayland_display_get_next_serial; display_class->notify_startup_complete = gdk_wayland_display_notify_startup_complete; - display_class->create_window_impl = _gdk_wayland_display_create_window_impl; + display_class->create_surface_impl = _gdk_wayland_display_create_surface_impl; display_class->get_keymap = _gdk_wayland_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_wayland_display_text_property_to_utf8_list; display_class->utf8_to_string_target = _gdk_wayland_display_utf8_to_string_target; @@ -982,7 +982,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) display_class->get_n_monitors = gdk_wayland_display_get_n_monitors; display_class->get_monitor = gdk_wayland_display_get_monitor; - display_class->get_monitor_at_window = gdk_wayland_display_get_monitor_at_window; + display_class->get_monitor_at_surface = gdk_wayland_display_get_monitor_at_surface; display_class->get_setting = gdk_wayland_display_get_setting; display_class->set_cursor_theme = gdk_wayland_display_set_cursor_theme; } diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index a466f0f920..b9ea9dff71 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -114,9 +114,9 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context, } if (context->is_source) - window = gdk_drag_context_get_source_window (context); + window = gdk_drag_context_get_source_surface (context); else - window = gdk_drag_context_get_dest_window (context); + window = gdk_drag_context_get_dest_surface (context); event = gdk_event_new (type); event->any.window = g_object_ref (window); @@ -174,7 +174,7 @@ gdk_wayland_drop_context_set_status (GdkDragContext *context, GdkDisplay *display; struct wl_data_offer *wl_offer; - if (!context->dest_window) + if (!context->dest_surface) return; context_wayland = GDK_WAYLAND_DRAG_CONTEXT (context); @@ -361,7 +361,7 @@ gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland) } static GdkSurface * -gdk_wayland_drag_context_get_drag_window (GdkDragContext *context) +gdk_wayland_drag_context_get_drag_surface (GdkDragContext *context) { return GDK_WAYLAND_DRAG_CONTEXT (context)->dnd_window; } @@ -450,7 +450,7 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass) context_class->read_async = gdk_wayland_drag_context_read_async; context_class->read_finish = gdk_wayland_drag_context_read_finish; context_class->drop_status = gdk_wayland_drag_context_drop_status; - context_class->get_drag_window = gdk_wayland_drag_context_get_drag_window; + context_class->get_drag_surface = gdk_wayland_drag_context_get_drag_surface; context_class->set_hotspot = gdk_wayland_drag_context_set_hotspot; context_class->drop_done = gdk_wayland_drag_context_drop_done; context_class->set_cursor = gdk_wayland_drag_context_set_cursor; @@ -498,7 +498,7 @@ _gdk_wayland_surface_drag_begin (GdkSurface *window, "content", content, NULL); context = GDK_DRAG_CONTEXT (context_wayland); - context->source_window = g_object_ref (window); + context->source_surface = g_object_ref (window); context->is_source = TRUE; gdk_drag_context_set_device (context, device); @@ -579,24 +579,24 @@ _gdk_wayland_drag_context_set_coords (GdkDragContext *context, } void -_gdk_wayland_drag_context_set_source_window (GdkDragContext *context, +_gdk_wayland_drag_context_set_source_surface (GdkDragContext *context, GdkSurface *window) { - if (context->source_window) - g_object_unref (context->source_window); + if (context->source_surface) + g_object_unref (context->source_surface); - context->source_window = window ? g_object_ref (window) : NULL; + context->source_surface = window ? g_object_ref (window) : NULL; } void -_gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, - GdkSurface *dest_window, +_gdk_wayland_drag_context_set_dest_surface (GdkDragContext *context, + GdkSurface *dest_surface, uint32_t serial) { - if (context->dest_window) - g_object_unref (context->dest_window); + if (context->dest_surface) + g_object_unref (context->dest_surface); - context->dest_window = dest_window ? g_object_ref (dest_window) : NULL; + context->dest_surface = dest_surface ? g_object_ref (dest_surface) : NULL; GDK_WAYLAND_DRAG_CONTEXT (context)->serial = serial; gdk_wayland_drop_context_update_targets (context); } @@ -618,13 +618,13 @@ gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source) } GdkDragContext * -gdk_wayland_drag_context_lookup_by_source_window (GdkSurface *window) +gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *window) { GList *l; for (l = contexts; l; l = l->next) { - if (window == gdk_drag_context_get_source_window (l->data)) + if (window == gdk_drag_context_get_source_surface (l->data)) return l->data; } diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index 9fe7d8447e..d3aa0d4a36 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -163,7 +163,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context) GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); EGLSurface egl_surface; - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); int buffer_age = 0; if (display_wayland->have_egl_buffer_age) @@ -176,7 +176,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context) shared = context; shared_wayland = GDK_WAYLAND_GL_CONTEXT (shared); - egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window, + egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface, shared_wayland->egl_config); gdk_gl_context_make_current (shared); eglQuerySurface (display_wayland->egl_display, egl_surface, @@ -208,7 +208,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, cairo_region_t *damage) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context); @@ -220,7 +220,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, gdk_gl_context_make_current (context); - egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window, + egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface, context_wayland->egl_config); if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL) @@ -360,7 +360,7 @@ gdk_wayland_display_init_gl (GdkDisplay *display) #define MAX_EGL_ATTRS 30 static gboolean -find_eglconfig_for_window (GdkSurface *window, +find_eglconfig_for_surface (GdkSurface *window, EGLConfig *egl_config_out, GError **error) { @@ -444,7 +444,7 @@ gdk_wayland_surface_create_gl_context (GdkSurface *window, return NULL; } - if (!find_eglconfig_for_window (window, &config, error)) + if (!find_eglconfig_for_surface (window, &config, error)) return NULL; context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT, @@ -466,7 +466,7 @@ gdk_wayland_gl_context_dispose (GObject *gobject) if (context_wayland->egl_context != NULL) { GdkGLContext *context = GDK_GL_CONTEXT (gobject); - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); @@ -501,16 +501,16 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display, } context_wayland = GDK_WAYLAND_GL_CONTEXT (context); - window = gdk_gl_context_get_window (context); + window = gdk_gl_context_get_surface (context); if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context))) - egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window, context_wayland->egl_config); + egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface, context_wayland->egl_config); else { if (display_wayland->have_egl_surfaceless_context) egl_surface = EGL_NO_SURFACE; else - egl_surface = gdk_wayland_surface_get_dummy_egl_surface (window->impl_window, + egl_surface = gdk_wayland_surface_get_dummy_egl_surface (window->impl_surface, context_wayland->egl_config); } diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index 9be6db1e6a..b5fbce2d2d 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -102,10 +102,10 @@ void _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *window, int y); GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display, struct wl_data_device *data_device); -void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context, +void _gdk_wayland_drag_context_set_source_surface (GdkDragContext *context, GdkSurface *window); -void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, - GdkSurface *dest_window, +void _gdk_wayland_drag_context_set_dest_surface (GdkDragContext *context, + GdkSurface *dest_surface, uint32_t serial); void _gdk_wayland_drag_context_emit_event (GdkDragContext *context, GdkEventType type, @@ -118,12 +118,12 @@ void gdk_wayland_drag_context_set_action (GdkDragContext *context, GdkDragAction action); GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source); -GdkDragContext * gdk_wayland_drag_context_lookup_by_source_window (GdkSurface *window); +GdkDragContext * gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *window); struct wl_data_source * gdk_wayland_drag_context_get_data_source (GdkDragContext *context); void gdk_wayland_drop_context_update_targets (GdkDragContext *context); -void _gdk_wayland_display_create_window_impl (GdkDisplay *display, +void _gdk_wayland_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index 70f1490f7d..757748dd7f 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -162,7 +162,7 @@ data_offer_source_actions (void *data, GDK_DISPLAY_NOTE (display, EVENTS, g_message ("data offer source actions, offer %p, actions %d", wl_data_offer, source_actions)); - if (gdk_drag_context_get_dest_window (drop_context)) + if (gdk_drag_context_get_dest_surface (drop_context)) _gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION, GDK_CURRENT_TIME); } @@ -184,7 +184,7 @@ data_offer_action (void *data, drop_context->action = _wl_to_gdk_actions (action); - if (gdk_drag_context_get_dest_window (drop_context)) + if (gdk_drag_context_get_dest_surface (drop_context)) _gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION, GDK_CURRENT_TIME); } diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 99d02bf971..da51a9d58f 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -48,7 +48,7 @@ enum { static guint signals[LAST_SIGNAL]; -#define WINDOW_IS_TOPLEVEL(window) \ +#define SURFACE_IS_TOPLEVEL(window) \ (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) #define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */ @@ -183,7 +183,7 @@ struct _GdkSurfaceImplWayland struct { GdkRectangle rect; GdkGravity rect_anchor; - GdkGravity window_anchor; + GdkGravity surface_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; @@ -603,7 +603,7 @@ gdk_wayland_surface_update_scale (GdkSurface *window) static void gdk_wayland_surface_create_surface (GdkSurface *window); void -_gdk_wayland_display_create_window_impl (GdkDisplay *display, +_gdk_wayland_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -1592,7 +1592,7 @@ rect_anchor_to_anchor (GdkGravity rect_anchor) } static enum zxdg_positioner_v6_gravity -window_anchor_to_gravity (GdkGravity rect_anchor) +surface_anchor_to_gravity (GdkGravity rect_anchor) { switch (rect_anchor) { @@ -1707,7 +1707,7 @@ translate_from_real_parent_window_geometry (GdkSurface *window, static void calculate_popup_rect (GdkSurface *window, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkRectangle *out_rect) { GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); @@ -1768,7 +1768,7 @@ calculate_popup_rect (GdkSurface *window, break; } - switch (window_anchor) + switch (surface_anchor) { default: case GDK_GRAVITY_STATIC: @@ -1908,7 +1908,7 @@ calculate_moved_to_rect_result (GdkSurface *window, calculate_popup_rect (window, impl->pending_move_to_rect.rect_anchor, - impl->pending_move_to_rect.window_anchor, + impl->pending_move_to_rect.surface_anchor, &best_rect); *flipped_rect = best_rect; @@ -1918,15 +1918,15 @@ calculate_moved_to_rect_result (GdkSurface *window, { GdkRectangle flipped_x_rect; GdkGravity flipped_rect_anchor; - GdkGravity flipped_window_anchor; + GdkGravity flipped_surface_anchor; flipped_rect_anchor = flip_anchor_horizontally (impl->pending_move_to_rect.rect_anchor); - flipped_window_anchor = - flip_anchor_horizontally (impl->pending_move_to_rect.window_anchor), + flipped_surface_anchor = + flip_anchor_horizontally (impl->pending_move_to_rect.surface_anchor), calculate_popup_rect (window, flipped_rect_anchor, - flipped_window_anchor, + flipped_surface_anchor, &flipped_x_rect); if (flipped_x_rect.x == x) @@ -1937,15 +1937,15 @@ calculate_moved_to_rect_result (GdkSurface *window, { GdkRectangle flipped_y_rect; GdkGravity flipped_rect_anchor; - GdkGravity flipped_window_anchor; + GdkGravity flipped_surface_anchor; flipped_rect_anchor = flip_anchor_vertically (impl->pending_move_to_rect.rect_anchor); - flipped_window_anchor = - flip_anchor_vertically (impl->pending_move_to_rect.window_anchor), + flipped_surface_anchor = + flip_anchor_vertically (impl->pending_move_to_rect.surface_anchor), calculate_popup_rect (window, flipped_rect_anchor, - flipped_window_anchor, + flipped_surface_anchor, &flipped_y_rect); if (flipped_y_rect.y == y) @@ -1996,7 +1996,7 @@ create_dynamic_positioner (GdkSurface *window) anchor = rect_anchor_to_anchor (impl->pending_move_to_rect.rect_anchor); zxdg_positioner_v6_set_anchor (positioner, anchor); - gravity = window_anchor_to_gravity (impl->pending_move_to_rect.window_anchor); + gravity = surface_anchor_to_gravity (impl->pending_move_to_rect.surface_anchor); zxdg_positioner_v6_set_gravity (positioner, gravity); if (impl->pending_move_to_rect.anchor_hints & GDK_ANCHOR_FLIP_X) @@ -2175,7 +2175,7 @@ should_be_mapped (GdkSurface *window) GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); /* Don't map crazy temp that GTK+ uses for internal X11 shenanigans. */ - if (window->window_type == GDK_SURFACE_TEMP && window->x < 0 && window->y < 0) + if (window->surface_type == GDK_SURFACE_TEMP && window->x < 0 && window->y < 0) return FALSE; if (impl->hint == GDK_SURFACE_TYPE_HINT_DND) @@ -2322,7 +2322,7 @@ gdk_wayland_surface_map (GdkSurface *window) GDK_SURFACE_IMPL_WAYLAND (attached_grab_window->impl); grab_device = gdk_seat_get_pointer (attached_impl->grab_input_seat); transient_for = - gdk_device_get_window_at_position (grab_device, + gdk_device_get_surface_at_position (grab_device, NULL, NULL); } } @@ -2330,7 +2330,7 @@ gdk_wayland_surface_map (GdkSurface *window) { grab_device = gdk_seat_get_pointer (impl->grab_input_seat); transient_for = - gdk_device_get_window_at_position (grab_device, NULL, NULL); + gdk_device_get_surface_at_position (grab_device, NULL, NULL); } if (transient_for) @@ -2419,7 +2419,7 @@ unmap_subsurface (GdkSurface *window) } static void -unmap_popups_for_window (GdkSurface *window) +unmap_popups_for_surface (GdkSurface *window) { GdkWaylandDisplay *display_wayland; GList *l; @@ -2446,7 +2446,7 @@ gdk_wayland_surface_hide_surface (GdkSurface *window) GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - unmap_popups_for_window (window); + unmap_popups_for_surface (window); if (impl->display_server.wl_surface) { @@ -2547,7 +2547,7 @@ gdk_surface_wayland_withdraw (GdkSurface *window) if (!window->destroyed) { if (GDK_SURFACE_IS_MAPPED (window)) - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); g_assert (!GDK_SURFACE_IS_MAPPED (window)); @@ -2591,20 +2591,20 @@ gdk_surface_wayland_restack_toplevel (GdkSurface *window, static void gdk_surface_request_transient_parent_commit (GdkSurface *window) { - GdkSurfaceImplWayland *window_impl, *impl; + GdkSurfaceImplWayland *surface_impl, *impl; GdkFrameClock *frame_clock; - window_impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + surface_impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (!window_impl->transient_for) + if (!surface_impl->transient_for) return; - impl = GDK_SURFACE_IMPL_WAYLAND (window_impl->transient_for->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (surface_impl->transient_for->impl); if (!impl->display_server.wl_surface || impl->pending_commit) return; - frame_clock = gdk_surface_get_frame_clock (window_impl->transient_for); + frame_clock = gdk_surface_get_frame_clock (surface_impl->transient_for); if (!frame_clock) return; @@ -2668,7 +2668,7 @@ static void gdk_surface_wayland_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, - GdkGravity window_anchor, + GdkGravity surface_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy) @@ -2679,7 +2679,7 @@ gdk_surface_wayland_move_to_rect (GdkSurface *window, sanitize_anchor_rect (window, &impl->pending_move_to_rect.rect); impl->pending_move_to_rect.rect_anchor = rect_anchor; - impl->pending_move_to_rect.window_anchor = window_anchor; + impl->pending_move_to_rect.surface_anchor = surface_anchor; impl->pending_move_to_rect.anchor_hints = anchor_hints; impl->pending_move_to_rect.rect_anchor_dx = rect_anchor_dx; impl->pending_move_to_rect.rect_anchor_dy = rect_anchor_dy; @@ -3028,7 +3028,7 @@ gdk_wayland_surface_set_geometry_hints (GdkSurface *window, int width, height; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); @@ -3217,7 +3217,7 @@ gdk_wayland_surface_iconify (GdkSurface *window) GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (!impl->display_server.xdg_toplevel) @@ -3230,14 +3230,14 @@ static void gdk_wayland_surface_deiconify (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) gdk_surface_show (window); else /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); } static void @@ -3262,7 +3262,7 @@ gdk_wayland_surface_maximize (GdkSurface *window) if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); } static void @@ -3276,7 +3276,7 @@ gdk_wayland_surface_unmaximize (GdkSurface *window) if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_unset_maximized (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } static void @@ -3296,7 +3296,7 @@ gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *window, } else { - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); impl->initial_fullscreen_output = output; } } @@ -3315,7 +3315,7 @@ gdk_wayland_surface_fullscreen (GdkSurface *window) if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, NULL); else - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); } static void @@ -3331,7 +3331,7 @@ gdk_wayland_surface_unfullscreen (GdkSurface *window) if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_unset_fullscreen (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } static void @@ -3389,7 +3389,7 @@ gdk_wayland_surface_begin_resize_drag (GdkSurface *window, uint32_t resize_edges, serial; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; switch (edge) @@ -3465,7 +3465,7 @@ gdk_wayland_surface_begin_move_drag (GdkSurface *window, uint32_t serial; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); @@ -3721,7 +3721,7 @@ gdk_wayland_surface_new_subsurface (GdkDisplay *display, attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_SURFACE_SUBSURFACE; + attr.surface_type = GDK_SURFACE_SUBSURFACE; return gdk_surface_new (display, NULL, &attr); } diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c index a5f721ec64..ad121be393 100644 --- a/gdk/wayland/gdkvulkancontext-wayland.c +++ b/gdk/wayland/gdkvulkancontext-wayland.c @@ -37,7 +37,7 @@ static VkResult gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context, VkSurfaceKHR *surface) { - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); /* This is necessary so that Vulkan sees the Window. @@ -64,7 +64,7 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context, cairo_region_t *painted, cairo_region_t *damage) { - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage); diff --git a/gdk/win32/gdkdevice-virtual.c b/gdk/win32/gdkdevice-virtual.c index 95f6fdd871..ce1e0ab5c5 100644 --- a/gdk/win32/gdkdevice-virtual.c +++ b/gdk/win32/gdkdevice-virtual.c @@ -89,7 +89,7 @@ gdk_device_virtual_get_state (GdkDevice *device, } static void -gdk_device_virtual_set_window_cursor (GdkDevice *device, +gdk_device_virtual_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -198,7 +198,7 @@ gdk_device_virtual_ungrab (GdkDevice *device, } static void -gdk_device_virtual_select_window_events (GdkDevice *device, +gdk_device_virtual_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { @@ -211,13 +211,13 @@ gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass) device_class->get_history = gdk_device_virtual_get_history; device_class->get_state = gdk_device_virtual_get_state; - device_class->set_window_cursor = gdk_device_virtual_set_window_cursor; + device_class->set_surface_cursor = gdk_device_virtual_set_surface_cursor; device_class->warp = gdk_device_virtual_warp; device_class->query_state = gdk_device_virtual_query_state; device_class->grab = gdk_device_virtual_grab; device_class->ungrab = gdk_device_virtual_ungrab; - device_class->window_at_position = _gdk_device_win32_surface_at_position; - device_class->select_window_events = gdk_device_virtual_select_window_events; + device_class->surface_at_position = _gdk_device_win32_surface_at_position; + device_class->select_surface_events = gdk_device_virtual_select_surface_events; } static void diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c index 86218dc02c..7960ee173b 100644 --- a/gdk/win32/gdkdevice-win32.c +++ b/gdk/win32/gdkdevice-win32.c @@ -57,7 +57,7 @@ gdk_device_win32_get_state (GdkDevice *device, } static void -gdk_device_win32_set_window_cursor (GdkDevice *device, +gdk_device_win32_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -112,14 +112,14 @@ gdk_device_win32_query_state (GdkDevice *device, if (window) { - scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale; + scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->surface_scale; hwnd = GDK_SURFACE_HWND (window); } else { GdkDisplay *display = gdk_device_get_display (device); - scale = GDK_WIN32_DISPLAY (display)->window_scale; + scale = GDK_WIN32_DISPLAY (display)->surface_scale; hwnd = NULL; } @@ -271,16 +271,16 @@ _gdk_device_win32_surface_at_position (GdkDevice *device, impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (win_x) - *win_x = client_pt.x / impl->window_scale; + *win_x = client_pt.x / impl->surface_scale; if (win_y) - *win_y = client_pt.y / impl->window_scale; + *win_y = client_pt.y / impl->surface_scale; } return window; } static void -gdk_device_win32_select_window_events (GdkDevice *device, +gdk_device_win32_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { @@ -293,13 +293,13 @@ gdk_device_win32_class_init (GdkDeviceWin32Class *klass) device_class->get_history = gdk_device_win32_get_history; device_class->get_state = gdk_device_win32_get_state; - device_class->set_window_cursor = gdk_device_win32_set_window_cursor; + device_class->set_surface_cursor = gdk_device_win32_set_surface_cursor; device_class->warp = gdk_device_win32_warp; device_class->query_state = gdk_device_win32_query_state; device_class->grab = gdk_device_win32_grab; device_class->ungrab = gdk_device_win32_ungrab; - device_class->window_at_position = _gdk_device_win32_surface_at_position; - device_class->select_window_events = gdk_device_win32_select_window_events; + device_class->surface_at_position = _gdk_device_win32_surface_at_position; + device_class->select_surface_events = gdk_device_win32_select_surface_events; } static void diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c index 73bf2b1773..553d2a3a62 100644 --- a/gdk/win32/gdkdevice-wintab.c +++ b/gdk/win32/gdkdevice-wintab.c @@ -93,7 +93,7 @@ gdk_device_wintab_get_state (GdkDevice *device, } static void -gdk_device_wintab_set_window_cursor (GdkDevice *device, +gdk_device_wintab_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -125,14 +125,14 @@ gdk_device_wintab_query_state (GdkDevice *device, device_wintab = GDK_DEVICE_WINTAB (device); if (window) { - scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale; + scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->surface_scale; hwnd = GDK_SURFACE_HWND (window); } else { GdkDisplay *display = gdk_device_get_display (device); - scale = GDK_WIN32_DISPLAY (display)->window_scale; + scale = GDK_WIN32_DISPLAY (display)->surface_scale; hwnd = NULL; } @@ -203,7 +203,7 @@ gdk_device_wintab_ungrab (GdkDevice *device, } static GdkSurface * -gdk_device_wintab_window_at_position (GdkDevice *device, +gdk_device_wintab_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -213,7 +213,7 @@ gdk_device_wintab_window_at_position (GdkDevice *device, } static void -gdk_device_wintab_select_window_events (GdkDevice *device, +gdk_device_wintab_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { @@ -227,17 +227,17 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, gdouble *y) { GdkDevice *device; - GdkSurface *impl_window; + GdkSurface *impl_surface; gint root_x, root_y; gdouble temp_x, temp_y; gint i; GdkDisplay *display; device = GDK_DEVICE (device_wintab); - impl_window = _gdk_surface_get_impl_window (window); + impl_surface = _gdk_surface_get_impl_surface (window); temp_x = temp_y = 0; - gdk_surface_get_origin (impl_window, &root_x, &root_y); + gdk_surface_get_origin (impl_surface, &root_x, &root_y); display = gdk_device_get_display (device); @@ -251,8 +251,8 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, { case GDK_AXIS_X: case GDK_AXIS_Y: - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) - _gdk_device_translate_window_coord (device, window, i, + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) + _gdk_device_translate_surface_coord (device, window, i, device_wintab->last_axis_data[i], &axes[i]); else @@ -301,13 +301,13 @@ gdk_device_wintab_class_init (GdkDeviceWintabClass *klass) device_class->get_history = gdk_device_wintab_get_history; device_class->get_state = gdk_device_wintab_get_state; - device_class->set_window_cursor = gdk_device_wintab_set_window_cursor; + device_class->set_surface_cursor = gdk_device_wintab_set_surface_cursor; device_class->warp = gdk_device_wintab_warp; device_class->query_state = gdk_device_wintab_query_state; device_class->grab = gdk_device_wintab_grab; device_class->ungrab = gdk_device_wintab_ungrab; - device_class->window_at_position = gdk_device_wintab_window_at_position; - device_class->select_window_events = gdk_device_wintab_select_window_events; + device_class->surface_at_position = gdk_device_wintab_surface_at_position; + device_class->select_surface_events = gdk_device_wintab_select_surface_events; } static void diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index ae32d410f9..eb58d57ee8 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -905,7 +905,7 @@ gdk_input_other_event (GdkDisplay *display, } device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); - window = gdk_device_get_window_at_position (device_manager->core_pointer, &x, &y); + window = gdk_device_get_surface_at_position (device_manager->core_pointer, &x, &y); if (window) g_object_ref (window); @@ -1070,16 +1070,16 @@ gdk_input_other_event (GdkDisplay *display, return FALSE; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - pt.x = x * impl->window_scale; - pt.y = y * impl->window_scale; + pt.x = x * impl->surface_scale; + pt.y = y * impl->surface_scale; ClientToScreen (GDK_SURFACE_HWND (window), &pt); g_object_unref (window); window = window->parent; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); g_object_ref (window); ScreenToClient (GDK_SURFACE_HWND (window), &pt); - x = pt.x / impl->window_scale; - y = pt.y / impl->window_scale; + x = pt.x / impl->surface_scale; + y = pt.y / impl->surface_scale; GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n", GDK_SURFACE_HWND (window), x, y)); } diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index e546e4b1be..c0358ab119 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -964,15 +964,15 @@ gdk_win32_display_init (GdkWin32Display *display) if (display->dpi_aware_type != PROCESS_DPI_UNAWARE && scale_str != NULL) { - display->window_scale = atol (scale_str); + display->surface_scale = atol (scale_str); - if (display->window_scale == 0) - display->window_scale = 1; + if (display->surface_scale == 0) + display->surface_scale = 1; display->has_fixed_scale = TRUE; } else - display->window_scale = 1; + display->surface_scale = 1; _gdk_win32_display_init_cursors (display); gdk_win32_display_check_composited (display); @@ -1107,7 +1107,7 @@ _gdk_win32_display_get_monitor_scale_factor (GdkWin32Display *win32_display, *dpi = dpix; if (win32_display->has_fixed_scale) - return win32_display->window_scale; + return win32_display->surface_scale; else return dpix / USER_DEFAULT_SCREEN_DPI > 1 ? dpix / USER_DEFAULT_SCREEN_DPI : 1; } @@ -1143,7 +1143,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass) object_class->dispose = gdk_win32_display_dispose; object_class->finalize = gdk_win32_display_finalize; - display_class->window_type = GDK_TYPE_WIN32_SURFACE; + display_class->surface_type = GDK_TYPE_WIN32_SURFACE; display_class->get_name = gdk_win32_display_get_name; display_class->beep = gdk_win32_display_beep; @@ -1164,7 +1164,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass) display_class->get_next_serial = gdk_win32_display_get_next_serial; display_class->notify_startup_complete = gdk_win32_display_notify_startup_complete; - display_class->create_window_impl = _gdk_win32_display_create_window_impl; + display_class->create_surface_impl = _gdk_win32_display_create_surface_impl; display_class->get_keymap = _gdk_win32_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list; diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h index 05239c665b..71bb5e0499 100644 --- a/gdk/win32/gdkdisplay-win32.h +++ b/gdk/win32/gdkdisplay-win32.h @@ -85,7 +85,7 @@ struct _GdkWin32Display guint have_at_least_win81 : 1; GdkWin32ProcessDpiAwareness dpi_aware_type; guint has_fixed_scale : 1; - guint window_scale; + guint surface_scale; GdkWin32ShcoreFuncs shcore_funcs; GdkWin32User32DPIFuncs user32_dpi_funcs; diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index e52b3afc25..f036817290 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -48,7 +48,7 @@ * To account for it the data is transmuted back and forth. There are two * main points of transmutation: * * GDK convert selection: transmute W32 data to GTK+ data - * * GDK window property change: transmute GTK+ data to W32 data + * * GDK surface property change: transmute GTK+ data to W32 data * * There are also two points where data formats are considered: * * When source drag context is created, it gets a list of GTK+ targets @@ -173,16 +173,16 @@ static gboolean drag_context_grab (GdkDragContext *context); G_DEFINE_TYPE (GdkWin32DragContext, gdk_win32_drag_context, GDK_TYPE_DRAG_CONTEXT) static void -move_drag_window (GdkDragContext *context, +move_drag_surface (GdkDragContext *context, guint x_root, guint y_root) { GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context); - gdk_surface_move (context_win32->drag_window, + gdk_surface_move (context_win32->drag_surface, x_root - context_win32->hot_x, y_root - context_win32->hot_y); - gdk_surface_raise (context_win32->drag_window); + gdk_surface_raise (context_win32->drag_surface); } static void @@ -204,7 +204,7 @@ gdk_win32_drag_context_finalize (GObject *object) { GdkDragContext *context; GdkWin32DragContext *context_win32; - GdkSurface *drag_window; + GdkSurface *drag_surface; GDK_NOTE (DND, g_print ("gdk_drag_context_finalize %p\n", object)); @@ -222,14 +222,14 @@ gdk_win32_drag_context_finalize (GObject *object) } g_set_object (&context_win32->ipc_window, NULL); - drag_window = context_win32->drag_window; + drag_surface = context_win32->drag_surface; g_array_unref (context_win32->droptarget_format_target_map); G_OBJECT_CLASS (gdk_win32_drag_context_parent_class)->finalize (object); - if (drag_window) - gdk_surface_destroy (drag_window); + if (drag_surface) + gdk_surface_destroy (drag_surface); } /* Drag Contexts */ @@ -237,8 +237,8 @@ gdk_win32_drag_context_finalize (GObject *object) static GdkDragContext * gdk_drag_context_new (GdkDisplay *display, gboolean is_source, - GdkSurface *source_window, - GdkSurface *dest_window, + GdkSurface *source_surface, + GdkSurface *dest_surface, GdkDragAction actions, GdkDevice *device, GdkDragProtocol protocol) @@ -255,15 +255,15 @@ gdk_drag_context_new (GdkDisplay *display, gdk_drag_context_set_device (context, device ? device : gdk_seat_get_pointer (gdk_display_get_default_seat (display))); if (win32_display->has_fixed_scale) - context_win32->scale = win32_display->window_scale; + context_win32->scale = win32_display->surface_scale; else context_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL); context_win32->droptarget_format_target_map = g_array_new (FALSE, FALSE, sizeof (GdkSelTargetFormat)); context->is_source = is_source; - g_set_object (&context->source_window, source_window); - g_set_object (&context->dest_window, dest_window); + g_set_object (&context->source_surface, source_surface); + g_set_object (&context->dest_surface, dest_surface); context->actions = actions; context->protocol = protocol; @@ -283,8 +283,8 @@ gdk_drag_context_find (gboolean is_source, context = (GdkDragContext *)tmp_list->data; if ((!context->is_source == !is_source) && - ((source == NULL) || (context->source_window && (context->source_window == source))) && - ((dest == NULL) || (context->dest_window && (context->dest_window == dest)))) + ((source == NULL) || (context->source_surface && (context->source_surface == source))) && + ((dest == NULL) || (context->dest_surface && (context->dest_surface == dest)))) return context; tmp_list = tmp_list->next; @@ -312,7 +312,7 @@ typedef struct { GdkDragContext *context; gint ref_count; - GdkSurface *dest_window; + GdkSurface *dest_surface; } target_drag_context; @@ -345,7 +345,7 @@ static enum_formats *enum_formats_new (data_object *dataobj); /* map windows -> target drag contexts. The table * owns a ref to both objects. */ -static GHashTable* target_ctx_for_window = NULL; +static GHashTable* target_ctx_for_surface = NULL; static ULONG STDMETHODCALLTYPE idroptarget_addref (LPDROPTARGET This) @@ -404,7 +404,7 @@ idroptarget_release (LPDROPTARGET This) if (ref_count == 0) { g_object_unref (ctx->context); - g_clear_object (&ctx->dest_window); + g_clear_object (&ctx->dest_surface); g_free (This); } @@ -482,16 +482,16 @@ dnd_event_put (GdkEventType type, GdkDragContext *context, gint pt_x, gint pt_y, - gboolean to_dest_window) + gboolean to_dest_surface) { GdkEvent *e; e = gdk_event_new (type); - if (to_dest_window) - g_set_object (&e->dnd.window, context->dest_window); + if (to_dest_surface) + g_set_object (&e->dnd.window, context->dest_surface); else - g_set_object (&e->dnd.window, context->source_window); + g_set_object (&e->dnd.window, context->source_surface); e->dnd.send_event = FALSE; g_set_object (&e->dnd.context, context); e->dnd.time = GDK_CURRENT_TIME; @@ -584,19 +584,19 @@ idroptarget_dragenter (LPDROPTARGET This, gint pt_x; gint pt_y; - GDK_NOTE (DND, g_print ("idroptarget_dragenter %p @ %ld : %ld for dest window 0x%p S_OK\n", This, pt.x, pt.y, ctx->dest_window)); + GDK_NOTE (DND, g_print ("idroptarget_dragenter %p @ %ld : %ld for dest window 0x%p S_OK\n", This, pt.x, pt.y, ctx->dest_surface)); g_clear_object (&ctx->context); - context = gdk_drag_context_new (gdk_surface_get_display (ctx->dest_window), + context = gdk_drag_context_new (gdk_surface_get_display (ctx->dest_surface), FALSE, /* OLE2 DnD does not allow us to get the source window, * but we *can* find it if it's ours. This is needed to * support DnD within the same widget, for example. */ /* FIXME: Root window used to be here instead of NULL. Find a substitute? */ - (current_src_context && current_src_context->context) ? current_src_context->context->source_window : NULL, - ctx->dest_window, + (current_src_context && current_src_context->context) ? current_src_context->context->source_surface : NULL, + ctx->dest_surface, GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE, NULL, GDK_DRAG_PROTO_OLE2); @@ -800,7 +800,7 @@ send_change_events (GdkDragContext *context, POINT pt; POINT pt_client; gboolean changed = FALSE; - HWND hwnd = GDK_SURFACE_HWND (context->source_window); + HWND hwnd = GDK_SURFACE_HWND (context->source_surface); LPARAM lparam; WPARAM wparam; gint pt_x; @@ -930,16 +930,16 @@ idropsource_givefeedback (LPDROPSOURCE This, ctx->context->action = suggested_action; if (dwEffect == DROPEFFECT_NONE) - g_clear_object (&ctx->context->dest_window); - else if (ctx->context->dest_window == NULL) - ctx->context->dest_window = NULL; /* FIXME: Root window was here originally. Find a substitute? */ + g_clear_object (&ctx->context->dest_surface); + else if (ctx->context->dest_surface == NULL) + ctx->context->dest_surface = NULL; /* FIXME: Root window was here originally. Find a substitute? */ context_win32->last_x = pt.x / context_win32->scale + _gdk_offset_x; context_win32->last_y = pt.y / context_win32->scale + _gdk_offset_y; e = gdk_event_new (GDK_DRAG_STATUS); - g_set_object (&e->dnd.window, ctx->context->source_window); + g_set_object (&e->dnd.window, ctx->context->source_surface); e->dnd.send_event = FALSE; g_set_object (&e->dnd.context, ctx->context); e->dnd.time = GDK_CURRENT_TIME; @@ -1103,7 +1103,7 @@ idataobject_getdata (LPDATAOBJECT This, memset (&e, 0, sizeof (GdkEvent)); e.type = GDK_SELECTION_REQUEST; - g_set_object (&e.selection.window, ctx->context->source_window); + g_set_object (&e.selection.window, ctx->context->source_surface); e.selection.send_event = FALSE; /* ??? */ /* Both selection and property are OLE2_DND, because change_property() * will only get the property and not the selection. Theoretically we @@ -1113,7 +1113,7 @@ idataobject_getdata (LPDATAOBJECT This, e.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND); e.selection.target = target; /* Requestor here is fake, just to allow the event to be processed */ - g_set_object (&e.selection.requestor, ctx->context->source_window); + g_set_object (&e.selection.requestor, ctx->context->source_surface); e.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND); e.selection.time = GDK_CURRENT_TIME; @@ -1448,11 +1448,11 @@ target_context_new (GdkSurface *window) result->idt.lpVtbl = &idt_vtbl; result->ref_count = 0; - result->dest_window = g_object_ref (window); + result->dest_surface = g_object_ref (window); idroptarget_addref (&result->idt); - GDK_NOTE (DND, g_print ("target_context_new: %p (window %p)\n", result, result->dest_window)); + GDK_NOTE (DND, g_print ("target_context_new: %p (window %p)\n", result, result->dest_surface)); return result; } @@ -1800,7 +1800,7 @@ _gdk_dnd_init (void) if (! SUCCEEDED (hr)) g_error ("OleInitialize failed"); - target_ctx_for_window = g_hash_table_new (g_direct_hash, g_direct_equal); + target_ctx_for_surface = g_hash_table_new (g_direct_hash, g_direct_equal); } } @@ -1829,11 +1829,11 @@ local_send_leave (GdkDragContext *context, if ((current_dest_drag != NULL) && (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && - (current_dest_drag->source_window == context->source_window)) + (current_dest_drag->source_surface == context->source_surface)) { tmp_event = gdk_event_new (GDK_DRAG_LEAVE); - g_set_object (&tmp_event->dnd.window, context->dest_window); + g_set_object (&tmp_event->dnd.window, context->dest_surface); /* Pass ownership of context to the event */ tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, current_dest_drag); @@ -1866,21 +1866,21 @@ local_send_enter (GdkDragContext *context, current_dest_drag = NULL; } - new_context = gdk_drag_context_new (gdk_surface_get_display (context->source_window), + new_context = gdk_drag_context_new (gdk_surface_get_display (context->source_surface), FALSE, - context->source_window, - context->dest_window, + context->source_surface, + context->dest_surface, context->actions, NULL, GDK_DRAG_PROTO_LOCAL); new_context->formats = gdk_content_formats_ref (context->formats); - gdk_surface_set_events (new_context->source_window, - gdk_surface_get_events (new_context->source_window) | + gdk_surface_set_events (new_context->source_surface, + gdk_surface_get_events (new_context->source_surface) | GDK_PROPERTY_CHANGE_MASK); tmp_event = gdk_event_new (GDK_DRAG_ENTER); - g_set_object (&tmp_event->dnd.window, context->dest_window); + g_set_object (&tmp_event->dnd.window, context->dest_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, new_context); tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ @@ -1910,12 +1910,12 @@ local_send_motion (GdkDragContext *context, if ((current_dest_drag != NULL) && (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && - (current_dest_drag->source_window == context->source_window)) + (current_dest_drag->source_surface == context->source_surface)) { GdkWin32DragContext *current_dest_drag_win32; tmp_event = gdk_event_new (GDK_DRAG_MOTION); - g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_window); + g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, current_dest_drag); tmp_event->dnd.time = time; @@ -1951,13 +1951,13 @@ local_send_drop (GdkDragContext *context, if ((current_dest_drag != NULL) && (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && - (current_dest_drag->source_window == context->source_window)) + (current_dest_drag->source_surface == context->source_surface)) { GdkWin32DragContext *context_win32; /* Pass ownership of context to the event */ tmp_event = gdk_event_new (GDK_DROP_START); - g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_window); + g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, current_dest_drag); tmp_event->dnd.time = GDK_CURRENT_TIME; @@ -1981,7 +1981,7 @@ static void gdk_drag_do_leave (GdkDragContext *context, guint32 time) { - if (context->dest_window) + if (context->dest_surface) { GDK_NOTE (DND, g_print ("gdk_drag_do_leave\n")); @@ -1991,12 +1991,12 @@ gdk_drag_do_leave (GdkDragContext *context, local_send_leave (context, time); } - g_clear_object (&context->dest_window); + g_clear_object (&context->dest_surface); } } static GdkSurface * -create_drag_window (GdkDisplay *display) +create_drag_surface (GdkDisplay *display) { GdkSurface *window; @@ -2064,7 +2064,7 @@ _gdk_win32_surface_drag_begin (GdkSurface *window, if (kbd_state[VK_RBUTTON] & 0x80) context_win32->last_key_state |= MK_RBUTTON; - context_win32->drag_window = create_drag_window (gdk_surface_get_display (window)); + context_win32->drag_surface = create_drag_surface (gdk_surface_get_display (window)); if (!drag_context_grab (context)) { @@ -2079,7 +2079,7 @@ _gdk_win32_surface_drag_begin (GdkSurface *window, sel_win32->dnd_source_state = GDK_WIN32_DND_PENDING; } - move_drag_window (context, x_root, y_root); + move_drag_surface (context, x_root, y_root); return context; } @@ -2127,13 +2127,13 @@ _gdk_win32_dnd_do_dragdrop (void) memset (&tmp_event, 0, sizeof (tmp_event)); tmp_event.type = GDK_SELECTION_REQUEST; - g_set_object (&tmp_event.selection.window, drag_ctx->source_window); + g_set_object (&tmp_event.selection.window, drag_ctx->source_surface); tmp_event.selection.send_event = FALSE; tmp_event.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND); tmp_event.selection.target = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE); win32_sel->property_change_target_atom = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE); tmp_event.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND); - g_set_object (&tmp_event.selection.requestor, drag_ctx->source_window); + g_set_object (&tmp_event.selection.requestor, drag_ctx->source_surface); tmp_event.selection.time = GDK_CURRENT_TIME; /* ??? */ GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); @@ -2143,7 +2143,7 @@ _gdk_win32_dnd_do_dragdrop (void) { GdkEvent *tmp_event; tmp_event = gdk_event_new (GDK_DROP_FINISHED); - g_set_object (&tmp_event->dnd.window, drag_ctx->source_window); + g_set_object (&tmp_event->dnd.window, drag_ctx->source_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, drag_ctx); gdk_event_set_device (tmp_event, gdk_drag_context_get_device (drag_ctx)); @@ -2202,43 +2202,43 @@ find_window_enum_proc (HWND hwnd, static GdkSurface * gdk_win32_drag_context_find_window (GdkDragContext *context, - GdkSurface *drag_window, + GdkSurface *drag_surface, gint x_root, gint y_root, GdkDragProtocol *protocol) { GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context); - GdkSurface *dest_window, *dw; + GdkSurface *dest_surface, *dw; find_window_enum_arg a; a.x = x_root * context_win32->scale - _gdk_offset_x; a.y = y_root * context_win32->scale - _gdk_offset_y; - a.ignore = drag_window ? GDK_SURFACE_HWND (drag_window) : NULL; + a.ignore = drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL; a.result = NULL; GDK_NOTE (DND, g_print ("gdk_drag_find_window_real: %p %+d%+d\n", - (drag_window ? GDK_SURFACE_HWND (drag_window) : NULL), + (drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL), a.x, a.y)); EnumWindows (find_window_enum_proc, (LPARAM) &a); if (a.result == NULL) - dest_window = NULL; + dest_surface = NULL; else { dw = gdk_win32_handle_table_lookup (a.result); if (dw) { - dest_window = gdk_surface_get_toplevel (dw); - g_object_ref (dest_window); + dest_surface = gdk_surface_get_toplevel (dw); + g_object_ref (dest_surface); } else - dest_window = gdk_win32_surface_foreign_new_for_display (context->display, a.result); + dest_surface = gdk_win32_surface_foreign_new_for_display (context->display, a.result); if (use_ole2_dnd) *protocol = GDK_DRAG_PROTO_OLE2; - else if (context->source_window) + else if (context->source_surface) *protocol = GDK_DRAG_PROTO_LOCAL; else *protocol = GDK_DRAG_PROTO_WIN32_DROPFILES; @@ -2246,18 +2246,18 @@ gdk_win32_drag_context_find_window (GdkDragContext *context, GDK_NOTE (DND, g_print ("gdk_drag_find_window: %p %+d%+d: %p: %p %s\n", - (drag_window ? GDK_SURFACE_HWND (drag_window) : NULL), + (drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL), x_root, y_root, a.result, - (dest_window ? GDK_SURFACE_HWND (dest_window) : NULL), + (dest_surface ? GDK_SURFACE_HWND (dest_surface) : NULL), _gdk_win32_drag_protocol_to_string (*protocol))); - return dest_window; + return dest_surface; } static gboolean gdk_win32_drag_context_drag_motion (GdkDragContext *context, - GdkSurface *dest_window, + GdkSurface *dest_surface, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -2284,18 +2284,18 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, context_win32 = GDK_WIN32_DRAG_CONTEXT (context); - if (context_win32->drag_window) - move_drag_window (context, x_root, y_root); + if (context_win32->drag_surface) + move_drag_surface (context, x_root, y_root); if (!use_ole2_dnd) { - if (context->dest_window == dest_window) + if (context->dest_surface == dest_surface) { GdkDragContext *dest_context; dest_context = gdk_drag_context_find (FALSE, - context->source_window, - dest_window); + context->source_surface, + dest_surface); if (dest_context) dest_context->actions = context->actions; @@ -2311,9 +2311,9 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, context_win32->drag_status = GDK_DRAG_STATUS_DRAG; /* Check if new destination accepts drags, and which protocol */ - if (dest_window) + if (dest_surface) { - g_set_object (&context->dest_window, dest_window); + g_set_object (&context->dest_surface, dest_surface); context->protocol = protocol; switch (protocol) @@ -2329,7 +2329,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, } else { - context->dest_window = NULL; + context->dest_surface = NULL; context->action = 0; } @@ -2337,7 +2337,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, * the drag changed */ tmp_event = gdk_event_new (GDK_DRAG_STATUS); - g_set_object (&tmp_event->dnd.window, context->source_window); + g_set_object (&tmp_event->dnd.window, context->source_surface); /* We use this to signal a synthetic status. Perhaps * we should use an extra field... */ @@ -2358,7 +2358,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, context_win32->last_x = x_root; context_win32->last_y = y_root; - if (context->dest_window) + if (context->dest_surface) { if (context_win32->drag_status == GDK_DRAG_STATUS_DRAG) { @@ -2410,7 +2410,7 @@ gdk_win32_drag_context_drag_drop (GdkDragContext *context, if (!use_ole2_dnd) { - if (context->dest_window && + if (context->dest_surface && context->protocol == GDK_DRAG_PROTO_LOCAL) local_send_drop (context, time); } @@ -2459,8 +2459,8 @@ gdk_win32_drag_context_drag_status (GdkDragContext *context, if (!use_ole2_dnd) { src_context = gdk_drag_context_find (TRUE, - context->source_window, - context->dest_window); + context->source_surface, + context->dest_surface); if (src_context) { @@ -2470,7 +2470,7 @@ gdk_win32_drag_context_drag_status (GdkDragContext *context, src_context_win32->drag_status = GDK_DRAG_STATUS_DRAG; tmp_event = gdk_event_new (GDK_DRAG_STATUS); - g_set_object (&tmp_event->dnd.window, context->source_window); + g_set_object (&tmp_event->dnd.window, context->source_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, src_context); tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ @@ -2499,7 +2499,7 @@ gdk_win32_drag_context_drop_reply (GdkDragContext *context, GDK_NOTE (DND, g_print ("gdk_drop_reply\n")); if (!use_ole2_dnd) - if (context->dest_window) + if (context->dest_surface) { if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES) _gdk_dropfiles_store (NULL); @@ -2522,12 +2522,12 @@ gdk_win32_drag_context_drop_finish (GdkDragContext *context, if (!use_ole2_dnd) { src_context = gdk_drag_context_find (TRUE, - context->source_window, - context->dest_window); + context->source_surface, + context->dest_surface); if (src_context) { tmp_event = gdk_event_new (GDK_DROP_FINISHED); - g_set_object (&tmp_event->dnd.window, src_context->source_window); + g_set_object (&tmp_event->dnd.window, src_context->source_surface); tmp_event->dnd.send_event = FALSE; g_set_object (&tmp_event->dnd.context, src_context); gdk_event_set_device (tmp_event, gdk_drag_context_get_device (src_context)); @@ -2602,7 +2602,7 @@ _gdk_win32_surface_register_dnd (GdkSurface *window) else { /* Return if window is already setup for DND. */ - if (g_hash_table_lookup (target_ctx_for_window, GDK_SURFACE_HWND (window)) != NULL) + if (g_hash_table_lookup (target_ctx_for_surface, GDK_SURFACE_HWND (window)) != NULL) return; ctx = target_context_new (window); @@ -2623,7 +2623,7 @@ _gdk_win32_surface_register_dnd (GdkSurface *window) else { g_object_ref (window); - g_hash_table_insert (target_ctx_for_window, GDK_SURFACE_HWND (window), ctx); + g_hash_table_insert (target_ctx_for_surface, GDK_SURFACE_HWND (window), ctx); } } } @@ -2721,11 +2721,11 @@ gdk_drag_anim_timeout (gpointer data) t = ease_out_cubic (f); - gdk_surface_show (context->drag_window); - gdk_surface_move (context->drag_window, + gdk_surface_show (context->drag_surface); + gdk_surface_move (context->drag_surface, context->last_x + (context->start_x - context->last_x) * t - context->hot_x, context->last_y + (context->start_y - context->last_y) * t - context->hot_y); - gdk_surface_set_opacity (context->drag_window, 1.0 - f); + gdk_surface_set_opacity (context->drag_surface, 1.0 - f); return G_SOURCE_CONTINUE; } @@ -2760,15 +2760,15 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, if (success) { - gdk_surface_hide (win32_context->drag_window); + gdk_surface_hide (win32_context->drag_surface); return; } - win_surface = _gdk_surface_ref_cairo_surface (win32_context->drag_window); - surface = gdk_surface_create_similar_surface (win32_context->drag_window, + win_surface = _gdk_surface_ref_cairo_surface (win32_context->drag_surface); + surface = gdk_surface_create_similar_surface (win32_context->drag_surface, cairo_surface_get_content (win_surface), - gdk_surface_get_width (win32_context->drag_window), - gdk_surface_get_height (win32_context->drag_window)); + gdk_surface_get_width (win32_context->drag_surface), + gdk_surface_get_height (win32_context->drag_surface)); cr = cairo_create (surface); cairo_set_source_surface (cr, win_surface, 0, 0); cairo_paint (cr); @@ -2778,7 +2778,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, /* pattern = cairo_pattern_create_for_surface (surface); - gdk_surface_set_background_pattern (win32_context->drag_window, pattern); + gdk_surface_set_background_pattern (win32_context->drag_surface, pattern); cairo_pattern_destroy (pattern); */ @@ -2786,7 +2786,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, anim = g_slice_new0 (GdkDragAnim); g_set_object (&anim->context, win32_context); - anim->frame_clock = gdk_surface_get_frame_clock (win32_context->drag_window); + anim->frame_clock = gdk_surface_get_frame_clock (win32_context->drag_surface); anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock); id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17, @@ -2948,17 +2948,17 @@ gdk_drag_update (GdkDragContext *context, { GdkWin32DragContext *win32_context = GDK_WIN32_DRAG_CONTEXT (context); GdkDragAction action, possible_actions; - GdkSurface *dest_window; + GdkSurface *dest_surface; GdkDragProtocol protocol; gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, win32_context->actions, &action, &possible_actions); gdk_drag_find_window (context, - win32_context->drag_window, - x_root, y_root, &dest_window, &protocol); + win32_context->drag_surface, + x_root, y_root, &dest_surface, &protocol); - gdk_drag_motion (context, dest_window, protocol, x_root, y_root, + gdk_drag_motion (context, dest_surface, protocol, x_root, y_root, action, possible_actions, evtime); } @@ -3010,7 +3010,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context, case GDK_KEY_KP_Enter: case GDK_KEY_KP_Space: if ((gdk_drag_context_get_selected_action (context) != 0) && - (gdk_drag_context_get_dest_window (context) != NULL)) + (gdk_drag_context_get_dest_surface (context) != NULL)) { g_signal_emit_by_name (context, "drop-performed", gdk_event_get_time ((GdkEvent *) event)); @@ -3074,7 +3074,7 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context, * example, when changing the drag cursor. */ if (event->implicit || - event->grab_window == win32_context->drag_window || + event->grab_window == win32_context->drag_surface || event->grab_window == win32_context->ipc_window) return FALSE; @@ -3100,7 +3100,7 @@ gdk_dnd_handle_button_event (GdkDragContext *context, #endif if ((gdk_drag_context_get_selected_action (context) != 0) && - (gdk_drag_context_get_dest_window (context) != NULL)) + (gdk_drag_context_get_dest_surface (context) != NULL)) { g_signal_emit_by_name (context, "drop-performed", gdk_event_get_time ((GdkEvent *) event)); @@ -3199,9 +3199,9 @@ gdk_win32_drag_context_action_changed (GdkDragContext *context, } static GdkSurface * -gdk_win32_drag_context_get_drag_window (GdkDragContext *context) +gdk_win32_drag_context_get_drag_surface (GdkDragContext *context) { - return GDK_WIN32_DRAG_CONTEXT (context)->drag_window; + return GDK_WIN32_DRAG_CONTEXT (context)->drag_surface; } static void @@ -3221,7 +3221,7 @@ gdk_win32_drag_context_set_hotspot (GdkDragContext *context, if (win32_context->grab_seat) { /* DnD is managed, update current position */ - move_drag_window (context, win32_context->last_x, win32_context->last_y); + move_drag_surface (context, win32_context->last_x, win32_context->last_y); } } @@ -3242,7 +3242,7 @@ gdk_win32_drag_context_class_init (GdkWin32DragContextClass *klass) context_class->drop_finish = gdk_win32_drag_context_drop_finish; context_class->drop_status = gdk_win32_drag_context_drop_status; - context_class->get_drag_window = gdk_win32_drag_context_get_drag_window; + context_class->get_drag_surface = gdk_win32_drag_context_get_drag_surface; context_class->set_hotspot = gdk_win32_drag_context_set_hotspot; context_class->drop_done = gdk_win32_drag_context_drop_done; context_class->set_cursor = gdk_win32_drag_context_set_cursor; diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 02da731c4e..2c9bf3ffa9 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -585,7 +585,7 @@ find_window_for_mouse_event (GdkSurface* reported_window, POINT pt; GdkDisplay *display; GdkDeviceManagerWin32 *device_manager; - GdkSurface *event_window; + GdkSurface *event_surface; HWND hwnd; RECT rect; GdkDeviceGrabInfo *grab; @@ -600,10 +600,10 @@ find_window_for_mouse_event (GdkSurface* reported_window, pt = msg->pt; if (!grab->owner_events) - event_window = grab->native_window; + event_surface = grab->native_surface; else { - event_window = NULL; + event_surface = NULL; hwnd = WindowFromPoint (pt); if (hwnd != NULL) { @@ -612,19 +612,19 @@ find_window_for_mouse_event (GdkSurface* reported_window, ScreenToClient (hwnd, &client_pt); GetClientRect (hwnd, &rect); if (PtInRect (&rect, client_pt)) - event_window = gdk_win32_handle_table_lookup (hwnd); + event_surface = gdk_win32_handle_table_lookup (hwnd); } - if (event_window == NULL) - event_window = grab->native_window; + if (event_surface == NULL) + event_surface = grab->native_surface; } /* need to also adjust the coordinates to the new window */ - ScreenToClient (GDK_SURFACE_HWND (event_window), &pt); + ScreenToClient (GDK_SURFACE_HWND (event_surface), &pt); /* ATTENTION: need to update client coords */ msg->lParam = MAKELPARAM (pt.x, pt.y); - return event_window; + return event_surface; } static void @@ -891,8 +891,8 @@ _gdk_win32_print_event (const GdkEvent *event) event->dnd.context, _gdk_win32_drag_protocol_to_string (event->dnd.context->protocol), event->dnd.context->is_source ? "SOURCE" : "DEST", - event->dnd.context->source_window == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->source_window), - event->dnd.context->dest_window == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->dest_window)); + event->dnd.context->source_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->source_surface), + event->dnd.context->dest_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->dest_surface)); break; case GDK_SCROLL: g_print ("(%.4g,%.4g) (%.4g,%.4g) %s ", @@ -907,8 +907,8 @@ _gdk_win32_print_event (const GdkEvent *event) break; case GDK_SURFACE_STATE: g_print ("%s: %s", - _gdk_win32_surface_state_to_string (event->window_state.changed_mask), - _gdk_win32_surface_state_to_string (event->window_state.new_window_state)); + _gdk_win32_surface_state_to_string (event->surface_state.changed_mask), + _gdk_win32_surface_state_to_string (event->surface_state.new_surface_state)); case GDK_GRAB_BROKEN: g_print ("%s %s %p", (event->grab_broken.keyboard ? "KEYBOARD" : "POINTER"), @@ -1233,7 +1233,7 @@ send_crossing_event (GdkDisplay *display, mode != GDK_CROSSING_UNGRAB) { /* !owner_event => only report events wrt grab window, ignore rest */ - if ((GdkSurface *)window != grab->native_window) + if ((GdkSurface *)window != grab->native_surface) return; } @@ -1244,10 +1244,10 @@ send_crossing_event (GdkDisplay *display, event->crossing.window = window; event->crossing.subwindow = subwindow; event->crossing.time = _gdk_win32_get_next_tick (time_); - event->crossing.x = pt.x / impl->window_scale; - event->crossing.y = pt.y / impl->window_scale; - event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->window_scale; - event->crossing.y_root = (screen_pt->y + _gdk_offset_y) / impl->window_scale; + event->crossing.x = pt.x / impl->surface_scale; + event->crossing.y = pt.y / impl->surface_scale; + event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->surface_scale; + event->crossing.y_root = (screen_pt->y + _gdk_offset_y) / impl->surface_scale; event->crossing.mode = mode; event->crossing.detail = notify_type; event->crossing.mode = mode; @@ -1265,7 +1265,7 @@ static GdkSurface * get_native_parent (GdkSurface *window) { if (window->parent != NULL) - return window->parent->impl_window; + return window->parent->impl_surface; return NULL; } @@ -1534,12 +1534,12 @@ gboolean _gdk_win32_get_window_rect (GdkSurface *window, RECT *rect) { - GdkSurfaceImplWin32 *window_impl; + GdkSurfaceImplWin32 *surface_impl; RECT client_rect; POINT point; HWND hwnd; - window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); hwnd = GDK_SURFACE_HWND (window); @@ -1551,8 +1551,8 @@ _gdk_win32_get_window_rect (GdkSurface *window, if (gdk_surface_get_parent (window) == NULL) { ClientToScreen (hwnd, &point); - point.x += _gdk_offset_x * window_impl->window_scale; - point.y += _gdk_offset_y * window_impl->window_scale; + point.x += _gdk_offset_x * surface_impl->surface_scale; + point.y += _gdk_offset_y * surface_impl->surface_scale; } rect->left = point.x; @@ -1560,7 +1560,7 @@ _gdk_win32_get_window_rect (GdkSurface *window, rect->right = point.x + client_rect.right - client_rect.left; rect->bottom = point.y + client_rect.bottom - client_rect.top; - return !window_impl->inhibit_configure; + return !surface_impl->inhibit_configure; } void @@ -1571,10 +1571,10 @@ _gdk_win32_do_emit_configure_event (GdkSurface *window, impl->unscaled_width = rect.right - rect.left; impl->unscaled_height = rect.bottom - rect.top; - window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale; - window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale; - window->x = rect.left / impl->window_scale; - window->y = rect.top / impl->window_scale; + window->width = (impl->unscaled_width + impl->surface_scale - 1) / impl->surface_scale; + window->height = (impl->unscaled_height + impl->surface_scale - 1) / impl->surface_scale; + window->x = rect.left / impl->surface_scale; + window->y = rect.top / impl->surface_scale; _gdk_surface_update_size (window); @@ -1694,7 +1694,7 @@ handle_wm_paint (MSG *msg, return; } - update_region = _gdk_win32_hrgn_to_region (hrgn, impl->window_scale); + update_region = _gdk_win32_hrgn_to_region (hrgn, impl->surface_scale); if (!cairo_region_is_empty (update_region)) _gdk_surface_invalidate_for_expose (window, update_region); cairo_region_destroy (update_region); @@ -1793,8 +1793,8 @@ handle_nchittest (HWND hwnd, /* If it's inside the rect, return FALSE and let DefWindowProc() handle it */ if (cairo_region_contains_point (window->input_shape, - rect.left / impl->window_scale, - rect.top / impl->window_scale)) + rect.left / impl->surface_scale, + rect.top / impl->surface_scale)) return FALSE; /* Otherwise override DefWindowProc() and tell WM that the point is not @@ -1815,7 +1815,7 @@ handle_dpi_changed (GdkSurface *window, GdkDevice *device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); RECT *rect = (RECT *)msg->lParam; GdkEvent *event; - guint old_scale = impl->window_scale; + guint old_scale = impl->surface_scale; /* MSDN for WM_DPICHANGED: dpi_x == dpi_y here, so LOWORD (msg->wParam) == HIWORD (msg->wParam) */ guint dpi = LOWORD (msg->wParam); @@ -1824,10 +1824,10 @@ handle_dpi_changed (GdkSurface *window, if (win32_display->has_fixed_scale) return; - impl->window_scale = dpi / USER_DEFAULT_SCREEN_DPI; + impl->surface_scale = dpi / USER_DEFAULT_SCREEN_DPI; /* Don't bother if scales did not change in the end */ - if (old_scale == impl->window_scale) + if (old_scale == impl->surface_scale) return; if (!IsIconic (msg->hwnd) && @@ -1835,21 +1835,21 @@ handle_dpi_changed (GdkSurface *window, { GdkMonitor *monitor; - monitor = gdk_display_get_monitor_at_window (display, window); - gdk_monitor_set_scale_factor (monitor, impl->window_scale); + monitor = gdk_display_get_monitor_at_surface (display, window); + gdk_monitor_set_scale_factor (monitor, impl->surface_scale); if (impl->layered) { /* We only need to set the cairo surface device scale here ourselves for layered windows */ if (impl->cache_surface != NULL) cairo_surface_set_device_scale (impl->cache_surface, - impl->window_scale, - impl->window_scale); + impl->surface_scale, + impl->surface_scale); if (impl->cairo_surface != NULL) cairo_surface_set_device_scale (impl->cairo_surface, - impl->window_scale, - impl->window_scale); + impl->surface_scale, + impl->surface_scale); } } @@ -1878,10 +1878,10 @@ generate_button_event (GdkEventType type, event->button.window = window; event->button.time = _gdk_win32_get_next_tick (msg->time); - event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale; - event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->window_scale; - event->button.x_root = (msg->pt.x + _gdk_offset_x) / impl->window_scale; - event->button.y_root = (msg->pt.y + _gdk_offset_y) / impl->window_scale; + event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale; + event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale; + event->button.x_root = (msg->pt.x + _gdk_offset_x) / impl->surface_scale; + event->button.y_root = (msg->pt.y + _gdk_offset_y) / impl->surface_scale; event->button.axes = NULL; event->button.state = build_pointer_event_state (msg); event->button.button = button; @@ -2180,8 +2180,8 @@ _gdk_win32_surface_fill_min_max_info (GdkSurface *window, if (impl->hint_flags & GDK_HINT_MIN_SIZE) { rect.left = rect.top = 0; - rect.right = impl->hints.min_width * impl->window_scale; - rect.bottom = impl->hints.min_height * impl->window_scale; + rect.right = impl->hints.min_width * impl->surface_scale; + rect.bottom = impl->hints.min_height * impl->surface_scale; _gdk_win32_adjust_client_rect (window, &rect); @@ -2194,8 +2194,8 @@ _gdk_win32_surface_fill_min_max_info (GdkSurface *window, int maxw, maxh; rect.left = rect.top = 0; - rect.right = impl->hints.max_width * impl->window_scale; - rect.bottom = impl->hints.max_height * impl->window_scale; + rect.right = impl->hints.max_width * impl->surface_scale; + rect.bottom = impl->hints.max_height * impl->surface_scale; _gdk_win32_adjust_client_rect (window, &rect); @@ -2264,8 +2264,8 @@ _gdk_win32_surface_fill_min_max_info (GdkSurface *window, mmi->ptMaxSize.y = nearest_info.rcWork.bottom - nearest_info.rcWork.top; } - mmi->ptMaxTrackSize.x = GetSystemMetrics (SM_CXVIRTUALSCREEN) + impl->margins_x * impl->window_scale; - mmi->ptMaxTrackSize.y = GetSystemMetrics (SM_CYVIRTUALSCREEN) + impl->margins_y * impl->window_scale; + mmi->ptMaxTrackSize.x = GetSystemMetrics (SM_CXVIRTUALSCREEN) + impl->margins_x * impl->surface_scale; + mmi->ptMaxTrackSize.y = GetSystemMetrics (SM_CYVIRTUALSCREEN) + impl->margins_y * impl->surface_scale; } return TRUE; @@ -2817,7 +2817,7 @@ gdk_event_translate (MSG *msg, /* We keep the implicit grab until no buttons at all are held down */ if ((state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (button - 1))) == 0) { - GdkSurface *native_window = pointer_grab->native_window; + GdkSurface *native_surface = pointer_grab->native_surface; ReleaseCapture (); @@ -2834,7 +2834,7 @@ gdk_event_translate (MSG *msg, } synthesize_crossing_events (display, - native_window, new_window, + native_surface, new_window, GDK_CROSSING_UNGRAB, &msg->pt, 0, /* TODO: Set right mask */ @@ -2885,7 +2885,7 @@ gdk_event_translate (MSG *msg, if (!pointer_grab->owner_events && new_window != NULL && - new_window != pointer_grab->native_window) + new_window != pointer_grab->native_surface) new_window = NULL; } @@ -2923,12 +2923,12 @@ gdk_event_translate (MSG *msg, * sends WM_MOUSEMOVE messages after a new window is shows under * the mouse, even if the mouse hasn't moved. This disturbs gtk. */ - if ((msg->pt.x + _gdk_offset_x) / impl->window_scale == current_root_x && - (msg->pt.y + _gdk_offset_y) / impl->window_scale == current_root_y) + if ((msg->pt.x + _gdk_offset_x) / impl->surface_scale == current_root_x && + (msg->pt.y + _gdk_offset_y) / impl->surface_scale == current_root_y) break; - current_root_x = (msg->pt.x + _gdk_offset_x) / impl->window_scale; - current_root_y = (msg->pt.y + _gdk_offset_y) / impl->window_scale; + current_root_x = (msg->pt.x + _gdk_offset_x) / impl->surface_scale; + current_root_y = (msg->pt.y + _gdk_offset_y) / impl->surface_scale; if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) @@ -2940,8 +2940,8 @@ gdk_event_translate (MSG *msg, event = gdk_event_new (GDK_MOTION_NOTIFY); event->motion.window = window; event->motion.time = _gdk_win32_get_next_tick (msg->time); - event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale; - event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->window_scale; + event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale; + event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale; event->motion.x_root = current_root_x; event->motion.y_root = current_root_y; event->motion.axes = NULL; @@ -3065,10 +3065,10 @@ gdk_event_translate (MSG *msg, event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ? GDK_SCROLL_RIGHT : GDK_SCROLL_LEFT; event->scroll.time = _gdk_win32_get_next_tick (msg->time); - event->scroll.x = (gint16) point.x / impl->window_scale; - event->scroll.y = (gint16) point.y / impl->window_scale; - event->scroll.x_root = ((gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x) / impl->window_scale; - event->scroll.y_root = ((gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y) / impl->window_scale; + event->scroll.x = (gint16) point.x / impl->surface_scale; + event->scroll.y = (gint16) point.y / impl->surface_scale; + event->scroll.x_root = ((gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x) / impl->surface_scale; + event->scroll.y_root = ((gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y) / impl->surface_scale; event->scroll.state = build_pointer_event_state (msg); gdk_event_set_device (event, device_manager_win32->core_pointer); gdk_event_set_source_device (event, device_manager_win32->system_pointer); @@ -3119,7 +3119,7 @@ gdk_event_translate (MSG *msg, case WM_MOUSEACTIVATE: { - if (gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP + if (gdk_surface_get_surface_type (window) == GDK_SURFACE_TEMP || !window->accept_focus) { *ret_valp = MA_NOACTIVATE; @@ -3397,7 +3397,7 @@ gdk_event_translate (MSG *msg, else unset_bits |= GDK_SURFACE_STATE_MAXIMIZED; - gdk_synthesize_window_state (window, unset_bits, set_bits); + gdk_synthesize_surface_state (window, unset_bits, set_bits); new_state = window->state; @@ -3484,8 +3484,8 @@ gdk_event_translate (MSG *msg, { /* Resize in increments relative to the base size */ rect.left = rect.top = 0; - rect.right = impl->hints.base_width * impl->window_scale; - rect.bottom = impl->hints.base_height * impl->window_scale; + rect.right = impl->hints.base_width * impl->surface_scale; + rect.bottom = impl->hints.base_height * impl->surface_scale; _gdk_win32_adjust_client_rect (window, &rect); point.x = rect.left; point.y = rect.top; @@ -3507,53 +3507,53 @@ gdk_event_translate (MSG *msg, case WMSZ_BOTTOM: if (drag->bottom == rect.bottom) break; - adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale); + adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale); break; case WMSZ_BOTTOMLEFT: if (drag->bottom == rect.bottom && drag->left == rect.left) break; - adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale); - adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale); + adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale); break; case WMSZ_LEFT: if (drag->left == rect.left) break; - adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale); break; case WMSZ_TOPLEFT: if (drag->top == rect.top && drag->left == rect.left) break; - adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale); - adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale); + adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale); break; case WMSZ_TOP: if (drag->top == rect.top) break; - adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale); + adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale); break; case WMSZ_TOPRIGHT: if (drag->top == rect.top && drag->right == rect.right) break; - adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale); - adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale); + adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale); break; case WMSZ_RIGHT: if (drag->right == rect.right) break; - adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale); break; case WMSZ_BOTTOMRIGHT: if (drag->bottom == rect.bottom && drag->right == rect.right) break; - adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale); - adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale); + adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale); + adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale); break; } @@ -3885,9 +3885,9 @@ gdk_event_translate (MSG *msg, } if (LOWORD (msg->wParam) == WA_INACTIVE) - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FOCUSED, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0); else - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FOCUSED); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED); /* Bring any tablet contexts to the top of the overlap order when * one of our windows is activated. diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c index 5e1c24d45f..d3119d4b49 100644 --- a/gdk/win32/gdkgeometry-win32.c +++ b/gdk/win32/gdkgeometry-win32.c @@ -83,22 +83,22 @@ _gdk_surface_move_resize_child (GdkSurface *window, _gdk_win32_surface_description (window), window->x, window->y, width, height, x, y)); - if (width * impl->window_scale > 65535 || height * impl->window_scale > 65535) + if (width * impl->surface_scale > 65535 || height * impl->surface_scale > 65535) { g_warning ("Native children wider or taller than 65535 pixels are not supported."); - if (width * impl->window_scale > 65535) - width = 65535 / impl->window_scale; - if (height * impl->window_scale > 65535) - height = 65535 /impl->window_scale; + if (width * impl->surface_scale > 65535) + width = 65535 / impl->surface_scale; + if (height * impl->surface_scale > 65535) + height = 65535 /impl->surface_scale; } window->x = x; window->y = y; window->width = width; window->height = height; - impl->unscaled_width = width * impl->window_scale; - impl->unscaled_height = height * impl->window_scale; + impl->unscaled_width = width * impl->surface_scale; + impl->unscaled_height = height * impl->surface_scale; _gdk_win32_surface_tmp_unset_parent_bg (window); _gdk_win32_surface_tmp_unset_bg (window, TRUE); @@ -106,14 +106,14 @@ _gdk_surface_move_resize_child (GdkSurface *window, GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d," "NOACTIVATE|NOZORDER)\n", GDK_SURFACE_HWND (window), - (window->x + window->parent->abs_x) * impl->window_scale, - (window->y + window->parent->abs_y) * impl->window_scale, + (window->x + window->parent->abs_x) * impl->surface_scale, + (window->y + window->parent->abs_y) * impl->surface_scale, impl->unscaled_width, impl->unscaled_height)); API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), NULL, - (window->x + window->parent->abs_x) * impl->window_scale, - (window->y + window->parent->abs_y) * impl->window_scale, + (window->x + window->parent->abs_x) * impl->surface_scale, + (window->y + window->parent->abs_y) * impl->surface_scale, impl->unscaled_width, impl->unscaled_height, SWP_NOACTIVATE | SWP_NOZORDER)); @@ -132,7 +132,7 @@ _gdk_win32_surface_tmp_unset_bg (GdkSurface *window, if (_gdk_surface_has_impl (window) && GDK_SURFACE_IS_WIN32 (window) && - window->window_type != GDK_SURFACE_FOREIGN) + window->surface_type != GDK_SURFACE_FOREIGN) tmp_unset_bg (window); if (recurse) @@ -150,7 +150,7 @@ _gdk_win32_surface_tmp_unset_parent_bg (GdkSurface *window) if (window->parent == NULL) return; - window = _gdk_surface_get_impl_window (window->parent); + window = _gdk_surface_get_impl_surface (window->parent); _gdk_win32_surface_tmp_unset_bg (window, FALSE); } @@ -165,7 +165,7 @@ _gdk_win32_surface_tmp_reset_bg (GdkSurface *window, if (_gdk_surface_has_impl (window) && GDK_SURFACE_IS_WIN32 (window) && - window->window_type != GDK_SURFACE_FOREIGN) + window->surface_type != GDK_SURFACE_FOREIGN) { tmp_reset_bg (window); } diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c index ed3db37eac..3cf24488ab 100644 --- a/gdk/win32/gdkglcontext-win32.c +++ b/gdk/win32/gdkglcontext-win32.c @@ -49,7 +49,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject) GdkGLContext *context = GDK_GL_CONTEXT (gobject); GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (gobject); GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context)); - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); if (context_win32->hglrc != NULL) { @@ -107,7 +107,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context, { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context); - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); GdkWin32Display *display = (GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context))); gboolean can_wait = display->hasWglOMLSyncControl; cairo_rectangle_int_t whole_window; @@ -177,7 +177,7 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context, /* If nothing else is known, repaint everything so that the back buffer is fully up-to-date for the swapbuffer */ - window = gdk_gl_context_get_window (context); + window = gdk_gl_context_get_surface (context); cairo_region_union_rectangle (update_area, &(GdkRectangle) { 0, 0, gdk_surface_get_width (window), @@ -647,7 +647,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, gint glver_major = 0; gint glver_minor = 0; - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_surface_get_display (window)); @@ -816,7 +816,7 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display, if (context_win32->is_attached && display_win32->hasWglEXTSwapControl) { - window = gdk_gl_context_get_window (context); + window = gdk_gl_context_get_surface (context); /* If there is compositing there is no particular need to delay * the swap when drawing on the offscreen, rendering to the screen diff --git a/gdk/win32/gdkmonitor-win32.c b/gdk/win32/gdkmonitor-win32.c index 2f7afd3a74..108e5083ed 100644 --- a/gdk/win32/gdkmonitor-win32.c +++ b/gdk/win32/gdkmonitor-win32.c @@ -691,7 +691,7 @@ enum_monitor (HMONITOR hmonitor, w32mon->work_rect = rect; if (data->display->has_fixed_scale) - scale = data->display->window_scale; + scale = data->display->surface_scale; else { /* First acquire the scale using the current screen */ diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index f22fa69634..6e51091ff5 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -412,7 +412,7 @@ void _gdk_win32_keymap_set_active_layout (GdkWin32Keymap *keymap, GdkKeymap *_gdk_win32_display_get_keymap (GdkDisplay *display); -void _gdk_win32_display_create_window_impl (GdkDisplay *display, +void _gdk_win32_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c index 14cf749f8a..56e7886803 100644 --- a/gdk/win32/gdkscreen-win32.c +++ b/gdk/win32/gdkscreen-win32.c @@ -33,7 +33,7 @@ struct _GdkWin32Screen GObject parent_instance; int width, height; - int window_scale; + int surface_scale; }; struct _GdkWin32ScreenClass @@ -80,12 +80,12 @@ init_root_window (GdkWin32Screen *screen_win32) win32_display = GDK_WIN32_DISPLAY (_gdk_display); if (win32_display->dpi_aware_type != PROCESS_DPI_UNAWARE) - screen_win32->window_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, + screen_win32->surface_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL); else - screen_win32->window_scale = 1; + screen_win32->surface_scale = 1; } static void diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index f41534f451..12e754325f 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -131,7 +131,7 @@ static gboolean _gdk_surface_get_functions (GdkSurface *window, static HDC _gdk_win32_impl_acquire_dc (GdkSurfaceImplWin32 *impl); static void _gdk_win32_impl_release_dc (GdkSurfaceImplWin32 *impl); -#define WINDOW_IS_TOPLEVEL(window) \ +#define SURFACE_IS_TOPLEVEL(window) \ (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) struct _GdkWin32Surface { @@ -190,7 +190,7 @@ gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *impl) { GdkDisplay *display = gdk_display_get_default (); - impl->toplevel_window_type = -1; + impl->toplevel_surface_type = -1; impl->hicon_big = NULL; impl->hicon_small = NULL; impl->hint_flags = 0; @@ -199,57 +199,57 @@ gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *impl) impl->transient_children = NULL; impl->num_transients = 0; impl->changing_state = FALSE; - impl->window_scale = 1; + impl->surface_scale = 1; } static void gdk_surface_impl_win32_finalize (GObject *object) { GdkSurface *wrapper; - GdkSurfaceImplWin32 *window_impl; + GdkSurfaceImplWin32 *surface_impl; g_return_if_fail (GDK_IS_SURFACE_IMPL_WIN32 (object)); - window_impl = GDK_SURFACE_IMPL_WIN32 (object); + surface_impl = GDK_SURFACE_IMPL_WIN32 (object); - wrapper = window_impl->wrapper; + wrapper = surface_impl->wrapper; if (!GDK_SURFACE_DESTROYED (wrapper)) { - gdk_win32_handle_table_remove (window_impl->handle); + gdk_win32_handle_table_remove (surface_impl->handle); } - g_clear_pointer (&window_impl->snap_stash, g_free); - g_clear_pointer (&window_impl->snap_stash_int, g_free); + g_clear_pointer (&surface_impl->snap_stash, g_free); + g_clear_pointer (&surface_impl->snap_stash_int, g_free); - if (window_impl->hicon_big != NULL) + if (surface_impl->hicon_big != NULL) { - GDI_CALL (DestroyIcon, (window_impl->hicon_big)); - window_impl->hicon_big = NULL; + GDI_CALL (DestroyIcon, (surface_impl->hicon_big)); + surface_impl->hicon_big = NULL; } - if (window_impl->hicon_small != NULL) + if (surface_impl->hicon_small != NULL) { - GDI_CALL (DestroyIcon, (window_impl->hicon_small)); - window_impl->hicon_small = NULL; + GDI_CALL (DestroyIcon, (surface_impl->hicon_small)); + surface_impl->hicon_small = NULL; } - g_free (window_impl->decorations); + g_free (surface_impl->decorations); - if (window_impl->cache_surface) + if (surface_impl->cache_surface) { - cairo_surface_destroy (window_impl->cache_surface); - window_impl->cache_surface = NULL; + cairo_surface_destroy (surface_impl->cache_surface); + surface_impl->cache_surface = NULL; } - if (window_impl->cairo_surface) + if (surface_impl->cairo_surface) { - cairo_surface_destroy (window_impl->cairo_surface); - window_impl->cairo_surface = NULL; + cairo_surface_destroy (surface_impl->cairo_surface); + surface_impl->cairo_surface = NULL; } - g_assert (window_impl->transient_owner == NULL); - g_assert (window_impl->transient_children == NULL); + g_assert (surface_impl->transient_owner == NULL); + g_assert (surface_impl->transient_children == NULL); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -277,16 +277,16 @@ gdk_win32_surface_get_queued_window_rect (GdkSurface *window, RECT window_rect; GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect); + gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect); /* Turn client area into window area */ _gdk_win32_adjust_client_rect (window, &window_rect); /* Convert GDK screen coordinates to W32 desktop coordinates */ - window_rect.left -= _gdk_offset_x * impl->window_scale; - window_rect.right -= _gdk_offset_x * impl->window_scale; - window_rect.top -= _gdk_offset_y * impl->window_scale; - window_rect.bottom -= _gdk_offset_y * impl->window_scale; + window_rect.left -= _gdk_offset_x * impl->surface_scale; + window_rect.right -= _gdk_offset_x * impl->surface_scale; + window_rect.top -= _gdk_offset_y * impl->surface_scale; + window_rect.bottom -= _gdk_offset_y * impl->surface_scale; *return_window_rect = window_rect; } @@ -685,7 +685,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) * [1] http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00214.html */ void -_gdk_win32_display_create_window_impl (GdkDisplay *display, +_gdk_win32_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -707,8 +707,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, g_return_if_fail (display == _gdk_display); GDK_NOTE (MISC, - g_print ("_gdk_surface_impl_new: %s %s\n", (window->window_type == GDK_SURFACE_TOPLEVEL ? "TOPLEVEL" : - (window->window_type == GDK_SURFACE_TEMP ? "TEMP" : "???")), + g_print ("_gdk_surface_impl_new: %s %s\n", (window->surface_type == GDK_SURFACE_TOPLEVEL ? "TOPLEVEL" : + (window->surface_type == GDK_SURFACE_TEMP ? "TEMP" : "???")), (attributes->wclass == GDK_INPUT_OUTPUT ? "" : "input-only"))); hparent = (real_parent != NULL) ? GDK_SURFACE_HWND (real_parent) : NULL; @@ -721,9 +721,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, impl->layered_opacity = 1.0; display_win32 = GDK_WIN32_DISPLAY (display); - impl->window_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL); - impl->unscaled_width = window->width * impl->window_scale; - impl->unscaled_height = window->height * impl->window_scale; + impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL); + impl->unscaled_width = window->width * impl->surface_scale; + impl->unscaled_height = window->height * impl->surface_scale; if (!window->input_only) { @@ -739,7 +739,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, GDK_NOTE (MISC, g_print ("... GDK_INPUT_ONLY\n")); } - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: if (window->parent) @@ -755,7 +755,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, else { /* MSDN: We need WS_CLIPCHILDREN and WS_CLIPSIBLINGS for GL Context Creation */ - if (window->window_type == GDK_SURFACE_TOPLEVEL) + if (window->surface_type == GDK_SURFACE_TOPLEVEL) dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; else dwStyle = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_CLIPCHILDREN; @@ -780,17 +780,17 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, g_assert_not_reached (); } - rect.left = window->x * impl->window_scale; - rect.top = window->y * impl->window_scale; - rect.right = rect.left + window->width * impl->window_scale; - rect.bottom = rect.top + window->height * impl->window_scale; + rect.left = window->x * impl->surface_scale; + rect.top = window->y * impl->surface_scale; + rect.right = rect.left + window->width * impl->surface_scale; + rect.bottom = rect.top + window->height * impl->surface_scale; AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle); - real_x = (window->x - offset_x) * impl->window_scale; - real_y = (window->y - offset_y) * impl->window_scale; + real_x = (window->x - offset_x) * impl->surface_scale; + real_y = (window->y - offset_y) * impl->surface_scale; - if (window->window_type == GDK_SURFACE_TOPLEVEL) + if (window->surface_type == GDK_SURFACE_TOPLEVEL) { /* We initially place it at default so that we can get the default window positioning if we want */ @@ -823,7 +823,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DND) dwExStyle |= WS_EX_TRANSPARENT; - klass = RegisterGdkClass (window->window_type, impl->type_hint); + klass = RegisterGdkClass (window->surface_type, impl->type_hint); wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL); @@ -896,7 +896,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, return; } -// if (!from_set_skip_taskbar_hint && window->window_type == GDK_SURFACE_TEMP) +// if (!from_set_skip_taskbar_hint && window->surface_type == GDK_SURFACE_TEMP) // gdk_surface_set_skip_taskbar_hint (window, TRUE); _gdk_win32_surface_enable_transparency (window); @@ -918,7 +918,7 @@ gdk_win32_surface_foreign_new_for_display (GdkDisplay *display, window = _gdk_display_create_window (display); window->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WIN32, NULL); - window->impl_window = window; + window->impl_surface = window; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->wrapper = window; parent = GetParent (anid); @@ -932,13 +932,13 @@ gdk_win32_surface_foreign_new_for_display (GdkDisplay *display, ClientToScreen ((HWND) anid, &point); if (parent != GetDesktopWindow ()) ScreenToClient (parent, &point); - window->x = point.x / impl->window_scale; - window->y = point.y / impl->window_scale; + window->x = point.x / impl->surface_scale; + window->y = point.y / impl->surface_scale; impl->unscaled_width = rect.right - rect.left; impl->unscaled_height = rect.bottom - rect.top; - window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale; - window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale; - window->window_type = GDK_SURFACE_FOREIGN; + window->width = (impl->unscaled_width + impl->surface_scale - 1) / impl->surface_scale; + window->height = (impl->unscaled_height + impl->surface_scale - 1) / impl->surface_scale; + window->surface_type = GDK_SURFACE_FOREIGN; window->destroyed = FALSE; window->event_mask = GDK_ALL_EVENTS_MASK; /* XXX */ if (IsWindowVisible ((HWND) anid)) @@ -970,7 +970,7 @@ gdk_win32_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - GdkSurfaceImplWin32 *window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GSList *tmp; g_return_if_fail (GDK_IS_SURFACE (window)); @@ -982,7 +982,7 @@ gdk_win32_surface_destroy (GdkSurface *window, _gdk_remove_modal_window (window); /* Remove all our transient children */ - tmp = window_impl->transient_children; + tmp = surface_impl->transient_children; while (tmp != NULL) { GdkSurface *child = tmp->data; @@ -991,11 +991,11 @@ gdk_win32_surface_destroy (GdkSurface *window, child_impl->transient_owner = NULL; tmp = tmp->next; } - g_slist_free (window_impl->transient_children); - window_impl->transient_children = NULL; + g_slist_free (surface_impl->transient_children); + surface_impl->transient_children = NULL; /* Remove ourself from our transient owner */ - if (window_impl->transient_owner != NULL) + if (surface_impl->transient_owner != NULL) { gdk_surface_set_transient_for (window, NULL); } @@ -1041,8 +1041,8 @@ get_outer_rect (GdkSurface *window, GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); rect->left = rect->top = 0; - rect->right = width * impl->window_scale; - rect->bottom = height * impl->window_scale; + rect->right = width * impl->surface_scale; + rect->bottom = height * impl->surface_scale; _gdk_win32_adjust_client_rect (window, rect); } @@ -1066,19 +1066,19 @@ adjust_for_gravity_hints (GdkSurface *window, case GDK_GRAVITY_NORTH: case GDK_GRAVITY_CENTER: case GDK_GRAVITY_SOUTH: - *x -= (outer_rect->right - outer_rect->left / 2) / impl->window_scale; + *x -= (outer_rect->right - outer_rect->left / 2) / impl->surface_scale; *x += window->width / 2; break; case GDK_GRAVITY_SOUTH_EAST: case GDK_GRAVITY_EAST: case GDK_GRAVITY_NORTH_EAST: - *x -= (outer_rect->right - outer_rect->left) / impl->window_scale; + *x -= (outer_rect->right - outer_rect->left) / impl->surface_scale; *x += window->width; break; case GDK_GRAVITY_STATIC: - *x += outer_rect->left / impl->window_scale; + *x += outer_rect->left / impl->surface_scale; break; default: @@ -1090,19 +1090,19 @@ adjust_for_gravity_hints (GdkSurface *window, case GDK_GRAVITY_WEST: case GDK_GRAVITY_CENTER: case GDK_GRAVITY_EAST: - *y -= ((outer_rect->bottom - outer_rect->top) / 2) / impl->window_scale; + *y -= ((outer_rect->bottom - outer_rect->top) / 2) / impl->surface_scale; *y += window->height / 2; break; case GDK_GRAVITY_SOUTH_WEST: case GDK_GRAVITY_SOUTH: case GDK_GRAVITY_SOUTH_EAST: - *y -= (outer_rect->bottom - outer_rect->top) / impl->window_scale; + *y -= (outer_rect->bottom - outer_rect->top) / impl->surface_scale; *y += window->height; break; case GDK_GRAVITY_STATIC: - *y += outer_rect->top * impl->window_scale; + *y += outer_rect->top * impl->surface_scale; break; default: @@ -1121,7 +1121,7 @@ show_window_internal (GdkSurface *window, gboolean already_mapped, gboolean deiconify) { - GdkSurfaceImplWin32 *window_impl; + GdkSurfaceImplWin32 *surface_impl; gboolean focus_on_map = FALSE; DWORD exstyle; @@ -1193,19 +1193,19 @@ show_window_internal (GdkSurface *window, * + Certain window types and hints have more elaborate positioning * schemes. */ - window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (!already_mapped && GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL && - (window_impl->hint_flags & (GDK_HINT_POS | GDK_HINT_USER_POS)) == 0) + (surface_impl->hint_flags & (GDK_HINT_POS | GDK_HINT_USER_POS)) == 0) { gboolean center = FALSE; RECT window_rect, center_on_rect; int x, y; - x = window_impl->initial_x; - y = window_impl->initial_y; + x = surface_impl->initial_x; + y = surface_impl->initial_y; - if (window_impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN) + if (surface_impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN) { HMONITOR monitor; MONITORINFO mi; @@ -1223,15 +1223,15 @@ show_window_internal (GdkSurface *window, } center = TRUE; } - else if (window_impl->transient_owner != NULL && - GDK_SURFACE_IS_MAPPED (window_impl->transient_owner)) + else if (surface_impl->transient_owner != NULL && + GDK_SURFACE_IS_MAPPED (surface_impl->transient_owner)) { - GdkSurface *owner = window_impl->transient_owner; + GdkSurface *owner = surface_impl->transient_owner; /* Center on transient parent */ - center_on_rect.left = (owner->x - _gdk_offset_x) * window_impl->window_scale; - center_on_rect.top = (owner->y - _gdk_offset_y) * window_impl->window_scale; - center_on_rect.right = center_on_rect.left + owner->width * window_impl->window_scale; - center_on_rect.bottom = center_on_rect.top + owner->height * window_impl->window_scale; + center_on_rect.left = (owner->x - _gdk_offset_x) * surface_impl->surface_scale; + center_on_rect.top = (owner->y - _gdk_offset_y) * surface_impl->surface_scale; + center_on_rect.right = center_on_rect.left + owner->width * surface_impl->surface_scale; + center_on_rect.bottom = center_on_rect.top + owner->height * surface_impl->surface_scale; _gdk_win32_adjust_client_rect (GDK_SURFACE (owner), ¢er_on_rect); center = TRUE; @@ -1241,8 +1241,8 @@ show_window_internal (GdkSurface *window, { window_rect.left = 0; window_rect.top = 0; - window_rect.right = window->width * window_impl->window_scale; - window_rect.bottom = window->height * window_impl->window_scale; + window_rect.right = window->width * surface_impl->surface_scale; + window_rect.bottom = window->height * surface_impl->surface_scale; _gdk_win32_adjust_client_rect (window, &window_rect); x = center_on_rect.left + ((center_on_rect.right - center_on_rect.left) - (window_rect.right - window_rect.left)) / 2; @@ -1369,7 +1369,7 @@ gdk_win32_surface_hide (GdkSurface *window) _gdk_win32_surface_state_to_string (window->state))); if (GDK_SURFACE_IS_MAPPED (window)) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); @@ -1441,13 +1441,13 @@ gdk_win32_surface_move (GdkSurface *window, GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,0,0," "NOACTIVATE|NOSIZE|NOZORDER)\n", GDK_SURFACE_HWND (window), - (x - _gdk_offset_x) * impl->window_scale, - (y - _gdk_offset_y) * impl->window_scale)); + (x - _gdk_offset_x) * impl->surface_scale, + (y - _gdk_offset_y) * impl->surface_scale)); API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, - (x - _gdk_offset_x) * impl->window_scale, - (y - _gdk_offset_y) * impl->window_scale, + (x - _gdk_offset_x) * impl->surface_scale, + (y - _gdk_offset_y) * impl->surface_scale, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER)); } @@ -1540,15 +1540,15 @@ gdk_win32_surface_move_resize_internal (GdkSurface *window, GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%ld,%ld," "NOACTIVATE|NOZORDER)\n", GDK_SURFACE_HWND (window), - (x - _gdk_offset_x) * impl->window_scale, - (y - _gdk_offset_y) * impl->window_scale, + (x - _gdk_offset_x) * impl->surface_scale, + (y - _gdk_offset_y) * impl->surface_scale, outer_rect.right - outer_rect.left, outer_rect.bottom - outer_rect.top)); API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, - (x - _gdk_offset_x) * impl->window_scale, - (y - _gdk_offset_y) * impl->window_scale, + (x - _gdk_offset_x) * impl->surface_scale, + (y - _gdk_offset_y) * impl->surface_scale, outer_rect.right - outer_rect.left, outer_rect.bottom - outer_rect.top, SWP_NOACTIVATE | SWP_NOZORDER)); @@ -1563,10 +1563,10 @@ gdk_win32_surface_move_resize (GdkSurface *window, gint width, gint height) { - GdkSurfaceImplWin32 *window_impl; + GdkSurfaceImplWin32 *surface_impl; - window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - window_impl->inhibit_configure = TRUE; + surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + surface_impl->inhibit_configure = TRUE; /* We ignore changes to the window being moved or resized by the user, as we don't want to fight the user */ @@ -1590,9 +1590,9 @@ gdk_win32_surface_move_resize (GdkSurface *window, } out: - window_impl->inhibit_configure = FALSE; + surface_impl->inhibit_configure = FALSE; - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) _gdk_win32_emit_configure_event (window); } @@ -1683,7 +1683,7 @@ get_effective_window_decorations (GdkSurface *window, if (gdk_surface_get_decorations (window, decoration)) return TRUE; - if (window->window_type != GDK_SURFACE_TOPLEVEL) + if (window->surface_type != GDK_SURFACE_TOPLEVEL) { return FALSE; } @@ -1876,7 +1876,7 @@ gdk_win32_surface_set_transient_for (GdkSurface *window, HWND window_id, parent_id; LONG_PTR old_ptr; DWORD w32_error; - GdkSurfaceImplWin32 *window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GdkSurfaceImplWin32 *parent_impl = NULL; GSList *item; @@ -1899,7 +1899,7 @@ gdk_win32_surface_set_transient_for (GdkSurface *window, if (parent == NULL) { - GdkSurfaceImplWin32 *trans_impl = GDK_SURFACE_IMPL_WIN32 (window_impl->transient_owner->impl); + GdkSurfaceImplWin32 *trans_impl = GDK_SURFACE_IMPL_WIN32 (surface_impl->transient_owner->impl); if (trans_impl->transient_children != NULL) { item = g_slist_find (trans_impl->transient_children, window); @@ -1912,10 +1912,10 @@ gdk_win32_surface_set_transient_for (GdkSurface *window, trans_impl->transient_children = NULL; } } - g_object_unref (G_OBJECT (window_impl->transient_owner)); + g_object_unref (G_OBJECT (surface_impl->transient_owner)); g_object_unref (G_OBJECT (window)); - window_impl->transient_owner = NULL; + surface_impl->transient_owner = NULL; } else { @@ -1924,7 +1924,7 @@ gdk_win32_surface_set_transient_for (GdkSurface *window, parent_impl->transient_children = g_slist_append (parent_impl->transient_children, window); g_object_ref (G_OBJECT (window)); parent_impl->num_transients++; - window_impl->transient_owner = parent; + surface_impl->transient_owner = parent; g_object_ref (G_OBJECT (parent)); } @@ -2057,25 +2057,25 @@ gdk_win32_surface_get_geometry (GdkSurface *window, if (parent == NULL) { - rect.left += _gdk_offset_x * impl->window_scale; - rect.top += _gdk_offset_y * impl->window_scale; - rect.right += _gdk_offset_x * impl->window_scale; - rect.bottom += _gdk_offset_y * impl->window_scale; + rect.left += _gdk_offset_x * impl->surface_scale; + rect.top += _gdk_offset_y * impl->surface_scale; + rect.right += _gdk_offset_x * impl->surface_scale; + rect.bottom += _gdk_offset_y * impl->surface_scale; } if (x) - *x = rect.left / impl->window_scale; + *x = rect.left / impl->surface_scale; if (y) - *y = rect.top / impl->window_scale; + *y = rect.top / impl->surface_scale; if (width) - *width = (rect.right - rect.left) / impl->window_scale; + *width = (rect.right - rect.left) / impl->surface_scale; if (height) - *height = (rect.bottom - rect.top) / impl->window_scale; + *height = (rect.bottom - rect.top) / impl->surface_scale; GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_geometry: %p: %ldx%ld@%+ld%\n", GDK_SURFACE_HWND (window), - (rect.right - rect.left) / impl->window_scale, - (rect.bottom - rect.top) / impl->window_scale, + (rect.right - rect.left) / impl->surface_scale, + (rect.bottom - rect.top) / impl->surface_scale, rect.left, rect.top)); } } @@ -2092,23 +2092,23 @@ gdk_win32_surface_get_root_coords (GdkSurface *window, POINT pt; GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - pt.x = x * impl->window_scale; - pt.y = y * impl->window_scale; + pt.x = x * impl->surface_scale; + pt.y = y * impl->surface_scale; ClientToScreen (GDK_SURFACE_HWND (window), &pt); tx = pt.x; ty = pt.y; if (root_x) - *root_x = (tx + _gdk_offset_x) / impl->window_scale; + *root_x = (tx + _gdk_offset_x) / impl->surface_scale; if (root_y) - *root_y = (ty + _gdk_offset_y) / impl->window_scale; + *root_y = (ty + _gdk_offset_y) / impl->surface_scale; GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_root_coords: %p: %+d%+d %+d%+d\n", GDK_SURFACE_HWND (window), - x * impl->window_scale, - y * impl->window_scale, - (tx + _gdk_offset_x) / impl->window_scale, - (ty + _gdk_offset_y) / impl->window_scale)); + x * impl->surface_scale, + y * impl->surface_scale, + (tx + _gdk_offset_x) / impl->surface_scale, + (ty + _gdk_offset_y) / impl->surface_scale)); } static void @@ -2149,18 +2149,18 @@ gdk_win32_surface_get_frame_extents (GdkSurface *window, API_CALL (GetWindowRect, (hwnd, &r)); /* Initialize to real, unscaled size */ - rect->x = r.left + _gdk_offset_x * impl->window_scale; - rect->y = r.top + _gdk_offset_y * impl->window_scale; + rect->x = r.left + _gdk_offset_x * impl->surface_scale; + rect->y = r.top + _gdk_offset_y * impl->surface_scale; rect->width = (r.right - r.left); rect->height = (r.bottom - r.top); /* Extend width and height to ensure that they cover the real size when de-scaled, * and replace everyting with scaled values */ - rect->width = (rect->width + rect->x % impl->window_scale + impl->window_scale - 1) / impl->window_scale; - rect->height = (rect->height + rect->y % impl->window_scale + impl->window_scale - 1) / impl->window_scale; - rect->x = r.left / impl->window_scale + _gdk_offset_x; - rect->y = r.top / impl->window_scale + _gdk_offset_y; + rect->width = (rect->width + rect->x % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale; + rect->height = (rect->height + rect->y % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale; + rect->x = r.left / impl->surface_scale + _gdk_offset_x; + rect->y = r.top / impl->surface_scale + _gdk_offset_y; GDK_NOTE (MISC, g_print ("gdk_surface_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n", GDK_SURFACE_HWND (window), @@ -2449,7 +2449,7 @@ _gdk_win32_surface_lacks_wm_decorations (GdkSurface *window) return FALSE; /* only toplevels can be layered */ - if (!WINDOW_IS_TOPLEVEL (window)) + if (!SURFACE_IS_TOPLEVEL (window)) return FALSE; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); @@ -2525,7 +2525,7 @@ _gdk_win32_surface_update_style_bits (GdkSurface *window) new_style = old_style; new_exstyle = old_exstyle; - if (window->window_type == GDK_SURFACE_TEMP) + if (window->surface_type == GDK_SURFACE_TEMP) { new_exstyle |= WS_EX_TOOLWINDOW; will_be_topmost = TRUE; @@ -2851,8 +2851,8 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context) } } - thickness = AEROSNAP_REGION_THICKNESS * impl->window_scale; - trigger_thickness = AEROSNAP_REGION_TRIGGER_THICKNESS * impl->window_scale; + thickness = AEROSNAP_REGION_THICKNESS * impl->surface_scale; + trigger_thickness = AEROSNAP_REGION_TRIGGER_THICKNESS * impl->surface_scale; snap_region.edge = wa; snap_region.trigger = wa; @@ -3065,28 +3065,28 @@ stash_window (GdkSurface *window, impl->snap_stash_int = g_new0 (GdkRectangle, 1); GDK_NOTE (MISC, g_print ("monitor work area %ld x %ld @ %ld : %ld\n", - (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->window_scale, - (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->window_scale, + (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->surface_scale, + (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->surface_scale, hmonitor_info.rcWork.left, hmonitor_info.rcWork.top)); GDK_NOTE (MISC, g_print ("monitor area %ld x %ld @ %ld : %ld\n", - (hmonitor_info.rcMonitor.right - hmonitor_info.rcMonitor.left) / impl->window_scale, - (hmonitor_info.rcMonitor.bottom - hmonitor_info.rcMonitor.top) / impl->window_scale, + (hmonitor_info.rcMonitor.right - hmonitor_info.rcMonitor.left) / impl->surface_scale, + (hmonitor_info.rcMonitor.bottom - hmonitor_info.rcMonitor.top) / impl->surface_scale, hmonitor_info.rcMonitor.left, hmonitor_info.rcMonitor.top)); GDK_NOTE (MISC, g_print ("window work place %ld x %ld @ %ld : %ld\n", - (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->window_scale, - (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->window_scale, + (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->surface_scale, + (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->surface_scale, placement.rcNormalPosition.left, placement.rcNormalPosition.top)); - width = (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->window_scale; - height = (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->window_scale; - x = (placement.rcNormalPosition.left - hmonitor_info.rcMonitor.left) / impl->window_scale; - y = (placement.rcNormalPosition.top - hmonitor_info.rcMonitor.top) / impl->window_scale; + width = (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->surface_scale; + height = (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->surface_scale; + x = (placement.rcNormalPosition.left - hmonitor_info.rcMonitor.left) / impl->surface_scale; + y = (placement.rcNormalPosition.top - hmonitor_info.rcMonitor.top) / impl->surface_scale; - wwidth = (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->window_scale; - wheight = (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->window_scale; + wwidth = (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->surface_scale; + wheight = (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->surface_scale; impl->snap_stash->x = (gdouble) (x) / (gdouble) (wwidth); impl->snap_stash->y = (gdouble) (y) / (gdouble) (wheight); @@ -3117,7 +3117,7 @@ snap_up (GdkSurface *window) stash_window (window, impl); - maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale; + maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->surface_scale; gdk_surface_get_position (window, &x, &y); width = gdk_surface_get_width (window); @@ -3192,16 +3192,16 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window, GdkSurfaceImplWin32 *impl; GdkDisplay *display; gint n_monitors; - GdkSurfaceState window_state = gdk_surface_get_state (window); - gboolean minimized = window_state & GDK_SURFACE_STATE_ICONIFIED; - gboolean maximized = window_state & GDK_SURFACE_STATE_MAXIMIZED; + GdkSurfaceState surface_state = gdk_surface_get_state (window); + gboolean minimized = surface_state & GDK_SURFACE_STATE_ICONIFIED; + gboolean maximized = surface_state & GDK_SURFACE_STATE_MAXIMIZED; gboolean halfsnapped; GdkMonitor *monitor; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); display = gdk_surface_get_display (window); n_monitors = gdk_display_get_n_monitors (display); - monitor = gdk_display_get_monitor_at_window (display, window); + monitor = gdk_display_get_monitor_at_surface (display, window); if (minimized && maximized) minimized = FALSE; @@ -3314,7 +3314,7 @@ apply_snap (GdkSurface *window, GdkDisplay *display; display = gdk_surface_get_display (window); - monitor = gdk_display_get_monitor_at_window (display, window); + monitor = gdk_display_get_monitor_at_surface (display, window); switch (snap) { @@ -3534,7 +3534,7 @@ draw_indicator (GdkW32DragMoveResizeContext *context, gint64 animation_duration; GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl); - line_width = AEROSNAP_INDICATOR_LINE_WIDTH * impl->window_scale; + line_width = AEROSNAP_INDICATOR_LINE_WIDTH * impl->surface_scale; corner_radius = AEROSNAP_INDICATOR_CORNER_RADIUS; animation_duration = AEROSNAP_INDICATOR_ANIMATION_DURATION; last_draw = FALSE; @@ -3602,10 +3602,10 @@ draw_indicator (GdkW32DragMoveResizeContext *context, cr = cairo_create (context->indicator_surface); rounded_rectangle (cr, - (current_rect.x - context->indicator_window_rect.x) * impl->window_scale, - (current_rect.y - context->indicator_window_rect.y) * impl->window_scale, - current_rect.width * impl->window_scale, - current_rect.height * impl->window_scale, + (current_rect.x - context->indicator_window_rect.x) * impl->surface_scale, + (current_rect.y - context->indicator_window_rect.y) * impl->surface_scale, + current_rect.width * impl->surface_scale, + current_rect.height * impl->surface_scale, corner_radius, line_width, &fill, &outline); @@ -3649,7 +3649,7 @@ redraw_indicator (gpointer user_data) if (!ensure_snap_indicator_surface (context, context->indicator_window_rect.width, context->indicator_window_rect.height, - impl->window_scale)) + impl->surface_scale)) { do_source_remove = TRUE; } @@ -3662,10 +3662,10 @@ redraw_indicator (gpointer user_data) last_draw = draw_indicator (context, context->draw_timestamp); - window_position.x = (context->indicator_window_rect.x - _gdk_offset_x) * impl->window_scale; - window_position.y = (context->indicator_window_rect.y - _gdk_offset_y) * impl->window_scale; - window_size.cx = context->indicator_window_rect.width * impl->window_scale; - window_size.cy = context->indicator_window_rect.height * impl->window_scale; + window_position.x = (context->indicator_window_rect.x - _gdk_offset_x) * impl->surface_scale; + window_position.y = (context->indicator_window_rect.y - _gdk_offset_y) * impl->surface_scale; + window_size.cx = context->indicator_window_rect.width * impl->surface_scale; + window_size.cy = context->indicator_window_rect.height * impl->surface_scale; blender.BlendOp = AC_SRC_OVER; blender.BlendFlags = 0; @@ -3812,7 +3812,7 @@ update_fullup_indicator (GdkSurface *window, context->indicator_target.width, context->indicator_target.height, context->indicator_target.x, context->indicator_target.y, to.width, to.height, to.x, to.y)); - start_indicator_drawing (context, from_adjusted, to, impl->window_scale); + start_indicator_drawing (context, from_adjusted, to, impl->surface_scale); return; } @@ -3830,7 +3830,7 @@ update_fullup_indicator (GdkSurface *window, context->indicator_target = to_adjusted; context->indicator_window_rect = from_or_to; - ensure_snap_indicator_surface (context, from_or_to.width, from_or_to.height, impl->window_scale); + ensure_snap_indicator_surface (context, from_or_to.width, from_or_to.height, impl->surface_scale); } static void @@ -3851,7 +3851,7 @@ start_indicator (GdkSurface *window, monitor = gdk_display_get_monitor_at_point (display, x, y); gdk_monitor_get_workarea (monitor, &workarea); - maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale; + maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->surface_scale; gdk_surface_get_position (window, &start_size.x, &start_size.y); start_size.width = gdk_surface_get_width (window); start_size.height = gdk_surface_get_height (window); @@ -3886,7 +3886,7 @@ start_indicator (GdkSurface *window, break; } - start_indicator_drawing (context, start_size, end_size, impl->window_scale); + start_indicator_drawing (context, start_size, end_size, impl->surface_scale); } static void @@ -4258,7 +4258,7 @@ setup_drag_move_resize_context (GdkSurface *window, GdkDisplay *display; display = gdk_surface_get_display (window); - monitor = gdk_display_get_monitor_at_window (display, window); + monitor = gdk_display_get_monitor_at_surface (display, window); gdk_surface_get_geometry (window, &wx, &wy, &wwidth, &wheight); swx = wx; @@ -4273,8 +4273,8 @@ setup_drag_move_resize_context (GdkSurface *window, */ if (op == GDK_WIN32_DRAGOP_MOVE && !maximized) { - swx += impl->margins.left / impl->window_scale; - swy += impl->margins.top / impl->window_scale; + swx += impl->margins.left / impl->surface_scale; + swy += impl->margins.top / impl->surface_scale; swwidth -= impl->margins_x; swheight -= impl->margins_y; } @@ -4320,52 +4320,52 @@ setup_drag_move_resize_context (GdkSurface *window, GDK_NOTE (MISC, g_print ("W32 WM unmaximized window placement is %ld x %ld @ %ld : %ld\n", placement.rcNormalPosition.right - placement.rcNormalPosition.left, placement.rcNormalPosition.bottom - placement.rcNormalPosition.top, - placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale, - placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale)); + placement.rcNormalPosition.left + _gdk_offset_x * impl->surface_scale, + placement.rcNormalPosition.top + _gdk_offset_y * impl->surface_scale)); unmax_width = placement.rcNormalPosition.right - placement.rcNormalPosition.left; unmax_height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top; - shadow_unmax_width = unmax_width - impl->margins_x * impl->window_scale; - shadow_unmax_height = unmax_height - impl->margins_y * impl->window_scale; + shadow_unmax_width = unmax_width - impl->margins_x * impl->surface_scale; + shadow_unmax_height = unmax_height - impl->margins_y * impl->surface_scale; - if (offsetx * impl->window_scale < (shadow_unmax_width / 2) && - offsety * impl->window_scale < (shadow_unmax_height / 2)) + if (offsetx * impl->surface_scale < (shadow_unmax_width / 2) && + offsety * impl->surface_scale < (shadow_unmax_height / 2)) { - placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale; + placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->surface_scale; placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height; if (left_half) { - placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left - _gdk_offset_x) * impl->window_scale; + placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left - _gdk_offset_x) * impl->surface_scale; placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width; } else { - placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right - _gdk_offset_x) * impl->window_scale; + placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right - _gdk_offset_x) * impl->surface_scale; placement.rcNormalPosition.left = placement.rcNormalPosition.right - unmax_width; } } else { - placement.rcNormalPosition.left = (root_x * impl->window_scale) - + placement.rcNormalPosition.left = (root_x * impl->surface_scale) - (unmax_width / 2) - - (_gdk_offset_x * impl->window_scale); + (_gdk_offset_x * impl->surface_scale); - if (offsety * impl->window_scale < shadow_unmax_height / 2) - placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale; + if (offsety * impl->surface_scale < shadow_unmax_height / 2) + placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->surface_scale; else - placement.rcNormalPosition.top = (root_y * impl->window_scale) - + placement.rcNormalPosition.top = (root_y * impl->surface_scale) - (unmax_height / 2) - - (_gdk_offset_y * impl->window_scale); + (_gdk_offset_y * impl->surface_scale); placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width; placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height; } GDK_NOTE (MISC, g_print ("Unmaximized window will be at %ld : %ld\n", - placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale, - placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale)); + placement.rcNormalPosition.left + _gdk_offset_x * impl->surface_scale, + placement.rcNormalPosition.top + _gdk_offset_y * impl->surface_scale)); API_CALL (SetWindowPlacement, (GDK_SURFACE_HWND (window), &placement)); } @@ -4386,12 +4386,12 @@ setup_drag_move_resize_context (GdkSurface *window, if (offsetx < snew_pos.width / 2 && offsety < snew_pos.height / 2) { - new_pos.y = root_y - offsety + impl->margins.top / impl->window_scale; + new_pos.y = root_y - offsety + impl->margins.top / impl->surface_scale; if (left_half) - new_pos.x = root_x - offsetx + impl->margins.left / impl->window_scale; + new_pos.x = root_x - offsetx + impl->margins.left / impl->surface_scale; else - new_pos.x = root_x + offsetx + impl->margins.left / impl->window_scale - new_pos.width; + new_pos.x = root_x + offsetx + impl->margins.left / impl->surface_scale - new_pos.width; } else { @@ -4544,10 +4544,10 @@ gdk_win32_get_window_size_and_position_from_client_rect (GdkSurface *window, _gdk_win32_adjust_client_rect (window, window_rect); /* Convert GDK screen coordinates to W32 desktop coordinates */ - window_rect->left -= _gdk_offset_x * impl->window_scale; - window_rect->right -= _gdk_offset_x * impl->window_scale; - window_rect->top -= _gdk_offset_y * impl->window_scale; - window_rect->bottom -= _gdk_offset_y * impl->window_scale; + window_rect->left -= _gdk_offset_x * impl->surface_scale; + window_rect->right -= _gdk_offset_x * impl->surface_scale; + window_rect->top -= _gdk_offset_y * impl->surface_scale; + window_rect->bottom -= _gdk_offset_y * impl->surface_scale; window_position->x = window_rect->left; window_position->y = window_rect->top; @@ -4628,8 +4628,8 @@ gdk_win32_surface_do_move_resize_drag (GdkSurface *window, return; new_rect = context->start_rect; - diffx = (x - context->start_root_x) * impl->window_scale; - diffy = (y - context->start_root_y) * impl->window_scale; + diffx = (x - context->start_root_x) * impl->surface_scale; + diffy = (y - context->start_root_y) * impl->surface_scale; switch (context->op) { @@ -4913,7 +4913,7 @@ gdk_win32_surface_iconify (GdkSurface *window) } else { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); } @@ -4937,7 +4937,7 @@ gdk_win32_surface_deiconify (GdkSurface *window) } else { - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); } @@ -4981,7 +4981,7 @@ gdk_win32_surface_maximize (GdkSurface *window) if (GDK_SURFACE_IS_MAPPED (window)) GtkShowWindow (window, SW_MAXIMIZE); else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); } @@ -5001,7 +5001,7 @@ gdk_win32_surface_unmaximize (GdkSurface *window) if (GDK_SURFACE_IS_MAPPED (window)) GtkShowWindow (window, SW_RESTORE); else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } @@ -5047,7 +5047,7 @@ gdk_win32_surface_fullscreen (GdkSurface *window) fi->style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE); /* Send state change before configure event */ - gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, (fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP); @@ -5070,7 +5070,7 @@ gdk_win32_surface_unfullscreen (GdkSurface *window) { GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); impl->hint_flags = fi->hint_flags; SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, fi->style); @@ -5106,7 +5106,7 @@ gdk_win32_surface_set_keep_above (GdkSurface *window, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE)); } - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE, setting ? GDK_SURFACE_STATE_ABOVE : 0); } @@ -5132,7 +5132,7 @@ gdk_win32_surface_set_keep_below (GdkSurface *window, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE)); } - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW, setting ? GDK_SURFACE_STATE_BELOW : 0); } @@ -5223,7 +5223,7 @@ gdk_win32_surface_set_skip_taskbar_hint (GdkSurface *window, #if 0 if (owner == NULL) { - wa.window_type = GDK_SURFACE_TEMP; + wa.surface_type = GDK_SURFACE_TEMP; wa.wclass = GDK_INPUT_OUTPUT; wa.width = wa.height = 1; wa.event_mask = 0; @@ -5366,7 +5366,7 @@ gdk_win32_surface_shape_combine_region (GdkSurface *window, HRGN hrgn; impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->window_scale); + hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->surface_scale); GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: %p\n", GDK_SURFACE_HWND (window), @@ -5396,7 +5396,7 @@ gdk_win32_surface_set_opacity (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); - if (!WINDOW_IS_TOPLEVEL (window) || GDK_SURFACE_DESTROYED (window)) + if (!SURFACE_IS_TOPLEVEL (window) || GDK_SURFACE_DESTROYED (window)) return; if (opacity < 0) @@ -5414,7 +5414,7 @@ gdk_win32_surface_set_opacity (GdkSurface *window, impl->layered_opacity = opacity; - gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect); + gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect); gdk_win32_update_layered_window_from_cache (window, &window_rect); } @@ -5472,7 +5472,7 @@ gdk_win32_surface_show_window_menu (GdkSurface *window, SendMessage (GDK_SURFACE_HWND (window), WM_SYSMENU, 0, - MAKELPARAM (x * impl->window_scale, y * impl->window_scale)); + MAKELPARAM (x * impl->surface_scale, y * impl->surface_scale)); return TRUE; } @@ -5575,7 +5575,7 @@ gdk_win32_ref_cairo_surface_layered (GdkSurface *window, gint width, height; RECT window_rect; - gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect); + gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect); /* Turn client area into window area */ _gdk_win32_adjust_client_rect (window, &window_rect); @@ -5609,8 +5609,8 @@ gdk_win32_ref_cairo_surface_layered (GdkSurface *window, impl->cache_surface = new_cache; cairo_surface_set_device_scale (impl->cache_surface, - impl->window_scale, - impl->window_scale); + impl->surface_scale, + impl->surface_scale); if (impl->cairo_surface) cairo_surface_destroy (impl->cairo_surface); @@ -5631,8 +5631,8 @@ gdk_win32_ref_cairo_surface_layered (GdkSurface *window, impl->dib_height = height; cairo_surface_set_device_scale (impl->cairo_surface, - impl->window_scale, - impl->window_scale); + impl->surface_scale, + impl->surface_scale); cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key, impl, gdk_win32_cairo_surface_destroy); @@ -5665,8 +5665,8 @@ gdk_win32_ref_cairo_surface (GdkSurface *window) impl->cairo_surface = cairo_win32_surface_create_with_format (hdc, CAIRO_FORMAT_ARGB32); cairo_surface_set_device_scale (impl->cairo_surface, - impl->window_scale, - impl->window_scale); + impl->surface_scale, + impl->surface_scale); cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key, impl, gdk_win32_cairo_surface_destroy); @@ -5735,7 +5735,7 @@ GtkShowWindow (GdkSurface *window, surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32, window_size.cx, window_size.cy); - cairo_surface_set_device_scale (surface, impl->window_scale, impl->window_scale); + cairo_surface_set_device_scale (surface, impl->surface_scale, impl->surface_scale); cr = cairo_create (surface); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0); @@ -5784,9 +5784,9 @@ gdk_win32_surface_set_shadow_width (GdkSurface *window, return; impl->margins.left = left; - impl->margins.right = right * impl->window_scale; + impl->margins.right = right * impl->surface_scale; impl->margins.top = top; - impl->margins.bottom = bottom * impl->window_scale; + impl->margins.bottom = bottom * impl->surface_scale; impl->margins_x = left + right; impl->margins_y = top + bottom; } @@ -5815,14 +5815,14 @@ _gdk_win32_surface_get_scale_factor (GdkSurface *window) if (win32_display->dpi_aware_type != PROCESS_DPI_UNAWARE) { if (win32_display->has_fixed_scale) - impl->window_scale = win32_display->window_scale; + impl->surface_scale = win32_display->surface_scale; else - impl->window_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, + impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, GDK_SURFACE_HWND (window), NULL); - return impl->window_scale; + return impl->surface_scale; } else { diff --git a/gdk/win32/gdksurface-win32.h b/gdk/win32/gdksurface-win32.h index 684690f65d..c037a33281 100644 --- a/gdk/win32/gdksurface-win32.h +++ b/gdk/win32/gdksurface-win32.h @@ -230,7 +230,7 @@ struct _GdkSurfaceImplWin32 GdkSurface *wrapper; HANDLE handle; - gint8 toplevel_window_type; + gint8 toplevel_surface_type; HICON hicon_big; HICON hicon_small; @@ -347,7 +347,7 @@ struct _GdkSurfaceImplWin32 LONG_PTR temp_styles; /* scale of window on HiDPI */ - gint window_scale; + gint surface_scale; gint unscaled_width; gint unscaled_height; }; diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c index 269f701031..583d762ecb 100644 --- a/gdk/win32/gdkvulkancontext-win32.c +++ b/gdk/win32/gdkvulkancontext-win32.c @@ -38,7 +38,7 @@ static VkResult gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context, VkSurfaceKHR *surface) { - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); VkWin32SurfaceCreateInfoKHR info; diff --git a/gdk/win32/gdkwin32dnd-private.h b/gdk/win32/gdkwin32dnd-private.h index 161f59a228..a6f414a9a0 100644 --- a/gdk/win32/gdkwin32dnd-private.h +++ b/gdk/win32/gdkwin32dnd-private.h @@ -30,7 +30,7 @@ struct _GdkWin32DragContext { GdkDragContext context; GdkSurface *ipc_window; - GdkSurface *drag_window; + GdkSurface *drag_surface; GdkCursor *cursor; GdkSeat *grab_seat; GdkDragAction actions; diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c index 055fa593ac..38b42173bd 100644 --- a/gdk/x11/gdkdevice-core-x11.c +++ b/gdk/x11/gdkdevice-core-x11.c @@ -49,7 +49,7 @@ static void gdk_x11_device_core_get_state (GdkDevice *device, GdkSurface *window, gdouble *axes, GdkModifierType *mask); -static void gdk_x11_device_core_set_window_cursor (GdkDevice *device, +static void gdk_x11_device_core_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor); static void gdk_x11_device_core_warp (GdkDevice *device, @@ -72,12 +72,12 @@ static GdkGrabStatus gdk_x11_device_core_grab (GdkDevice *device, guint32 time_); static void gdk_x11_device_core_ungrab (GdkDevice *device, guint32 time_); -static GdkSurface * gdk_x11_device_core_window_at_position (GdkDevice *device, +static GdkSurface * gdk_x11_device_core_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); -static void gdk_x11_device_core_select_window_events (GdkDevice *device, +static void gdk_x11_device_core_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask); @@ -90,13 +90,13 @@ gdk_x11_device_core_class_init (GdkX11DeviceCoreClass *klass) device_class->get_history = gdk_x11_device_core_get_history; device_class->get_state = gdk_x11_device_core_get_state; - device_class->set_window_cursor = gdk_x11_device_core_set_window_cursor; + device_class->set_surface_cursor = gdk_x11_device_core_set_surface_cursor; device_class->warp = gdk_x11_device_core_warp; device_class->query_state = gdk_x11_device_core_query_state; device_class->grab = gdk_x11_device_core_grab; device_class->ungrab = gdk_x11_device_core_ungrab; - device_class->window_at_position = gdk_x11_device_core_window_at_position; - device_class->select_window_events = gdk_x11_device_core_select_window_events; + device_class->surface_at_position = gdk_x11_device_core_surface_at_position; + device_class->select_surface_events = gdk_x11_device_core_select_surface_events; } static void @@ -136,15 +136,15 @@ gdk_x11_device_core_get_history (GdkDevice *device, { XTimeCoord *xcoords; GdkTimeCoord **coords; - GdkSurface *impl_window; + GdkSurface *impl_surface; GdkSurfaceImplX11 *impl; int tmp_n_events; int i, j; - impl_window = _gdk_surface_get_impl_window (window); - impl = GDK_SURFACE_IMPL_X11 (impl_window->impl); + impl_surface = _gdk_surface_get_impl_surface (window); + impl = GDK_SURFACE_IMPL_X11 (impl_surface->impl); xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (window), - GDK_SURFACE_XID (impl_window), + GDK_SURFACE_XID (impl_surface), start, stop, &tmp_n_events); if (!xcoords) return FALSE; @@ -154,12 +154,12 @@ gdk_x11_device_core_get_history (GdkDevice *device, for (i = 0, j = 0; i < tmp_n_events; i++) { if (impl_coord_in_window (window, - xcoords[i].x / impl->window_scale, - xcoords[i].y / impl->window_scale)) + xcoords[i].x / impl->surface_scale, + xcoords[i].y / impl->surface_scale)) { coords[j]->time = xcoords[i].time; - coords[j]->axes[0] = (double)xcoords[i].x / impl->window_scale - window->abs_x; - coords[j]->axes[1] = (double)xcoords[i].y / impl->window_scale - window->abs_y; + coords[j]->axes[0] = (double)xcoords[i].x / impl->surface_scale - window->abs_x; + coords[j]->axes[1] = (double)xcoords[i].y / impl->surface_scale - window->abs_y; j++; } } @@ -210,7 +210,7 @@ gdk_x11_device_core_get_state (GdkDevice *device, } static void -gdk_x11_device_core_set_window_cursor (GdkDevice *device, +gdk_x11_device_core_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -243,8 +243,8 @@ gdk_x11_device_core_warp (GdkDevice *device, dest = GDK_SCREEN_XROOTWIN (screen); XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, - round (x * screen->window_scale), - round (y * screen->window_scale)); + round (x * screen->surface_scale), + round (y * screen->surface_scale)); } static void @@ -270,12 +270,12 @@ gdk_x11_device_core_query_state (GdkDevice *device, if (window == NULL) { xwindow = GDK_SCREEN_XROOTWIN (screen); - scale = screen->window_scale; + scale = screen->surface_scale; } else { xwindow = GDK_SURFACE_XID (window); - scale = GDK_SURFACE_IMPL_X11 (window->impl)->window_scale; + scale = GDK_SURFACE_IMPL_X11 (window->impl)->surface_scale; } if (!GDK_X11_DISPLAY (display)->trusted_client || @@ -343,7 +343,7 @@ gdk_x11_device_core_grab (GdkDevice *device, xwindow = GDK_SURFACE_XID (window); if (confine_to) - confine_to = _gdk_surface_get_impl_window (confine_to); + confine_to = _gdk_surface_get_impl_surface (confine_to); if (!confine_to || GDK_SURFACE_DESTROYED (confine_to)) xconfine_to = None; @@ -425,7 +425,7 @@ gdk_x11_device_core_ungrab (GdkDevice *device, } static GdkSurface * -gdk_x11_device_core_window_at_position (GdkDevice *device, +gdk_x11_device_core_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -497,7 +497,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, break; } gdk_surface_get_geometry (window, NULL, NULL, &width, &height); - if (winx >= 0 && winy >= 0 && winx < width * impl->window_scale && winy < height * impl->window_scale) + if (winx >= 0 && winy >= 0 && winx < width * impl->surface_scale && winy < height * impl->surface_scale) { /* A childless toplevel, or below another window? */ XSetWindowAttributes attributes; @@ -538,7 +538,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, if (get_toplevel && last != root && (window = gdk_x11_surface_lookup_for_display (display, last)) != NULL && - window->window_type != GDK_SURFACE_FOREIGN) + window->surface_type != GDK_SURFACE_FOREIGN) { xwindow = last; break; @@ -553,10 +553,10 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, impl = GDK_SURFACE_IMPL_X11 (window->impl); if (win_x) - *win_x = (window) ? (double)xwin_x / impl->window_scale : -1; + *win_x = (window) ? (double)xwin_x / impl->surface_scale : -1; if (win_y) - *win_y = (window) ? (double)xwin_y / impl->window_scale : -1; + *win_y = (window) ? (double)xwin_y / impl->surface_scale : -1; if (mask) *mask = xmask; @@ -565,7 +565,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, } static void -gdk_x11_device_core_select_window_events (GdkDevice *device, +gdk_x11_device_core_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c index a73a036023..acbcce047f 100644 --- a/gdk/x11/gdkdevice-xi2.c +++ b/gdk/x11/gdkdevice-xi2.c @@ -74,7 +74,7 @@ static void gdk_x11_device_xi2_get_state (GdkDevice *device, GdkSurface *window, gdouble *axes, GdkModifierType *mask); -static void gdk_x11_device_xi2_set_window_cursor (GdkDevice *device, +static void gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor); static void gdk_x11_device_xi2_warp (GdkDevice *device, @@ -99,12 +99,12 @@ static GdkGrabStatus gdk_x11_device_xi2_grab (GdkDevice *device, static void gdk_x11_device_xi2_ungrab (GdkDevice *device, guint32 time_); -static GdkSurface * gdk_x11_device_xi2_window_at_position (GdkDevice *device, +static GdkSurface * gdk_x11_device_xi2_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); -static void gdk_x11_device_xi2_select_window_events (GdkDevice *device, +static void gdk_x11_device_xi2_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask); @@ -125,13 +125,13 @@ gdk_x11_device_xi2_class_init (GdkX11DeviceXI2Class *klass) object_class->set_property = gdk_x11_device_xi2_set_property; device_class->get_state = gdk_x11_device_xi2_get_state; - device_class->set_window_cursor = gdk_x11_device_xi2_set_window_cursor; + device_class->set_surface_cursor = gdk_x11_device_xi2_set_surface_cursor; device_class->warp = gdk_x11_device_xi2_warp; device_class->query_state = gdk_x11_device_xi2_query_state; device_class->grab = gdk_x11_device_xi2_grab; device_class->ungrab = gdk_x11_device_xi2_ungrab; - device_class->window_at_position = gdk_x11_device_xi2_window_at_position; - device_class->select_window_events = gdk_x11_device_xi2_select_window_events; + device_class->surface_at_position = gdk_x11_device_xi2_surface_at_position; + device_class->select_surface_events = gdk_x11_device_xi2_select_surface_events; g_object_class_install_property (object_class, PROP_DEVICE_ID, @@ -238,8 +238,8 @@ gdk_x11_device_xi2_get_state (GdkDevice *device, case GDK_AXIS_X: case GDK_AXIS_Y: case GDK_AXIS_IGNORE: - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) - _gdk_device_translate_window_coord (device, window, j, value, &axes[j]); + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) + _gdk_device_translate_surface_coord (device, window, j, value, &axes[j]); else { gint root_x, root_y; @@ -275,7 +275,7 @@ gdk_x11_device_xi2_get_state (GdkDevice *device, } static void -gdk_x11_device_xi2_set_window_cursor (GdkDevice *device, +gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device, GdkSurface *window, GdkCursor *cursor) { @@ -310,8 +310,8 @@ gdk_x11_device_xi2_warp (GdkDevice *device, device_xi2->device_id, None, dest, 0, 0, 0, 0, - round (x * screen->window_scale), - round (y * screen->window_scale)); + round (x * screen->surface_scale), + round (y * screen->surface_scale)); } static void @@ -339,12 +339,12 @@ gdk_x11_device_xi2_query_state (GdkDevice *device, if (window == NULL) { xwindow = GDK_DISPLAY_XROOTWIN (display); - scale = default_screen->window_scale; + scale = default_screen->surface_scale; } else { xwindow = GDK_SURFACE_XID (window); - scale = GDK_SURFACE_IMPL_X11 (window->impl)->window_scale; + scale = GDK_SURFACE_IMPL_X11 (window->impl)->surface_scale; } if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE) @@ -487,7 +487,7 @@ gdk_x11_device_xi2_ungrab (GdkDevice *device, } static GdkSurface * -gdk_x11_device_xi2_window_at_position (GdkDevice *device, +gdk_x11_device_xi2_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, @@ -659,17 +659,17 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, } if (win_x) - *win_x = (window) ? (xwin_x / impl->window_scale) : -1; + *win_x = (window) ? (xwin_x / impl->surface_scale) : -1; if (win_y) - *win_y = (window) ? (xwin_y / impl->window_scale) : -1; + *win_y = (window) ? (xwin_y / impl->surface_scale) : -1; return window; } static void -gdk_x11_device_xi2_select_window_events (GdkDevice *device, +gdk_x11_device_xi2_select_surface_events (GdkDevice *device, GdkSurface *window, GdkEventMask event_mask) { diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c index f5c4a35701..0dc6ca1148 100644 --- a/gdk/x11/gdkdevicemanager-core-x11.c +++ b/gdk/x11/gdkdevicemanager-core-x11.c @@ -334,7 +334,7 @@ is_parent_of (GdkSurface *parent, } static GdkSurface * -get_event_window (GdkEventTranslator *translator, +get_event_surface (GdkEventTranslator *translator, const XEvent *xevent) { GdkDisplay *display; @@ -380,7 +380,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, device_manager = GDK_X11_DEVICE_MANAGER_CORE (translator); - window = get_event_window (translator, xevent); + window = get_event_surface (translator, xevent); scale = 1; if (window) @@ -390,7 +390,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, g_object_ref (window); impl = GDK_SURFACE_IMPL_X11 (window->impl); - scale = impl->window_scale; + scale = impl->surface_scale; } event->any.window = window; diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 19c4002537..c39c43656d 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -82,7 +82,7 @@ static gboolean gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator * GdkEvent *event, const XEvent *xevent); static GdkEventMask gdk_x11_device_manager_xi2_get_handled_events (GdkEventTranslator *translator); -static void gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator, +static void gdk_x11_device_manager_xi2_select_surface_events (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); static GdkSurface * gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator, @@ -835,7 +835,7 @@ gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface { iface->translate_event = gdk_x11_device_manager_xi2_translate_event; iface->get_handled_events = gdk_x11_device_manager_xi2_get_handled_events; - iface->select_window_events = gdk_x11_device_manager_xi2_select_window_events; + iface->select_surface_events = gdk_x11_device_manager_xi2_select_surface_events; iface->get_window = gdk_x11_device_manager_xi2_get_window; } @@ -1110,8 +1110,8 @@ translate_axes (GdkDevice *device, { case GDK_AXIS_X: case GDK_AXIS_Y: - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) - _gdk_device_translate_window_coord (device, window, i, val, &axes[i]); + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) + _gdk_device_translate_surface_coord (device, window, i, val, &axes[i]); else { if (use == GDK_AXIS_X) @@ -1150,7 +1150,7 @@ is_parent_of (GdkSurface *parent, } static gboolean -get_event_window (GdkEventTranslator *translator, +get_event_surface (GdkEventTranslator *translator, XIEvent *ev, GdkSurface **window_p) { @@ -1367,7 +1367,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, if (!ev) return FALSE; - if (!get_event_window (translator, ev, &window)) + if (!get_event_surface (translator, ev, &window)) return FALSE; if (window && GDK_SURFACE_DESTROYED (window)) @@ -1377,7 +1377,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, if (window) { impl = GDK_SURFACE_IMPL_X11 (window->impl); - scale = impl->window_scale; + scale = impl->surface_scale; } if (ev->evtype == XI_Motion || @@ -1552,7 +1552,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->any.window, &xev->valuators); - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) { /* Update event coordinates from axes */ gdk_device_get_axis (device, event->button.axes, GDK_AXIS_X, &event->button.x); @@ -1650,7 +1650,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->any.window, &xev->valuators); - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) { /* Update event coordinates from axes */ gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_X, &event->motion.x); @@ -1698,7 +1698,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->any.window, &xev->valuators); - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) { /* Update event coordinates from axes */ gdk_device_get_axis (device, event->touch.axes, GDK_AXIS_X, &event->touch.x); @@ -1771,7 +1771,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->any.window, &xev->valuators); - if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) + if (gdk_device_get_mode (device) == GDK_MODE_SURFACE) { /* Update event coordinates from axes */ gdk_device_get_axis (device, event->touch.axes, GDK_AXIS_X, &event->touch.x); @@ -1817,7 +1817,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, if (ev->evtype == XI_Enter && xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab && - gdk_surface_get_window_type (window) == GDK_SURFACE_TOPLEVEL) + gdk_surface_get_surface_type (window) == GDK_SURFACE_TOPLEVEL) { if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER) _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device)); @@ -1911,7 +1911,7 @@ gdk_x11_device_manager_xi2_get_handled_events (GdkEventTranslator *translator) } static void -gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator, +gdk_x11_device_manager_xi2_select_surface_events (GdkEventTranslator *translator, Window window, GdkEventMask evmask) { @@ -1944,7 +1944,7 @@ gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator, if (!ev) return NULL; - get_event_window (translator, ev, &window); + get_event_surface (translator, ev, &window); return window; } diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 0a2bfbff53..d871dbc944 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -357,7 +357,7 @@ do_net_wm_state_changes (GdkSurface *window) GdkSurfaceState old_state, set, unset; if (GDK_SURFACE_DESTROYED (window) || - gdk_surface_get_window_type (window) != GDK_SURFACE_TOPLEVEL) + gdk_surface_get_surface_type (window) != GDK_SURFACE_TOPLEVEL) return; old_state = gdk_surface_get_state (window); @@ -428,7 +428,7 @@ do_net_wm_state_changes (GdkSurface *window) /* Update edge constraints and tiling */ do_edge_constraint_state_check (window, old_state, &set, &unset); - gdk_synthesize_window_state (window, unset, set); + gdk_synthesize_surface_state (window, unset, set); } static void @@ -637,7 +637,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, Window xwindow; GdkSurface *window; gboolean is_substructure; - GdkSurfaceImplX11 *window_impl = NULL; + GdkSurfaceImplX11 *surface_impl = NULL; GdkX11Screen *x11_screen = NULL; GdkToplevelX11 *toplevel = NULL; GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); @@ -667,7 +667,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, x11_screen = GDK_SURFACE_SCREEN (window); toplevel = _gdk_x11_surface_get_toplevel (window); - window_impl = GDK_SURFACE_IMPL_X11 (window->impl); + surface_impl = GDK_SURFACE_IMPL_X11 (window->impl); g_object_ref (window); } @@ -739,13 +739,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, GdkRectangle expose_rect; int x2, y2; - expose_rect.x = xevent->xexpose.x / window_impl->window_scale; - expose_rect.y = xevent->xexpose.y / window_impl->window_scale; + expose_rect.x = xevent->xexpose.x / surface_impl->surface_scale; + expose_rect.y = xevent->xexpose.y / surface_impl->surface_scale; - x2 = (xevent->xexpose.x + xevent->xexpose.width + window_impl->window_scale -1) / window_impl->window_scale; + x2 = (xevent->xexpose.x + xevent->xexpose.width + surface_impl->surface_scale -1) / surface_impl->surface_scale; expose_rect.width = x2 - expose_rect.x; - y2 = (xevent->xexpose.y + xevent->xexpose.height + window_impl->window_scale -1) / window_impl->window_scale; + y2 = (xevent->xexpose.y + xevent->xexpose.height + surface_impl->surface_scale -1) / surface_impl->surface_scale; expose_rect.height = y2 - expose_rect.y; _gdk_x11_surface_process_expose (window, xevent->xexpose.serial, &expose_rect); @@ -769,13 +769,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, break; } - expose_rect.x = xevent->xgraphicsexpose.x / window_impl->window_scale; - expose_rect.y = xevent->xgraphicsexpose.y / window_impl->window_scale; + expose_rect.x = xevent->xgraphicsexpose.x / surface_impl->surface_scale; + expose_rect.y = xevent->xgraphicsexpose.y / surface_impl->surface_scale; - x2 = (xevent->xgraphicsexpose.x + xevent->xgraphicsexpose.width + window_impl->window_scale -1) / window_impl->window_scale; + x2 = (xevent->xgraphicsexpose.x + xevent->xgraphicsexpose.width + surface_impl->surface_scale -1) / surface_impl->surface_scale; expose_rect.width = x2 - expose_rect.x; - y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + window_impl->window_scale -1) / window_impl->window_scale; + y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + surface_impl->surface_scale -1) / surface_impl->surface_scale; expose_rect.height = y2 - expose_rect.y; _gdk_x11_surface_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); @@ -866,15 +866,15 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, * the iconified bit off. */ if (GDK_SURFACE_IS_MAPPED (window)) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); } - if (window_impl->toplevel && - window_impl->toplevel->frame_pending) + if (surface_impl->toplevel && + surface_impl->toplevel->frame_pending) { - window_impl->toplevel->frame_pending = FALSE; + surface_impl->toplevel->frame_pending = FALSE; _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.window)); } @@ -898,7 +898,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, { /* Unset iconified if it was set */ if (window->state & GDK_SURFACE_STATE_ICONIFIED) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); @@ -934,7 +934,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, xevent->xconfigure.override_redirect, !window ? " (discarding)" - : window->window_type == GDK_SURFACE_CHILD + : window->surface_type == GDK_SURFACE_CHILD ? " (discarding child)" : xevent->xconfigure.event != xevent->xconfigure.window ? " (discarding substructure)" @@ -961,8 +961,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, { event->any.type = GDK_CONFIGURE; event->any.window = window; - event->configure.width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale; - event->configure.height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale; + event->configure.width = (xevent->xconfigure.width + surface_impl->surface_scale - 1) / surface_impl->surface_scale; + event->configure.height = (xevent->xconfigure.height + surface_impl->surface_scale - 1) / surface_impl->surface_scale; if (!xevent->xconfigure.send_event && !xevent->xconfigure.override_redirect && @@ -980,31 +980,31 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, &tx, &ty, &child_window)) { - event->configure.x = tx / window_impl->window_scale; - event->configure.y = ty / window_impl->window_scale; + event->configure.x = tx / surface_impl->surface_scale; + event->configure.y = ty / surface_impl->surface_scale; } gdk_x11_display_error_trap_pop_ignored (display); } else { - event->configure.x = xevent->xconfigure.x / window_impl->window_scale; - event->configure.y = xevent->xconfigure.y / window_impl->window_scale; + event->configure.x = xevent->xconfigure.x / surface_impl->surface_scale; + event->configure.y = xevent->xconfigure.y / surface_impl->surface_scale; } if (!is_substructure) { window->x = event->configure.x; window->y = event->configure.y; - if (window_impl->unscaled_width != xevent->xconfigure.width || - window_impl->unscaled_height != xevent->xconfigure.height) + if (surface_impl->unscaled_width != xevent->xconfigure.width || + surface_impl->unscaled_height != xevent->xconfigure.height) { - window_impl->unscaled_width = xevent->xconfigure.width; - window_impl->unscaled_height = xevent->xconfigure.height; + surface_impl->unscaled_width = xevent->xconfigure.width; + surface_impl->unscaled_height = xevent->xconfigure.height; window->width = event->configure.width; window->height = event->configure.height; _gdk_surface_update_size (window); - _gdk_x11_surface_update_size (window_impl); + _gdk_x11_surface_update_size (surface_impl); } if (window->resize_count >= 1) @@ -1217,9 +1217,9 @@ _gdk_wm_protocols_filter (const XEvent *xevent, * in the message for everything that gets stuffed in */ if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_DRAWN")) { - GdkSurfaceImplX11 *window_impl; - window_impl = GDK_SURFACE_IMPL_X11 (win->impl); - if (window_impl->toplevel) + GdkSurfaceImplX11 *surface_impl; + surface_impl = GDK_SURFACE_IMPL_X11 (win->impl); + if (surface_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; guint32 d1 = xevent->xclient.data.l[1]; @@ -1236,9 +1236,9 @@ _gdk_wm_protocols_filter (const XEvent *xevent, if (timings) timings->drawn_time = frame_drawn_time; - if (window_impl->toplevel->frame_pending) + if (surface_impl->toplevel->frame_pending) { - window_impl->toplevel->frame_pending = FALSE; + surface_impl->toplevel->frame_pending = FALSE; _gdk_frame_clock_thaw (clock); } @@ -1247,7 +1247,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent, &refresh_interval, &presentation_time); if (presentation_time != 0) - window_impl->toplevel->throttled_presentation_time = presentation_time + refresh_interval; + surface_impl->toplevel->throttled_presentation_time = presentation_time + refresh_interval; } return GDK_FILTER_REMOVE; @@ -1255,9 +1255,9 @@ _gdk_wm_protocols_filter (const XEvent *xevent, if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_TIMINGS")) { - GdkSurfaceImplX11 *window_impl; - window_impl = GDK_SURFACE_IMPL_X11 (win->impl); - if (window_impl->toplevel) + GdkSurfaceImplX11 *surface_impl; + surface_impl = GDK_SURFACE_IMPL_X11 (win->impl); + if (surface_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; guint32 d1 = xevent->xclient.data.l[1]; @@ -1983,7 +1983,7 @@ gdk_x11_display_finalize (GObject *object) g_slist_free_full (display_x11->event_types, g_free); /* input GdkSurface list */ - g_list_free_full (display_x11->input_windows, g_free); + g_list_free_full (display_x11->input_surfaces, g_free); /* Free all GdkX11Screens */ g_object_unref (display_x11->screen); @@ -2744,7 +2744,7 @@ gdk_x11_display_error_trap_pop_internal (GdkDisplay *display, } /** - * gdk_x11_display_set_window_scale: + * gdk_x11_display_set_surface_scale: * @display: (type GdkX11Display): the display * @scale: The new scale value * @@ -2757,7 +2757,7 @@ gdk_x11_display_error_trap_pop_internal (GdkDisplay *display, * to later user configuration changes. */ void -gdk_x11_display_set_window_scale (GdkDisplay *display, +gdk_x11_display_set_surface_scale (GdkDisplay *display, gint scale) { GdkX11Screen *x11_screen; @@ -2769,9 +2769,9 @@ gdk_x11_display_set_window_scale (GdkDisplay *display, x11_screen = GDK_X11_SCREEN (GDK_X11_DISPLAY (display)->screen); - if (!x11_screen->fixed_window_scale) + if (!x11_screen->fixed_surface_scale) { - x11_screen->fixed_window_scale = TRUE; + x11_screen->fixed_surface_scale = TRUE; /* We treat screens with a window scale set differently when * reading xsettings, so we need to reread @@ -2779,7 +2779,7 @@ gdk_x11_display_set_window_scale (GdkDisplay *display, need_reread_settings = TRUE; } - _gdk_x11_screen_set_window_scale (x11_screen, scale); + _gdk_x11_screen_set_surface_scale (x11_screen, scale); if (need_reread_settings) _gdk_x11_settings_force_reread (x11_screen); @@ -3034,7 +3034,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) object_class->dispose = gdk_x11_display_dispose; object_class->finalize = gdk_x11_display_finalize; - display_class->window_type = GDK_TYPE_X11_SURFACE; + display_class->surface_type = GDK_TYPE_X11_SURFACE; #ifdef GDK_RENDERING_VULKAN display_class->vk_context_type = GDK_TYPE_X11_VULKAN_CONTEXT; display_class->vk_extension_name = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; @@ -3054,7 +3054,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) display_class->get_next_serial = gdk_x11_display_get_next_serial; display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete; - display_class->create_window_impl = _gdk_x11_display_create_window_impl; + display_class->create_surface_impl = _gdk_x11_display_create_surface_impl; display_class->get_keymap = gdk_x11_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list; display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target; diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h index c4cc9e61b7..0625c7d395 100644 --- a/gdk/x11/gdkdisplay-x11.h +++ b/gdk/x11/gdkdisplay-x11.h @@ -112,7 +112,7 @@ struct _GdkX11Display GSList *streams; /* input GdkSurface list */ - GList *input_windows; + GList *input_surfaces; /* GdkCursor => XCursor */ GHashTable *cursors; diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index eff6658986..f2ddce6f29 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -111,7 +111,7 @@ struct _GdkX11DragContext GdkSurfaceCache *cache; - GdkSurface *drag_window; + GdkSurface *drag_surface; GdkSurface *ipc_window; GdkCursor *cursor; @@ -224,12 +224,12 @@ gdk_x11_drag_context_init (GdkX11DragContext *context) static void gdk_x11_drag_context_finalize (GObject *object); static GdkSurface * gdk_x11_drag_context_find_window (GdkDragContext *context, - GdkSurface *drag_window, + GdkSurface *drag_surface, gint x_root, gint y_root, GdkDragProtocol *protocol); static gboolean gdk_x11_drag_context_drag_motion (GdkDragContext *context, - GdkSurface *dest_window, + GdkSurface *dest_surface, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -250,7 +250,7 @@ static void gdk_x11_drag_context_drop_finish (GdkDragContext *context, gboolean success, guint32 time_); static gboolean gdk_x11_drag_context_drop_status (GdkDragContext *context); -static GdkSurface * gdk_x11_drag_context_get_drag_window (GdkDragContext *context); +static GdkSurface * gdk_x11_drag_context_get_drag_surface (GdkDragContext *context); static void gdk_x11_drag_context_set_hotspot (GdkDragContext *context, gint hot_x, gint hot_y); @@ -408,7 +408,7 @@ gdk_x11_drag_context_class_init (GdkX11DragContextClass *klass) context_class->drop_status = gdk_x11_drag_context_drop_status; context_class->read_async = gdk_x11_drag_context_read_async; context_class->read_finish = gdk_x11_drag_context_read_finish; - context_class->get_drag_window = gdk_x11_drag_context_get_drag_window; + context_class->get_drag_surface = gdk_x11_drag_context_get_drag_surface; context_class->set_hotspot = gdk_x11_drag_context_set_hotspot; context_class->drop_done = gdk_x11_drag_context_drop_done; context_class->set_cursor = gdk_x11_drag_context_set_cursor; @@ -423,12 +423,12 @@ gdk_x11_drag_context_finalize (GObject *object) { GdkDragContext *context = GDK_DRAG_CONTEXT (object); GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (object); - GdkSurface *drag_window, *ipc_window; + GdkSurface *drag_surface, *ipc_window; - if (context->source_window) + if (context->source_surface) { if ((x11_context->protocol == GDK_DRAG_PROTO_XDND) && !context->is_source) - xdnd_manage_source_filter (context, context->source_window, FALSE); + xdnd_manage_source_filter (context, context->source_surface, FALSE); } if (x11_context->cache) @@ -436,13 +436,13 @@ gdk_x11_drag_context_finalize (GObject *object) contexts = g_list_remove (contexts, context); - drag_window = context->drag_window; + drag_surface = context->drag_surface; ipc_window = x11_context->ipc_window; G_OBJECT_CLASS (gdk_x11_drag_context_parent_class)->finalize (object); - if (drag_window) - gdk_surface_destroy (drag_window); + if (drag_surface) + gdk_surface_destroy (drag_surface); if (ipc_window) gdk_surface_destroy (ipc_window); } @@ -465,19 +465,19 @@ gdk_drag_context_find (GdkDisplay *display, context = (GdkDragContext *)tmp_list->data; context_x11 = (GdkX11DragContext *)context; - if ((context->source_window && gdk_surface_get_display (context->source_window) != display) || - (context->dest_window && gdk_surface_get_display (context->dest_window) != display)) + if ((context->source_surface && gdk_surface_get_display (context->source_surface) != display) || + (context->dest_surface && gdk_surface_get_display (context->dest_surface) != display)) continue; - context_dest_xid = context->dest_window + context_dest_xid = context->dest_surface ? (context_x11->drop_xid ? context_x11->drop_xid - : GDK_SURFACE_XID (context->dest_window)) + : GDK_SURFACE_XID (context->dest_surface)) : None; if ((!context->is_source == !is_source) && - ((source_xid == None) || (context->source_window && - (GDK_SURFACE_XID (context->source_window) == source_xid))) && + ((source_xid == None) || (context->source_surface && + (GDK_SURFACE_XID (context->source_surface) == source_xid))) && ((dest_xid == None) || (context_dest_xid == dest_xid))) return context; } @@ -737,9 +737,9 @@ gdk_surface_cache_new (GdkDisplay *display) impl = GDK_SURFACE_IMPL_X11 (window->impl); gdk_surface_get_geometry (window, &x, &y, &width, &height); gdk_surface_cache_add (result, GDK_SURFACE_XID (window), - x * impl->window_scale, y * impl->window_scale, - width * impl->window_scale, - height * impl->window_scale, + x * impl->surface_scale, y * impl->surface_scale, + width * impl->surface_scale, + height * impl->surface_scale, gdk_surface_is_visible (window)); } return result; @@ -774,8 +774,8 @@ gdk_surface_cache_new (GdkDisplay *display) { cow = XCompositeGetOverlayWindow (xdisplay, xroot_window); gdk_surface_cache_add (result, cow, 0, 0, - WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale, - HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale, + WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->surface_scale, + HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->surface_scale, TRUE); XCompositeReleaseOverlayWindow (xdisplay, xroot_window); } @@ -1064,21 +1064,21 @@ xdnd_status_filter (const XEvent *xevent, gpointer data) { GdkDisplay *display; - guint32 dest_window = xevent->xclient.data.l[0]; + guint32 dest_surface = xevent->xclient.data.l[0]; guint32 flags = xevent->xclient.data.l[1]; Atom action = xevent->xclient.data.l[4]; GdkDragContext *context; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ display = gdk_surface_get_display (event->any.window); - context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window); + context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_surface); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndStatus: dest_window: %#x action: %ld", - dest_window, action)); + g_message ("XdndStatus: dest_surface: %#x action: %ld", + dest_surface, action)); if (context) { @@ -1111,19 +1111,19 @@ xdnd_finished_filter (const XEvent *xevent, gpointer data) { GdkDisplay *display; - guint32 dest_window = xevent->xclient.data.l[0]; + guint32 dest_surface = xevent->xclient.data.l[0]; GdkDragContext *context; GdkX11DragContext *context_x11; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ display = gdk_surface_get_display (event->any.window); - context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window); + context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_surface); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndFinished: dest_window: %#x", dest_window)); + g_message ("XdndFinished: dest_surface: %#x", dest_surface)); if (context) { @@ -1228,13 +1228,13 @@ send_client_message_async_cb (Window window, * so we don't end up blocking for a timeout */ if (!success && - context->dest_window && - window == GDK_SURFACE_XID (context->dest_window)) + context->dest_surface && + window == GDK_SURFACE_XID (context->dest_surface)) { GdkX11DragContext *context_x11 = data; - g_object_unref (context->dest_window); - context->dest_window = NULL; + g_object_unref (context->dest_surface); + context->dest_surface = NULL; context->action = 0; if (context->action != context_x11->current_action) { @@ -1277,7 +1277,7 @@ xdnd_send_xevent (GdkX11DragContext *context_x11, g_assert (event_send->xany.type == ClientMessage); /* We short-circuit messages to ourselves */ - if (gdk_surface_get_window_type (window) != GDK_SURFACE_FOREIGN) + if (gdk_surface_get_surface_type (window) != GDK_SURFACE_FOREIGN) { gint i; @@ -1328,7 +1328,7 @@ xdnd_send_enter (GdkX11DragContext *context_x11) xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_SURFACE_XID (context->dest_window); + : GDK_SURFACE_XID (context->dest_surface); xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = (context_x11->version << 24); /* version */ xev.xclient.data.l[2] = 0; @@ -1354,13 +1354,13 @@ xdnd_send_enter (GdkX11DragContext *context_x11) } } - if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev)) + if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->dest_window))); - g_object_unref (context->dest_window); - context->dest_window = NULL; + GDK_SURFACE_XID (context->dest_surface))); + g_object_unref (context->dest_surface); + context->dest_surface = NULL; } } @@ -1376,20 +1376,20 @@ xdnd_send_leave (GdkX11DragContext *context_x11) xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_SURFACE_XID (context->dest_window); + : GDK_SURFACE_XID (context->dest_surface); xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; - if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev)) + if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->dest_window))); - g_object_unref (context->dest_window); - context->dest_window = NULL; + GDK_SURFACE_XID (context->dest_surface))); + g_object_unref (context->dest_surface); + context->dest_surface = NULL; } } @@ -1406,20 +1406,20 @@ xdnd_send_drop (GdkX11DragContext *context_x11, xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_SURFACE_XID (context->dest_window); + : GDK_SURFACE_XID (context->dest_surface); xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = time; xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; - if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev)) + if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->dest_window))); - g_object_unref (context->dest_window); - context->dest_window = NULL; + GDK_SURFACE_XID (context->dest_surface))); + g_object_unref (context->dest_surface); + context->dest_surface = NULL; } } @@ -1439,20 +1439,20 @@ xdnd_send_motion (GdkX11DragContext *context_x11, xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_SURFACE_XID (context->dest_window); + : GDK_SURFACE_XID (context->dest_surface); xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = (x_root << 16) | y_root; xev.xclient.data.l[3] = time; xev.xclient.data.l[4] = xdnd_action_to_atom (display, action); - if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev)) + if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->dest_window))); - g_object_unref (context->dest_window); - context->dest_window = NULL; + GDK_SURFACE_XID (context->dest_surface))); + g_object_unref (context->dest_surface); + context->dest_surface = NULL; } context_x11->drag_status = GDK_DRAG_STATUS_MOTION_WAIT; } @@ -1546,13 +1546,13 @@ xdnd_read_actions (GdkX11DragContext *context_x11) context_x11->xdnd_have_actions = FALSE; - if (gdk_surface_get_window_type (context->source_window) == GDK_SURFACE_FOREIGN) + if (gdk_surface_get_surface_type (context->source_surface) == GDK_SURFACE_FOREIGN) { /* Get the XdndActionList, if set */ gdk_x11_display_error_trap_push (display); if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_SURFACE_XID (context->source_window), + GDK_SURFACE_XID (context->source_surface), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), 0, 65536, False, XA_ATOM, &type, &format, &nitems, @@ -1600,8 +1600,8 @@ xdnd_read_actions (GdkX11DragContext *context_x11) GdkDragContext *source_context; source_context = gdk_drag_context_find (display, TRUE, - GDK_SURFACE_XID (context->source_window), - GDK_SURFACE_XID (context->dest_window)); + GDK_SURFACE_XID (context->source_surface), + GDK_SURFACE_XID (context->dest_surface)); if (source_context) { @@ -1618,7 +1618,7 @@ xdnd_read_actions (GdkX11DragContext *context_x11) * and add this filter. */ GdkFilterReturn -xdnd_source_window_filter (const XEvent *xevent, +xdnd_source_surface_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { @@ -1648,7 +1648,7 @@ xdnd_manage_source_filter (GdkDragContext *context, gboolean add_filter) { if (!GDK_SURFACE_DESTROYED (window) && - gdk_surface_get_window_type (window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (window) == GDK_SURFACE_FOREIGN) { GdkDisplay *display = gdk_drag_context_get_display (context); @@ -1742,15 +1742,15 @@ xdnd_enter_filter (const XEvent *xevent, guchar *data; Atom *atoms; GPtrArray *formats; - guint32 source_window; + guint32 source_surface; gboolean get_types; gint version; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - source_window = xevent->xclient.data.l[0]; + source_surface = xevent->xclient.data.l[0]; get_types = ((xevent->xclient.data.l[1] & 1) != 0); version = (xevent->xclient.data.l[1] & 0xff000000) >> 24; @@ -1760,8 +1760,8 @@ xdnd_enter_filter (const XEvent *xevent, xdnd_precache_atoms (display); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndEnter: source_window: %#x, version: %#x", - source_window, version)); + g_message ("XdndEnter: source_surface: %#x, version: %#x", + source_surface, version)); if (version < 3) { @@ -1788,21 +1788,21 @@ xdnd_enter_filter (const XEvent *xevent, seat = gdk_display_get_default_seat (display); gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat)); - context->source_window = gdk_x11_surface_foreign_new_for_display (display, source_window); - if (!context->source_window) + context->source_surface = gdk_x11_surface_foreign_new_for_display (display, source_surface); + if (!context->source_surface) { g_object_unref (context); return GDK_FILTER_REMOVE; } - context->dest_window = event->any.window; - g_object_ref (context->dest_window); + context->dest_surface = event->any.window; + g_object_ref (context->dest_surface); formats = g_ptr_array_new (); if (get_types) { gdk_x11_display_error_trap_push (display); XGetWindowProperty (GDK_SURFACE_XDISPLAY (event->any.window), - source_window, + source_surface, gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"), 0, 65536, False, XA_ATOM, &type, &format, &nitems, @@ -1841,7 +1841,7 @@ xdnd_enter_filter (const XEvent *xevent, print_target_list (context->formats); #endif /* G_ENABLE_DEBUG */ - xdnd_manage_source_filter (context, context->source_window, TRUE); + xdnd_manage_source_filter (context, context->source_surface, TRUE); xdnd_read_actions (context_x11); event->any.type = GDK_DRAG_ENTER; @@ -1859,26 +1859,26 @@ xdnd_leave_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - guint32 source_window = xevent->xclient.data.l[0]; + guint32 source_surface = xevent->xclient.data.l[0]; GdkDisplay *display; GdkX11Display *display_x11; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndLeave: source_window: %#x", - source_window)); + g_message ("XdndLeave: source_surface: %#x", + source_surface)); xdnd_precache_atoms (display); if ((display_x11->current_dest_drag != NULL) && (GDK_X11_DRAG_CONTEXT (display_x11->current_dest_drag)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_SURFACE_XID (display_x11->current_dest_drag->source_window) == source_window)) + (GDK_SURFACE_XID (display_x11->current_dest_drag->source_surface) == source_surface)) { event->any.type = GDK_DRAG_LEAVE; /* Pass ownership of context to the event */ @@ -1899,7 +1899,7 @@ xdnd_position_filter (const XEvent *xevent, gpointer data) { GdkSurfaceImplX11 *impl; - guint32 source_window = xevent->xclient.data.l[0]; + guint32 source_surface = xevent->xclient.data.l[0]; gint16 x_root = xevent->xclient.data.l[2] >> 16; gint16 y_root = xevent->xclient.data.l[2] & 0xffff; guint32 time = xevent->xclient.data.l[3]; @@ -1910,15 +1910,15 @@ xdnd_position_filter (const XEvent *xevent, GdkX11DragContext *context_x11; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld", - source_window, x_root, y_root, time, action)); + g_message ("XdndPosition: source_surface: %#x position: (%d, %d) time: %d action: %ld", + source_surface, x_root, y_root, time, action)); xdnd_precache_atoms (display); @@ -1926,7 +1926,7 @@ xdnd_position_filter (const XEvent *xevent, if ((context != NULL) && (GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_SURFACE_XID (context->source_window) == source_window)) + (GDK_SURFACE_XID (context->source_surface) == source_surface)) { impl = GDK_SURFACE_IMPL_X11 (event->any.window->impl); @@ -1944,11 +1944,11 @@ xdnd_position_filter (const XEvent *xevent, if (!context_x11->xdnd_have_actions) context->actions = context->suggested_action; - event->dnd.x_root = x_root / impl->window_scale; - event->dnd.y_root = y_root / impl->window_scale; + event->dnd.x_root = x_root / impl->surface_scale; + event->dnd.y_root = y_root / impl->surface_scale; - context_x11->last_x = x_root / impl->window_scale; - context_x11->last_y = y_root / impl->window_scale; + context_x11->last_x = x_root / impl->surface_scale; + context_x11->last_y = y_root / impl->surface_scale; return GDK_FILTER_TRANSLATE; } @@ -1961,7 +1961,7 @@ xdnd_drop_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - guint32 source_window = xevent->xclient.data.l[0]; + guint32 source_surface = xevent->xclient.data.l[0]; guint32 time = xevent->xclient.data.l[2]; GdkDisplay *display; GdkX11Display *display_x11; @@ -1969,15 +1969,15 @@ xdnd_drop_filter (const XEvent *xevent, GdkX11DragContext *context_x11; if (!event->any.window || - gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) + gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, - g_message ("XdndDrop: source_window: %#x time: %d", - source_window, time)); + g_message ("XdndDrop: source_surface: %#x time: %d", + source_surface, time)); xdnd_precache_atoms (display); @@ -1985,7 +1985,7 @@ xdnd_drop_filter (const XEvent *xevent, if ((context != NULL) && (GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_SURFACE_XID (context->source_window) == source_window)) + (GDK_SURFACE_XID (context->source_surface) == source_surface)) { context_x11 = GDK_X11_DRAG_CONTEXT (context); event->any.type = GDK_DROP_START; @@ -2041,7 +2041,7 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11, { GdkDragContext *context = GDK_DRAG_CONTEXT (context_x11); - if (context->dest_window) + if (context->dest_surface) { switch (context_x11->protocol) { @@ -2054,13 +2054,13 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11, break; } - g_object_unref (context->dest_window); - context->dest_window = NULL; + g_object_unref (context->dest_surface); + context->dest_surface = NULL; } } static GdkSurface * -create_drag_window (GdkDisplay *display) +create_drag_surface (GdkDisplay *display) { GdkSurface *window; @@ -2085,7 +2085,7 @@ _gdk_x11_display_get_drag_protocol (GdkDisplay *display, /* Check for a local drag */ window = gdk_x11_surface_lookup_for_display (display, xid); - if (window && gdk_surface_get_window_type (window) != GDK_SURFACE_FOREIGN) + if (window && gdk_surface_get_surface_type (window) != GDK_SURFACE_FOREIGN) { if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL) { @@ -2142,7 +2142,7 @@ drag_context_find_window_cache (GdkX11DragContext *context_x11, static GdkSurface * gdk_x11_drag_context_find_window (GdkDragContext *context, - GdkSurface *drag_window, + GdkSurface *drag_surface, gint x_root, gint y_root, GdkDragProtocol *protocol) @@ -2152,17 +2152,17 @@ gdk_x11_drag_context_find_window (GdkDragContext *context, GdkSurfaceCache *window_cache; GdkDisplay *display; Window dest; - GdkSurface *dest_window; + GdkSurface *dest_surface; display = gdk_drag_context_get_display (context); window_cache = drag_context_find_window_cache (context_x11, display); dest = get_client_window_at_coords (window_cache, - drag_window && GDK_SURFACE_IS_X11 (drag_window) ? - GDK_SURFACE_XID (drag_window) : None, - x_root * screen_x11->window_scale, - y_root * screen_x11->window_scale); + drag_surface && GDK_SURFACE_IS_X11 (drag_surface) ? + GDK_SURFACE_XID (drag_surface) : None, + x_root * screen_x11->surface_scale, + y_root * screen_x11->surface_scale); if (context_x11->dest_xid != dest) { @@ -2172,7 +2172,7 @@ gdk_x11_drag_context_find_window (GdkDragContext *context, /* Check if new destination accepts drags, and which protocol */ /* There is some ugliness here. We actually need to pass - * _three_ pieces of information to drag_motion - dest_window, + * _three_ pieces of information to drag_motion - dest_surface, * protocol, and the XID of the unproxied window. The first * two are passed explicitly, the third implicitly through * protocol->dest_xid. @@ -2183,37 +2183,37 @@ gdk_x11_drag_context_find_window (GdkDragContext *context, &context_x11->version); if (recipient != None) - dest_window = gdk_x11_surface_foreign_new_for_display (display, recipient); + dest_surface = gdk_x11_surface_foreign_new_for_display (display, recipient); else - dest_window = NULL; + dest_surface = NULL; } else { - dest_window = context->dest_window; - if (dest_window) - g_object_ref (dest_window); + dest_surface = context->dest_surface; + if (dest_surface) + g_object_ref (dest_surface); *protocol = context_x11->protocol; } - return dest_window; + return dest_surface; } static void -move_drag_window (GdkDragContext *context, +move_drag_surface (GdkDragContext *context, guint x_root, guint y_root) { GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); - gdk_surface_move (context_x11->drag_window, + gdk_surface_move (context_x11->drag_surface, x_root - context_x11->hot_x, y_root - context_x11->hot_y); - gdk_surface_raise (context_x11->drag_window); + gdk_surface_raise (context_x11->drag_surface); } static gboolean gdk_x11_drag_context_drag_motion (GdkDragContext *context, - GdkSurface *dest_window, + GdkSurface *dest_surface, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -2224,8 +2224,8 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); GdkSurfaceImplX11 *impl; - if (context_x11->drag_window) - move_drag_window (context, x_root, y_root); + if (context_x11->drag_surface) + move_drag_surface (context, x_root, y_root); context_x11->old_actions = context->actions; context->actions = possible_actions; @@ -2243,12 +2243,12 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, * gdk_drag_find_window(). This happens, e.g. * when GTK+ is proxying DND events to embedded windows. */ - if (dest_window) + if (dest_surface) { - GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_surface); xdnd_check_dest (display, - GDK_SURFACE_XID (dest_window), + GDK_SURFACE_XID (dest_surface), &context_x11->version); } } @@ -2258,18 +2258,18 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, */ if (protocol == GDK_DRAG_PROTO_XDND && !context_x11->xdnd_actions_set) { - if (dest_window) + if (dest_surface) { - if (gdk_surface_get_window_type (dest_window) == GDK_SURFACE_FOREIGN) + if (gdk_surface_get_surface_type (dest_surface) == GDK_SURFACE_FOREIGN) xdnd_set_actions (context_x11); - else if (context->dest_window == dest_window) + else if (context->dest_surface == dest_surface) { - GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_surface); GdkDragContext *dest_context; dest_context = gdk_drag_context_find (display, FALSE, - GDK_SURFACE_XID (context->source_window), - GDK_SURFACE_XID (dest_window)); + GDK_SURFACE_XID (context->source_surface), + GDK_SURFACE_XID (dest_surface)); if (dest_context) { @@ -2280,7 +2280,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, } } - if (context->dest_window != dest_window) + if (context->dest_surface != dest_surface) { /* Send a leave to the last destination */ gdk_drag_do_leave (context_x11, time); @@ -2288,11 +2288,11 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, /* Check if new destination accepts drags, and which protocol */ - if (dest_window) + if (dest_surface) { - context->dest_window = dest_window; + context->dest_surface = dest_surface; context_x11->drop_xid = context_x11->dest_xid; - g_object_ref (context->dest_window); + g_object_ref (context->dest_surface); context_x11->protocol = protocol; switch (protocol) @@ -2312,7 +2312,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, } else { - context->dest_window = NULL; + context->dest_surface = NULL; context_x11->drop_xid = None; context->action = 0; } @@ -2337,16 +2337,16 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, context_x11->last_x = x_root; context_x11->last_y = y_root; - if (context->dest_window) + if (context->dest_surface) { - impl = GDK_SURFACE_IMPL_X11 (context->dest_window->impl); + impl = GDK_SURFACE_IMPL_X11 (context->dest_surface->impl); if (context_x11->drag_status == GDK_DRAG_STATUS_DRAG) { switch (context_x11->protocol) { case GDK_DRAG_PROTO_XDND: - xdnd_send_motion (context_x11, x_root * impl->window_scale, y_root * impl->window_scale, suggested_action, time); + xdnd_send_motion (context_x11, x_root * impl->surface_scale, y_root * impl->surface_scale, suggested_action, time); break; case GDK_DRAG_PROTO_ROOTWIN: @@ -2394,7 +2394,7 @@ gdk_x11_drag_context_drag_drop (GdkDragContext *context, { GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); - if (context->dest_window) + if (context->dest_surface) { switch (context_x11->protocol) { @@ -2435,18 +2435,18 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context, xev.xclient.type = ClientMessage; xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus"); xev.xclient.format = 32; - xev.xclient.window = GDK_SURFACE_XID (context->source_window); + xev.xclient.window = GDK_SURFACE_XID (context->source_surface); - xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_surface); xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0; xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = xdnd_action_to_atom (display, action); - if (!xdnd_send_xevent (context_x11, context->source_window, FALSE, &xev)) + if (!xdnd_send_xevent (context_x11, context->source_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->source_window))); + GDK_SURFACE_XID (context->source_surface))); } } @@ -2476,7 +2476,7 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"), gdk_x11_get_xatom_by_name_for_display (display, "DELETE"), gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION"), - GDK_SURFACE_XID (context->source_window), + GDK_SURFACE_XID (context->source_surface), time); /* XXX: Do we need to wait for a reply here before sending the next message? */ } @@ -2484,9 +2484,9 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, xev.xclient.type = ClientMessage; xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished"); xev.xclient.format = 32; - xev.xclient.window = GDK_SURFACE_XID (context->source_window); + xev.xclient.window = GDK_SURFACE_XID (context->source_surface); - xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_surface); if (success) { xev.xclient.data.l[1] = 1; @@ -2501,11 +2501,11 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; - if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_window, FALSE, &xev)) + if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_surface, FALSE, &xev)) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_SURFACE_XID (context->source_window))); + GDK_SURFACE_XID (context->source_surface))); } } } @@ -2542,9 +2542,9 @@ gdk_x11_drag_context_drop_status (GdkDragContext *context) } static GdkSurface * -gdk_x11_drag_context_get_drag_window (GdkDragContext *context) +gdk_x11_drag_context_get_drag_surface (GdkDragContext *context) { - return GDK_X11_DRAG_CONTEXT (context)->drag_window; + return GDK_X11_DRAG_CONTEXT (context)->drag_surface; } static void @@ -2560,7 +2560,7 @@ gdk_x11_drag_context_set_hotspot (GdkDragContext *context, if (x11_context->grab_seat) { /* DnD is managed, update current position */ - move_drag_window (context, x11_context->last_x, x11_context->last_y); + move_drag_surface (context, x11_context->last_x, x11_context->last_y); } } @@ -2713,11 +2713,11 @@ gdk_drag_anim_timeout (gpointer data) t = ease_out_cubic (f); - gdk_surface_show (context->drag_window); - gdk_surface_move (context->drag_window, + gdk_surface_show (context->drag_surface); + gdk_surface_move (context->drag_surface, context->last_x + (context->start_x - context->last_x) * t, context->last_y + (context->start_y - context->last_y) * t); - gdk_surface_set_opacity (context->drag_window, 1.0 - f); + gdk_surface_set_opacity (context->drag_surface, 1.0 - f); return G_SOURCE_CONTINUE; } @@ -2758,15 +2758,15 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, context); if (success) { - gdk_surface_hide (x11_context->drag_window); + gdk_surface_hide (x11_context->drag_surface); return; } - win_surface = _gdk_surface_ref_cairo_surface (x11_context->drag_window); - surface = gdk_surface_create_similar_surface (x11_context->drag_window, + win_surface = _gdk_surface_ref_cairo_surface (x11_context->drag_surface); + surface = gdk_surface_create_similar_surface (x11_context->drag_surface, cairo_surface_get_content (win_surface), - gdk_surface_get_width (x11_context->drag_window), - gdk_surface_get_height (x11_context->drag_window)); + gdk_surface_get_width (x11_context->drag_surface), + gdk_surface_get_height (x11_context->drag_surface)); cr = cairo_create (surface); cairo_set_source_surface (cr, win_surface, 0, 0); cairo_paint (cr); @@ -2776,7 +2776,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, /* pattern = cairo_pattern_create_for_surface (surface); - gdk_surface_set_background_pattern (x11_context->drag_window, pattern); + gdk_surface_set_background_pattern (x11_context->drag_surface, pattern); cairo_pattern_destroy (pattern); */ @@ -2784,7 +2784,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, anim = g_slice_new0 (GdkDragAnim); anim->context = g_object_ref (x11_context); - anim->frame_clock = gdk_surface_get_frame_clock (x11_context->drag_window); + anim->frame_clock = gdk_surface_get_frame_clock (x11_context->drag_surface); anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock); id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17, @@ -2983,10 +2983,10 @@ _gdk_x11_surface_drag_begin (GdkSurface *window, gdk_surface_set_group (x11_context->ipc_window, window); gdk_surface_show (x11_context->ipc_window); - context->source_window = x11_context->ipc_window; - g_object_ref (context->source_window); + context->source_surface = x11_context->ipc_window; + g_object_ref (context->source_surface); - x11_context->drag_window = create_drag_window (display); + x11_context->drag_surface = create_drag_surface (display); if (!drag_context_grab (context)) { @@ -2994,7 +2994,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *window, return NULL; } - move_drag_window (context, x_root, y_root); + move_drag_surface (context, x_root, y_root); x11_context->timestamp = gdk_display_get_last_seen_time (display); xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"); @@ -3118,17 +3118,17 @@ gdk_drag_update (GdkDragContext *context, { GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context); GdkDragAction action, possible_actions; - GdkSurface *dest_window; + GdkSurface *dest_surface; GdkDragProtocol protocol; gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_context->actions, &action, &possible_actions); - dest_window = gdk_x11_drag_context_find_window (context, - x11_context->drag_window, + dest_surface = gdk_x11_drag_context_find_window (context, + x11_context->drag_surface, x_root, y_root, &protocol); - gdk_x11_drag_context_drag_motion (context, dest_window, protocol, x_root, y_root, + gdk_x11_drag_context_drag_motion (context, dest_surface, protocol, x_root, y_root, action, possible_actions, evtime); } @@ -3173,7 +3173,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context, case GDK_KEY_KP_Enter: case GDK_KEY_KP_Space: if ((gdk_drag_context_get_selected_action (context) != 0) && - (gdk_drag_context_get_dest_window (context) != NULL)) + (gdk_drag_context_get_dest_surface (context) != NULL)) { g_signal_emit_by_name (context, "drop-performed", gdk_event_get_time ((GdkEvent *) event)); @@ -3238,7 +3238,7 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context, * example, when changing the drag cursor. */ if (event->implicit || - event->grab_window == x11_context->drag_window || + event->grab_window == x11_context->drag_surface || event->grab_window == x11_context->ipc_window) return FALSE; @@ -3261,7 +3261,7 @@ gdk_dnd_handle_button_event (GdkDragContext *context, #endif if ((gdk_drag_context_get_selected_action (context) != 0) && - (gdk_drag_context_get_dest_window (context) != NULL)) + (gdk_drag_context_get_dest_surface (context) != NULL)) { g_signal_emit_by_name (context, "drop-performed", gdk_event_get_time ((GdkEvent *) event)); diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c index 168e33cfb8..88007c2e89 100644 --- a/gdk/x11/gdkeventsource.c +++ b/gdk/x11/gdkeventsource.c @@ -274,7 +274,7 @@ gdk_event_source_translate_event (GdkX11Display *x11_display, if (result == GDK_FILTER_CONTINUE && filter_window) { gpointer context = g_object_get_data (G_OBJECT (filter_window), "xdnd-source-context"); - result = xdnd_source_window_filter (xevent, event, context); + result = xdnd_source_surface_filter (xevent, event, context); } if (result != GDK_FILTER_CONTINUE) @@ -523,7 +523,7 @@ gdk_x11_event_source_select_events (GdkEventSource *source, if (mask != 0) { - _gdk_x11_event_translator_select_window_events (translator, window, mask); + _gdk_x11_event_translator_select_surface_events (translator, window, mask); event_mask &= ~mask; } diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c index 579c59ae23..5e3f4770b2 100644 --- a/gdk/x11/gdkeventtranslator.c +++ b/gdk/x11/gdkeventtranslator.c @@ -72,7 +72,7 @@ _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator) } void -_gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator, +_gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator, Window window, GdkEventMask event_mask) { @@ -82,8 +82,8 @@ _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator, iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator); - if (iface->select_window_events) - iface->select_window_events (translator, window, event_mask); + if (iface->select_surface_events) + iface->select_surface_events (translator, window, event_mask); } GdkSurface * diff --git a/gdk/x11/gdkeventtranslator.h b/gdk/x11/gdkeventtranslator.h index 7d7d0b7a9f..f72eb451de 100644 --- a/gdk/x11/gdkeventtranslator.h +++ b/gdk/x11/gdkeventtranslator.h @@ -44,7 +44,7 @@ struct _GdkEventTranslatorIface const XEvent *xevent); GdkEventMask (* get_handled_events) (GdkEventTranslator *translator); - void (* select_window_events) (GdkEventTranslator *translator, + void (* select_surface_events) (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); GdkSurface * (* get_window) (GdkEventTranslator *translator, @@ -57,7 +57,7 @@ GdkEvent * _gdk_x11_event_translator_translate (GdkEventTranslator *translator, GdkDisplay *display, const XEvent *xevent); GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator); -void _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator, +void _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); GdkSurface * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator, diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index 0405d0588a..9cf8714551 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -125,7 +125,7 @@ gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context, { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkX11GLContext *context_x11 = GDK_X11_GL_CONTEXT (context); - GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_surface (context); GdkDisplay *display = gdk_gl_context_get_display (context); Display *dpy = gdk_x11_display_get_xdisplay (display); GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); @@ -194,7 +194,7 @@ gdk_x11_gl_context_get_damage (GdkGLContext *context) GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); Display *dpy = gdk_x11_display_get_xdisplay (display); - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); unsigned int buffer_age = 0; if (display_x11->has_glx_buffer_age) @@ -372,7 +372,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, int n_rects, i; GdkSurface *window; int unscaled_window_height; - int window_scale; + int surface_scale; unsigned int texture_id; gboolean use_texture_rectangle; guint target; @@ -400,8 +400,8 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, GDK_DISPLAY_NOTE (GDK_DISPLAY (display_x11), OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface")); - window = gdk_gl_context_get_window (paint_context)->impl_window; - window_scale = gdk_surface_get_scale_factor (window); + window = gdk_gl_context_get_surface (paint_context)->impl_surface; + surface_scale = gdk_surface_get_scale_factor (window); gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height); sx = sy = 1; @@ -430,8 +430,8 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, #define FLIP_Y(_y) (unscaled_window_height - (_y)) cairo_region_get_extents (region, &rect); - glScissor (rect.x * window_scale, FLIP_Y((rect.y + rect.height) * window_scale), - rect.width * window_scale, rect.height * window_scale); + glScissor (rect.x * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale), + rect.width * surface_scale, rect.height * surface_scale); for (i = 0; i < n_rects; i++) { @@ -457,8 +457,8 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, { GdkTexturedQuad quad = { - rect.x * window_scale, FLIP_Y(rect.y * window_scale), - (rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale), + rect.x * surface_scale, FLIP_Y(rect.y * surface_scale), + (rect.x + rect.width) * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale), uscale * src_x, vscale * src_y, uscale * (src_x + src_width), vscale * (src_y + src_height), }; @@ -570,7 +570,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, gboolean debug_bit, compat_bit, legacy_bit, es_bit; int major, minor, flags; - window = gdk_gl_context_get_window (context); + window = gdk_gl_context_get_surface (context); display = gdk_surface_get_display (window); dpy = gdk_x11_display_get_xdisplay (display); context_x11 = GDK_X11_GL_CONTEXT (context); @@ -669,7 +669,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, xvisinfo = find_xvisinfo_for_fbconfig (display, context_x11->glx_config); - info = get_glx_drawable_info (window->impl_window); + info = get_glx_drawable_info (window->impl_surface); if (info == NULL) { XSetWindowAttributes attrs; @@ -698,7 +698,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, if (GDK_X11_DISPLAY (display)->glx_version >= 13) { info->glx_drawable = glXCreateWindow (dpy, context_x11->glx_config, - gdk_x11_surface_get_xid (window->impl_window), + gdk_x11_surface_get_xid (window->impl_surface), NULL); info->dummy_glx = glXCreateWindow (dpy, context_x11->glx_config, info->dummy_xwin, NULL); } @@ -717,12 +717,12 @@ gdk_x11_gl_context_realize (GdkGLContext *context, return FALSE; } - set_glx_drawable_info (window->impl_window, info); + set_glx_drawable_info (window->impl_surface, info); } XFree (xvisinfo); - context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (window->impl_window); + context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (window->impl_surface); context_x11->unattached_drawable = info->dummy_glx ? info->dummy_glx : info->dummy_xwin; context_x11->is_direct = glXIsDirect (dpy, context_x11->glx_context); diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index c14c04e09d..53347328d4 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -186,7 +186,7 @@ _gdk_x11_surface_grab_check_destroy (GdkSurface *window) /* Make sure there is no lasting grab in this native window */ grab = _gdk_display_get_last_device_grab (display, d->data); - if (grab && grab->native_window == window) + if (grab && grab->native_surface == window) { /* We don't know the actual serial to end, but it doesn't really matter as this only happens diff --git a/gdk/x11/gdkmonitor-x11.c b/gdk/x11/gdkmonitor-x11.c index 8a282b95cf..35f519a7df 100644 --- a/gdk/x11/gdkmonitor-x11.c +++ b/gdk/x11/gdkmonitor-x11.c @@ -48,7 +48,7 @@ gdk_monitor_has_fullscreen_window (GdkMonitor *monitor) continue; if (gdk_surface_get_fullscreen_mode (window) == GDK_FULLSCREEN_ON_ALL_MONITORS || - gdk_display_get_monitor_at_window (monitor->display, window) == monitor) + gdk_display_get_monitor_at_surface (monitor->display, window) == monitor) { has_fullscreen = TRUE; break; diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index e784b1f1b7..c55b0b3fc9 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -196,7 +196,7 @@ void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display, void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); -void _gdk_x11_display_create_window_impl (GdkDisplay *display, +void _gdk_x11_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -217,7 +217,7 @@ _gdk_x11_dnd_filter (const XEvent *xevent, gpointer data); GdkFilterReturn -xdnd_source_window_filter (const XEvent *xevent, +xdnd_source_surface_filter (const XEvent *xevent, GdkEvent *event, gpointer data); diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index bcabeb32de..83b6818e55 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -242,10 +242,10 @@ gdk_x11_screen_get_work_area (GdkX11Screen *x11_screen, area->width = workareas[desktop * 4 + 2]; area->height = workareas[desktop * 4 + 3]; - area->x /= x11_screen->window_scale; - area->y /= x11_screen->window_scale; - area->width /= x11_screen->window_scale; - area->height /= x11_screen->window_scale; + area->x /= x11_screen->surface_scale; + area->y /= x11_screen->surface_scale; + area->width /= x11_screen->surface_scale; + area->height /= x11_screen->surface_scale; out: if (ret_workarea) @@ -408,10 +408,10 @@ init_randr15 (GdkX11Screen *x11_screen, gboolean *changed) gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry); name = g_strndup (output_info->name, output_info->nameLen); - newgeo.x = rr_monitors[i].x / x11_screen->window_scale; - newgeo.y = rr_monitors[i].y / x11_screen->window_scale; - newgeo.width = rr_monitors[i].width / x11_screen->window_scale; - newgeo.height = rr_monitors[i].height / x11_screen->window_scale; + newgeo.x = rr_monitors[i].x / x11_screen->surface_scale; + newgeo.y = rr_monitors[i].y / x11_screen->surface_scale; + newgeo.width = rr_monitors[i].width / x11_screen->surface_scale; + newgeo.height = rr_monitors[i].height / x11_screen->surface_scale; if (newgeo.x != geometry.x || newgeo.y != geometry.y || newgeo.width != geometry.width || @@ -430,7 +430,7 @@ init_randr15 (GdkX11Screen *x11_screen, gboolean *changed) gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor), translate_subpixel_order (output_info->subpixel_order)); gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh_rate); - gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale); + gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale); gdk_monitor_set_model (GDK_MONITOR (monitor), name); g_free (name); @@ -570,10 +570,10 @@ init_randr13 (GdkX11Screen *x11_screen, gboolean *changed) gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry); name = g_strndup (output_info->name, output_info->nameLen); - newgeo.x = crtc->x / x11_screen->window_scale; - newgeo.y = crtc->y / x11_screen->window_scale; - newgeo.width = crtc->width / x11_screen->window_scale; - newgeo.height = crtc->height / x11_screen->window_scale; + newgeo.x = crtc->x / x11_screen->surface_scale; + newgeo.y = crtc->y / x11_screen->surface_scale; + newgeo.width = crtc->width / x11_screen->surface_scale; + newgeo.height = crtc->height / x11_screen->surface_scale; if (newgeo.x != geometry.x || newgeo.y != geometry.y || newgeo.width != geometry.width || @@ -592,7 +592,7 @@ init_randr13 (GdkX11Screen *x11_screen, gboolean *changed) gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor), translate_subpixel_order (output_info->subpixel_order)); gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh_rate); - gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale); + gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale); gdk_monitor_set_model (GDK_MONITOR (monitor), name); g_free (name); @@ -712,7 +712,7 @@ init_no_multihead (GdkX11Screen *x11_screen, gboolean *changed) gdk_monitor_set_size (GDK_MONITOR (monitor), width, height); g_object_notify (G_OBJECT (monitor), "workarea"); gdk_monitor_set_physical_size (GDK_MONITOR (monitor), width_mm, height_mm); - gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale); + gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale); if (x11_display->primary_monitor != 0) *changed = TRUE; @@ -772,13 +772,13 @@ _gdk_x11_screen_new (GdkDisplay *display, scale_str = g_getenv ("GDK_SCALE"); if (scale_str) { - x11_screen->fixed_window_scale = TRUE; - x11_screen->window_scale = atol (scale_str); - if (x11_screen->window_scale == 0) - x11_screen->window_scale = 1; + x11_screen->fixed_surface_scale = TRUE; + x11_screen->surface_scale = atol (scale_str); + if (x11_screen->surface_scale == 0) + x11_screen->surface_scale = 1; } else - x11_screen->window_scale = 1; + x11_screen->surface_scale = 1; init_randr_support (x11_screen); init_multihead (x11_screen); @@ -789,17 +789,17 @@ _gdk_x11_screen_new (GdkDisplay *display, } void -_gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, +_gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen, gint scale) { GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display); GList *toplevels, *l; int i; - if (x11_screen->window_scale == scale) + if (x11_screen->surface_scale == scale) return; - x11_screen->window_scale = scale; + x11_screen->surface_scale = scale; toplevels = gdk_x11_display_get_toplevel_windows (x11_screen->display); @@ -807,7 +807,7 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, { GdkSurface *window = l->data; - _gdk_x11_surface_set_window_scale (window, scale); + _gdk_x11_surface_set_surface_scale (window, scale); } for (i = 0; i < x11_display->monitors->len; i++) diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h index 9553b4baba..08e3e8ba87 100644 --- a/gdk/x11/gdkscreen-x11.h +++ b/gdk/x11/gdkscreen-x11.h @@ -41,8 +41,8 @@ struct _GdkX11Screen Window xroot_window; gint screen_num; - gint window_scale; - gboolean fixed_window_scale; + gint surface_scale; + gboolean fixed_surface_scale; /* Xft resources for the display, used for default values for * the Xft/ XSETTINGS @@ -108,7 +108,7 @@ void _gdk_x11_screen_get_edge_monitors (GdkX11Screen *screen, gint *bottom, gint *left, gint *right); -void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, +void _gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen, int scale); void gdk_x11_screen_get_work_area (GdkX11Screen *screen, GdkRectangle *area); diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 21f1d14bf1..288271c64a 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -110,12 +110,12 @@ static void move_to_current_desktop (GdkSurface *window); static void gdk_surface_impl_x11_finalize (GObject *object); -#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \ +#define SURFACE_IS_TOPLEVEL_OR_FOREIGN(window) \ (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL || \ GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || \ GDK_SURFACE_TYPE (window) == GDK_SURFACE_FOREIGN) -#define WINDOW_IS_TOPLEVEL(window) \ +#define SURFACE_IS_TOPLEVEL(window) \ (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL || \ GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) @@ -153,7 +153,7 @@ G_DEFINE_TYPE (GdkSurfaceImplX11, gdk_surface_impl_x11, GDK_TYPE_SURFACE_IMPL) static void gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl) { - impl->window_scale = 1; + impl->surface_scale = 1; impl->frame_sync_enabled = TRUE; } @@ -164,7 +164,7 @@ _gdk_x11_surface_get_toplevel (GdkSurface *window) g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (!WINDOW_IS_TOPLEVEL (window)) + if (!SURFACE_IS_TOPLEVEL (window)) return NULL; impl = GDK_SURFACE_IMPL_X11 (window->impl); @@ -235,7 +235,7 @@ window_pre_damage (GdkSurface *window) GdkSurface *toplevel_window = gdk_surface_get_toplevel (window); GdkSurfaceImplX11 *impl; - if (!toplevel_window || !WINDOW_IS_TOPLEVEL (toplevel_window)) + if (!toplevel_window || !SURFACE_IS_TOPLEVEL (toplevel_window)) return; impl = GDK_SURFACE_IMPL_X11 (toplevel_window->impl); @@ -310,7 +310,7 @@ gdk_x11_surface_predict_presentation_time (GdkSurface *window) gint64 presentation_time; gint64 refresh_interval; - if (!WINDOW_IS_TOPLEVEL (window)) + if (!SURFACE_IS_TOPLEVEL (window)) return; clock = gdk_surface_get_frame_clock (window); @@ -357,7 +357,7 @@ gdk_x11_surface_begin_frame (GdkSurface *window, impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (!WINDOW_IS_TOPLEVEL (window) || + if (!SURFACE_IS_TOPLEVEL (window) || impl->toplevel->extended_update_counter == None) return; @@ -398,7 +398,7 @@ gdk_x11_surface_end_frame (GdkSurface *window) impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (!WINDOW_IS_TOPLEVEL (window) || + if (!SURFACE_IS_TOPLEVEL (window) || impl->toplevel->extended_update_counter == None || !impl->toplevel->in_frame) return; @@ -488,11 +488,11 @@ gdk_x11_ref_cairo_surface (GdkSurface *window) if (!impl->cairo_surface) { impl->cairo_surface = gdk_x11_create_cairo_surface (impl, - gdk_surface_get_width (window) * impl->window_scale, - gdk_surface_get_height (window) * impl->window_scale); - cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale); + gdk_surface_get_width (window) * impl->surface_scale, + gdk_surface_get_height (window) * impl->surface_scale); + cairo_surface_set_device_scale (impl->cairo_surface, impl->surface_scale, impl->surface_scale); - if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel->in_frame) + if (SURFACE_IS_TOPLEVEL (window) && impl->toplevel->in_frame) hook_surface_changed (window); } @@ -513,7 +513,7 @@ gdk_surface_impl_x11_finalize (GObject *object) wrapper = impl->wrapper; - if (WINDOW_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame) + if (SURFACE_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame) unhook_surface_changed (wrapper); _gdk_x11_surface_grab_check_destroy (wrapper); @@ -775,8 +775,8 @@ setup_toplevel_window (GdkSurface *window, * correct value??? */ size_hints.flags = PSize; - size_hints.width = window->width * impl->window_scale; - size_hints.height = window->height * impl->window_scale; + size_hints.width = window->width * impl->surface_scale; + size_hints.height = window->height * impl->surface_scale; XSetWMNormalHints (xdisplay, xid, &size_hints); @@ -837,7 +837,7 @@ connect_frame_clock (GdkSurface *window) GdkSurfaceImplX11 *impl; impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (WINDOW_IS_TOPLEVEL (window) && !impl->frame_clock_connected) + if (SURFACE_IS_TOPLEVEL (window) && !impl->frame_clock_connected) { GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window); @@ -851,7 +851,7 @@ connect_frame_clock (GdkSurface *window) } void -_gdk_x11_display_create_window_impl (GdkDisplay *display, +_gdk_x11_display_create_surface_impl (GdkDisplay *display, GdkSurface *window, GdkSurface *real_parent, GdkEventMask event_mask, @@ -885,7 +885,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL); window->impl = GDK_SURFACE_IMPL (impl); impl->wrapper = GDK_SURFACE (window); - impl->window_scale = x11_screen->window_scale; + impl->surface_scale = x11_screen->surface_scale; xdisplay = x11_screen->xdisplay; @@ -896,7 +896,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, impl->override_redirect = FALSE; /* Sanity checks */ - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: @@ -928,7 +928,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, xattributes.colormap = gdk_x11_display_get_window_colormap (display_x11); xattributes_mask |= CWColormap; - if (window->window_type == GDK_SURFACE_TEMP) + if (window->surface_type == GDK_SURFACE_TEMP) { xattributes.save_under = True; xattributes.override_redirect = True; @@ -944,7 +944,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, { class = InputOnly; - if (window->window_type == GDK_SURFACE_TEMP) + if (window->surface_type == GDK_SURFACE_TEMP) { xattributes.override_redirect = True; xattributes_mask |= CWOverrideRedirect; @@ -955,19 +955,19 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, depth = 0; } - if (window->width * impl->window_scale > 32767 || - window->height * impl->window_scale > 32767) + if (window->width * impl->surface_scale > 32767 || + window->height * impl->surface_scale > 32767) { g_warning ("Native Windows wider or taller than 32767 pixels are not supported"); - if (window->width * impl->window_scale > 32767) - window->width = 32767 / impl->window_scale; - if (window->height * impl->window_scale > 32767) - window->height = 32767 / impl->window_scale; + if (window->width * impl->surface_scale > 32767) + window->width = 32767 / impl->surface_scale; + if (window->height * impl->surface_scale > 32767) + window->height = 32767 / impl->surface_scale; } - impl->unscaled_width = window->width * impl->window_scale; - impl->unscaled_height = window->height * impl->window_scale; + impl->unscaled_width = window->width * impl->surface_scale; + impl->unscaled_height = window->height * impl->surface_scale; if (window->parent) { @@ -981,9 +981,9 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, } impl->xid = XCreateWindow (xdisplay, xparent, - (window->x + abs_x) * impl->window_scale, - (window->y + abs_y) * impl->window_scale, - window->width * impl->window_scale, window->height * impl->window_scale, + (window->x + abs_x) * impl->surface_scale, + (window->y + abs_y) * impl->surface_scale, + window->width * impl->surface_scale, window->height * impl->surface_scale, 0, depth, class, xvisual, xattributes_mask, &xattributes); @@ -1094,24 +1094,24 @@ gdk_x11_surface_foreign_new_for_display (GdkDisplay *display, win = _gdk_display_create_window (display); win->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL); - win->impl_window = win; + win->impl_surface = win; impl = GDK_SURFACE_IMPL_X11 (win->impl); impl->wrapper = win; - impl->window_scale = GDK_X11_SCREEN (screen)->window_scale; + impl->surface_scale = GDK_X11_SCREEN (screen)->surface_scale; /* Always treat foreigns as toplevels */ win->parent = NULL; impl->xid = window; - win->x = attrs.x / impl->window_scale; - win->y = attrs.y / impl->window_scale; + win->x = attrs.x / impl->surface_scale; + win->y = attrs.y / impl->surface_scale; impl->unscaled_width = attrs.width; impl->unscaled_height = attrs.height; - win->width = attrs.width / impl->window_scale; - win->height = attrs.height / impl->window_scale; - win->window_type = GDK_SURFACE_FOREIGN; + win->width = attrs.width / impl->surface_scale; + win->height = attrs.height / impl->surface_scale; + win->surface_type = GDK_SURFACE_FOREIGN; win->destroyed = FALSE; win->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask); @@ -1197,9 +1197,9 @@ gdk_x11_surface_destroy (GdkSurface *window, static void gdk_x11_surface_destroy_notify (GdkSurface *window) { - GdkSurfaceImplX11 *window_impl; + GdkSurfaceImplX11 *surface_impl; - window_impl = GDK_SURFACE_IMPL_X11 ((window)->impl); + surface_impl = GDK_SURFACE_IMPL_X11 ((window)->impl); if (!GDK_SURFACE_DESTROYED (window)) { @@ -1210,8 +1210,8 @@ gdk_x11_surface_destroy_notify (GdkSurface *window) } _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), GDK_SURFACE_XID (window)); - if (window_impl->toplevel && window_impl->toplevel->focus_window) - _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), window_impl->toplevel->focus_window); + if (surface_impl->toplevel && surface_impl->toplevel->focus_window) + _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), surface_impl->toplevel->focus_window); _gdk_x11_surface_grab_check_destroy (window); @@ -1411,7 +1411,7 @@ gdk_surface_x11_show (GdkSurface *window, gboolean already_mapped) if (!already_mapped) set_initial_hints (window); - if (WINDOW_IS_TOPLEVEL (window)) + if (SURFACE_IS_TOPLEVEL (window)) { display = gdk_surface_get_display (window); display_x11 = GDK_X11_DISPLAY (display); @@ -1444,7 +1444,7 @@ gdk_surface_x11_hide (GdkSurface *window) NextRequest (GDK_SURFACE_XDISPLAY (window))); /* You can't simply unmap toplevel windows. */ - switch (window->window_type) + switch (window->surface_type) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: /* ? */ @@ -1469,7 +1469,7 @@ gdk_surface_x11_withdraw (GdkSurface *window) if (!window->destroyed) { if (GDK_SURFACE_IS_MAPPED (window)) - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); @@ -1489,7 +1489,7 @@ window_x11_move (GdkSurface *window, XMoveWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), - x * impl->window_scale, y * impl->window_scale); + x * impl->surface_scale, y * impl->surface_scale); if (impl->override_redirect) { @@ -1515,19 +1515,19 @@ window_x11_resize (GdkSurface *window, XResizeWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), - width * impl->window_scale, height * impl->window_scale); + width * impl->surface_scale, height * impl->surface_scale); if (impl->override_redirect) { - impl->unscaled_width = width * impl->window_scale; - impl->unscaled_height = height * impl->window_scale; + impl->unscaled_width = width * impl->surface_scale; + impl->unscaled_height = height * impl->surface_scale; window->width = width; window->height = height; _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (window->impl)); } else { - if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height) + if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height) window->resize_count += 1; } } @@ -1551,16 +1551,16 @@ window_x11_move_resize (GdkSurface *window, XMoveResizeWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), - x * impl->window_scale, y * impl->window_scale, - width * impl->window_scale, height * impl->window_scale); + x * impl->surface_scale, y * impl->surface_scale, + width * impl->surface_scale, height * impl->surface_scale); if (impl->override_redirect) { window->x = x; window->y = y; - impl->unscaled_width = width * impl->window_scale; - impl->unscaled_height = height * impl->window_scale; + impl->unscaled_width = width * impl->surface_scale; + impl->unscaled_height = height * impl->surface_scale; window->width = width; window->height = height; @@ -1568,7 +1568,7 @@ window_x11_move_resize (GdkSurface *window, } else { - if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height) + if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height) window->resize_count += 1; } } @@ -1593,7 +1593,7 @@ gdk_surface_x11_move_resize (GdkSurface *window, } void -_gdk_x11_surface_set_window_scale (GdkSurface *window, +_gdk_x11_surface_set_surface_scale (GdkSurface *window, int scale) { GdkSurfaceImplX11 *impl; @@ -1602,13 +1602,13 @@ _gdk_x11_surface_set_window_scale (GdkSurface *window, impl = GDK_SURFACE_IMPL_X11 (window->impl); - impl->window_scale = scale; + impl->surface_scale = scale; if (impl->cairo_surface) - cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale); + cairo_surface_set_device_scale (impl->cairo_surface, impl->surface_scale, impl->surface_scale); _gdk_surface_update_size (window); toplevel = _gdk_x11_surface_get_toplevel (window); - if (toplevel && window->window_type != GDK_SURFACE_FOREIGN) + if (toplevel && window->surface_type != GDK_SURFACE_FOREIGN) { /* These are affected by window scale: */ geom_mask = toplevel->last_geometry_hints_mask & @@ -1619,23 +1619,23 @@ _gdk_x11_surface_set_window_scale (GdkSurface *window, geom_mask); } - if (window->window_type == GDK_SURFACE_FOREIGN) + if (window->surface_type == GDK_SURFACE_FOREIGN) XMoveWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), - window->x * impl->window_scale, - window->y * impl->window_scale); + window->x * impl->surface_scale, + window->y * impl->surface_scale); else { if (impl->override_redirect) { - impl->unscaled_width = window->width * impl->window_scale; - impl->unscaled_height = window->height * impl->window_scale; + impl->unscaled_width = window->width * impl->surface_scale; + impl->unscaled_height = window->height * impl->surface_scale; } XResizeWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), - window->width * impl->window_scale, - window->height * impl->window_scale); + window->width * impl->surface_scale, + window->height * impl->surface_scale); } gdk_surface_invalidate_rect (window, NULL, TRUE); @@ -1803,7 +1803,7 @@ gdk_x11_surface_focus (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = GDK_SURFACE_DISPLAY (window); @@ -1853,7 +1853,7 @@ gdk_x11_surface_set_type_hint (GdkSurface *window, Atom atom; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = gdk_surface_get_display (window); @@ -1927,7 +1927,7 @@ gdk_x11_surface_get_type_hint (GdkSurface *window) g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_SURFACE_TYPE_HINT_NORMAL); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return GDK_SURFACE_TYPE_HINT_NORMAL; type = GDK_SURFACE_TYPE_HINT_NORMAL; @@ -2014,7 +2014,7 @@ gdk_x11_surface_set_modal_hint (GdkSurface *window, gboolean modal) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; window->modal_hint = modal; @@ -2034,7 +2034,7 @@ gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *window, g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -2055,7 +2055,7 @@ gdk_x11_surface_set_skip_pager_hint (GdkSurface *window, g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -2076,7 +2076,7 @@ gdk_x11_surface_set_urgency_hint (GdkSurface *window, g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -2095,7 +2095,7 @@ gdk_x11_surface_set_geometry_hints (GdkSurface *window, GdkToplevelX11 *toplevel; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -2132,35 +2132,35 @@ gdk_x11_surface_set_geometry_hints (GdkSurface *window, if (geom_mask & GDK_HINT_MIN_SIZE) { size_hints.flags |= PMinSize; - size_hints.min_width = geometry->min_width * impl->window_scale; - size_hints.min_height = geometry->min_height * impl->window_scale; + size_hints.min_width = geometry->min_width * impl->surface_scale; + size_hints.min_height = geometry->min_height * impl->surface_scale; } if (geom_mask & GDK_HINT_MAX_SIZE) { size_hints.flags |= PMaxSize; - size_hints.max_width = MAX (geometry->max_width, 1) * impl->window_scale; - size_hints.max_height = MAX (geometry->max_height, 1) * impl->window_scale; + size_hints.max_width = MAX (geometry->max_width, 1) * impl->surface_scale; + size_hints.max_height = MAX (geometry->max_height, 1) * impl->surface_scale; } if (geom_mask & GDK_HINT_BASE_SIZE) { size_hints.flags |= PBaseSize; - size_hints.base_width = geometry->base_width * impl->window_scale; - size_hints.base_height = geometry->base_height * impl->window_scale; + size_hints.base_width = geometry->base_width * impl->surface_scale; + size_hints.base_height = geometry->base_height * impl->surface_scale; } if (geom_mask & GDK_HINT_RESIZE_INC) { size_hints.flags |= PResizeInc; - size_hints.width_inc = geometry->width_inc * impl->window_scale; - size_hints.height_inc = geometry->height_inc * impl->window_scale; + size_hints.width_inc = geometry->width_inc * impl->surface_scale; + size_hints.height_inc = geometry->height_inc * impl->surface_scale; } - else if (impl->window_scale > 1) + else if (impl->surface_scale > 1) { size_hints.flags |= PResizeInc; - size_hints.width_inc = impl->window_scale; - size_hints.height_inc = impl->window_scale; + size_hints.width_inc = impl->surface_scale; + size_hints.height_inc = impl->surface_scale; } if (geom_mask & GDK_HINT_ASPECT) @@ -2218,7 +2218,7 @@ gdk_surface_get_geometry_hints (GdkSurface *window, *geom_mask = 0; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; impl = GDK_SURFACE_IMPL_X11 (window->impl); @@ -2236,22 +2236,22 @@ gdk_surface_get_geometry_hints (GdkSurface *window, if (size_hints->flags & PMinSize) { *geom_mask |= GDK_HINT_MIN_SIZE; - geometry->min_width = size_hints->min_width / impl->window_scale; - geometry->min_height = size_hints->min_height / impl->window_scale; + geometry->min_width = size_hints->min_width / impl->surface_scale; + geometry->min_height = size_hints->min_height / impl->surface_scale; } if (size_hints->flags & PMaxSize) { *geom_mask |= GDK_HINT_MAX_SIZE; - geometry->max_width = MAX (size_hints->max_width, 1) / impl->window_scale; - geometry->max_height = MAX (size_hints->max_height, 1) / impl->window_scale; + geometry->max_width = MAX (size_hints->max_width, 1) / impl->surface_scale; + geometry->max_height = MAX (size_hints->max_height, 1) / impl->surface_scale; } if (size_hints->flags & PResizeInc) { *geom_mask |= GDK_HINT_RESIZE_INC; - geometry->width_inc = size_hints->width_inc / impl->window_scale; - geometry->height_inc = size_hints->height_inc / impl->window_scale; + geometry->width_inc = size_hints->width_inc / impl->surface_scale; + geometry->height_inc = size_hints->height_inc / impl->surface_scale; } if (size_hints->flags & PAspect) @@ -2367,7 +2367,7 @@ gdk_x11_surface_set_title (GdkSurface *window, g_return_if_fail (title != NULL); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = gdk_surface_get_display (window); @@ -2398,7 +2398,7 @@ gdk_x11_surface_set_role (GdkSurface *window, display = gdk_surface_get_display (window); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (role) @@ -2421,7 +2421,7 @@ gdk_x11_surface_set_startup_id (GdkSurface *window, display = gdk_surface_get_display (window); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (startup_id) @@ -2439,7 +2439,7 @@ gdk_x11_surface_set_transient_for (GdkSurface *window, GdkSurface *parent) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* XSetTransientForHint() doesn't allow unsetting, so do it manually */ @@ -2490,13 +2490,13 @@ gdk_surface_x11_get_geometry (GdkSurface *window, &root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth); if (x) - *x = tx / impl->window_scale; + *x = tx / impl->surface_scale; if (y) - *y = ty / impl->window_scale; + *y = ty / impl->surface_scale; if (width) - *width = twidth / impl->window_scale; + *width = twidth / impl->surface_scale; if (height) - *height = theight / impl->window_scale; + *height = theight / impl->surface_scale; } } @@ -2515,13 +2515,13 @@ gdk_surface_x11_get_root_coords (GdkSurface *window, XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), GDK_SURFACE_XROOTWIN (window), - x * impl->window_scale, y * impl->window_scale, &tx, &ty, + x * impl->surface_scale, y * impl->surface_scale, &tx, &ty, &child); if (root_x) - *root_x = tx / impl->window_scale; + *root_x = tx / impl->surface_scale; if (root_y) - *root_y = ty / impl->window_scale; + *root_y = ty / impl->surface_scale; } static void @@ -2561,10 +2561,10 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window, impl = GDK_SURFACE_IMPL_X11 (window->impl); /* Refine our fallback answer a bit using local information */ - rect->x = window->x * impl->window_scale; - rect->y = window->y * impl->window_scale; - rect->width = window->width * impl->window_scale; - rect->height = window->height * impl->window_scale; + rect->x = window->x * impl->surface_scale; + rect->y = window->y * impl->surface_scale; + rect->width = window->width * impl->surface_scale; + rect->height = window->height * impl->surface_scale; if (GDK_SURFACE_DESTROYED (window) || impl->override_redirect) return; @@ -2688,10 +2688,10 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window, as well as round the size up when we divide by scale so that the returned size is guaranteed to cover the real pixels, but it may overshoot a bit in case the window is not positioned/sized according to the scale */ - rect->width = (rect->width + rect->x % impl->window_scale + impl->window_scale - 1) / impl->window_scale; - rect->height = (rect->height + rect->y % impl->window_scale + impl->window_scale - 1) / impl->window_scale; - rect->x = rect->x / impl->window_scale; - rect->y = rect->y / impl->window_scale; + rect->width = (rect->width + rect->x % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale; + rect->height = (rect->height + rect->y % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale; + rect->x = rect->x / impl->surface_scale; + rect->y = rect->y / impl->surface_scale; gdk_x11_display_error_trap_pop_ignored (display); } @@ -2794,14 +2794,14 @@ do_shape_combine_region (GdkSurface *window, XRectangle *xrects = NULL; _gdk_x11_region_get_xrectangles (shape_region, - 0, 0, impl->window_scale, + 0, 0, impl->surface_scale, &xrects, &n_rects); XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), shape, - offset_x * impl->window_scale, - offset_y * impl->window_scale, + offset_x * impl->surface_scale, + offset_y * impl->surface_scale, xrects, n_rects, ShapeSet, YXBanded); @@ -2841,7 +2841,7 @@ gdk_x11_surface_set_accept_focus (GdkSurface *window, window->accept_focus = accept_focus; if (!GDK_SURFACE_DESTROYED (window) && - WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) update_wm_hints (window, FALSE); } } @@ -2858,7 +2858,7 @@ gdk_x11_surface_set_focus_on_map (GdkSurface *window, if ((!GDK_SURFACE_DESTROYED (window)) && (!window->focus_on_map) && - WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) gdk_x11_surface_set_user_time (window, 0); } } @@ -2892,7 +2892,7 @@ gdk_x11_surface_set_user_time (GdkSurface *window, Window xid; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = gdk_surface_get_display (window); @@ -2943,7 +2943,7 @@ gdk_x11_surface_set_utf8_property (GdkSurface *window, { GdkDisplay *display; - if (!WINDOW_IS_TOPLEVEL (window)) + if (!SURFACE_IS_TOPLEVEL (window)) return; display = gdk_surface_get_display (window); @@ -2974,10 +2974,10 @@ gdk_x11_surface_set_shadow_width (GdkSurface *window, GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); Atom frame_extents; gulong data[4] = { - left * impl->window_scale, - right * impl->window_scale, - top * impl->window_scale, - bottom * impl->window_scale + left * impl->surface_scale, + right * impl->surface_scale, + top * impl->surface_scale, + bottom * impl->surface_scale }; frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_surface_get_display (window), @@ -3135,7 +3135,7 @@ gdk_x11_surface_set_icon_list (GdkSurface *window, gint i, n; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = gdk_surface_get_display (window); @@ -3217,7 +3217,7 @@ gdk_x11_surface_set_icon_name (GdkSurface *window, GdkDisplay *display; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; display = gdk_surface_get_display (window); @@ -3252,7 +3252,7 @@ static void gdk_x11_surface_iconify (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3264,7 +3264,7 @@ gdk_x11_surface_iconify (GdkSurface *window) else { /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_ICONIFIED); gdk_wmspec_change_state (TRUE, window, @@ -3277,7 +3277,7 @@ static void gdk_x11_surface_deiconify (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3290,7 +3290,7 @@ gdk_x11_surface_deiconify (GdkSurface *window) else { /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); gdk_wmspec_change_state (FALSE, window, @@ -3303,7 +3303,7 @@ static void gdk_x11_surface_stick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3341,7 +3341,7 @@ gdk_x11_surface_stick (GdkSurface *window) else { /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_STICKY); } @@ -3351,7 +3351,7 @@ static void gdk_x11_surface_unstick (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3366,7 +3366,7 @@ gdk_x11_surface_unstick (GdkSurface *window) else { /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_STICKY, 0); @@ -3377,7 +3377,7 @@ static void gdk_x11_surface_maximize (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3385,7 +3385,7 @@ gdk_x11_surface_maximize (GdkSurface *window) g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"), g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ")); else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); } @@ -3394,7 +3394,7 @@ static void gdk_x11_surface_unmaximize (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3402,7 +3402,7 @@ gdk_x11_surface_unmaximize (GdkSurface *window) g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"), g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ")); else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } @@ -3411,7 +3411,7 @@ static void gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* _NET_WM_FULLSCREEN_MONITORS gives an indication to the window manager as @@ -3503,7 +3503,7 @@ static void gdk_x11_surface_fullscreen (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3518,7 +3518,7 @@ gdk_x11_surface_fullscreen (GdkSurface *window) gdk_x11_surface_apply_fullscreen_mode (window); } else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); } @@ -3530,7 +3530,7 @@ gdk_x11_surface_fullscreen_on_monitor (GdkSurface *window, GdkRectangle geom; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; gdk_monitor_get_geometry (monitor, &geom); @@ -3544,7 +3544,7 @@ static void gdk_x11_surface_unfullscreen (GdkSurface *window) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3553,7 +3553,7 @@ gdk_x11_surface_unfullscreen (GdkSurface *window) NULL); else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } @@ -3565,7 +3565,7 @@ gdk_x11_surface_set_keep_above (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3579,7 +3579,7 @@ gdk_x11_surface_set_keep_above (GdkSurface *window, NULL); } else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE, setting ? GDK_SURFACE_STATE_ABOVE : 0); } @@ -3590,7 +3590,7 @@ gdk_x11_surface_set_keep_below (GdkSurface *window, gboolean setting) g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (GDK_SURFACE_IS_MAPPED (window)) @@ -3604,7 +3604,7 @@ gdk_x11_surface_set_keep_below (GdkSurface *window, gboolean setting) NULL); } else - gdk_synthesize_window_state (window, + gdk_synthesize_surface_state (window, setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW, setting ? GDK_SURFACE_STATE_BELOW : 0); } @@ -3615,7 +3615,7 @@ gdk_x11_surface_get_group (GdkSurface *window) GdkToplevelX11 *toplevel; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return NULL; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -3635,7 +3635,7 @@ gdk_x11_surface_set_group (GdkSurface *window, if (GDK_SURFACE_DESTROYED (window) || (leader != NULL && GDK_SURFACE_DESTROYED (leader)) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; toplevel = _gdk_x11_surface_get_toplevel (window); @@ -3741,7 +3741,7 @@ gdk_x11_surface_set_decorations (GdkSurface *window, MotifWmHints hints; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* initialize to zero to avoid writing uninitialized data to socket */ @@ -3760,7 +3760,7 @@ gdk_x11_surface_get_decorations(GdkSurface *window, gboolean result = FALSE; if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return FALSE; hints = gdk_surface_get_mwm_hints (window); @@ -3789,7 +3789,7 @@ gdk_x11_surface_set_functions (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* initialize to zero to avoid writing uninitialized data to socket */ @@ -3886,8 +3886,8 @@ wmspec_send_message (GdkDisplay *display, xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_MOVERESIZE"); xclient.format = 32; - xclient.data.l[0] = root_x * impl->window_scale; - xclient.data.l[1] = root_y * impl->window_scale; + xclient.data.l[0] = root_x * impl->surface_scale; + xclient.data.l[1] = root_y * impl->surface_scale; xclient.data.l[2] = action; xclient.data.l[3] = button; xclient.data.l[4] = 1; /* source indication */ @@ -4284,8 +4284,8 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) break; update_pos (mv_resize, - event->xmotion.x_root / impl->window_scale, - event->xmotion.y_root / impl->window_scale); + event->xmotion.x_root / impl->surface_scale, + event->xmotion.y_root / impl->surface_scale); /* This should never be triggered in normal cases, but in the * case where the drag started without an implicit grab being @@ -4296,22 +4296,22 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) if ((event->xmotion.state & button_mask) == 0) { check_maximize (mv_resize, - event->xmotion.x_root / impl->window_scale, - event->xmotion.y_root / impl->window_scale); + event->xmotion.x_root / impl->surface_scale, + event->xmotion.y_root / impl->surface_scale); finish_drag (mv_resize); } break; case ButtonRelease: update_pos (mv_resize, - event->xbutton.x_root / impl->window_scale, - event->xbutton.y_root / impl->window_scale); + event->xbutton.x_root / impl->surface_scale, + event->xbutton.y_root / impl->surface_scale); if (event->xbutton.button == mv_resize->moveresize_button) { check_maximize (mv_resize, - event->xmotion.x_root / impl->window_scale, - event->xmotion.y_root / impl->window_scale); + event->xmotion.x_root / impl->surface_scale, + event->xmotion.y_root / impl->surface_scale); finish_drag (mv_resize); } break; @@ -4326,24 +4326,24 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) switch (ev->evtype) { case XI_Motion: - update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale); + update_pos (mv_resize, xev->root_x / impl->surface_scale, xev->root_y / impl->surface_scale); state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group); if ((state & button_mask) == 0) { check_maximize (mv_resize, - xev->root_x / impl->window_scale, - xev->root_y / impl->window_scale); + xev->root_x / impl->surface_scale, + xev->root_y / impl->surface_scale); finish_drag (mv_resize); } break; case XI_ButtonRelease: - update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale); + update_pos (mv_resize, xev->root_x / impl->surface_scale, xev->root_y / impl->surface_scale); if (xev->detail == mv_resize->moveresize_button) { check_maximize (mv_resize, - xev->root_x / impl->window_scale, - xev->root_y / impl->window_scale); + xev->root_x / impl->surface_scale, + xev->root_y / impl->surface_scale); finish_drag (mv_resize); } break; @@ -4571,7 +4571,7 @@ gdk_x11_surface_begin_resize_drag (GdkSurface *window, guint32 timestamp) { if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) + !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* Avoid EWMH for touch devices */ @@ -4591,7 +4591,7 @@ gdk_x11_surface_begin_move_drag (GdkSurface *window, { gint direction; - if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) + if (GDK_SURFACE_DESTROYED (window) || !SURFACE_IS_TOPLEVEL (window)) return; if (button == 0) @@ -4637,7 +4637,7 @@ gdk_x11_surface_set_opacity (GdkSurface *window, g_return_if_fail (GDK_IS_SURFACE (window)); if (GDK_SURFACE_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL (window)) + !SURFACE_IS_TOPLEVEL (window)) return; display = gdk_surface_get_display (window); @@ -4747,7 +4747,7 @@ gdk_x11_surface_get_scale_factor (GdkSurface *window) if (GDK_SURFACE_DESTROYED (window)) return 1; - return impl->window_scale; + return impl->surface_scale; } /** @@ -4800,10 +4800,10 @@ gdk_x11_surface_set_opaque_region (GdkSurface *window, { cairo_rectangle_int_t rect; cairo_region_get_rectangle (region, i, &rect); - data[i*4+0] = rect.x * impl->window_scale; - data[i*4+1] = rect.y * impl->window_scale; - data[i*4+2] = rect.width * impl->window_scale; - data[i*4+3] = rect.height * impl->window_scale; + data[i*4+0] = rect.x * impl->surface_scale; + data[i*4+1] = rect.y * impl->surface_scale; + data[i*4+2] = rect.width * impl->surface_scale; + data[i*4+3] = rect.height * impl->surface_scale; } } else @@ -4860,8 +4860,8 @@ gdk_x11_surface_show_window_menu (GdkSurface *window, xclient.window = GDK_SURFACE_XID (window); xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_GTK_SHOW_WINDOW_MENU"); xclient.data.l[0] = device_id; - xclient.data.l[1] = x_root * impl->window_scale; - xclient.data.l[2] = y_root * impl->window_scale; + xclient.data.l[1] = x_root * impl->surface_scale; + xclient.data.l[2] = y_root * impl->surface_scale; xclient.format = 32; XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False, diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h index 15993af589..08f3befe43 100644 --- a/gdk/x11/gdksurface-x11.h +++ b/gdk/x11/gdksurface-x11.h @@ -74,11 +74,11 @@ struct _GdkSurfaceImplX11 guint frame_sync_enabled : 1; guint tracking_damage: 1; - gint window_scale; + gint surface_scale; - /* Width and height not divided by window_scale - this matters in the + /* Width and height not divided by surface_scale - this matters in the * corner-case where the window manager assigns us a size that isn't - * a multiple of window_scale - for example for a maximized window + * a multiple of surface_scale - for example for a maximized window * with an odd-sized title-bar. */ gint unscaled_width; @@ -191,7 +191,7 @@ GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window); GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window); void _gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl); -void _gdk_x11_surface_set_window_scale (GdkSurface *window, +void _gdk_x11_surface_set_surface_scale (GdkSurface *window, int scale); G_END_DECLS diff --git a/gdk/x11/gdkvulkancontext-x11.c b/gdk/x11/gdkvulkancontext-x11.c index b27c407bd4..c59dbe3dec 100644 --- a/gdk/x11/gdkvulkancontext-x11.c +++ b/gdk/x11/gdkvulkancontext-x11.c @@ -36,7 +36,7 @@ static VkResult gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context, VkSurfaceKHR *surface) { - GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); /* This is necessary so that Vulkan sees the Window. diff --git a/gdk/x11/gdkx11display.h b/gdk/x11/gdkx11display.h index 85f54995b1..4bf8de7452 100644 --- a/gdk/x11/gdkx11display.h +++ b/gdk/x11/gdkx11display.h @@ -111,7 +111,7 @@ GDK_AVAILABLE_IN_ALL void gdk_x11_display_ungrab (GdkDisplay *display); GDK_AVAILABLE_IN_ALL -void gdk_x11_display_set_window_scale (GdkDisplay *display, +void gdk_x11_display_set_surface_scale (GdkDisplay *display, gint scale); GDK_AVAILABLE_IN_ALL diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c index 9adfcf27d4..247e90e9f7 100644 --- a/gdk/x11/xsettings-client.c +++ b/gdk/x11/xsettings-client.c @@ -445,7 +445,7 @@ read_settings (GdkX11Screen *x11_screen, /* Since we support scaling we look at the specific Gdk/UnscaledDPI setting if it exists and use that instead of Xft/DPI if it is set */ - if (x11_screen->xsettings && !x11_screen->fixed_window_scale) + if (x11_screen->xsettings && !x11_screen->fixed_surface_scale) { setting = g_hash_table_lookup (x11_screen->xsettings, "gdk-unscaled-dpi"); if (setting) @@ -465,9 +465,9 @@ read_settings (GdkX11Screen *x11_screen, g_value_init (&value, G_TYPE_INT); - if (!x11_screen->fixed_window_scale && + if (!x11_screen->fixed_surface_scale && gdk_display_get_setting (display, "gdk-window-scaling-factor", &value)) - _gdk_x11_screen_set_window_scale (x11_screen, g_value_get_int (&value)); + _gdk_x11_screen_set_surface_scale (x11_screen, g_value_get_int (&value)); } static Atom |