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/x11 | |
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/x11')
-rw-r--r-- | gdk/x11/gdkdevice-core-x11.c | 52 | ||||
-rw-r--r-- | gdk/x11/gdkdevice-xi2.c | 34 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-core-x11.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-xi2.c | 28 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 92 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdkdnd-x11.c | 334 | ||||
-rw-r--r-- | gdk/x11/gdkeventsource.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkeventtranslator.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkeventtranslator.h | 4 | ||||
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 28 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkmonitor-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 4 | ||||
-rw-r--r-- | gdk/x11/gdkscreen-x11.c | 48 | ||||
-rw-r--r-- | gdk/x11/gdkscreen-x11.h | 6 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 356 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.h | 8 | ||||
-rw-r--r-- | gdk/x11/gdkvulkancontext-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkx11display.h | 2 | ||||
-rw-r--r-- | gdk/x11/xsettings-client.c | 6 |
21 files changed, 513 insertions, 513 deletions
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 |