summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2018-03-20 15:14:10 +0100
committerAlexander Larsson <alexl@redhat.com>2018-03-20 15:14:10 +0100
commit3dce0dcca705c4ab6d8c4f5067db93947184b6af (patch)
tree8de99e5b35abc5242accafb84d0526b08c66b9e7 /gdk
parent9a7e721181ce714ab248429dc1258984b9e10748 (diff)
downloadgtk+-3dce0dcca705c4ab6d8c4f5067db93947184b6af.tar.gz
GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is that event.window is now event.surface.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdk-private.h10
-rw-r--r--gdk/gdkcairo.c4
-rw-r--r--gdk/gdkcairo.h2
-rw-r--r--gdk/gdkdevice.c130
-rw-r--r--gdk/gdkdevice.h10
-rw-r--r--gdk/gdkdeviceprivate.h26
-rw-r--r--gdk/gdkdisplay.c108
-rw-r--r--gdk/gdkdisplay.h2
-rw-r--r--gdk/gdkdisplayprivate.h22
-rw-r--r--gdk/gdkdnd.c20
-rw-r--r--gdk/gdkdnd.h2
-rw-r--r--gdk/gdkdrawcontext.c36
-rw-r--r--gdk/gdkdrawingcontext.c38
-rw-r--r--gdk/gdkevents.c62
-rw-r--r--gdk/gdkevents.h66
-rw-r--r--gdk/gdkeventsprivate.h90
-rw-r--r--gdk/gdkgl.c50
-rw-r--r--gdk/gdkglcontext.c16
-rw-r--r--gdk/gdkgltexture.c12
-rw-r--r--gdk/gdkinternals.h56
-rw-r--r--gdk/gdkmonitor.c2
-rw-r--r--gdk/gdkpaintable.c2
-rw-r--r--gdk/gdkpango.c4
-rw-r--r--gdk/gdkseat.c20
-rw-r--r--gdk/gdkseat.h10
-rw-r--r--gdk/gdkseatdefault.c16
-rw-r--r--gdk/gdkseatprivate.h2
-rw-r--r--gdk/gdksurface.c3562
-rw-r--r--gdk/gdksurface.h382
-rw-r--r--gdk/gdksurfaceimpl.c68
-rw-r--r--gdk/gdksurfaceimpl.h154
-rw-r--r--gdk/gdktypes.h24
-rw-r--r--gdk/gdkvulkancontext.c30
-rw-r--r--gdk/quartz/gdkevents-quartz.c10
-rw-r--r--gdk/wayland/gdkdevice-wayland.c226
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c4
-rw-r--r--gdk/wayland/gdkdnd-wayland.c66
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c52
-rw-r--r--gdk/wayland/gdkglcontext-wayland.h2
-rw-r--r--gdk/wayland/gdkprivate-wayland.h34
-rw-r--r--gdk/wayland/gdksurface-wayland.c1268
-rw-r--r--gdk/wayland/gdkvulkancontext-wayland.c14
-rw-r--r--gdk/wayland/gdkwaylandsurface.h16
-rw-r--r--gdk/win32/gdkevents-win32.c8
-rw-r--r--gdk/x11/gdkdevice-core-x11.c108
-rw-r--r--gdk/x11/gdkdevice-xi2.c86
-rw-r--r--gdk/x11/gdkdevicemanager-core-x11.c112
-rw-r--r--gdk/x11/gdkdevicemanager-xi2.c98
-rw-r--r--gdk/x11/gdkdisplay-x11.c170
-rw-r--r--gdk/x11/gdkdnd-x11.c186
-rw-r--r--gdk/x11/gdkeventsource.c46
-rw-r--r--gdk/x11/gdkeventtranslator.c10
-rw-r--r--gdk/x11/gdkeventtranslator.h4
-rw-r--r--gdk/x11/gdkgeometry-x11.c34
-rw-r--r--gdk/x11/gdkglcontext-x11.c76
-rw-r--r--gdk/x11/gdkmain-x11.c26
-rw-r--r--gdk/x11/gdkmonitor-x11.c10
-rw-r--r--gdk/x11/gdkscreen-x11.c4
-rw-r--r--gdk/x11/gdksurface-x11.c1510
-rw-r--r--gdk/x11/gdkx11surface.h18
-rw-r--r--gdk/x11/gdkxid.c8
61 files changed, 4622 insertions, 4622 deletions
diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h
index a2b4b27a93..b037d66092 100644
--- a/gdk/gdk-private.h
+++ b/gdk/gdk-private.h
@@ -10,17 +10,17 @@ GdkDisplay * gdk_display_open_default (void);
gboolean gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device,
- GdkSurface **grab_window,
+ GdkSurface **grab_surface,
gboolean *owner_events);
void gdk_pre_parse (void);
-void gdk_surface_freeze_toplevel_updates (GdkSurface *window);
-void gdk_surface_thaw_toplevel_updates (GdkSurface *window);
+void gdk_surface_freeze_toplevel_updates (GdkSurface *surface);
+void gdk_surface_thaw_toplevel_updates (GdkSurface *surface);
-gboolean gdk_surface_supports_edge_constraints (GdkSurface *window);
+gboolean gdk_surface_supports_edge_constraints (GdkSurface *surface);
-void gdk_surface_move_to_rect (GdkSurface *window,
+void gdk_surface_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index 6c9e28726e..548e87bf80 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -240,8 +240,8 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
/**
* gdk_cairo_surface_create_from_pixbuf:
* @pixbuf: a #GdkPixbuf
- * @scale: the scale of the new surface, or 0 to use same as @window
- * @for_surface: (allow-none): The window this will be drawn to, or %NULL
+ * @scale: the scale of the new surface, or 0 to use same as @surface
+ * @for_surface: (allow-none): The surface this will be drawn to, or %NULL
*
* Creates an image surface with the same contents as
* the pixbuf.
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index a6de1055f6..ebac127107 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -61,7 +61,7 @@ cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pi
GdkSurface *for_surface);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_draw_from_gl (cairo_t *cr,
- GdkSurface *window,
+ GdkSurface *surface,
int source,
int source_type,
int buffer_scale,
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 82c39aa44b..54bcc0b344 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -502,30 +502,30 @@ gdk_device_get_property (GObject *object,
/**
* gdk_device_get_state: (skip)
* @device: a #GdkDevice.
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
* @axes: (nullable) (array): an array of doubles to store the values of
* the axes of @device in, or %NULL.
* @mask: (optional) (out): location to store the modifiers, or %NULL.
*
- * Gets the current state of a pointer device relative to @window. As a slave
+ * Gets the current state of a pointer device relative to @surface. As a slave
* device’s coordinates are those of its master pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them. See gdk_device_grab().
*/
void
gdk_device_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
if (GDK_DEVICE_GET_CLASS (device)->get_state)
- GDK_DEVICE_GET_CLASS (device)->get_state (device, window, axes, mask);
+ GDK_DEVICE_GET_CLASS (device)->get_state (device, surface, axes, mask);
}
/**
@@ -597,12 +597,12 @@ gdk_device_get_position (GdkDevice *device,
* gdk_device_get_surface_at_position_double:
* @device: pointer #GdkDevice to query info to.
* @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * relative to the surface origin, or %NULL.
* @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * relative to the surface origin, or %NULL.
*
- * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y in
- * double precision. Returns %NULL if the window tree under @device is not known to GDK (for example,
+ * Obtains the surface underneath @device, returning the location of the device in @win_x and @win_y in
+ * double precision. Returns %NULL if the surface tree under @device is not known to GDK (for example,
* belongs to another application).
*
* As a slave device coordinates are those of its master pointer, This
@@ -618,19 +618,19 @@ gdk_device_get_surface_at_position_double (GdkDevice *device,
gdouble *win_y)
{
gdouble tmp_x, tmp_y;
- GdkSurface *window;
+ GdkSurface *surface;
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
- window = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
+ surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
- /* This might need corrections, as the native window returned
+ /* This might need corrections, as the native surface returned
may contain client side children */
- if (window)
- window = _gdk_surface_find_descendant_at (window,
+ if (surface)
+ surface = _gdk_surface_find_descendant_at (surface,
tmp_x, tmp_y,
&tmp_x, &tmp_y);
@@ -639,19 +639,19 @@ gdk_device_get_surface_at_position_double (GdkDevice *device,
if (win_y)
*win_y = tmp_y;
- return window;
+ return surface;
}
/**
* gdk_device_get_surface_at_position:
* @device: pointer #GdkDevice to query info to.
* @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * relative to the surface origin, or %NULL.
* @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * relative to the surface origin, or %NULL.
*
- * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
- * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
+ * Obtains the surface underneath @device, returning the location of the device in @win_x and @win_y. Returns
+ * %NULL if the surface tree under @device is not known to GDK (for example, belongs to another application).
*
* As a slave device coordinates are those of its master pointer, This
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
@@ -666,9 +666,9 @@ gdk_device_get_surface_at_position (GdkDevice *device,
gint *win_y)
{
gdouble tmp_x, tmp_y;
- GdkSurface *window;
+ GdkSurface *surface;
- window =
+ surface =
gdk_device_get_surface_at_position_double (device, &tmp_x, &tmp_y);
if (win_x)
@@ -676,13 +676,13 @@ gdk_device_get_surface_at_position (GdkDevice *device,
if (win_y)
*win_y = round (tmp_y);
- return window;
+ return surface;
}
/**
* gdk_device_get_history: (skip)
* @device: a #GdkDevice
- * @window: the window with respect to which which the event coordinates will be reported
+ * @surface: the surface with respect to which which the event coordinates will be reported
* @start: starting timestamp for range of events to return
* @stop: ending timestamp for the range of events to return
* @events: (array length=n_events) (out) (transfer full) (optional):
@@ -707,7 +707,7 @@ gdk_device_get_surface_at_position (GdkDevice *device,
**/
gboolean
gdk_device_get_history (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -715,7 +715,7 @@ gdk_device_get_history (GdkDevice *device,
{
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
if (n_events)
*n_events = 0;
@@ -723,13 +723,13 @@ gdk_device_get_history (GdkDevice *device,
if (events)
*events = NULL;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return FALSE;
if (!GDK_DEVICE_GET_CLASS (device)->get_history)
return FALSE;
- return GDK_DEVICE_GET_CLASS (device)->get_history (device, window,
+ return GDK_DEVICE_GET_CLASS (device)->get_history (device, surface,
start, stop,
events, n_events);
}
@@ -838,7 +838,7 @@ gdk_device_get_mode (GdkDevice *device)
*
* Sets a the mode of an input device. The mode controls if the
* device is active and whether the device’s range is mapped to the
- * entire screen or to a single window.
+ * entire screen or to a single surface.
*
* Note: This is only meaningful for floating devices, master devices (and
* slaves connected to these) drive the pointer cursor, which is not limited
@@ -1311,19 +1311,19 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
* or gdk_event_get_device() if the grab is in reaction to an event. Also, you can use
* gdk_seat_get_pointer() but only in code that isn’t triggered by a
* #GdkEvent and there aren’t other means to get a meaningful #GdkDevice to operate on.
- * @window: the #GdkSurface which will own the grab (the grab window)
+ * @surface: the #GdkSurface which will own the grab (the grab surface)
* @grab_ownership: specifies the grab ownership.
* @owner_events: if %FALSE then all device events are reported with respect to
- * @window and are only reported if selected by @event_mask. If
+ * @surface and are only reported if selected by @event_mask. If
* %TRUE then pointer events for this application are reported
* as normal, but pointer events outside this application are
- * reported with respect to @window and only if selected by
+ * reported with respect to @surface and only if selected by
* @event_mask. In either mode, unreported events are discarded.
* @event_mask: specifies the event mask, which is used in accordance with
* @owner_events.
* @cursor: (allow-none): the cursor to display while the grab is active if the device is
* a pointer. If this is %NULL then the normal cursors are used for
- * @window and its descendants, and the cursor for @window is used
+ * @surface and its descendants, and the cursor for @surface is used
* elsewhere.
* @time_: the timestamp of the event which led to this pointer grab. This
* usually comes from the #GdkEvent struct, though %GDK_CURRENT_TIME
@@ -1331,10 +1331,10 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
*
* Grabs the device so that all events coming from this device are passed to
* this application until the device is ungrabbed with gdk_device_ungrab(),
- * or the window becomes unviewable. This overrides any previous grab on the device
+ * or the surface becomes unviewable. This overrides any previous grab on the device
* by this client.
*
- * Note that @device and @window need to be on the same display.
+ * Note that @device and @surface need to be on the same display.
*
* Device grabs are used for operations which need complete control over the
* given device events (either pointer or keyboard). For example in GTK+ this
@@ -1344,7 +1344,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
* and button release events, then a button press event will cause an automatic
* pointer grab until the button is released. X does this automatically since
* most applications expect to receive button press and release events in pairs.
- * It is equivalent to a pointer grab on the window with @owner_events set to
+ * It is equivalent to a pointer grab on the surface with @owner_events set to
* %TRUE.
*
* If you set up anything at the time you take the grab that needs to be
@@ -1357,7 +1357,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
**/
GdkGrabStatus
gdk_device_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
@@ -1368,10 +1368,10 @@ gdk_device_grab (GdkDevice *device,
GdkSurface *native;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
- g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_GRAB_FAILED);
- g_return_val_if_fail (gdk_surface_get_display (window) == gdk_device_get_display (device), GDK_GRAB_FAILED);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_GRAB_FAILED);
+ g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_device_get_display (device), GDK_GRAB_FAILED);
- native = gdk_surface_get_toplevel (window);
+ native = gdk_surface_get_toplevel (surface);
if (native == NULL || GDK_SURFACE_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE;
@@ -1389,12 +1389,12 @@ gdk_device_grab (GdkDevice *device,
GdkDisplay *display;
gulong serial;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
serial = _gdk_display_get_next_serial (display);
_gdk_display_add_device_grab (display,
device,
- window,
+ surface,
native,
grab_ownership,
owner_events,
@@ -1432,7 +1432,7 @@ gdk_device_ungrab (GdkDevice *device,
* @y: the Y coordinate of the destination.
*
* Warps @device in @display to the point @x,@y,
- * unless the device is confined to a window by a grab,
+ * unless the device is confined to a surface by a grab,
* in which case it will be moved
* as far as allowed by the grab. Warping the pointer
* creates events as if the user had moved the mouse
@@ -1567,7 +1567,7 @@ find_axis_info (GArray *array,
gboolean
_gdk_device_translate_surface_coord (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint index_,
gdouble value,
gdouble *axis_value)
@@ -1580,7 +1580,7 @@ _gdk_device_translate_surface_coord (GdkDevice *device,
gdouble x_min, y_min;
gdouble x_resolution, y_resolution;
gdouble device_aspect;
- gint window_width, window_height;
+ gint surface_width, surface_height;
if (index_ >= device->axes->len)
return FALSE;
@@ -1608,8 +1608,8 @@ _gdk_device_translate_surface_coord (GdkDevice *device,
x_min = axis_info_x->min_value;
y_min = axis_info_y->min_value;
- window_width = gdk_surface_get_width (window);
- window_height = gdk_surface_get_height (window);
+ surface_width = gdk_surface_get_width (surface);
+ surface_height = gdk_surface_get_height (surface);
x_resolution = axis_info_x->resolution;
y_resolution = axis_info_y->resolution;
@@ -1633,23 +1633,23 @@ _gdk_device_translate_surface_coord (GdkDevice *device,
device_aspect = (device_height * y_resolution) /
(device_width * x_resolution);
- if (device_aspect * window_width >= window_height)
+ if (device_aspect * surface_width >= surface_height)
{
- /* device taller than window */
- x_scale = window_width / device_width;
+ /* device taller than surface */
+ x_scale = surface_width / device_width;
y_scale = (x_scale * x_resolution) / y_resolution;
x_offset = 0;
- y_offset = - (device_height * y_scale - window_height) / 2;
+ y_offset = - (device_height * y_scale - surface_height) / 2;
}
else
{
- /* window taller than device */
- y_scale = window_height / device_height;
+ /* surface taller than device */
+ y_scale = surface_height / device_height;
x_scale = (y_scale * y_resolution) / x_resolution;
y_offset = 0;
- x_offset = - (device_width * x_scale - window_width) / 2;
+ x_offset = - (device_width * x_scale - surface_width) / 2;
}
if (axis_value)
@@ -1665,9 +1665,9 @@ _gdk_device_translate_surface_coord (GdkDevice *device,
gboolean
_gdk_device_translate_screen_coord (GdkDevice *device,
- GdkSurface *window,
- gdouble window_root_x,
- gdouble window_root_y,
+ GdkSurface *surface,
+ gdouble surface_root_x,
+ gdouble surface_root_y,
gdouble screen_width,
gdouble screen_height,
guint index_,
@@ -1698,7 +1698,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
else
scale = 1;
- offset = - window_root_x - window->abs_x;
+ offset = - surface_root_x - surface->abs_x;
}
else
{
@@ -1707,7 +1707,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
else
scale = 1;
- offset = - window_root_y - window->abs_y;
+ offset = - surface_root_y - surface->abs_y;
}
if (axis_value)
@@ -1746,8 +1746,8 @@ _gdk_device_translate_axis (GdkDevice *device,
void
_gdk_device_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -1755,8 +1755,8 @@ _gdk_device_query_state (GdkDevice *device,
GdkModifierType *mask)
{
GDK_DEVICE_GET_CLASS (device)->query_state (device,
- window,
- child_window,
+ surface,
+ child_surface,
root_x,
root_y,
win_x,
@@ -1782,13 +1782,13 @@ _gdk_device_surface_at_position (GdkDevice *device,
* gdk_device_get_last_event_surface:
* @device: a #GdkDevice, with a source other than %GDK_SOURCE_KEYBOARD
*
- * Gets information about which window the given pointer device is in, based on events
+ * Gets information about which surface the given pointer device is in, based on events
* that have been received so far from the display server. If another application
* has a pointer grab, or this application has a grab with owner_events = %FALSE,
* %NULL may be returned even if the pointer is physically over one of this
- * application's windows.
+ * application's surfaces.
*
- * Returns: (transfer none) (allow-none): the last window the device
+ * Returns: (transfer none) (allow-none): the last surface the device
*/
GdkSurface *
gdk_device_get_last_event_surface (GdkDevice *device)
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 044b790448..c52ddababa 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -74,9 +74,9 @@ typedef enum
* @GDK_MODE_SCREEN: the device is enabled. The device’s coordinate space
* maps to the entire screen.
* @GDK_MODE_SURFACE: the device is enabled. The device’s coordinate space
- * is mapped to a single window. The manner in which this window
+ * is mapped to a single surface. The manner in which this surface
* is chosen is undefined, but it will typically be the same
- * way in which the focus window for key events is determined.
+ * way in which the focus surface for key events is determined.
*
* An enumeration that describes the mode of an input device.
*/
@@ -163,7 +163,7 @@ void gdk_device_set_axis_use (GdkDevice *device,
GDK_AVAILABLE_IN_ALL
void gdk_device_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
@@ -188,7 +188,7 @@ GdkSurface *
gdouble *win_y);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_history (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -225,7 +225,7 @@ GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
GDK_DEPRECATED_FOR(gdk_seat_grab)
GdkGrabStatus gdk_device_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index 69b50d537e..1614970834 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -71,34 +71,34 @@ struct _GdkDeviceClass
GObjectClass parent_class;
gboolean (* get_history) (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
void (* get_state) (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
void (* set_surface_cursor) (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor);
void (* warp) (GdkDevice *device,
gdouble x,
gdouble y);
void (* query_state) (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
GdkGrabStatus (* grab) (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -113,7 +113,7 @@ struct _GdkDeviceClass
GdkModifierType *mask,
gboolean get_toplevel);
void (* select_surface_events) (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask);
};
@@ -139,15 +139,15 @@ void _gdk_device_set_keys (GdkDevice *device,
guint num_keys);
gboolean _gdk_device_translate_surface_coord (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint index,
gdouble value,
gdouble *axis_value);
gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
- GdkSurface *window,
- gdouble window_root_x,
- gdouble window_root_y,
+ GdkSurface *surface,
+ gdouble surface_root_x,
+ gdouble surface_root_y,
gdouble screen_width,
gdouble screen_height,
guint index,
@@ -167,8 +167,8 @@ void _gdk_device_add_slave (GdkDevice *device,
void _gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index fad14e6be8..d8ca382e9e 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -335,7 +335,7 @@ free_pointer_info (GdkPointerSurfaceInfo *info)
static void
free_device_grab (GdkDeviceGrabInfo *info)
{
- g_object_unref (info->window);
+ g_object_unref (info->surface);
g_object_unref (info->native_surface);
g_free (info);
}
@@ -516,22 +516,22 @@ gdk_display_put_event (GdkDisplay *display,
static void
generate_grab_broken_event (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkDevice *device,
gboolean implicit,
- GdkSurface *grab_window)
+ GdkSurface *grab_surface)
{
- g_return_if_fail (window != NULL);
+ g_return_if_fail (surface != NULL);
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
GdkEvent *event;
event = gdk_event_new (GDK_GRAB_BROKEN);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = FALSE;
event->grab_broken.implicit = implicit;
- event->grab_broken.grab_window = grab_window;
+ event->grab_broken.grab_surface = grab_surface;
gdk_event_set_device (event, device);
event->grab_broken.keyboard = (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) ? TRUE : FALSE;
@@ -559,7 +559,7 @@ _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDeviceGrabInfo *
_gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *native_surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
@@ -573,7 +573,7 @@ _gdk_display_add_device_grab (GdkDisplay *display,
info = g_new0 (GdkDeviceGrabInfo, 1);
- info->window = g_object_ref (window);
+ info->surface = g_object_ref (surface);
info->native_surface = g_object_ref (native_surface);
info->serial_start = serial_start;
info->serial_end = G_MAXULONG;
@@ -626,23 +626,23 @@ get_current_toplevel (GdkDisplay *display,
int *y_out,
GdkModifierType *state_out)
{
- GdkSurface *pointer_window;
+ GdkSurface *pointer_surface;
gdouble x, y;
GdkModifierType state;
- pointer_window = _gdk_device_surface_at_position (device, &x, &y, &state, TRUE);
+ pointer_surface = _gdk_device_surface_at_position (device, &x, &y, &state, TRUE);
- if (pointer_window != NULL &&
- (GDK_SURFACE_DESTROYED (pointer_window) ||
- GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_ROOT ||
- GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_FOREIGN))
- pointer_window = NULL;
+ if (pointer_surface != NULL &&
+ (GDK_SURFACE_DESTROYED (pointer_surface) ||
+ GDK_SURFACE_TYPE (pointer_surface) == GDK_SURFACE_ROOT ||
+ GDK_SURFACE_TYPE (pointer_surface) == GDK_SURFACE_FOREIGN))
+ pointer_surface = NULL;
*x_out = round (x);
*y_out = round (y);
*state_out = state;
- return pointer_window;
+ return pointer_surface;
}
static void
@@ -670,9 +670,9 @@ switch_to_pointer_grab (GdkDisplay *display,
/* New grab is in effect */
if (!grab->implicit)
{
- /* !owner_event Grabbing a window that we're not inside, current status is
- now NULL (i.e. outside grabbed window) */
- if (!grab->owner_events && info->surface_under_pointer != grab->window)
+ /* !owner_event Grabbing a surface that we're not inside, current status is
+ now NULL (i.e. outside grabbed surface) */
+ if (!grab->owner_events && info->surface_under_pointer != grab->surface)
_gdk_display_set_surface_under_pointer (display, device, NULL);
}
@@ -767,11 +767,11 @@ _gdk_display_device_grab_update (GdkDisplay *display,
}
if ((next_grab == NULL && current_grab->implicit_ungrab) ||
- (next_grab != NULL && current_grab->window != next_grab->window))
- generate_grab_broken_event (display, GDK_SURFACE (current_grab->window),
+ (next_grab != NULL && current_grab->surface != next_grab->surface))
+ generate_grab_broken_event (display, GDK_SURFACE (current_grab->surface),
device,
current_grab->implicit,
- next_grab? next_grab->window : NULL);
+ next_grab? next_grab->surface : NULL);
/* Remove old grab */
grabs = g_list_delete_link (grabs, grabs);
@@ -832,7 +832,7 @@ _gdk_display_has_device_grab (GdkDisplay *display,
/* Returns true if last grab was ended
* If if_child is non-NULL, end the grab only if the grabbed
- * window is the same as if_child or a descendant of it */
+ * surface is the same as if_child or a descendant of it */
gboolean
_gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device,
@@ -851,7 +851,7 @@ _gdk_display_end_device_grab (GdkDisplay *display,
grab = l->data;
if (grab &&
(if_child == NULL ||
- _gdk_surface_event_parent_of (if_child, grab->window)))
+ _gdk_surface_event_parent_of (if_child, grab->surface)))
{
grab->serial_end = serial;
grab->implicit_ungrab = implicit;
@@ -962,7 +962,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
* gdk_device_grab_info:
* @display: the display for which to get the grab information
* @device: device to get the grab information from
- * @grab_window: (out) (transfer none): location to store current grab window
+ * @grab_surface: (out) (transfer none): location to store current grab surface
* @owner_events: (out): location to store boolean indicating whether
* the @owner_events flag to gdk_device_grab() was %TRUE.
*
@@ -975,7 +975,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
gboolean
gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device,
- GdkSurface **grab_window,
+ GdkSurface **grab_surface,
gboolean *owner_events)
{
GdkDeviceGrabInfo *info;
@@ -987,8 +987,8 @@ gdk_device_grab_info (GdkDisplay *display,
if (info)
{
- if (grab_window)
- *grab_window = info->window;
+ if (grab_surface)
+ *grab_surface = info->surface;
if (owner_events)
*owner_events = info->owner_events;
@@ -1103,11 +1103,11 @@ gdk_display_flush (GdkDisplay *display)
* gdk_display_get_default_group:
* @display: a #GdkDisplay
*
- * Returns the default group leader window for all toplevel windows
- * on @display. This window is implicitly created by GDK.
+ * Returns the default group leader surface for all toplevel surfaces
+ * on @display. This surface is implicitly created by GDK.
* See gdk_surface_set_group().
*
- * Returns: (transfer none): The default group leader window
+ * Returns: (transfer none): The default group leader surface
* for @display
**/
GdkSurface *
@@ -1180,9 +1180,9 @@ gdk_display_supports_shapes (GdkDisplay *display)
* @display: a #GdkDisplay
*
* Returns %TRUE if gdk_surface_input_shape_combine_mask() can
- * be used to modify the input shape of windows on @display.
+ * be used to modify the input shape of surfaces on @display.
*
- * Returns: %TRUE if windows with modified input shape are supported
+ * Returns: %TRUE if surfaces with modified input shape are supported
*/
gboolean
gdk_display_supports_input_shapes (GdkDisplay *display)
@@ -1315,20 +1315,20 @@ _gdk_display_event_data_free (GdkDisplay *display,
void
_gdk_display_create_surface_impl (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes)
{
GDK_DISPLAY_GET_CLASS (display)->create_surface_impl (display,
- window,
+ surface,
real_parent,
event_mask,
attributes);
}
GdkSurface *
-_gdk_display_create_window (GdkDisplay *display)
+_gdk_display_create_surface (GdkDisplay *display)
{
return g_object_new (GDK_DISPLAY_GET_CLASS (display)->surface_type,
"display", display,
@@ -1383,7 +1383,7 @@ gdk_display_set_debug_flags (GdkDisplay *display,
* gdk_display_is_composited:
* @display: a #GdkDisplay
*
- * Returns whether windows can reasonably be expected to have
+ * Returns whether surfaces can reasonably be expected to have
* their alpha channel drawn correctly on the screen. Check
* gdk_display_is_rgba() for wether the display supports an
* alpha channel.
@@ -1393,7 +1393,7 @@ gdk_display_set_debug_flags (GdkDisplay *display,
*
* On modern displays, this value is always %TRUE.
*
- * Returns: Whether windows with RGBA visuals can reasonably be
+ * Returns: Whether surfaces with RGBA visuals can reasonably be
* expected to have their alpha channels drawn correctly on the screen.
**/
gboolean
@@ -1422,22 +1422,22 @@ gdk_display_set_composited (GdkDisplay *display,
* gdk_display_is_rgba:
* @display: a #GdkDisplay
*
- * Returns wether windows on this @display are created with an
+ * Returns wether surfaces on this @display are created with an
* alpha channel.
*
* Even if a %TRUE is returned, it is possible that the
- * window’s alpha channel won’t be honored when displaying the
- * window on the screen: in particular, for X an appropriate
+ * surface’s alpha channel won’t be honored when displaying the
+ * surface on the screen: in particular, for X an appropriate
* windowing manager and compositing manager must be running to
* provide appropriate display. Use gdk_display_is_composited()
* to check if that is the case.
*
- * For setting an overall opacity for a top-level window, see
+ * For setting an overall opacity for a top-level surface, see
* gdk_surface_set_opacity().
*
* On modern displays, this value is always %TRUE.
*
- * Returns: %TRUE if windows are created with an alpha channel or
+ * Returns: %TRUE if surfaces are created with an alpha channel or
* %FALSE if the display does not support this functionality.
**/
gboolean
@@ -1593,8 +1593,8 @@ gdk_display_get_monitor (GdkDisplay *display,
* Gets the primary monitor for the display.
*
* The primary monitor is considered the monitor where the “main desktop”
- * lives. While normal application windows typically allow the window
- * manager to place the windows, specialized desktop applications
+ * lives. While normal application surfaces typically allow the window
+ * manager to place the surfaces, specialized desktop applications
* such as panels should place themselves on the primary monitor.
*
* If no monitor is the designated primary monitor, any monitor
@@ -1675,17 +1675,17 @@ gdk_display_get_monitor_at_point (GdkDisplay *display,
/**
* gdk_display_get_monitor_at_surface:
* @display: a #GdkDisplay
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the monitor in which the largest area of @window
- * resides, or a monitor close to @window if it is outside
+ * Gets the monitor in which the largest area of @surface
+ * resides, or a monitor close to @surface if it is outside
* of all monitors.
*
- * Returns: (transfer none): the monitor with the largest overlap with @window
+ * Returns: (transfer none): the monitor with the largest overlap with @surface
*/
GdkMonitor *
gdk_display_get_monitor_at_surface (GdkDisplay *display,
- GdkSurface *window)
+ GdkSurface *surface)
{
GdkRectangle win;
int n_monitors, i;
@@ -1698,14 +1698,14 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display,
class = GDK_DISPLAY_GET_CLASS (display);
if (class->get_monitor_at_surface)
{
- best = class->get_monitor_at_surface (display, window);
+ best = class->get_monitor_at_surface (display, surface);
if (best)
return best;
}
- gdk_surface_get_geometry (window, &win.x, &win.y, &win.width, &win.height);
- gdk_surface_get_origin (window, &win.x, &win.y);
+ gdk_surface_get_geometry (surface, &win.x, &win.y, &win.width, &win.height);
+ gdk_surface_get_origin (surface, &win.x, &win.y);
n_monitors = gdk_display_get_n_monitors (display);
for (i = 0; i < n_monitors; i++)
diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h
index 94e40f0164..b9f5d71fd8 100644
--- a/gdk/gdkdisplay.h
+++ b/gdk/gdkdisplay.h
@@ -117,7 +117,7 @@ GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display,
int y);
GDK_AVAILABLE_IN_ALL
GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display,
- GdkSurface *window);
+ GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GdkKeymap * gdk_display_get_keymap (GdkDisplay *display);
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index f885f33400..db2ec347d7 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -40,7 +40,7 @@ typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the device grab on this display */
typedef struct
{
- GdkSurface *window;
+ GdkSurface *surface;
GdkSurface *native_surface;
gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */
@@ -54,16 +54,16 @@ typedef struct
guint implicit : 1;
} GdkDeviceGrabInfo;
-/* Tracks information about which window and position the pointer last was in.
+/* Tracks information about which surface and position the pointer last was in.
* This is useful when we need to synthesize events later.
* Note that we track toplevel_under_pointer using enter/leave events,
* so in the case of a grab, either with owner_events==FALSE or with the
- * pointer in no clients window the x/y coordinates may actually be outside
- * the window.
+ * pointer in no clients surface the x/y coordinates may actually be outside
+ * the surface.
*/
typedef struct
{
- GdkSurface *surface_under_pointer; /* window that last got a normal enter event */
+ GdkSurface *surface_under_pointer; /* surface that last got a normal enter event */
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
@@ -114,7 +114,7 @@ struct _GdkDisplayClass
{
GObjectClass parent_class;
- GType surface_type; /* type for native windows for this display, set in class_init */
+ GType surface_type; /* type for native surfaces for this display, set in class_init */
GType vk_context_type; /* type for GdkVulkanContext, must be set if vk_extension_name != NULL */
const char *vk_extension_name; /* Name of required windowing vulkan extension or %NULL (default) if Vulkan isn't supported */
@@ -141,7 +141,7 @@ struct _GdkDisplayClass
void (*event_data_free) (GdkDisplay *display,
GdkEvent *event);
void (*create_surface_impl) (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes);
@@ -167,7 +167,7 @@ struct _GdkDisplayClass
int index);
GdkMonitor * (*get_primary_monitor) (GdkDisplay *display);
GdkMonitor * (*get_monitor_at_surface) (GdkDisplay *display,
- GdkSurface *window);
+ GdkSurface *surface);
gboolean (*get_setting) (GdkDisplay *display,
const char *name,
GValue *value);
@@ -198,7 +198,7 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDevice *device);
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *native_surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
@@ -231,11 +231,11 @@ void _gdk_display_event_data_copy (GdkDisplay *display
void _gdk_display_event_data_free (GdkDisplay *display,
GdkEvent *event);
void _gdk_display_create_surface_impl (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes);
-GdkSurface * _gdk_display_create_window (GdkDisplay *display);
+GdkSurface * _gdk_display_create_surface (GdkDisplay *display);
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 219f759ef3..8a7f16c355 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -190,7 +190,7 @@ gdk_drag_context_get_source_surface (GdkDragContext *context)
* gdk_drag_context_get_dest_surface:
* @context: a #GdkDragContext
*
- * Returns the destination window for the DND operation.
+ * Returns the destination surface for the DND operation.
*
* Returns: (transfer none): a #GdkSurface
**/
@@ -785,14 +785,14 @@ gdk_drop_read_finish (GdkDragContext *context,
* gdk_drag_context_get_drag_surface:
* @context: a #GdkDragContext
*
- * Returns the window on which the drag icon should be rendered
- * during the drag operation. Note that the window may not be
+ * Returns the surface on which the drag icon should be rendered
+ * during the drag operation. Note that the surface may not be
* available until the drag operation has begun. GDK will move
- * the window in accordance with the ongoing drag operation.
- * The window is owned by @context and will be destroyed when
+ * the surface in accordance with the ongoing drag operation.
+ * The surface is owned by @context and will be destroyed when
* the drag operation is over.
*
- * Returns: (nullable) (transfer none): the drag window, or %NULL
+ * Returns: (nullable) (transfer none): the drag surface, or %NULL
*/
GdkSurface *
gdk_drag_context_get_drag_surface (GdkDragContext *context)
@@ -808,12 +808,12 @@ gdk_drag_context_get_drag_surface (GdkDragContext *context)
/**
* gdk_drag_context_set_hotspot:
* @context: a #GdkDragContext
- * @hot_x: x coordinate of the drag window hotspot
- * @hot_y: y coordinate of the drag window hotspot
+ * @hot_x: x coordinate of the drag surface hotspot
+ * @hot_y: y coordinate of the drag surface hotspot
*
- * Sets the position of the drag window that will be kept
+ * Sets the position of the drag surface that will be kept
* under the cursor hotspot. Initially, the hotspot is at the
- * top left corner of the drag window.
+ * top left corner of the drag surface.
*/
void
gdk_drag_context_set_hotspot (GdkDragContext *context,
diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h
index aaa49b5faf..0cc1d33131 100644
--- a/gdk/gdkdnd.h
+++ b/gdk/gdkdnd.h
@@ -132,7 +132,7 @@ GInputStream * gdk_drop_read_finish (GdkDragContext *
/* Source side */
GDK_AVAILABLE_IN_ALL
-GdkDragContext * gdk_drag_begin (GdkSurface *window,
+GdkDragContext * gdk_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c
index bcd7004d8b..565dd307d5 100644
--- a/gdk/gdkdrawcontext.c
+++ b/gdk/gdkdrawcontext.c
@@ -36,7 +36,7 @@
*
* You will always interact with one of those s.ubclasses.
*
- * A GdkDrawContext is always associated with a single toplevel window.
+ * A GdkDrawContext is always associated with a single toplevel surface.
*/
/**
@@ -49,7 +49,7 @@
typedef struct _GdkDrawContextPrivate GdkDrawContextPrivate;
struct _GdkDrawContextPrivate {
- GdkSurface *window;
+ GdkSurface *surface;
guint is_drawing : 1;
};
@@ -58,7 +58,7 @@ enum {
PROP_0,
PROP_DISPLAY,
- PROP_WINDOW,
+ PROP_SURFACE,
LAST_PROP
};
@@ -73,7 +73,7 @@ gdk_draw_context_dispose (GObject *gobject)
GdkDrawContext *context = GDK_DRAW_CONTEXT (gobject);
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
- g_clear_object (&priv->window);
+ g_clear_object (&priv->surface);
G_OBJECT_CLASS (gdk_draw_context_parent_class)->dispose (gobject);
}
@@ -89,9 +89,9 @@ gdk_draw_context_set_property (GObject *gobject,
switch (prop_id)
{
- case PROP_WINDOW:
- priv->window = g_value_dup_object (value);
- g_assert (priv->window != NULL);
+ case PROP_SURFACE:
+ priv->surface = g_value_dup_object (value);
+ g_assert (priv->surface != NULL);
break;
default:
@@ -114,8 +114,8 @@ gdk_draw_context_get_property (GObject *gobject,
g_value_set_object (value, gdk_draw_context_get_display (context));
break;
- case PROP_WINDOW:
- g_value_set_object (value, priv->window);
+ case PROP_SURFACE:
+ g_value_set_object (value, priv->surface);
break;
default:
@@ -146,13 +146,13 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
G_PARAM_STATIC_STRINGS);
/**
- * GdkDrawContext:window:
+ * GdkDrawContext:surface:
*
* The #GdkSurface the gl context is bound to.
*/
- pspecs[PROP_WINDOW] =
- g_param_spec_object ("window",
- P_("Window"),
+ pspecs[PROP_SURFACE] =
+ g_param_spec_object ("surface",
+ P_("Surface"),
P_("The GDK surface bound to the context"),
GDK_TYPE_SURFACE,
G_PARAM_READWRITE |
@@ -171,8 +171,8 @@ gdk_draw_context_init (GdkDrawContext *self)
* gdk_draw_context_is_drawing:
* @context: a #GdkDrawContext
*
- * Returns %TRUE if @context is in the process of drawing to its window. In such
- * cases, it will have access to the window's backbuffer to render the new frame
+ * Returns %TRUE if @context is in the process of drawing to its surface. In such
+ * cases, it will have access to the surface's backbuffer to render the new frame
* onto it.
*
* Returns: %TRUE if the context is between begin_frame() and end_frame() calls.
@@ -194,7 +194,7 @@ gdk_draw_context_is_drawing (GdkDrawContext *context)
*
* The @context is free to update @region to the size that actually needs to
* be repainted. Contexts that do not support partial blits for example may
- * want to invalidate the whole window instead.
+ * want to invalidate the whole surface instead.
*
* The function does not clear the background. Clearing the backgroud is the
* job of the renderer. The contents of the backbuffer are undefined after this
@@ -257,7 +257,7 @@ gdk_draw_context_get_display (GdkDrawContext *context)
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
- return priv->window ? gdk_surface_get_display (priv->window) : NULL;
+ return priv->surface ? gdk_surface_get_display (priv->surface) : NULL;
}
/**
@@ -275,6 +275,6 @@ gdk_draw_context_get_surface (GdkDrawContext *context)
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
- return priv->window;
+ return priv->surface;
}
diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c
index 3fe2e7153a..671da31930 100644
--- a/gdk/gdkdrawingcontext.c
+++ b/gdk/gdkdrawingcontext.c
@@ -56,7 +56,7 @@
typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate;
struct _GdkDrawingContextPrivate {
- GdkSurface *window;
+ GdkSurface *surface;
GdkDrawContext *paint_context;
cairo_region_t *clip;
@@ -68,7 +68,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GdkDrawingContext, gdk_drawing_context, G_TYPE_OBJEC
enum {
PROP_0,
- PROP_WINDOW,
+ PROP_SURFACE,
PROP_CLIP,
PROP_PAINT_CONTEXT,
@@ -89,7 +89,7 @@ gdk_drawing_context_dispose (GObject *gobject)
if (priv->cr != NULL)
gdk_cairo_set_drawing_context (priv->cr, NULL);
- g_clear_object (&priv->window);
+ g_clear_object (&priv->surface);
g_clear_object (&priv->paint_context);
g_clear_pointer (&priv->clip, cairo_region_destroy);
g_clear_pointer (&priv->cr, cairo_destroy);
@@ -108,11 +108,11 @@ gdk_drawing_context_set_property (GObject *gobject,
switch (prop_id)
{
- case PROP_WINDOW:
- priv->window = g_value_dup_object (value);
- if (priv->window == NULL)
+ case PROP_SURFACE:
+ priv->surface = g_value_dup_object (value);
+ if (priv->surface == NULL)
{
- g_critical ("The drawing context of type %s does not have a window "
+ g_critical ("The drawing context of type %s does not have a surface "
"associated to it. Drawing contexts can only be created "
"using gdk_surface_begin_draw_frame().",
G_OBJECT_TYPE_NAME (gobject));
@@ -144,8 +144,8 @@ gdk_drawing_context_get_property (GObject *gobject,
switch (prop_id)
{
- case PROP_WINDOW:
- g_value_set_object (value, priv->window);
+ case PROP_SURFACE:
+ g_value_set_object (value, priv->surface);
break;
case PROP_CLIP:
@@ -171,12 +171,12 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass)
gobject_class->dispose = gdk_drawing_context_dispose;
/**
- * GdkDrawingContext:window:
+ * GdkDrawingContext:surface:
*
* The #GdkSurface that created the drawing context.
*/
- obj_property[PROP_WINDOW] =
- g_param_spec_object ("window", "Window", "The window that created the context",
+ obj_property[PROP_SURFACE] =
+ g_param_spec_object ("surface", "Surface", "The surface that created the context",
GDK_TYPE_SURFACE,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
@@ -263,7 +263,7 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
- g_return_val_if_fail (GDK_IS_SURFACE (priv->window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (priv->surface), NULL);
if (priv->paint_context != NULL)
return NULL;
@@ -273,12 +273,12 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
cairo_region_t *region;
cairo_surface_t *surface;
- surface = _gdk_surface_ref_cairo_surface (priv->window);
+ surface = _gdk_surface_ref_cairo_surface (priv->surface);
priv->cr = cairo_create (surface);
gdk_cairo_set_drawing_context (priv->cr, context);
- region = gdk_surface_get_current_paint_region (priv->window);
+ region = gdk_surface_get_current_paint_region (priv->surface);
cairo_region_union (region, priv->clip);
gdk_cairo_region (priv->cr, region);
cairo_clip (priv->cr);
@@ -294,7 +294,7 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
* gdk_drawing_context_get_surface:
* @context: a #GdkDrawingContext
*
- * Retrieves the window that created the drawing @context.
+ * Retrieves the surface that created the drawing @context.
*
* Returns: (transfer none): a #GdkSurface
*/
@@ -305,7 +305,7 @@ gdk_drawing_context_get_surface (GdkDrawingContext *context)
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
- return priv->window;
+ return priv->surface;
}
/**
@@ -362,10 +362,10 @@ gdk_drawing_context_is_valid (GdkDrawingContext *context)
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), FALSE);
- if (priv->window == NULL)
+ if (priv->surface == NULL)
return FALSE;
- if (gdk_surface_get_drawing_context (priv->window) != context)
+ if (gdk_surface_get_drawing_context (priv->surface) != context)
return FALSE;
return TRUE;
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 70c992b2f5..d7a7337d4c 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -372,12 +372,12 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
{
GList *tmp_list;
GList *pending_motions = NULL;
- GdkSurface *pending_motion_window = NULL;
+ GdkSurface *pending_motion_surface = NULL;
GdkDevice *pending_motion_device = NULL;
GdkEvent *last_motion = NULL;
/* If the last N events in the event queue are motion notify
- * events for the same window, drop all but the last */
+ * events for the same surface, drop all but the last */
tmp_list = display->queued_tail;
@@ -391,8 +391,8 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
if (event->any.type != GDK_MOTION_NOTIFY)
break;
- if (pending_motion_window != NULL &&
- pending_motion_window != event->any.window)
+ if (pending_motion_surface != NULL &&
+ pending_motion_surface != event->any.surface)
break;
if (pending_motion_device != NULL &&
@@ -402,7 +402,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
if (!last_motion)
last_motion = event;
- pending_motion_window = event->any.window;
+ pending_motion_surface = event->any.surface;
pending_motion_device = event->any.device;
pending_motions = tmp_list;
@@ -429,8 +429,8 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
pending_motions == display->queued_events &&
pending_motions == display->queued_tail)
{
- GdkFrameClock *clock = gdk_surface_get_frame_clock (pending_motion_window);
- if (clock) /* might be NULL if window was destroyed */
+ GdkFrameClock *clock = gdk_surface_get_frame_clock (pending_motion_surface);
+ if (clock) /* might be NULL if surface was destroyed */
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
}
}
@@ -619,8 +619,8 @@ gdk_event_copy (const GdkEvent *event)
EVENT_PAYLOAD (event),
EVENT_PAYLOAD_SIZE);
- if (new_event->any.window)
- g_object_ref (new_event->any.window);
+ if (new_event->any.surface)
+ g_object_ref (new_event->any.surface);
if (new_event->any.device)
g_object_ref (new_event->any.device);
if (new_event->any.source_device)
@@ -637,8 +637,8 @@ gdk_event_copy (const GdkEvent *event)
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
- if (event->crossing.subwindow != NULL)
- g_object_ref (event->crossing.subwindow);
+ if (event->crossing.child_surface != NULL)
+ g_object_ref (event->crossing.child_surface);
break;
case GDK_DRAG_ENTER:
@@ -723,7 +723,7 @@ gdk_event_finalize (GObject *object)
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
- g_clear_object (&event->crossing.subwindow);
+ g_clear_object (&event->crossing.child_surface);
break;
case GDK_DRAG_ENTER:
@@ -766,8 +766,8 @@ gdk_event_finalize (GObject *object)
if (display)
_gdk_display_event_data_free (display, event);
- if (event->any.window)
- g_object_unref (event->any.window);
+ if (event->any.surface)
+ g_object_unref (event->any.surface);
g_clear_object (&event->any.device);
g_clear_object (&event->any.source_device);
@@ -776,7 +776,7 @@ gdk_event_finalize (GObject *object)
}
/**
- * gdk_event_get_window:
+ * gdk_event_get_surface:
* @event: a #GdkEvent
*
* Extracts the #GdkSurface associated with an event.
@@ -784,11 +784,11 @@ gdk_event_finalize (GObject *object)
* Returns: (transfer none): The #GdkSurface associated with the event
*/
GdkSurface *
-gdk_event_get_window (const GdkEvent *event)
+gdk_event_get_surface (const GdkEvent *event)
{
g_return_val_if_fail (event != NULL, NULL);
- return event->any.window;
+ return event->any.surface;
}
/**
@@ -947,12 +947,12 @@ gdk_event_get_state (const GdkEvent *event,
/**
* gdk_event_get_coords:
* @event: a #GdkEvent
- * @x_win: (out) (optional): location to put event window x coordinate
- * @y_win: (out) (optional): location to put event window y coordinate
+ * @x_win: (out) (optional): location to put event surface x coordinate
+ * @y_win: (out) (optional): location to put event surface y coordinate
*
- * Extract the event window relative x/y coordinates from an event.
+ * Extract the event surface relative x/y coordinates from an event.
*
- * Returns: %TRUE if the event delivered event window coordinates
+ * Returns: %TRUE if the event delivered event surface coordinates
**/
gboolean
gdk_event_get_coords (const GdkEvent *event,
@@ -1673,13 +1673,13 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
GdkDisplay *display;
GdkModifierType modifier;
- g_return_val_if_fail (GDK_IS_SURFACE (bevent->any.window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (bevent->any.surface), FALSE);
if (bevent->button == GDK_BUTTON_SECONDARY &&
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
return TRUE;
- display = gdk_surface_get_display (bevent->any.window);
+ display = gdk_surface_get_display (bevent->any.surface);
modifier = gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display),
GDK_MODIFIER_INTENT_CONTEXT_MENU);
@@ -1847,8 +1847,8 @@ gdk_event_get_display (const GdkEvent *event)
if (event->any.display)
return event->any.display;
- if (event->any.window)
- return gdk_surface_get_display (event->any.window);
+ if (event->any.surface)
+ return gdk_surface_get_display (event->any.surface);
return NULL;
}
@@ -2326,24 +2326,24 @@ gdk_event_get_touch_emulating_pointer (const GdkEvent *event,
}
/**
- * gdk_event_get_grab_window:
+ * gdk_event_get_grab_surface:
* @event: a #GdkEvent
- * @window: (out) (transfer none): Return location for the grab window
+ * @surface: (out) (transfer none): Return location for the grab surface
*
- * Extracts the grab window from a grab broken event.
+ * Extracts the grab surface from a grab broken event.
*
* Returns: %TRUE on success, otherwise %FALSE
**/
gboolean
-gdk_event_get_grab_window (const GdkEvent *event,
- GdkSurface **window)
+gdk_event_get_grab_surface (const GdkEvent *event,
+ GdkSurface **surface)
{
if (!event)
return FALSE;
if (event->any.type == GDK_GRAB_BROKEN)
{
- *window = event->grab_broken.grab_window;
+ *surface = event->grab_broken.grab_surface;
return TRUE;
}
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index f312fb20c0..a014def3dd 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -56,7 +56,7 @@ G_BEGIN_DECLS
/**
* GDK_PRIORITY_REDRAW:
*
- * This is the priority that the idle handler processing window updates
+ * This is the priority that the idle handler processing surface updates
* is given in the
* [GLib Main Loop][glib-The-Main-Event-Loop].
*/
@@ -151,33 +151,33 @@ typedef void (*GdkEventFunc) (GdkEvent *event,
/**
* GdkEventType:
* @GDK_NOTHING: a special code to indicate a null event.
- * @GDK_DELETE: the window manager has requested that the toplevel window be
+ * @GDK_DELETE: the window manager has requested that the toplevel surface be
* hidden or destroyed, usually when the user clicks on a special icon in the
* title bar.
- * @GDK_DESTROY: the window has been destroyed.
- * @GDK_EXPOSE: all or part of the window has become visible and needs to be
+ * @GDK_DESTROY: the surface has been destroyed.
+ * @GDK_EXPOSE: all or part of the surface has become visible and needs to be
* redrawn.
* @GDK_MOTION_NOTIFY: the pointer (usually a mouse) has moved.
* @GDK_BUTTON_PRESS: a mouse button has been pressed.
* @GDK_BUTTON_RELEASE: a mouse button has been released.
* @GDK_KEY_PRESS: a key has been pressed.
* @GDK_KEY_RELEASE: a key has been released.
- * @GDK_ENTER_NOTIFY: the pointer has entered the window.
- * @GDK_LEAVE_NOTIFY: the pointer has left the window.
- * @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the window.
- * @GDK_CONFIGURE: the size, position or stacking order of the window has changed.
- * Note that GTK+ discards these events for %GDK_SURFACE_CHILD windows.
- * @GDK_MAP: the window has been mapped.
- * @GDK_UNMAP: the window has been unmapped.
+ * @GDK_ENTER_NOTIFY: the pointer has entered the surface.
+ * @GDK_LEAVE_NOTIFY: the pointer has left the surface.
+ * @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the surface.
+ * @GDK_CONFIGURE: the size, position or stacking order of the surface has changed.
+ * Note that GTK+ discards these events for %GDK_SURFACE_CHILD surfaces.
+ * @GDK_MAP: the surface has been mapped.
+ * @GDK_UNMAP: the surface has been unmapped.
* @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
* surface (e.g. a touchscreen or graphics tablet).
* @GDK_PROXIMITY_OUT: an input device has moved out of contact with a sensing
* surface.
- * @GDK_DRAG_ENTER: the mouse has entered the window while a drag is in progress.
- * @GDK_DRAG_LEAVE: the mouse has left the window while a drag is in progress.
- * @GDK_DRAG_MOTION: the mouse has moved in the window while a drag is in
+ * @GDK_DRAG_ENTER: the mouse has entered the surface while a drag is in progress.
+ * @GDK_DRAG_LEAVE: the mouse has left the surface while a drag is in progress.
+ * @GDK_DRAG_MOTION: the mouse has moved in the surface while a drag is in
* progress.
- * @GDK_DROP_START: a drop operation onto the window has started.
+ * @GDK_DROP_START: a drop operation onto the surface has started.
* @GDK_SCROLL: the scroll wheel was turned
* @GDK_GRAB_BROKEN: a pointer or keyboard grab was broken. This event type
* was added in 2.8.
@@ -286,10 +286,10 @@ typedef enum
/**
* GdkScrollDirection:
- * @GDK_SCROLL_UP: the window is scrolled up.
- * @GDK_SCROLL_DOWN: the window is scrolled down.
- * @GDK_SCROLL_LEFT: the window is scrolled to the left.
- * @GDK_SCROLL_RIGHT: the window is scrolled to the right.
+ * @GDK_SCROLL_UP: the surface is scrolled up.
+ * @GDK_SCROLL_DOWN: the surface is scrolled down.
+ * @GDK_SCROLL_LEFT: the surface is scrolled to the left.
+ * @GDK_SCROLL_RIGHT: the surface is scrolled to the right.
* @GDK_SCROLL_SMOOTH: the scrolling is determined by the delta values
* in scroll events. See gdk_event_get_scroll_deltas(). Since: 3.4
*
@@ -306,17 +306,17 @@ typedef enum
/**
* GdkNotifyType:
- * @GDK_NOTIFY_ANCESTOR: the window is entered from an ancestor or
+ * @GDK_NOTIFY_ANCESTOR: the surface is entered from an ancestor or
* left towards an ancestor.
* @GDK_NOTIFY_VIRTUAL: the pointer moves between an ancestor and an
- * inferior of the window.
- * @GDK_NOTIFY_INFERIOR: the window is entered from an inferior or
+ * inferior of the surface.
+ * @GDK_NOTIFY_INFERIOR: the surface is entered from an inferior or
* left towards an inferior.
- * @GDK_NOTIFY_NONLINEAR: the window is entered from or left towards
- * a window which is neither an ancestor nor an inferior.
- * @GDK_NOTIFY_NONLINEAR_VIRTUAL: the pointer moves between two windows
- * which are not ancestors of each other and the window is part of
- * the ancestor chain between one of these windows and their least
+ * @GDK_NOTIFY_NONLINEAR: the surface is entered from or left towards
+ * a surface which is neither an ancestor nor an inferior.
+ * @GDK_NOTIFY_NONLINEAR_VIRTUAL: the pointer moves between two surfaces
+ * which are not ancestors of each other and the surface is part of
+ * the ancestor chain between one of these surfaces and their least
* common ancestor.
* @GDK_NOTIFY_UNKNOWN: an unknown type of enter/leave event occurred.
*
@@ -345,12 +345,12 @@ typedef enum
* @GDK_CROSSING_STATE_CHANGED: crossing because a GTK+ widget changed
* state (e.g. sensitivity).
* @GDK_CROSSING_TOUCH_BEGIN: crossing because a touch sequence has begun,
- * this event is synthetic as the pointer might have not left the window.
+ * this event is synthetic as the pointer might have not left the surface.
* @GDK_CROSSING_TOUCH_END: crossing because a touch sequence has ended,
- * this event is synthetic as the pointer might have not left the window.
+ * this event is synthetic as the pointer might have not left the surface.
* @GDK_CROSSING_DEVICE_SWITCH: crossing because of a device switch (i.e.
* a mouse taking control of the pointer after a touch device), this event
- * is synthetic as the pointer didn’t leave the window.
+ * is synthetic as the pointer didn’t leave the surface.
*
* Specifies the crossing mode for enter and leave events.
*/
@@ -381,7 +381,7 @@ GDK_AVAILABLE_IN_ALL
void gdk_event_free (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
-GdkSurface *gdk_event_get_window (const GdkEvent *event);
+GdkSurface *gdk_event_get_surface (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
guint32 gdk_event_get_time (const GdkEvent *event);
@@ -545,8 +545,8 @@ GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_touch_emulating_pointer (const GdkEvent *event,
gboolean *emulating);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_event_get_grab_window (const GdkEvent *event,
- GdkSurface **window);
+gboolean gdk_event_get_grab_surface (const GdkEvent *event,
+ GdkSurface **surface);
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_focus_in (const GdkEvent *event,
gboolean *focus_in);
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index ce86bd9891..b664f2706c 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -44,7 +44,7 @@ struct _GdkEventClass
/*
* GdkEventAny:
* @type: the type of the event.
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
*
* Contains the fields which are common to all event structs.
@@ -55,7 +55,7 @@ struct _GdkEventAny
{
GObject parent_instance;
GdkEventType type;
- GdkSurface *window;
+ GdkSurface *surface;
guint16 flags;
gint8 send_event;
GdkDevice *device;
@@ -66,7 +66,7 @@ struct _GdkEventAny
/*
* GdkEventExpose:
* @type: the type of the event (%GDK_EXPOSE)
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @area: bounding box of @region.
* @region: the region that needs to be redrawn.
@@ -75,7 +75,7 @@ struct _GdkEventAny
* contiguous %GDK_EXPOSE events in one go, though GDK performs some
* exposure compression so this is not normally needed.
*
- * Generated when all or part of a window becomes visible and needs to be
+ * Generated when all or part of a surface becomes visible and needs to be
* redrawn.
*/
struct _GdkEventExpose
@@ -89,11 +89,11 @@ struct _GdkEventExpose
/*
* GdkEventMotion:
* @type: the type of the event.
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
- * @x: the x coordinate of the pointer relative to the window.
- * @y: the y coordinate of the pointer relative to the window.
+ * @x: the x coordinate of the pointer relative to the surface.
+ * @y: the y coordinate of the pointer relative to the surface.
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
* the mouse.
* @state: (type GdkModifierType): a bit-mask representing the state of
@@ -124,11 +124,11 @@ struct _GdkEventMotion
/*
* GdkEventButton:
* @type: the type of the event (%GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
- * @x: the x coordinate of the pointer relative to the window.
- * @y: the y coordinate of the pointer relative to the window.
+ * @x: the x coordinate of the pointer relative to the surface.
+ * @y: the y coordinate of the pointer relative to the surface.
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
* the mouse.
* @state: (type GdkModifierType): a bit-mask representing the state of
@@ -165,11 +165,11 @@ struct _GdkEventButton
* GdkEventTouch:
* @type: the type of the event (%GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE,
* %GDK_TOUCH_END, %GDK_TOUCH_CANCEL)
- * @window: the window which received the event
+ * @surface: the surface which received the event
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
- * @x: the x coordinate of the pointer relative to the window
- * @y: the y coordinate of the pointer relative to the window
+ * @x: the x coordinate of the pointer relative to the surface
+ * @y: the y coordinate of the pointer relative to the surface
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
* the mouse
* @state: (type GdkModifierType): a bit-mask representing the state of
@@ -212,11 +212,11 @@ struct _GdkEventTouch
/*
* GdkEventScroll:
* @type: the type of the event (%GDK_SCROLL).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
- * @x: the x coordinate of the pointer relative to the window.
- * @y: the y coordinate of the pointer relative to the window.
+ * @x: the x coordinate of the pointer relative to the surface.
+ * @y: the y coordinate of the pointer relative to the surface.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
@@ -258,7 +258,7 @@ struct _GdkEventScroll
/*
* GdkEventKey:
* @type: the type of the event (%GDK_KEY_PRESS or %GDK_KEY_RELEASE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
* @state: (type GdkModifierType): a bit-mask representing the state of
@@ -303,12 +303,12 @@ struct _GdkEventKey
/*
* GdkEventCrossing:
* @type: the type of the event (%GDK_ENTER_NOTIFY or %GDK_LEAVE_NOTIFY).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
- * @subwindow: the window that was entered or left.
+ * @child_surface: the surface that was entered or left.
* @time: the time of the event in milliseconds.
- * @x: the x coordinate of the pointer relative to the window.
- * @y: the y coordinate of the pointer relative to the window.
+ * @x: the x coordinate of the pointer relative to the surface.
+ * @y: the y coordinate of the pointer relative to the surface.
* @x_root: the x coordinate of the pointer relative to the root of the screen.
* @y_root: the y coordinate of the pointer relative to the root of the screen.
* @mode: the crossing mode (%GDK_CROSSING_NORMAL, %GDK_CROSSING_GRAB,
@@ -319,17 +319,17 @@ struct _GdkEventKey
* @detail: the kind of crossing that happened (%GDK_NOTIFY_INFERIOR,
* %GDK_NOTIFY_ANCESTOR, %GDK_NOTIFY_VIRTUAL, %GDK_NOTIFY_NONLINEAR or
* %GDK_NOTIFY_NONLINEAR_VIRTUAL).
- * @focus: %TRUE if @window is the focus window or an inferior.
+ * @focus: %TRUE if @surface is the focus surface or an inferior.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
*
- * Generated when the pointer enters or leaves a window.
+ * Generated when the pointer enters or leaves a surface.
*/
struct _GdkEventCrossing
{
GdkEventAny any;
- GdkSurface *subwindow;
+ GdkSurface *child_surface;
guint32 time;
gdouble x;
gdouble y;
@@ -344,9 +344,9 @@ struct _GdkEventCrossing
/*
* GdkEventFocus:
* @type: the type of the event (%GDK_FOCUS_CHANGE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
- * @in: %TRUE if the window has gained the keyboard focus, %FALSE if
+ * @in: %TRUE if the surface has gained the keyboard focus, %FALSE if
* it has lost the focus.
*
* Describes a change of keyboard focus.
@@ -360,14 +360,14 @@ struct _GdkEventFocus
/*
* GdkEventConfigure:
* @type: the type of the event (%GDK_CONFIGURE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
- * @x: the new x coordinate of the window, relative to its parent.
- * @y: the new y coordinate of the window, relative to its parent.
- * @width: the new width of the window.
- * @height: the new height of the window.
+ * @x: the new x coordinate of the surface, relative to its parent.
+ * @y: the new y coordinate of the surface, relative to its parent.
+ * @width: the new width of the surface.
+ * @height: the new height of the surface.
*
- * Generated when a window size or position has changed.
+ * Generated when a surface size or position has changed.
*/
struct _GdkEventConfigure
{
@@ -380,7 +380,7 @@ struct _GdkEventConfigure
/*
* GdkEventProximity:
* @type: the type of the event (%GDK_PROXIMITY_IN or %GDK_PROXIMITY_OUT).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
* @device: the master device that the event originated from. Use
@@ -405,18 +405,18 @@ struct _GdkEventProximity
/*
* GdkEventGrabBroken:
* @type: the type of the event (%GDK_GRAB_BROKEN)
- * @window: the window which received the event, i.e. the window
+ * @surface: the surface which received the event, i.e. the surface
* that previously owned the grab
* @send_event: %TRUE if the event was sent explicitly.
* @keyboard: %TRUE if a keyboard grab was broken, %FALSE if a pointer
* grab was broken
* @implicit: %TRUE if the broken grab was implicit
- * @grab_window: If this event is caused by another grab in the same
- * application, @grab_window contains the new grab window. Otherwise
- * @grab_window is %NULL.
+ * @grab_surface: If this event is caused by another grab in the same
+ * application, @grab_surface contains the new grab surface. Otherwise
+ * @grab_surface is %NULL.
*
* Generated when a pointer or keyboard grab is broken. On X11, this happens
- * when the grab window becomes unviewable (i.e. it or one of its ancestors
+ * when the grab surface becomes unviewable (i.e. it or one of its ancestors
* is unmapped), or if the same application grabs the pointer or keyboard
* again. Note that implicit grabs (which are initiated by button presses)
* can also cause #GdkEventGrabBroken events.
@@ -427,14 +427,14 @@ struct _GdkEventGrabBroken {
GdkEventAny any;
gboolean keyboard;
gboolean implicit;
- GdkSurface *grab_window;
+ GdkSurface *grab_surface;
};
/*
* GdkEventDND:
* @type: the type of the event (%GDK_DRAG_ENTER, %GDK_DRAG_LEAVE,
* %GDK_DRAG_MOTION or %GDK_DROP_START)
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @context: the #GdkDragContext for the current DND operation.
* @time: the time of the event in milliseconds.
@@ -456,7 +456,7 @@ struct _GdkEventDND {
/*
* GdkEventTouchpadSwipe:
* @type: the type of the event (%GDK_TOUCHPAD_SWIPE)
- * @window: the window which received the event
+ * @surface: the surface which received the event
* @send_event: %TRUE if the event was sent explicitly
* @phase: (type GdkTouchpadGesturePhase): the current phase of the gesture
* @n_fingers: The number of fingers triggering the swipe
@@ -491,7 +491,7 @@ struct _GdkEventTouchpadSwipe {
/*
* GdkEventTouchpadPinch:
* @type: the type of the event (%GDK_TOUCHPAD_PINCH)
- * @window: the window which received the event
+ * @surface: the surface which received the event
* @send_event: %TRUE if the event was sent explicitly
* @phase: (type GdkTouchpadGesturePhase): the current phase of the gesture
* @n_fingers: The number of fingers triggering the pinch
@@ -532,7 +532,7 @@ struct _GdkEventTouchpadPinch {
/*
* GdkEventPadButton:
* @type: the type of the event (%GDK_PAD_BUTTON_PRESS or %GDK_PAD_BUTTON_RELEASE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
* @group: the pad group the button belongs to. A %GDK_SOURCE_TABLET_PAD device
@@ -556,7 +556,7 @@ struct _GdkEventPadButton {
/*
* GdkEventPadAxis:
* @type: the type of the event (%GDK_PAD_RING or %GDK_PAD_STRIP).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
* @group: the pad group the ring/strip belongs to. A %GDK_SOURCE_TABLET_PAD
@@ -583,7 +583,7 @@ struct _GdkEventPadAxis {
/*
* GdkEventPadGroupMode:
* @type: the type of the event (%GDK_PAD_GROUP_MODE).
- * @window: the window which received the event.
+ * @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
* @time: the time of the event in milliseconds.
* @group: the pad group that is switching mode. A %GDK_SOURCE_TABLET_PAD
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index 565721ad06..214890ad00 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -29,11 +29,11 @@
static cairo_user_data_key_t direct_key;
void
-gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
- GdkSurface *window)
+gdk_cairo_surface_mark_as_direct (cairo_surface_t *cairo_surface,
+ GdkSurface *surface)
{
- cairo_surface_set_user_data (surface, &direct_key,
- g_object_ref (window), g_object_unref);
+ cairo_surface_set_user_data (cairo_surface, &direct_key,
+ g_object_ref (surface), g_object_unref);
}
static const char *
@@ -219,10 +219,10 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
{
GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context);
GdkGLContextProgram *program;
- GdkSurface *window = gdk_gl_context_get_surface (paint_context);
- int surface_scale = gdk_surface_get_scale_factor (window);
- float w = gdk_surface_get_width (window) * surface_scale;
- float h = gdk_surface_get_height (window) * surface_scale;
+ GdkSurface *surface = gdk_gl_context_get_surface (paint_context);
+ int surface_scale = gdk_surface_get_scale_factor (surface);
+ float w = gdk_surface_get_width (surface) * surface_scale;
+ float h = gdk_surface_get_height (surface) * surface_scale;
int i;
float *vertex_buffer_data;
@@ -299,7 +299,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
/**
* gdk_cairo_draw_from_gl:
* @cr: a cairo context
- * @window: The window we're rendering for (not necessarily into)
+ * @surface: The surface we're rendering for (not necessarily into)
* @source: The GL ID of the source buffer
* @source_type: The type of the @source
* @buffer_scale: The scale-factor that the @source buffer is allocated for
@@ -314,9 +314,9 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
* The top left corner of the rectangle specified by @x, @y, @width and @height
* will be drawn at the current (0,0) position of the cairo_t.
*
- * This will work for *all* cairo_t, as long as @window is realized, but the
+ * This will work for *all* cairo_t, as long as @surface is realized, but the
* fallback implementation that reads back the pixels from the buffer may be
- * used in the general case. In the case of direct drawing to a window with
+ * used in the general case. In the case of direct drawing to a surface with
* no special effects applied to @cr it will however use a more efficient
* approach.
*
@@ -327,7 +327,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
*/
void
gdk_cairo_draw_from_gl (cairo_t *cr,
- GdkSurface *window,
+ GdkSurface *surface,
int source,
int source_type,
int buffer_scale,
@@ -345,7 +345,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
GdkGLContextPaintData *paint_data;
int major, minor, version;
- paint_context = gdk_surface_get_paint_gl_context (window, NULL);
+ paint_context = gdk_surface_get_paint_gl_context (surface, NULL);
if (paint_context == NULL)
{
g_warning ("gdk_cairo_draw_gl_render_buffer failed - no paint context");
@@ -449,7 +449,7 @@ out:
/* This is always called with the paint context current */
void
-gdk_gl_texture_from_surface (cairo_surface_t *surface,
+gdk_gl_texture_from_surface (cairo_surface_t *cairo_surface,
cairo_region_t *region)
{
GdkGLContext *paint_context;
@@ -458,8 +458,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect, e;
int n_rects, i;
- GdkSurface *window;
- int unscaled_window_height;
+ GdkSurface *surface;
+ int unscaled_surface_height;
unsigned int texture_id;
int surface_scale;
double sx, sy;
@@ -476,19 +476,19 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
if (paint_context &&
GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0 &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
- GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
+ GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, cairo_surface, region))
return;
/* Software fallback */
use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context);
- window = gdk_gl_context_get_surface (paint_context);
- surface_scale = gdk_surface_get_scale_factor (window);
- gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height);
+ surface = gdk_gl_context_get_surface (paint_context);
+ surface_scale = gdk_surface_get_scale_factor (surface);
+ gdk_surface_get_unscaled_size (surface, NULL, &unscaled_surface_height);
sx = sy = 1;
- cairo_surface_get_device_scale (surface, &sx, &sy);
- cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset);
+ cairo_surface_get_device_scale (cairo_surface, &sx, &sy);
+ cairo_surface_get_device_offset (cairo_surface, &device_x_offset, &device_y_offset);
glGenTextures (1, &texture_id);
if (use_texture_rectangle)
@@ -506,7 +506,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
n_rects = cairo_region_num_rectangles (region);
-#define FLIP_Y(_y) (unscaled_window_height - (_y))
+#define FLIP_Y(_y) (unscaled_surface_height - (_y))
for (i = 0; i < n_rects; i++)
{
@@ -522,7 +522,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
e.y += (int)device_y_offset;
e.width *= sx;
e.height *= sy;
- image = cairo_surface_map_to_image (surface, &e);
+ image = cairo_surface_map_to_image (cairo_surface, &e);
gdk_gl_context_upload_texture (paint_context,
cairo_image_surface_get_data (image),
@@ -531,7 +531,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
cairo_image_surface_get_stride (image),
target);
- cairo_surface_unmap_image (surface, image);
+ cairo_surface_unmap_image (cairo_surface, image);
if (use_texture_rectangle)
{
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 69dc4976e1..c31ad1e4c9 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -28,7 +28,7 @@
*
* #GdkGLContexts are created for a #GdkSurface using
* gdk_surface_create_gl_context(), and the context will match the
- * the characteristics of the window.
+ * the characteristics of the surface.
*
* A #GdkGLContext is not tied to any particular normal framebuffer.
* For instance, it cannot draw to the #GdkSurface back buffer. The GDK
@@ -265,12 +265,12 @@ gdk_gl_context_real_realize (GdkGLContext *self,
static cairo_region_t *
gdk_gl_context_real_get_damage (GdkGLContext *context)
{
- GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
return cairo_region_create_rectangle (&(GdkRectangle) {
0, 0,
- gdk_surface_get_width (window),
- gdk_surface_get_height (window)
+ gdk_surface_get_width (surface),
+ gdk_surface_get_height (surface)
});
}
@@ -279,7 +279,7 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
cairo_region_t *region)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
- GdkSurface *window;
+ GdkSurface *surface;
GdkGLContext *shared;
cairo_region_t *damage;
int ww, wh;
@@ -295,9 +295,9 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
cairo_region_union (region, damage);
cairo_region_destroy (damage);
- window = gdk_draw_context_get_surface (draw_context);
- ww = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window);
- wh = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window);
+ surface = gdk_draw_context_get_surface (draw_context);
+ ww = gdk_surface_get_width (surface) * gdk_surface_get_scale_factor (surface);
+ wh = gdk_surface_get_height (surface) * gdk_surface_get_scale_factor (surface);
gdk_gl_context_make_current (context);
diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c
index 2e9d28dab4..618aa45f4c 100644
--- a/gdk/gdkgltexture.c
+++ b/gdk/gdkgltexture.c
@@ -91,10 +91,10 @@ gdk_gl_texture_download (GdkTexture *texture,
}
else
{
- GdkSurface *window;
+ GdkSurface *surface;
- window = gdk_gl_context_get_surface (self->context);
- gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1,
+ surface = gdk_gl_context_get_surface (self->context);
+ gdk_cairo_draw_from_gl (cr, surface, self->id, GL_TEXTURE, 1,
area->x, area->y,
area->width, area->height);
}
@@ -145,7 +145,7 @@ gdk_gl_texture_get_id (GdkGLTexture *self)
void
gdk_gl_texture_release (GdkGLTexture *self)
{
- GdkSurface *window;
+ GdkSurface *surface;
GdkTexture *texture;
cairo_t *cr;
@@ -158,8 +158,8 @@ gdk_gl_texture_release (GdkGLTexture *self)
cr = cairo_create (self->saved);
- window = gdk_gl_context_get_surface (self->context);
- gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1, 0, 0,
+ surface = gdk_gl_context_get_surface (self->context);
+ gdk_cairo_draw_from_gl (cr, surface, self->id, GL_TEXTURE, 1, 0, 0,
texture->width, texture->height);
cairo_destroy (cr);
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 1aae305feb..de55b8b4b4 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -163,7 +163,7 @@ struct _GdkSurface
struct {
/* The temporary surface that we're painting to. This will be composited
- * back into the window when we call end_paint. This is our poor-man's
+ * back into the surface when we call end_paint. This is our poor-man's
* way of doing double buffering. */
cairo_surface_t *surface;
@@ -202,15 +202,15 @@ struct _GdkSurface
guint synthesize_crossing_event_queued : 1;
guint effective_visibility : 2;
guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
- guint native_visibility : 2; /* the native visibility of a impl windows */
+ guint native_visibility : 2; /* the native visibility of a impl surfaces */
guint viewable : 1; /* mapped and all parents mapped */
guint applied_shape : 1;
guint in_update : 1;
guint geometry_dirty : 1;
guint frame_clock_events_paused : 1;
- /* The GdkSurface that has the impl, ref:ed if another window.
- * This ref is required to keep the wrapper of the impl window alive
+ /* The GdkSurface that has the impl, ref:ed if another surface.
+ * This ref is required to keep the wrapper of the impl surface alive
* for as long as any GdkSurface references the impl. */
GdkSurface *impl_surface;
@@ -223,9 +223,9 @@ struct _GdkSurface
gint shadow_right;
gint shadow_bottom;
- /* The clip region is the part of the window, in window coordinates
+ /* The clip region is the part of the surface, in surface coordinates
that is fully or partially (i.e. semi transparently) visible in
- the window hierarchy from the toplevel and down */
+ the surface hierarchy from the toplevel and down */
cairo_region_t *clip_region;
GdkCursor *cursor;
@@ -280,7 +280,7 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
void _gdk_windowing_event_data_free (GdkEvent *event);
-void gdk_surface_set_state (GdkSurface *window,
+void gdk_surface_set_state (GdkSurface *surface,
GdkSurfaceState new_state);
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
@@ -302,8 +302,8 @@ void gdk_gl_texture_quads (GdkGLContext *paint_context,
void gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
const GdkPixbuf *pixbuf);
-void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
- GdkSurface *window);
+void gdk_cairo_surface_mark_as_direct (cairo_surface_t *cairo_surface,
+ GdkSurface *surface);
cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
void gdk_cairo_set_drawing_context (cairo_t *cr,
@@ -314,27 +314,27 @@ void gdk_cairo_set_drawing_context (cairo_t *cr,
*************************************/
cairo_surface_t *
- _gdk_surface_ref_cairo_surface (GdkSurface *window);
+ _gdk_surface_ref_cairo_surface (GdkSurface *surface);
GdkSurface* gdk_surface_new (GdkDisplay *display,
GdkSurface *parent,
GdkSurfaceAttr *attributes);
-void _gdk_surface_destroy (GdkSurface *window,
+void _gdk_surface_destroy (GdkSurface *surface,
gboolean foreign_destroy);
-void _gdk_surface_clear_update_area (GdkSurface *window);
-void _gdk_surface_update_size (GdkSurface *window);
-gboolean _gdk_surface_update_viewable (GdkSurface *window);
-GdkGLContext * gdk_surface_get_paint_gl_context (GdkSurface *window,
+void _gdk_surface_clear_update_area (GdkSurface *surface);
+void _gdk_surface_update_size (GdkSurface *surface);
+gboolean _gdk_surface_update_viewable (GdkSurface *surface);
+GdkGLContext * gdk_surface_get_paint_gl_context (GdkSurface *surface,
GError **error);
-void gdk_surface_get_unscaled_size (GdkSurface *window,
+void gdk_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height);
-GdkDrawingContext *gdk_surface_get_drawing_context (GdkSurface *window);
+GdkDrawingContext *gdk_surface_get_drawing_context (GdkSurface *surface);
-cairo_region_t *gdk_surface_get_current_paint_region (GdkSurface *window);
+cairo_region_t *gdk_surface_get_current_paint_region (GdkSurface *surface);
-void _gdk_surface_process_updates_recurse (GdkSurface *window,
+void _gdk_surface_process_updates_recurse (GdkSurface *surface,
cairo_region_t *expose_region);
/*****************************************
@@ -352,19 +352,19 @@ void _gdk_windowing_got_event (GdkDisplay *display,
GdkEvent *event,
gulong serial);
-#define GDK_SURFACE_IS_MAPPED(window) (((window)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
+#define GDK_SURFACE_IS_MAPPED(surface) (((surface)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
-void _gdk_surface_invalidate_for_expose (GdkSurface *window,
+void _gdk_surface_invalidate_for_expose (GdkSurface *surface,
cairo_region_t *region);
-GdkSurface * _gdk_surface_find_child_at (GdkSurface *window,
+GdkSurface * _gdk_surface_find_child_at (GdkSurface *surface,
double x, double y);
GdkSurface * _gdk_surface_find_descendant_at (GdkSurface *toplevel,
double x, double y,
double *found_x,
double *found_y);
-GdkEvent * _gdk_make_event (GdkSurface *window,
+GdkEvent * _gdk_make_event (GdkSurface *surface,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
@@ -386,14 +386,14 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display,
gboolean non_linear);
void _gdk_display_set_surface_under_pointer (GdkDisplay *display,
GdkDevice *device,
- GdkSurface *window);
+ GdkSurface *surface);
-gboolean _gdk_surface_has_impl (GdkSurface *window);
-GdkSurface * _gdk_surface_get_impl_surface (GdkSurface *window);
+gboolean _gdk_surface_has_impl (GdkSurface *surface);
+GdkSurface * _gdk_surface_get_impl_surface (GdkSurface *surface);
-void gdk_surface_destroy_notify (GdkSurface *window);
+void gdk_surface_destroy_notify (GdkSurface *surface);
-void gdk_synthesize_surface_state (GdkSurface *window,
+void gdk_synthesize_surface_state (GdkSurface *surface,
GdkSurfaceState unset_flags,
GdkSurfaceState set_flags);
diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c
index b27282ce5f..4b3358e2d7 100644
--- a/gdk/gdkmonitor.c
+++ b/gdk/gdkmonitor.c
@@ -410,7 +410,7 @@ gdk_monitor_get_model (GdkMonitor *monitor)
* on very high density outputs this can be a higher value (often 2).
*
* This can be used if you want to create pixel based data for a
- * particular monitor, but most of the time you’re drawing to a window
+ * particular monitor, but most of the time you’re drawing to a surface
* where it is better to use gdk_surface_get_scale_factor() instead.
*
* Returns: the scale factor
diff --git a/gdk/gdkpaintable.c b/gdk/gdkpaintable.c
index dd6422654a..378172ff2a 100644
--- a/gdk/gdkpaintable.c
+++ b/gdk/gdkpaintable.c
@@ -165,7 +165,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
* has changed.
*
* Examples for such an event would be a paintable displaying the contents of a toplevel
- * window being resized.
+ * surface being resized.
*
* Since: 4.0
*/
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index 419eb322f8..443afed7ba 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -67,8 +67,8 @@
* // where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
* // We first center, then change the scale
*
- * width = gdk_surface_get_width (window);
- * height = gdk_surface_get_height (window);
+ * width = gdk_surface_get_width (surface);
+ * height = gdk_surface_get_height (surface);
* radius = MIN (width, height) / 2.;
*
* cairo_translate (cr,
diff --git a/gdk/gdkseat.c b/gdk/gdkseat.c
index 04dd593c04..aa120f298b 100644
--- a/gdk/gdkseat.c
+++ b/gdk/gdkseat.c
@@ -233,28 +233,28 @@ gdk_seat_get_capabilities (GdkSeat *seat)
/**
* gdk_seat_grab:
* @seat: a #GdkSeat
- * @window: the #GdkSurface which will own the grab
+ * @surface: the #GdkSurface which will own the grab
* @capabilities: capabilities that will be grabbed
* @owner_events: if %FALSE then all device events are reported with respect to
- * @window and are only reported if selected by @event_mask. If
+ * @surface and are only reported if selected by @event_mask. If
* %TRUE then pointer events for this application are reported
* as normal, but pointer events outside this application are
- * reported with respect to @window and only if selected by
+ * reported with respect to @surface and only if selected by
* @event_mask. In either mode, unreported events are discarded.
* @cursor: (nullable): the cursor to display while the grab is active. If
* this is %NULL then the normal cursors are used for
- * @window and its descendants, and the cursor for @window is used
+ * @surface and its descendants, and the cursor for @surface is used
* elsewhere.
* @event: (nullable): the event that is triggering the grab, or %NULL if none
* is available.
* @prepare_func: (nullable) (scope call) (closure prepare_func_data): function to
- * prepare the window to be grabbed, it can be %NULL if @window is
+ * prepare the surface to be grabbed, it can be %NULL if @surface is
* visible before this call.
* @prepare_func_data: user data to pass to @prepare_func
*
* Grabs the seat so that all events corresponding to the given @capabilities
* are passed to this application until the seat is ungrabbed with gdk_seat_ungrab(),
- * or the window becomes hidden. This overrides any previous grab on the
+ * or the surface becomes hidden. This overrides any previous grab on the
* seat by this client.
*
* As a rule of thumb, if a grab is desired over %GDK_SEAT_CAPABILITY_POINTER,
@@ -270,7 +270,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
* Note that if the event mask of a #GdkSurface has selected both button press
* and button release events, or touch begin and touch end, then a press event
* will cause an automatic grab until the button is released, equivalent to a
- * grab on the window with @owner_events set to %TRUE. This is done because most
+ * grab on the surface with @owner_events set to %TRUE. This is done because most
* applications expect to receive paired press and release events.
*
* If you set up anything at the time you take the grab that needs to be
@@ -281,7 +281,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
**/
GdkGrabStatus
gdk_seat_grab (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
@@ -292,14 +292,14 @@ gdk_seat_grab (GdkSeat *seat,
GdkSeatClass *seat_class;
g_return_val_if_fail (GDK_IS_SEAT (seat), GDK_GRAB_FAILED);
- g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_GRAB_FAILED);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_GRAB_FAILED);
capabilities &= GDK_SEAT_CAPABILITY_ALL;
g_return_val_if_fail (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED);
seat_class = GDK_SEAT_GET_CLASS (seat);
- return seat_class->grab (seat, window, capabilities, owner_events, cursor,
+ return seat_class->grab (seat, surface, capabilities, owner_events, cursor,
event, prepare_func, prepare_func_data);
}
diff --git a/gdk/gdkseat.h b/gdk/gdkseat.h
index c9a0a4c220..bb0eb069f2 100644
--- a/gdk/gdkseat.h
+++ b/gdk/gdkseat.h
@@ -64,18 +64,18 @@ typedef enum {
/**
* GdkSeatGrabPrepareFunc:
* @seat: the #GdkSeat being grabbed
- * @window: the #GdkSurface being grabbed
+ * @surface: the #GdkSurface being grabbed
* @user_data: user data passed in gdk_seat_grab()
*
- * Type of the callback used to set up @window so it can be
- * grabbed. A typical action would be ensuring the window is
+ * Type of the callback used to set up @surface so it can be
+ * grabbed. A typical action would be ensuring the surface is
* visible, although there's room for other initialization
* actions.
*
* Since: 3.20
*/
typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
gpointer user_data);
struct _GdkSeat
@@ -88,7 +88,7 @@ GType gdk_seat_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkGrabStatus gdk_seat_grab (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
index 7531c89a5d..3f43427f73 100644
--- a/gdk/gdkseatdefault.c
+++ b/gdk/gdkseatdefault.c
@@ -104,7 +104,7 @@ gdk_seat_default_get_capabilities (GdkSeat *seat)
static GdkGrabStatus
gdk_seat_default_grab (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
@@ -119,12 +119,12 @@ gdk_seat_default_grab (GdkSeat *seat,
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
if (prepare_func)
- (prepare_func) (seat, window, prepare_func_data);
+ (prepare_func) (seat, surface, prepare_func_data);
- if (!gdk_surface_is_visible (window))
+ if (!gdk_surface_is_visible (surface))
{
- g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc",
- window);
+ g_critical ("Surface %p has not been made visible in GdkSeatGrabPrepareFunc",
+ surface);
return GDK_GRAB_NOT_VIEWABLE;
}
@@ -145,7 +145,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
pointer_evmask |= TOUCH_EVENTS;
- status = gdk_device_grab (priv->master_pointer, window,
+ status = gdk_device_grab (priv->master_pointer, surface,
GDK_OWNERSHIP_NONE, owner_events,
pointer_evmask, cursor,
evtime);
@@ -154,7 +154,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (status == GDK_GRAB_SUCCESS &&
capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
{
- status = gdk_device_grab (priv->master_keyboard, window,
+ status = gdk_device_grab (priv->master_keyboard, surface,
GDK_OWNERSHIP_NONE, owner_events,
KEYBOARD_EVENTS, cursor,
evtime);
@@ -163,7 +163,7 @@ gdk_seat_default_grab (GdkSeat *seat,
{
if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD)
gdk_device_ungrab (priv->master_pointer, evtime);
- gdk_surface_hide (window);
+ gdk_surface_hide (surface);
}
}
diff --git a/gdk/gdkseatprivate.h b/gdk/gdkseatprivate.h
index ca3af76914..97127dbfae 100644
--- a/gdk/gdkseatprivate.h
+++ b/gdk/gdkseatprivate.h
@@ -42,7 +42,7 @@ struct _GdkSeatClass
GdkSeatCapabilities (*get_capabilities) (GdkSeat *seat);
GdkGrabStatus (* grab) (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 239ca6d304..8f287d5199 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -52,18 +52,18 @@
#include "wayland/gdkwayland.h"
#endif
-#undef DEBUG_WINDOW_PRINTING
+#undef DEBUG_SURFACE_PRINTING
/**
- * SECTION:windows
+ * SECTION:surfaces
* @Short_description: Onscreen display areas in the target window system
- * @Title: Windows
+ * @Title: Surfaces
*
* A #GdkSurface is a (usually) rectangular region on the screen.
* It’s a low-level object, used to implement high-level objects such as
* #GtkWidget and #GtkWindow on the GTK+ level. A #GtkWindow is a toplevel
- * window, the thing a user might think of as a “window” with a titlebar
+ * surface, the thing a user might think of as a “window” with a titlebar
* and so on; a #GtkWindow may contain many sub-GdkSurfaces.
*/
@@ -78,22 +78,22 @@
* be it a toplevel window or a child window. In this setup the
* GdkSurface (and other GdkDrawables) were platform independent classes,
* and the actual platform specific implementation was in a delegate
- * object available as “impl” in the window object.
+ * object available as “impl” in the surface object.
*
* With the addition of client side windows this changes a bit. The
* application-visible GdkSurface object behaves as it did before, but
- * such windows now don't a corresponding native window. Instead subwindows
- * windows are “client side”, i.e. emulated by the gdk code such
+ * such surfaces now don't a corresponding native window. Instead subwindows
+ * surfaces are “client side”, i.e. emulated by the gdk code such
* that clipping, drawing, moving, events etc work as expected.
*
- * GdkSurfaces have a pointer to the “impl window” they are in, i.e.
+ * GdkSurfaces have a pointer to the “impl surface” they are in, i.e.
* the topmost GdkSurface which have the same “impl” value. This is stored
- * in impl_surface, which is different from the window itself only for client
- * side windows.
- * All GdkSurfaces (native or not) track the position of the window in the parent
- * (x, y), the size of the window (width, height), the position of the window
- * with respect to the impl window (abs_x, abs_y). We also track the clip
- * region of the window wrt parent windows, in window-relative coordinates (clip_region).
+ * in impl_surface, which is different from the surface itself only for client
+ * side surfaces.
+ * All GdkSurfaces (native or not) track the position of the surface in the parent
+ * (x, y), the size of the surface (width, height), the position of the surface
+ * with respect to the impl surface (abs_x, abs_y). We also track the clip
+ * region of the surface wrt parent surfaces, in surface-relative coordinates (clip_region).
*/
enum {
@@ -122,7 +122,7 @@ static void gdk_surface_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
-static void gdk_surface_clear_backing_region (GdkSurface *window);
+static void gdk_surface_clear_backing_region (GdkSurface *surface);
static void recompute_visible_regions (GdkSurface *private,
gboolean recalculate_children);
@@ -131,15 +131,15 @@ static void update_cursor (GdkDisplay *display,
GdkDevice *device);
static void impl_surface_add_update_area (GdkSurface *impl_surface,
cairo_region_t *region);
-static void gdk_surface_invalidate_region_full (GdkSurface *window,
+static void gdk_surface_invalidate_region_full (GdkSurface *surface,
const cairo_region_t *region,
gboolean invalidate_children);
-static void gdk_surface_invalidate_rect_full (GdkSurface *window,
+static void gdk_surface_invalidate_rect_full (GdkSurface *surface,
const GdkRectangle *rect,
gboolean invalidate_children);
-static cairo_surface_t *gdk_surface_ref_impl_surface (GdkSurface *window);
+static cairo_surface_t *gdk_surface_ref_impl_surface (GdkSurface *surface);
-static void gdk_surface_set_frame_clock (GdkSurface *window,
+static void gdk_surface_set_frame_clock (GdkSurface *surface,
GdkFrameClock *clock);
@@ -148,7 +148,7 @@ static GParamSpec *properties[LAST_PROP] = { NULL, };
G_DEFINE_ABSTRACT_TYPE (GdkSurface, gdk_surface, G_TYPE_OBJECT)
-#ifdef DEBUG_WINDOW_PRINTING
+#ifdef DEBUG_SURFACE_PRINTING
char *
print_region (cairo_region_t *region)
{
@@ -223,20 +223,20 @@ list_insert_link_before (GList *list,
}
static void
-gdk_surface_init (GdkSurface *window)
+gdk_surface_init (GdkSurface *surface)
{
/* 0-initialization is good for all other fields. */
- window->surface_type = GDK_SURFACE_CHILD;
+ surface->surface_type = GDK_SURFACE_CHILD;
- window->state = GDK_SURFACE_STATE_WITHDRAWN;
- window->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
- window->width = 1;
- window->height = 1;
- window->toplevel_surface_type = -1;
- window->children_list_node.data = window;
+ surface->state = GDK_SURFACE_STATE_WITHDRAWN;
+ surface->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
+ surface->width = 1;
+ surface->height = 1;
+ surface->toplevel_surface_type = -1;
+ surface->children_list_node.data = surface;
- window->device_cursor = g_hash_table_new_full (NULL, NULL,
+ surface->device_cursor = g_hash_table_new_full (NULL, NULL,
NULL, g_object_unref);
}
@@ -267,7 +267,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
/**
* GdkSurface:display:
*
- * The #GdkDisplay connection of the window. See gdk_surface_get_display()
+ * The #GdkDisplay connection of the surface. See gdk_surface_get_display()
* for details.
*/
properties[PROP_DISPLAY] =
@@ -288,25 +288,25 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
/**
* GdkSurface::moved-to-rect:
- * @window: the #GdkSurface that moved
- * @flipped_rect: (nullable): the position of @window after any possible
+ * @surface: the #GdkSurface that moved
+ * @flipped_rect: (nullable): the position of @surface after any possible
* flipping or %NULL if the backend can't obtain it
- * @final_rect: (nullable): the final position of @window or %NULL if the
+ * @final_rect: (nullable): the final position of @surface or %NULL if the
* backend can't obtain it
* @flipped_x: %TRUE if the anchors were flipped horizontally
* @flipped_y: %TRUE if the anchors were flipped vertically
*
- * Emitted when the position of @window is finalized after being moved to a
+ * Emitted when the position of @surface is finalized after being moved to a
* destination rectangle.
*
- * @window might be flipped over the destination rectangle in order to keep
+ * @surface might be flipped over the destination rectangle in order to keep
* it on-screen, in which case @flipped_x and @flipped_y will be set to %TRUE
* accordingly.
*
- * @flipped_rect is the ideal position of @window after any possible
+ * @flipped_rect is the ideal position of @surface after any possible
* flipping, but before any possible sliding. @final_rect is @flipped_rect,
* but possibly translated in the case that flipping is still ineffective in
- * keeping @window on-screen.
+ * keeping @surface on-screen.
* Stability: Private
*/
signals[MOVED_TO_RECT] =
@@ -328,73 +328,73 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
static void
seat_removed_cb (GdkDisplay *display,
GdkSeat *seat,
- GdkSurface *window)
+ GdkSurface *surface)
{
GdkDevice *device = gdk_seat_get_pointer (seat);
- window->devices_inside = g_list_remove (window->devices_inside, device);
- g_hash_table_remove (window->device_cursor, device);
+ surface->devices_inside = g_list_remove (surface->devices_inside, device);
+ g_hash_table_remove (surface->device_cursor, device);
- if (window->device_events)
- g_hash_table_remove (window->device_events, device);
+ if (surface->device_events)
+ g_hash_table_remove (surface->device_events, device);
}
static void
gdk_surface_finalize (GObject *object)
{
- GdkSurface *window = GDK_SURFACE (object);
+ GdkSurface *surface = GDK_SURFACE (object);
- g_signal_handlers_disconnect_by_func (gdk_surface_get_display (window),
- seat_removed_cb, window);
+ g_signal_handlers_disconnect_by_func (gdk_surface_get_display (surface),
+ seat_removed_cb, surface);
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
+ if (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_FOREIGN)
{
- g_warning ("losing last reference to undestroyed window");
- _gdk_surface_destroy (window, FALSE);
+ g_warning ("losing last reference to undestroyed surface");
+ _gdk_surface_destroy (surface, FALSE);
}
else
/* We use TRUE here, to keep us from actually calling
* XDestroyWindow() on the window
*/
- _gdk_surface_destroy (window, TRUE);
+ _gdk_surface_destroy (surface, TRUE);
}
- if (window->impl)
+ if (surface->impl)
{
- g_object_unref (window->impl);
- window->impl = NULL;
+ g_object_unref (surface->impl);
+ surface->impl = NULL;
}
- if (window->impl_surface != window)
+ if (surface->impl_surface != surface)
{
- g_object_unref (window->impl_surface);
- window->impl_surface = NULL;
+ g_object_unref (surface->impl_surface);
+ surface->impl_surface = NULL;
}
- if (window->shape)
- cairo_region_destroy (window->shape);
+ if (surface->shape)
+ cairo_region_destroy (surface->shape);
- if (window->input_shape)
- cairo_region_destroy (window->input_shape);
+ if (surface->input_shape)
+ cairo_region_destroy (surface->input_shape);
- if (window->cursor)
- g_object_unref (window->cursor);
+ if (surface->cursor)
+ g_object_unref (surface->cursor);
- if (window->device_cursor)
- g_hash_table_destroy (window->device_cursor);
+ if (surface->device_cursor)
+ g_hash_table_destroy (surface->device_cursor);
- if (window->device_events)
- g_hash_table_destroy (window->device_events);
+ if (surface->device_events)
+ g_hash_table_destroy (surface->device_events);
- if (window->devices_inside)
- g_list_free (window->devices_inside);
+ if (surface->devices_inside)
+ g_list_free (surface->devices_inside);
- g_clear_object (&window->display);
+ g_clear_object (&surface->display);
- if (window->opaque_region)
- cairo_region_destroy (window->opaque_region);
+ if (surface->opaque_region)
+ cairo_region_destroy (surface->opaque_region);
G_OBJECT_CLASS (gdk_surface_parent_class)->finalize (object);
}
@@ -405,17 +405,17 @@ gdk_surface_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GdkSurface *window = GDK_SURFACE (object);
+ GdkSurface *surface = GDK_SURFACE (object);
switch (prop_id)
{
case PROP_CURSOR:
- gdk_surface_set_cursor (window, g_value_get_object (value));
+ gdk_surface_set_cursor (surface, g_value_get_object (value));
break;
case PROP_DISPLAY:
- window->display = g_value_dup_object (value);
- g_assert (window->display != NULL);
+ surface->display = g_value_dup_object (value);
+ g_assert (surface->display != NULL);
break;
default:
@@ -430,20 +430,20 @@ gdk_surface_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GdkSurface *window = GDK_SURFACE (object);
+ GdkSurface *surface = GDK_SURFACE (object);
switch (prop_id)
{
case PROP_CURSOR:
- g_value_set_object (value, gdk_surface_get_cursor (window));
+ g_value_set_object (value, gdk_surface_get_cursor (surface));
break;
case PROP_DISPLAY:
- g_value_set_object (value, window->display);
+ g_value_set_object (value, surface->display);
break;
case PROP_STATE:
- g_value_set_flags (value, window->state);
+ g_value_set_flags (value, surface->state);
break;
default:
@@ -453,51 +453,51 @@ gdk_surface_get_property (GObject *object,
}
static gboolean
-gdk_surface_is_subsurface (GdkSurface *window)
+gdk_surface_is_subsurface (GdkSurface *surface)
{
- return window->surface_type == GDK_SURFACE_SUBSURFACE;
+ return surface->surface_type == GDK_SURFACE_SUBSURFACE;
}
static GdkSurface *
-gdk_surface_get_impl_surface (GdkSurface *window)
+gdk_surface_get_impl_surface (GdkSurface *surface)
{
- return window->impl_surface;
+ return surface->impl_surface;
}
GdkSurface *
-_gdk_surface_get_impl_surface (GdkSurface *window)
+_gdk_surface_get_impl_surface (GdkSurface *surface)
{
- return gdk_surface_get_impl_surface (window);
+ return gdk_surface_get_impl_surface (surface);
}
static gboolean
-gdk_surface_has_impl (GdkSurface *window)
+gdk_surface_has_impl (GdkSurface *surface)
{
- return window->impl_surface == window;
+ return surface->impl_surface == surface;
}
static gboolean
-gdk_surface_is_toplevel (GdkSurface *window)
+gdk_surface_is_toplevel (GdkSurface *surface)
{
return
- window->parent == NULL ||
- window->parent->surface_type == GDK_SURFACE_ROOT;
+ surface->parent == NULL ||
+ surface->parent->surface_type == GDK_SURFACE_ROOT;
}
gboolean
-_gdk_surface_has_impl (GdkSurface *window)
+_gdk_surface_has_impl (GdkSurface *surface)
{
- return gdk_surface_has_impl (window);
+ return gdk_surface_has_impl (surface);
}
static gboolean
-gdk_surface_has_no_impl (GdkSurface *window)
+gdk_surface_has_no_impl (GdkSurface *surface)
{
- return window->impl_surface != window;
+ return surface->impl_surface != surface;
}
static void
-remove_sibling_overlapped_area (GdkSurface *window,
+remove_sibling_overlapped_area (GdkSurface *surface,
cairo_region_t *region)
{
GdkSurface *parent;
@@ -506,19 +506,19 @@ remove_sibling_overlapped_area (GdkSurface *window,
GdkRectangle r;
GList *l;
- parent = window->parent;
+ parent = surface->parent;
- if (gdk_surface_is_toplevel (window))
+ if (gdk_surface_is_toplevel (surface))
return;
- /* Convert from from window coords to parent coords */
- cairo_region_translate (region, window->x, window->y);
+ /* Convert from from surface coords to parent coords */
+ cairo_region_translate (region, surface->x, surface->y);
for (l = parent->children; l; l = l->next)
{
sibling = l->data;
- if (sibling == window)
+ if (sibling == surface)
break;
if (!GDK_SURFACE_IS_MAPPED (sibling) || sibling->input_only)
@@ -533,7 +533,7 @@ remove_sibling_overlapped_area (GdkSurface *window,
if (sibling->shape)
{
- /* Adjust shape region to parent window coords */
+ /* Adjust shape region to parent surface coords */
cairo_region_translate (sibling->shape, sibling->x, sibling->y);
cairo_region_intersect (child_region, sibling->shape);
cairo_region_translate (sibling->shape, -sibling->x, -sibling->y);
@@ -545,12 +545,12 @@ remove_sibling_overlapped_area (GdkSurface *window,
remove_sibling_overlapped_area (parent, region);
- /* Convert back to window coords */
- cairo_region_translate (region, -window->x, -window->y);
+ /* Convert back to surface coords */
+ cairo_region_translate (region, -surface->x, -surface->y);
}
static void
-remove_child_area (GdkSurface *window,
+remove_child_area (GdkSurface *surface,
gboolean for_input,
cairo_region_t *region)
{
@@ -559,7 +559,7 @@ remove_child_area (GdkSurface *window,
GdkRectangle r;
GList *l;
- for (l = window->children; l; l = l->next)
+ for (l = surface->children; l; l = l->next)
{
child = l->data;
@@ -584,7 +584,7 @@ remove_child_area (GdkSurface *window,
if (child->shape)
{
- /* Adjust shape region to parent window coords */
+ /* Adjust shape region to parent surface coords */
cairo_region_translate (child->shape, child->x, child->y);
cairo_region_intersect (child_region, child->shape);
cairo_region_translate (child->shape, -child->x, -child->y);
@@ -602,20 +602,20 @@ remove_child_area (GdkSurface *window,
}
static gboolean
-should_apply_clip_as_shape (GdkSurface *window)
+should_apply_clip_as_shape (GdkSurface *surface)
{
return
- gdk_surface_has_impl (window) &&
+ gdk_surface_has_impl (surface) &&
/* Not for non-shaped toplevels */
- (window->shape != NULL || window->applied_shape) &&
- /* or for foreign windows */
- window->surface_type != GDK_SURFACE_FOREIGN &&
- /* or for the root window */
- window->surface_type != GDK_SURFACE_ROOT;
+ (surface->shape != NULL || surface->applied_shape) &&
+ /* or for foreign surfaces */
+ surface->surface_type != GDK_SURFACE_FOREIGN &&
+ /* or for the root surface */
+ surface->surface_type != GDK_SURFACE_ROOT;
}
static void
-apply_shape (GdkSurface *window,
+apply_shape (GdkSurface *surface,
cairo_region_t *region)
{
GdkSurfaceImplClass *impl_class;
@@ -623,16 +623,16 @@ apply_shape (GdkSurface *window,
/* We trash whether we applied a shape so that
we can avoid unsetting it many times, which
could happen in e.g. apply_clip_as_shape as
- windows get resized */
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ surfaces get resized */
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (region)
- impl_class->shape_combine_region (window,
+ impl_class->shape_combine_region (surface,
region, 0, 0);
- else if (window->applied_shape)
- impl_class->shape_combine_region (window,
+ else if (surface->applied_shape)
+ impl_class->shape_combine_region (surface,
NULL, 0, 0);
- window->applied_shape = region != NULL;
+ surface->applied_shape = region != NULL;
}
static gboolean
@@ -653,26 +653,26 @@ region_rect_equal (const cairo_region_t *region,
}
static void
-apply_clip_as_shape (GdkSurface *window)
+apply_clip_as_shape (GdkSurface *surface)
{
GdkRectangle r;
cairo_region_t *region;
r.x = r.y = 0;
- r.width = window->width;
- r.height = window->height;
+ r.width = surface->width;
+ r.height = surface->height;
- region = cairo_region_copy (window->clip_region);
- remove_sibling_overlapped_area (window, region);
+ region = cairo_region_copy (surface->clip_region);
+ remove_sibling_overlapped_area (surface, region);
/* We only apply the clip region if would differ
from the actual clip region implied by the size
- of the window. This is to avoid unneccessarily
- adding meaningless shapes to all native subwindows */
+ of the surface. This is to avoid unneccessarily
+ adding meaningless shapes to all native subsurfaces */
if (!region_rect_equal (region, &r))
- apply_shape (window, region);
+ apply_shape (surface, region);
else
- apply_shape (window, NULL);
+ apply_shape (surface, NULL);
cairo_region_destroy (region);
}
@@ -699,7 +699,7 @@ recompute_visible_regions_internal (GdkSurface *private,
(gdk_surface_is_toplevel (private) &&
private->surface_type == GDK_SURFACE_SUBSURFACE))
{
- /* Native windows and toplevel subsurfaces start here */
+ /* Native surfaces and toplevel subsurfaces start here */
private->abs_x = 0;
private->abs_y = 0;
}
@@ -715,14 +715,14 @@ recompute_visible_regions_internal (GdkSurface *private,
/* Update clip region based on:
* parent clip
- * window size/position
+ * surface size/position
*/
clip_region_changed = FALSE;
if (recalculate_clip)
{
if (private->viewable)
{
- /* Calculate visible region (sans children) in parent window coords */
+ /* Calculate visible region (sans children) in parent surface coords */
r.x = private->x;
r.y = private->y;
r.width = private->width;
@@ -732,7 +732,7 @@ recompute_visible_regions_internal (GdkSurface *private,
if (!gdk_surface_is_toplevel (private))
cairo_region_intersect (new_clip, private->parent->clip_region);
- /* Convert from parent coords to window coords */
+ /* Convert from parent coords to surface coords */
cairo_region_translate (new_clip, -private->x, -private->y);
if (should_apply_clip_as_shape (private) && private->shape)
@@ -770,17 +770,17 @@ recompute_visible_regions_internal (GdkSurface *private,
/* Call this when private has changed in one or more of these ways:
* size changed
- * window moved
- * new window added
- * stacking order of window changed
+ * surface moved
+ * new surface added
+ * stacking order of surface changed
* child deleted
*
* It will recalculate abs_x/y and the clip regions
*
- * Unless the window didn’t change stacking order or size/pos, pass in TRUE
+ * Unless the surface didn’t change stacking order or size/pos, pass in TRUE
* for recalculate_siblings. (Mostly used internally for the recursion)
*
- * If a child window was removed (and you can’t use that child for
+ * If a child surface was removed (and you can’t use that child for
* recompute_visible_regions), pass in TRUE for recalculate_children on the parent
*/
static void
@@ -798,35 +798,35 @@ recompute_visible_regions (GdkSurface *private,
}
static void
-gdk_surface_clear_old_updated_area (GdkSurface *window)
+gdk_surface_clear_old_updated_area (GdkSurface *surface)
{
int i;
for (i = 0; i < 2; i++)
{
- if (window->old_updated_area[i])
+ if (surface->old_updated_area[i])
{
- cairo_region_destroy (window->old_updated_area[i]);
- window->old_updated_area[i] = NULL;
+ cairo_region_destroy (surface->old_updated_area[i]);
+ surface->old_updated_area[i] = NULL;
}
}
}
static void
-gdk_surface_append_old_updated_area (GdkSurface *window,
+gdk_surface_append_old_updated_area (GdkSurface *surface,
cairo_region_t *region)
{
- if (window->old_updated_area[1])
- cairo_region_destroy (window->old_updated_area[1]);
- window->old_updated_area[1] = window->old_updated_area[0];
- window->old_updated_area[0] = cairo_region_reference (region);
+ if (surface->old_updated_area[1])
+ cairo_region_destroy (surface->old_updated_area[1]);
+ surface->old_updated_area[1] = surface->old_updated_area[0];
+ surface->old_updated_area[0] = cairo_region_reference (region);
}
void
-_gdk_surface_update_size (GdkSurface *window)
+_gdk_surface_update_size (GdkSurface *surface)
{
- gdk_surface_clear_old_updated_area (window);
- recompute_visible_regions (window, FALSE);
+ gdk_surface_clear_old_updated_area (surface);
+ recompute_visible_regions (surface, FALSE);
}
static GdkEventMask
@@ -849,7 +849,7 @@ get_native_device_event_mask (GdkSurface *private,
mask = private->event_mask;
- /* We need thse for all native windows so we can
+ /* We need thse for all native surfaces so we can
emulate events on children: */
mask |=
GDK_EXPOSURE_MASK |
@@ -874,7 +874,7 @@ gdk_surface_new (GdkDisplay *display,
GdkSurface *parent,
GdkSurfaceAttr *attributes)
{
- GdkSurface *window;
+ GdkSurface *surface;
gboolean native;
GdkEventMask event_mask;
@@ -886,47 +886,47 @@ gdk_surface_new (GdkDisplay *display,
return NULL;
}
- window = _gdk_display_create_window (display);
+ surface = _gdk_display_create_surface (display);
- window->parent = parent;
+ surface->parent = parent;
- window->accept_focus = TRUE;
- window->focus_on_map = TRUE;
+ surface->accept_focus = TRUE;
+ surface->focus_on_map = TRUE;
- window->x = attributes->x;
- window->y = attributes->y;
- window->width = (attributes->width > 1) ? (attributes->width) : (1);
- window->height = (attributes->height > 1) ? (attributes->height) : (1);
- window->alpha = 255;
+ surface->x = attributes->x;
+ surface->y = attributes->y;
+ surface->width = (attributes->width > 1) ? (attributes->width) : (1);
+ surface->height = (attributes->height > 1) ? (attributes->height) : (1);
+ surface->alpha = 255;
if (attributes->wclass == GDK_INPUT_ONLY)
{
/* Backwards compatiblity - we've always ignored
- * attributes->surface_type for input-only windows
+ * attributes->surface_type for input-only surfaces
* before
*/
if (parent == NULL)
- window->surface_type = GDK_SURFACE_TEMP;
+ surface->surface_type = GDK_SURFACE_TEMP;
else
- window->surface_type = GDK_SURFACE_CHILD;
+ surface->surface_type = GDK_SURFACE_CHILD;
}
else
- window->surface_type = attributes->surface_type;
+ surface->surface_type = attributes->surface_type;
/* Sanity checks */
- switch (window->surface_type)
+ switch (surface->surface_type)
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP:
if (parent != NULL && GDK_SURFACE_TYPE (parent) != GDK_SURFACE_ROOT)
- g_warning (G_STRLOC "Toplevel windows must be created as children of\n"
- "a window of type GDK_SURFACE_ROOT");
+ g_warning (G_STRLOC "Toplevel surfaces must be created as children of\n"
+ "a surface of type GDK_SURFACE_ROOT");
break;
case GDK_SURFACE_SUBSURFACE:
#ifdef GDK_WINDOWING_WAYLAND
if (!GDK_IS_WAYLAND_DISPLAY (display))
{
- g_warning (G_STRLOC "Subsurface windows can only be used on Wayland");
+ g_warning (G_STRLOC "Subsurface surfaces can only be used on Wayland");
return NULL;
}
#endif
@@ -935,73 +935,73 @@ gdk_surface_new (GdkDisplay *display,
if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_ROOT ||
GDK_SURFACE_TYPE (parent) == GDK_SURFACE_FOREIGN)
{
- g_warning (G_STRLOC "Child windows must not be created as children of\n"
- "a window of type GDK_SURFACE_ROOT or GDK_SURFACE_FOREIGN");
+ g_warning (G_STRLOC "Child surfaces must not be created as children of\n"
+ "a surface of type GDK_SURFACE_ROOT or GDK_SURFACE_FOREIGN");
return NULL;
}
break;
default:
- g_warning (G_STRLOC "cannot make windows of type %d", window->surface_type);
+ g_warning (G_STRLOC "cannot make surfaces of type %d", surface->surface_type);
return NULL;
}
- window->event_mask = GDK_ALL_EVENTS_MASK;
+ surface->event_mask = GDK_ALL_EVENTS_MASK;
if (attributes->wclass == GDK_INPUT_OUTPUT)
{
- window->input_only = FALSE;
+ surface->input_only = FALSE;
}
else
{
- window->input_only = TRUE;
+ surface->input_only = TRUE;
}
native = FALSE;
- if (window->parent != NULL)
- window->parent->children = g_list_concat (&window->children_list_node, window->parent->children);
+ if (surface->parent != NULL)
+ surface->parent->children = g_list_concat (&surface->children_list_node, surface->parent->children);
else
{
GdkFrameClock *frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
- gdk_surface_set_frame_clock (window, frame_clock);
+ gdk_surface_set_frame_clock (surface, frame_clock);
g_object_unref (frame_clock);
- native = TRUE; /* Always use native windows for toplevels */
+ native = TRUE; /* Always use native surfaces for toplevels */
}
#ifdef GDK_WINDOWING_WAYLAND
- if (window->surface_type == GDK_SURFACE_SUBSURFACE)
+ if (surface->surface_type == GDK_SURFACE_SUBSURFACE)
native = TRUE; /* Always use native windows for subsurfaces as well */
#endif
if (native)
{
- event_mask = get_native_event_mask (window);
+ event_mask = get_native_event_mask (surface);
/* Create the impl */
- _gdk_display_create_surface_impl (display, window, parent, event_mask, attributes);
- window->impl_surface = window;
+ _gdk_display_create_surface_impl (display, surface, parent, event_mask, attributes);
+ surface->impl_surface = surface;
}
else
{
- window->impl_surface = g_object_ref (window->parent->impl_surface);
- window->impl = g_object_ref (window->impl_surface->impl);
+ surface->impl_surface = g_object_ref (surface->parent->impl_surface);
+ surface->impl = g_object_ref (surface->impl_surface->impl);
}
- recompute_visible_regions (window, FALSE);
+ recompute_visible_regions (surface, FALSE);
- g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), window);
+ g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), surface);
- return window;
+ return surface;
}
/**
* gdk_surface_new_toplevel: (constructor)
- * @display: the display to create the window on
- * @width: width of new window
- * @height: height of new window
+ * @display: the display to create the surface on
+ * @width: width of new surface
+ * @height: height of new surface
*
- * Creates a new toplevel window. The window will be managed by the window
+ * Creates a new toplevel surface. The surface will be managed by the surface
* manager.
*
* Returns: (transfer full): the new #GdkSurface
@@ -1027,10 +1027,10 @@ gdk_surface_new_toplevel (GdkDisplay *display,
/**
* gdk_surface_new_popup: (constructor)
- * @display: the display to create the window on
- * @position: position of the window on screen
+ * @display: the display to create the surface on
+ * @position: position of the surface on screen
*
- * Creates a new toplevel popup window. The window will bypass window
+ * Creates a new toplevel popup surface. The surface will bypass surface
* management.
*
* Returns: (transfer full): the new #GdkSurface
@@ -1056,9 +1056,9 @@ gdk_surface_new_popup (GdkDisplay *display,
/**
* gdk_surface_new_temp: (constructor)
- * @display: the display to create the window on
+ * @display: the display to create the surface on
*
- * Creates a new toplevel temporary window. The window will be
+ * Creates a new toplevel temporary surface. The surface will be
* situated off-screen and not handle output.
*
* You most likely do not want to use this function.
@@ -1084,10 +1084,10 @@ gdk_surface_new_temp (GdkDisplay *display)
/**
* gdk_surface_new_child: (constructor)
- * @parent: the parent window
- * @position: placement of the window inside @parent
+ * @parent: the parent surface
+ * @position: placement of the surface inside @parent
*
- * Creates a new client-side child window.
+ * Creates a new client-side child surface.
*
* Returns: (transfer full): the new #GdkSurface
**/
@@ -1115,9 +1115,9 @@ update_pointer_info_foreach (GdkDisplay *display,
GdkPointerSurfaceInfo *pointer_info,
gpointer user_data)
{
- GdkSurface *window = user_data;
+ GdkSurface *surface = user_data;
- if (pointer_info->surface_under_pointer == window)
+ if (pointer_info->surface_under_pointer == surface)
{
g_object_unref (pointer_info->surface_under_pointer);
pointer_info->surface_under_pointer = NULL;
@@ -1125,63 +1125,63 @@ update_pointer_info_foreach (GdkDisplay *display,
}
static void
-window_remove_from_pointer_info (GdkSurface *window,
+surface_remove_from_pointer_info (GdkSurface *surface,
GdkDisplay *display)
{
_gdk_display_pointer_info_foreach (display,
update_pointer_info_foreach,
- window);
+ surface);
}
static void
-gdk_surface_free_current_paint (GdkSurface *window)
+gdk_surface_free_current_paint (GdkSurface *surface)
{
- cairo_surface_destroy (window->current_paint.surface);
- window->current_paint.surface = NULL;
+ cairo_surface_destroy (surface->current_paint.surface);
+ surface->current_paint.surface = NULL;
- cairo_region_destroy (window->current_paint.region);
- window->current_paint.region = NULL;
+ cairo_region_destroy (surface->current_paint.region);
+ surface->current_paint.region = NULL;
- window->current_paint.surface_needs_composite = FALSE;
+ surface->current_paint.surface_needs_composite = FALSE;
}
/**
* _gdk_surface_destroy_hierarchy:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @recursing: If %TRUE, then this is being called because a parent
* was destroyed.
* @recursing_native: If %TRUE, then this is being called because a native parent
* was destroyed. This generally means that the call to the
- * windowing system to destroy the window can be omitted, since
+ * windowing system to destroy the surface can be omitted, since
* it will be destroyed as a result of the parent being destroyed.
* Unless @foreign_destroy.
- * @foreign_destroy: If %TRUE, the window or a parent was destroyed by some
- * external agency. The window has already been destroyed and no
+ * @foreign_destroy: If %TRUE, the surface or a parent was destroyed by some
+ * external agency. The surface has already been destroyed and no
* windowing system calls should be made. (This may never happen
* for some windowing systems.)
*
- * Internal function to destroy a window. Like gdk_surface_destroy(),
+ * Internal function to destroy a surface. Like gdk_surface_destroy(),
* but does not drop the reference count created by gdk_surface_new().
**/
static void
-_gdk_surface_destroy_hierarchy (GdkSurface *window,
+_gdk_surface_destroy_hierarchy (GdkSurface *surface,
gboolean recursing,
gboolean recursing_native,
gboolean foreign_destroy)
{
GdkSurfaceImplClass *impl_class;
- GdkSurface *temp_window;
+ GdkSurface *temp_surface;
GdkDisplay *display;
GList *tmp;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- switch (window->surface_type)
+ switch (surface->surface_type)
{
default:
g_assert_not_reached ();
@@ -1199,86 +1199,86 @@ _gdk_surface_destroy_hierarchy (GdkSurface *window,
case GDK_SURFACE_TEMP:
case GDK_SURFACE_FOREIGN:
case GDK_SURFACE_SUBSURFACE:
- if (window->surface_type == GDK_SURFACE_FOREIGN && !foreign_destroy)
+ if (surface->surface_type == GDK_SURFACE_FOREIGN && !foreign_destroy)
{
}
else
{
- if (window->parent)
+ if (surface->parent)
{
- if (window->parent->children)
- window->parent->children = g_list_remove_link (window->parent->children, &window->children_list_node);
+ if (surface->parent->children)
+ surface->parent->children = g_list_remove_link (surface->parent->children, &surface->children_list_node);
if (!recursing &&
- GDK_SURFACE_IS_MAPPED (window))
+ GDK_SURFACE_IS_MAPPED (surface))
{
- recompute_visible_regions (window, FALSE);
- gdk_surface_invalidate_in_parent (window);
+ recompute_visible_regions (surface, FALSE);
+ gdk_surface_invalidate_in_parent (surface);
}
}
- if (window->gl_paint_context)
+ if (surface->gl_paint_context)
{
/* Make sure to destroy if current */
- g_object_run_dispose (G_OBJECT (window->gl_paint_context));
- g_object_unref (window->gl_paint_context);
- window->gl_paint_context = NULL;
+ g_object_run_dispose (G_OBJECT (surface->gl_paint_context));
+ g_object_unref (surface->gl_paint_context);
+ surface->gl_paint_context = NULL;
}
- if (window->frame_clock)
+ if (surface->frame_clock)
{
- g_object_run_dispose (G_OBJECT (window->frame_clock));
- gdk_surface_set_frame_clock (window, NULL);
+ g_object_run_dispose (G_OBJECT (surface->frame_clock));
+ gdk_surface_set_frame_clock (surface, NULL);
}
- gdk_surface_free_current_paint (window);
+ gdk_surface_free_current_paint (surface);
- if (window->surface_type == GDK_SURFACE_FOREIGN)
- g_assert (window->children == NULL);
+ if (surface->surface_type == GDK_SURFACE_FOREIGN)
+ g_assert (surface->children == NULL);
else
{
- tmp = window->children;
- window->children = NULL;
+ tmp = surface->children;
+ surface->children = NULL;
/* No need to free children list, its all made up of in-struct nodes */
while (tmp)
{
- temp_window = tmp->data;
+ temp_surface = tmp->data;
tmp = tmp->next;
- if (temp_window)
- _gdk_surface_destroy_hierarchy (temp_window,
+ if (temp_surface)
+ _gdk_surface_destroy_hierarchy (temp_surface,
TRUE,
- recursing_native || gdk_surface_has_impl (window),
+ recursing_native || gdk_surface_has_impl (surface),
foreign_destroy);
}
}
- _gdk_surface_clear_update_area (window);
+ _gdk_surface_clear_update_area (surface);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
- if (gdk_surface_has_impl (window))
- impl_class->destroy (window, recursing_native, foreign_destroy);
+ if (gdk_surface_has_impl (surface))
+ impl_class->destroy (surface, recursing_native, foreign_destroy);
else
{
/* hide to make sure we repaint and break grabs */
- gdk_surface_hide (window);
+ gdk_surface_hide (surface);
}
- window->state |= GDK_SURFACE_STATE_WITHDRAWN;
- window->parent = NULL;
- window->destroyed = TRUE;
+ surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
+ surface->parent = NULL;
+ surface->destroyed = TRUE;
- window_remove_from_pointer_info (window, display);
+ surface_remove_from_pointer_info (surface, display);
- if (window->clip_region)
+ if (surface->clip_region)
{
- cairo_region_destroy (window->clip_region);
- window->clip_region = NULL;
+ cairo_region_destroy (surface->clip_region);
+ surface->clip_region = NULL;
}
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
}
break;
}
@@ -1286,44 +1286,44 @@ _gdk_surface_destroy_hierarchy (GdkSurface *window,
/**
* _gdk_surface_destroy:
- * @window: a #GdkSurface
- * @foreign_destroy: If %TRUE, the window or a parent was destroyed by some
- * external agency. The window has already been destroyed and no
+ * @surface: a #GdkSurface
+ * @foreign_destroy: If %TRUE, the surface or a parent was destroyed by some
+ * external agency. The surface has already been destroyed and no
* windowing system calls should be made. (This may never happen
* for some windowing systems.)
*
- * Internal function to destroy a window. Like gdk_surface_destroy(),
+ * Internal function to destroy a surface. Like gdk_surface_destroy(),
* but does not drop the reference count created by gdk_surface_new().
**/
void
-_gdk_surface_destroy (GdkSurface *window,
+_gdk_surface_destroy (GdkSurface *surface,
gboolean foreign_destroy)
{
- _gdk_surface_destroy_hierarchy (window, FALSE, FALSE, foreign_destroy);
+ _gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, foreign_destroy);
}
/**
* gdk_surface_destroy:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Destroys the window system resources associated with @window and decrements @window's
- * reference count. The window system resources for all children of @window are also
+ * Destroys the window system resources associated with @surface and decrements @surface's
+ * reference count. The window system resources for all children of @surface are also
* destroyed, but the children’s reference counts are not decremented.
*
- * Note that a window will not be destroyed automatically when its reference count
+ * Note that a surface will not be destroyed automatically when its reference count
* reaches zero. You must call this function yourself before that happens.
*
**/
void
-gdk_surface_destroy (GdkSurface *window)
+gdk_surface_destroy (GdkSurface *surface)
{
- _gdk_surface_destroy_hierarchy (window, FALSE, FALSE, FALSE);
- g_object_unref (window);
+ _gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, FALSE);
+ g_object_unref (surface);
}
/**
* gdk_surface_set_user_data:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @user_data: (allow-none) (type GObject.Object): user data
*
* For most purposes this function is deprecated in favor of
@@ -1331,255 +1331,255 @@ gdk_surface_destroy (GdkSurface *window)
* the #GtkWidget that owns a #GdkSurface as user data on the
* #GdkSurface. So, custom widget implementations should use
* this function for that. If GTK+ receives an event for a #GdkSurface,
- * and the user data for the window is non-%NULL, GTK+ will assume the
+ * and the user data for the surface is non-%NULL, GTK+ will assume the
* user data is a #GtkWidget, and forward the event to that widget.
*
**/
void
-gdk_surface_set_user_data (GdkSurface *window,
+gdk_surface_set_user_data (GdkSurface *surface,
gpointer user_data)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- window->user_data = user_data;
+ surface->user_data = user_data;
}
/**
* gdk_surface_get_user_data:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @data: (out): return location for user data
*
- * Retrieves the user data for @window, which is normally the widget
- * that @window belongs to. See gdk_surface_set_user_data().
+ * Retrieves the user data for @surface, which is normally the widget
+ * that @surface belongs to. See gdk_surface_set_user_data().
*
**/
void
-gdk_surface_get_user_data (GdkSurface *window,
+gdk_surface_get_user_data (GdkSurface *surface,
gpointer *data)
{
- *data = window->user_data;
+ *data = surface->user_data;
}
/**
* gdk_surface_get_surface_type:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the type of the window. See #GdkSurfaceType.
+ * Gets the type of the surface. See #GdkSurfaceType.
*
- * Returns: type of window
+ * Returns: type of surface
**/
GdkSurfaceType
-gdk_surface_get_surface_type (GdkSurface *window)
+gdk_surface_get_surface_type (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), (GdkSurfaceType) -1);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), (GdkSurfaceType) -1);
- return GDK_SURFACE_TYPE (window);
+ return GDK_SURFACE_TYPE (surface);
}
/**
* gdk_surface_get_display:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
* Gets the #GdkDisplay associated with a #GdkSurface.
*
- * Returns: (transfer none): the #GdkDisplay associated with @window
+ * Returns: (transfer none): the #GdkDisplay associated with @surface
**/
GdkDisplay *
-gdk_surface_get_display (GdkSurface *window)
+gdk_surface_get_display (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- return window->display;
+ return surface->display;
}
/**
* gdk_surface_is_destroyed:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Check to see if a window is destroyed..
+ * Check to see if a surface is destroyed..
*
- * Returns: %TRUE if the window is destroyed
+ * Returns: %TRUE if the surface is destroyed
**/
gboolean
-gdk_surface_is_destroyed (GdkSurface *window)
+gdk_surface_is_destroyed (GdkSurface *surface)
{
- return GDK_SURFACE_DESTROYED (window);
+ return GDK_SURFACE_DESTROYED (surface);
}
/**
* gdk_surface_has_native:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Checks whether the window has a native window or not.
+ * Checks whether the surface has a native surface or not.
*
- * Returns: %TRUE if the @window has a native window, %FALSE otherwise.
+ * Returns: %TRUE if the @surface has a native surface, %FALSE otherwise.
*/
gboolean
-gdk_surface_has_native (GdkSurface *window)
+gdk_surface_has_native (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->parent == NULL || window->parent->impl != window->impl;
+ return surface->parent == NULL || surface->parent->impl != surface->impl;
}
/**
* gdk_surface_get_position:
- * @window: a #GdkSurface
- * @x: (out) (allow-none): X coordinate of window
- * @y: (out) (allow-none): Y coordinate of window
+ * @surface: a #GdkSurface
+ * @x: (out) (allow-none): X coordinate of surface
+ * @y: (out) (allow-none): Y coordinate of surface
*
- * Obtains the position of the window as reported in the
+ * Obtains the position of the surface as reported in the
* most-recently-processed #GdkEventConfigure. Contrast with
* gdk_surface_get_geometry() which queries the X server for the
- * current window position, regardless of which events have been
+ * current surface position, regardless of which events have been
* received or processed.
*
- * The position coordinates are relative to the window’s parent window.
+ * The position coordinates are relative to the surface’s parent surface.
*
**/
void
-gdk_surface_get_position (GdkSurface *window,
+gdk_surface_get_position (GdkSurface *surface,
gint *x,
gint *y)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
if (x)
- *x = window->x;
+ *x = surface->x;
if (y)
- *y = window->y;
+ *y = surface->y;
}
/**
* gdk_surface_get_parent:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Obtains the parent of @window, as known to GDK. Does not query the
+ * Obtains the parent of @surface, as known to GDK. Does not query the
* X server; thus this returns the parent as passed to gdk_surface_new(),
* not the actual parent. This should never matter unless you’re using
* Xlib calls mixed with GDK calls on the X11 platform. It may also
* matter for toplevel windows, because the window manager may choose
* to reparent them.
*
- * Returns: (transfer none): parent of @window
+ * Returns: (transfer none): parent of @surface
**/
GdkSurface*
-gdk_surface_get_parent (GdkSurface *window)
+gdk_surface_get_parent (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (gdk_surface_is_subsurface (window))
- return window->transient_for;
+ if (gdk_surface_is_subsurface (surface))
+ return surface->transient_for;
else
- return window->parent;
+ return surface->parent;
}
/**
* gdk_surface_get_toplevel:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the toplevel window that’s an ancestor of @window.
+ * Gets the toplevel surface that’s an ancestor of @surface.
*
- * Any window type but %GDK_SURFACE_CHILD is considered a
- * toplevel window, as is a %GDK_SURFACE_CHILD window that
- * has a root window as parent.
+ * Any surface type but %GDK_SURFACE_CHILD is considered a
+ * toplevel surface, as is a %GDK_SURFACE_CHILD surface that
+ * has a root surface as parent.
*
- * Returns: (transfer none): the toplevel window containing @window
+ * Returns: (transfer none): the toplevel surface containing @surface
**/
GdkSurface *
-gdk_surface_get_toplevel (GdkSurface *window)
+gdk_surface_get_toplevel (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- while (window->surface_type == GDK_SURFACE_CHILD ||
- window->surface_type == GDK_SURFACE_SUBSURFACE)
+ while (surface->surface_type == GDK_SURFACE_CHILD ||
+ surface->surface_type == GDK_SURFACE_SUBSURFACE)
{
- if (gdk_surface_is_toplevel (window))
+ if (gdk_surface_is_toplevel (surface))
break;
- window = window->parent;
+ surface = surface->parent;
}
- return window;
+ return surface;
}
/**
* gdk_surface_get_children:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the list of children of @window known to GDK.
+ * Gets the list of children of @surface known to GDK.
* This function only returns children created via GDK,
* so for example it’s useless when used with the root window;
- * it only returns windows an application created itself.
+ * it only returns surfaces an application created itself.
*
* The returned list must be freed, but the elements in the
* list need not be.
*
* Returns: (transfer container) (element-type GdkSurface):
- * list of child windows inside @window
+ * list of child surfaces inside @surface
**/
GList*
-gdk_surface_get_children (GdkSurface *window)
+gdk_surface_get_children (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- return g_list_copy (window->children);
+ return g_list_copy (surface->children);
}
/**
* gdk_surface_peek_children:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
* Like gdk_surface_get_children(), but does not copy the list of
* children, so the list does not need to be freed.
*
* Returns: (transfer none) (element-type GdkSurface):
- * a reference to the list of child windows in @window
+ * a reference to the list of child surfaces in @surface
**/
GList *
-gdk_surface_peek_children (GdkSurface *window)
+gdk_surface_peek_children (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- return window->children;
+ return surface->children;
}
/**
* gdk_surface_get_children_with_user_data:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @user_data: user data to look for
*
- * Gets the list of children of @window known to GDK with a
+ * Gets the list of children of @surface known to GDK with a
* particular @user_data set on it.
*
* The returned list must be freed, but the elements in the
* list need not be.
*
* The list is returned in (relative) stacking order, i.e. the
- * lowest window is first.
+ * lowest surface is first.
*
* Returns: (transfer container) (element-type GdkSurface):
- * list of child windows inside @window
+ * list of child surfaces inside @surface
**/
GList *
-gdk_surface_get_children_with_user_data (GdkSurface *window,
+gdk_surface_get_children_with_user_data (GdkSurface *surface,
gpointer user_data)
{
GdkSurface *child;
GList *res, *l;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
res = NULL;
- for (l = window->children; l != NULL; l = l->next)
+ for (l = surface->children; l != NULL; l = l->next)
{
child = l->data;
@@ -1593,88 +1593,88 @@ gdk_surface_get_children_with_user_data (GdkSurface *window,
/**
* gdk_surface_is_visible:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Checks whether the window has been mapped (with gdk_surface_show() or
+ * Checks whether the surface has been mapped (with gdk_surface_show() or
* gdk_surface_show_unraised()).
*
- * Returns: %TRUE if the window is mapped
+ * Returns: %TRUE if the surface is mapped
**/
gboolean
-gdk_surface_is_visible (GdkSurface *window)
+gdk_surface_is_visible (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return GDK_SURFACE_IS_MAPPED (window);
+ return GDK_SURFACE_IS_MAPPED (surface);
}
/**
* gdk_surface_is_viewable:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Check if the window and all ancestors of the window are
+ * Check if the surface and all ancestors of the surface are
* mapped. (This is not necessarily "viewable" in the X sense, since
* we only check as far as we have GDK surface parents, not to the root
- * window.)
+ * surface.)
*
- * Returns: %TRUE if the window is viewable
+ * Returns: %TRUE if the surface is viewable
**/
gboolean
-gdk_surface_is_viewable (GdkSurface *window)
+gdk_surface_is_viewable (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- if (window->destroyed)
+ if (surface->destroyed)
return FALSE;
- return window->viewable;
+ return surface->viewable;
}
/**
* gdk_surface_get_state:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the bitwise OR of the currently active window state flags,
+ * Gets the bitwise OR of the currently active surface state flags,
* from the #GdkSurfaceState enumeration.
*
- * Returns: window state bitfield
+ * Returns: surface state bitfield
**/
GdkSurfaceState
-gdk_surface_get_state (GdkSurface *window)
+gdk_surface_get_state (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->state;
+ return surface->state;
}
static cairo_content_t
-gdk_surface_get_content (GdkSurface *window)
+gdk_surface_get_content (GdkSurface *surface)
{
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
cairo_content_t content;
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- surface = gdk_surface_ref_impl_surface (window);
- content = cairo_surface_get_content (surface);
- cairo_surface_destroy (surface);
+ cairo_surface = gdk_surface_ref_impl_surface (surface);
+ content = cairo_surface_get_content (cairo_surface);
+ cairo_surface_destroy (cairo_surface);
return content;
}
static cairo_surface_t *
-gdk_surface_ref_impl_surface (GdkSurface *window)
+gdk_surface_ref_impl_surface (GdkSurface *surface)
{
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_surface_get_impl_surface (window));
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->ref_cairo_surface (gdk_surface_get_impl_surface (surface));
}
GdkGLContext *
-gdk_surface_get_paint_gl_context (GdkSurface *window,
+gdk_surface_get_paint_gl_context (GdkSurface *surface,
GError **error)
{
GError *internal_error = NULL;
- if (GDK_DISPLAY_DEBUG_CHECK (window->display, GL_DISABLE))
+ if (GDK_DISPLAY_DEBUG_CHECK (surface->display, GL_DISABLE))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
@@ -1682,9 +1682,9 @@ gdk_surface_get_paint_gl_context (GdkSurface *window,
return NULL;
}
- if (window->impl_surface->gl_paint_context == NULL)
+ if (surface->impl_surface->gl_paint_context == NULL)
{
- GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->create_gl_context == NULL)
{
@@ -1693,8 +1693,8 @@ gdk_surface_get_paint_gl_context (GdkSurface *window,
return NULL;
}
- window->impl_surface->gl_paint_context =
- impl_class->create_gl_context (window->impl_surface,
+ surface->impl_surface->gl_paint_context =
+ impl_class->create_gl_context (surface->impl_surface,
TRUE,
NULL,
&internal_error);
@@ -1703,29 +1703,29 @@ gdk_surface_get_paint_gl_context (GdkSurface *window,
if (internal_error != NULL)
{
g_propagate_error (error, internal_error);
- g_clear_object (&(window->impl_surface->gl_paint_context));
+ g_clear_object (&(surface->impl_surface->gl_paint_context));
return NULL;
}
- gdk_gl_context_realize (window->impl_surface->gl_paint_context, &internal_error);
+ gdk_gl_context_realize (surface->impl_surface->gl_paint_context, &internal_error);
if (internal_error != NULL)
{
g_propagate_error (error, internal_error);
- g_clear_object (&(window->impl_surface->gl_paint_context));
+ g_clear_object (&(surface->impl_surface->gl_paint_context));
return NULL;
}
- return window->impl_surface->gl_paint_context;
+ return surface->impl_surface->gl_paint_context;
}
/**
* gdk_surface_create_gl_context:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @error: return location for an error
*
* Creates a new #GdkGLContext matching the
* framebuffer format to the visual of the #GdkSurface. The context
- * is disconnected from any particular window or surface.
+ * is disconnected from any particular surface or surface.
*
* If the creation of the #GdkGLContext failed, @error will be set.
*
@@ -1736,19 +1736,19 @@ gdk_surface_get_paint_gl_context (GdkSurface *window,
* %NULL on error
**/
GdkGLContext *
-gdk_surface_create_gl_context (GdkSurface *window,
+gdk_surface_create_gl_context (GdkSurface *surface,
GError **error)
{
GdkGLContext *paint_context;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- paint_context = gdk_surface_get_paint_gl_context (window, error);
+ paint_context = gdk_surface_get_paint_gl_context (surface, error);
if (paint_context == NULL)
return NULL;
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_surface,
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_gl_context (surface->impl_surface,
FALSE,
paint_context,
error);
@@ -1756,10 +1756,10 @@ gdk_surface_create_gl_context (GdkSurface *window,
/**
* gdk_surface_create_vulkan_context:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @error: return location for an error
*
- * Creates a new #GdkVulkanContext for rendering on @window.
+ * Creates a new #GdkVulkanContext for rendering on @surface.
*
* If the creation of the #GdkVulkanContext failed, @error will be set.
*
@@ -1767,22 +1767,22 @@ gdk_surface_create_gl_context (GdkSurface *window,
* %NULL on error
**/
GdkVulkanContext *
-gdk_surface_create_vulkan_context (GdkSurface *window,
+gdk_surface_create_vulkan_context (GdkSurface *surface,
GError **error)
{
GdkDisplay *display;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- if (GDK_DISPLAY_DEBUG_CHECK (window->display, VULKAN_DISABLE))
+ if (GDK_DISPLAY_DEBUG_CHECK (surface->display, VULKAN_DISABLE))
{
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
_("Vulkan support disabled via GDK_DEBUG"));
return NULL;
}
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
if (GDK_DISPLAY_GET_CLASS (display)->vk_extension_name == NULL)
{
@@ -1794,12 +1794,12 @@ gdk_surface_create_vulkan_context (GdkSurface *window,
return g_initable_new (GDK_DISPLAY_GET_CLASS (display)->vk_context_type,
NULL,
error,
- "window", window,
+ "surface", surface,
NULL);
}
static void
-gdk_surface_begin_paint_internal (GdkSurface *window,
+gdk_surface_begin_paint_internal (GdkSurface *surface,
const cairo_region_t *region)
{
GdkRectangle clip_box;
@@ -1808,74 +1808,74 @@ gdk_surface_begin_paint_internal (GdkSurface *window,
gboolean needs_surface;
cairo_content_t surface_content;
- if (window->current_paint.surface != NULL)
+ if (surface->current_paint.surface != NULL)
{
- g_warning ("A paint operation on the window is alredy in progress. "
+ g_warning ("A paint operation on the surface is alredy in progress. "
"This is not allowed.");
return;
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
needs_surface = TRUE;
if (impl_class->begin_paint)
- needs_surface = impl_class->begin_paint (window);
+ needs_surface = impl_class->begin_paint (surface);
- window->current_paint.region = cairo_region_copy (region);
- cairo_region_intersect (window->current_paint.region, window->clip_region);
- cairo_region_get_extents (window->current_paint.region, &clip_box);
+ surface->current_paint.region = cairo_region_copy (region);
+ cairo_region_intersect (surface->current_paint.region, surface->clip_region);
+ cairo_region_get_extents (surface->current_paint.region, &clip_box);
- surface_content = gdk_surface_get_content (window);
+ surface_content = gdk_surface_get_content (surface);
if (needs_surface)
{
- window->current_paint.surface = gdk_surface_create_similar_surface (window,
+ surface->current_paint.surface = gdk_surface_create_similar_surface (surface,
surface_content,
MAX (clip_box.width, 1),
MAX (clip_box.height, 1));
sx = sy = 1;
- cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
- cairo_surface_set_device_offset (window->current_paint.surface, -clip_box.x*sx, -clip_box.y*sy);
- gdk_cairo_surface_mark_as_direct (window->current_paint.surface, window);
+ cairo_surface_get_device_scale (surface->current_paint.surface, &sx, &sy);
+ cairo_surface_set_device_offset (surface->current_paint.surface, -clip_box.x*sx, -clip_box.y*sy);
+ gdk_cairo_surface_mark_as_direct (surface->current_paint.surface, surface);
- window->current_paint.surface_needs_composite = TRUE;
+ surface->current_paint.surface_needs_composite = TRUE;
}
else
{
- window->current_paint.surface = gdk_surface_ref_impl_surface (window);
- window->current_paint.surface_needs_composite = FALSE;
+ surface->current_paint.surface = gdk_surface_ref_impl_surface (surface);
+ surface->current_paint.surface_needs_composite = FALSE;
}
- if (!cairo_region_is_empty (window->current_paint.region))
- gdk_surface_clear_backing_region (window);
+ if (!cairo_region_is_empty (surface->current_paint.region))
+ gdk_surface_clear_backing_region (surface);
}
static void
-gdk_surface_end_paint_internal (GdkSurface *window)
+gdk_surface_end_paint_internal (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
cairo_t *cr;
- if (window->current_paint.surface == NULL)
+ if (surface->current_paint.surface == NULL)
{
g_warning (G_STRLOC": no preceding call to gdk_surface_begin_draw_frame(), see documentation");
return;
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->end_paint)
- impl_class->end_paint (window);
+ impl_class->end_paint (surface);
- if (window->current_paint.surface_needs_composite)
+ if (surface->current_paint.surface_needs_composite)
{
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
- surface = gdk_surface_ref_impl_surface (window);
- cr = cairo_create (surface);
+ cairo_surface = gdk_surface_ref_impl_surface (surface);
+ cr = cairo_create (cairo_surface);
- cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
- gdk_cairo_region (cr, window->current_paint.region);
+ cairo_set_source_surface (cr, surface->current_paint.surface, 0, 0);
+ gdk_cairo_region (cr, surface->current_paint.region);
cairo_clip (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
@@ -1883,35 +1883,35 @@ gdk_surface_end_paint_internal (GdkSurface *window)
cairo_destroy (cr);
- cairo_surface_flush (surface);
- cairo_surface_destroy (surface);
+ cairo_surface_flush (cairo_surface);
+ cairo_surface_destroy (cairo_surface);
}
- gdk_surface_free_current_paint (window);
+ gdk_surface_free_current_paint (surface);
}
/**
* gdk_surface_begin_draw_frame:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @context: (allow-none): the context used to draw the frame
* @region: a Cairo region
*
* Indicates that you are beginning the process of redrawing @region
- * on @window, and provides you with a #GdkDrawingContext.
+ * on @surface, and provides you with a #GdkDrawingContext.
*
- * If @window is a top level #GdkSurface, backed by a native window
+ * If @surface is a top level #GdkSurface, backed by a native surface
* implementation, a backing store (offscreen buffer) large enough to
* contain @region will be created. The backing store will be initialized
- * with the background color or background surface for @window. Then, all
- * drawing operations performed on @window will be diverted to the
+ * with the background color or background surface for @surface. Then, all
+ * drawing operations performed on @surface will be diverted to the
* backing store. When you call gdk_surface_end_frame(), the contents of
- * the backing store will be copied to @window, making it visible
- * on screen. Only the part of @window contained in @region will be
+ * the backing store will be copied to @surface, making it visible
+ * on screen. Only the part of @surface contained in @region will be
* modified; that is, drawing operations are clipped to @region.
*
* The net result of all this is to remove flicker, because the user
* sees the finished product appear all at once when you call
- * gdk_surface_end_draw_frame(). If you draw to @window directly without
+ * gdk_surface_end_draw_frame(). If you draw to @surface directly without
* calling gdk_surface_begin_draw_frame(), the user may see flicker
* as individual drawing operations are performed in sequence.
*
@@ -1925,35 +1925,35 @@ gdk_surface_end_paint_internal (GdkSurface *window)
* explicitly.
*
* Returns: (transfer none): a #GdkDrawingContext context that should be
- * used to draw the contents of the window; the returned context is owned
+ * used to draw the contents of the surface; the returned context is owned
* by GDK.
*/
GdkDrawingContext *
-gdk_surface_begin_draw_frame (GdkSurface *window,
+gdk_surface_begin_draw_frame (GdkSurface *surface,
GdkDrawContext *draw_context,
const cairo_region_t *region)
{
GdkDrawingContext *context;
cairo_region_t *real_region;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
- g_return_val_if_fail (gdk_surface_has_native (window), NULL);
- g_return_val_if_fail (gdk_surface_is_toplevel (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+ g_return_val_if_fail (gdk_surface_has_native (surface), NULL);
+ g_return_val_if_fail (gdk_surface_is_toplevel (surface), NULL);
g_return_val_if_fail (region != NULL, NULL);
if (draw_context != NULL)
{
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (draw_context), NULL);
- g_return_val_if_fail (gdk_draw_context_get_surface (draw_context) == window, NULL);
+ g_return_val_if_fail (gdk_draw_context_get_surface (draw_context) == surface, NULL);
}
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- if (window->drawing_context != NULL)
+ if (surface->drawing_context != NULL)
{
- g_critical ("The window %p already has a drawing context. You cannot "
+ g_critical ("The surface %p already has a drawing context. You cannot "
"call gdk_surface_begin_draw_frame() without calling "
- "gdk_surface_end_draw_frame() first.", window);
+ "gdk_surface_end_draw_frame() first.", surface);
return NULL;
}
@@ -1962,16 +1962,16 @@ gdk_surface_begin_draw_frame (GdkSurface *window,
if (draw_context)
gdk_draw_context_begin_frame (draw_context, real_region);
else
- gdk_surface_begin_paint_internal (window, real_region);
+ gdk_surface_begin_paint_internal (surface, real_region);
context = g_object_new (GDK_TYPE_DRAWING_CONTEXT,
- "window", window,
+ "surface", surface,
"paint-context", draw_context,
"clip", real_region,
NULL);
/* Do not take a reference, to avoid creating cycles */
- window->drawing_context = context;
+ surface->drawing_context = context;
cairo_region_destroy (real_region);
@@ -1980,10 +1980,10 @@ gdk_surface_begin_draw_frame (GdkSurface *window,
/**
* gdk_surface_end_draw_frame:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @context: the #GdkDrawingContext created by gdk_surface_begin_draw_frame()
*
- * Indicates that the drawing of the contents of @window started with
+ * Indicates that the drawing of the contents of @surface started with
* gdk_surface_begin_frame() has been completed.
*
* This function will take care of destroying the #GdkDrawingContext.
@@ -1992,25 +1992,25 @@ gdk_surface_begin_draw_frame (GdkSurface *window,
* gdk_surface_begin_frame() first.
*/
void
-gdk_surface_end_draw_frame (GdkSurface *window,
+gdk_surface_end_draw_frame (GdkSurface *surface,
GdkDrawingContext *context)
{
GdkDrawContext *paint_context;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_DRAWING_CONTEXT (context));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (window->drawing_context == NULL)
+ if (surface->drawing_context == NULL)
{
- g_critical ("The window %p has no drawing context. You must call "
+ g_critical ("The surface %p has no drawing context. You must call "
"gdk_surface_begin_draw_frame() before calling "
- "gdk_surface_end_draw_frame().", window);
+ "gdk_surface_end_draw_frame().", surface);
return;
}
- g_return_if_fail (window->drawing_context == context);
+ g_return_if_fail (surface->drawing_context == context);
paint_context = gdk_drawing_context_get_paint_context (context);
if (paint_context)
@@ -2019,41 +2019,41 @@ gdk_surface_end_draw_frame (GdkSurface *window,
gdk_draw_context_end_frame (paint_context,
clip,
- window->active_update_area);
+ surface->active_update_area);
cairo_region_destroy (clip);
}
else
{
- gdk_surface_end_paint_internal (window);
+ gdk_surface_end_paint_internal (surface);
}
- window->drawing_context = NULL;
+ surface->drawing_context = NULL;
g_object_unref (context);
}
/*< private >
* gdk_surface_get_current_paint_region:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
* Retrieves a copy of the current paint region.
*
* Returns: (transfer full): a Cairo region
*/
cairo_region_t *
-gdk_surface_get_current_paint_region (GdkSurface *window)
+gdk_surface_get_current_paint_region (GdkSurface *surface)
{
cairo_region_t *region;
- if (window->impl_surface->current_paint.region != NULL)
+ if (surface->impl_surface->current_paint.region != NULL)
{
- region = cairo_region_copy (window->impl_surface->current_paint.region);
- cairo_region_translate (region, -window->abs_x, -window->abs_y);
+ region = cairo_region_copy (surface->impl_surface->current_paint.region);
+ cairo_region_translate (region, -surface->abs_x, -surface->abs_y);
}
else
{
- region = cairo_region_copy (window->clip_region);
+ region = cairo_region_copy (surface->clip_region);
}
return region;
@@ -2061,31 +2061,31 @@ gdk_surface_get_current_paint_region (GdkSurface *window)
/*< private >
* gdk_surface_get_drawing_context:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Retrieves the #GdkDrawingContext associated to @window by
+ * Retrieves the #GdkDrawingContext associated to @surface by
* gdk_surface_begin_draw_frame().
*
* Returns: (transfer none) (nullable): a #GdkDrawingContext, if any is set
*/
GdkDrawingContext *
-gdk_surface_get_drawing_context (GdkSurface *window)
+gdk_surface_get_drawing_context (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- return window->drawing_context;
+ return surface->drawing_context;
}
/**
* gdk_surface_get_clip_region:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Computes the region of a window that potentially can be written
+ * Computes the region of a surface that potentially can be written
* to by drawing primitives. This region may not take into account
- * other factors such as if the window is obscured by other windows,
+ * other factors such as if the surface is obscured by other surfaces,
* but no area outside of this region will be affected by drawing
* primitives.
*
@@ -2093,154 +2093,154 @@ gdk_surface_get_drawing_context (GdkSurface *window)
* when you are done.
**/
cairo_region_t*
-gdk_surface_get_clip_region (GdkSurface *window)
+gdk_surface_get_clip_region (GdkSurface *surface)
{
cairo_region_t *result;
- g_return_val_if_fail (GDK_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_SURFACE (surface), NULL);
- result = cairo_region_copy (window->clip_region);
+ result = cairo_region_copy (surface->clip_region);
- if (window->current_paint.region != NULL)
- cairo_region_intersect (result, window->current_paint.region);
+ if (surface->current_paint.region != NULL)
+ cairo_region_intersect (result, surface->current_paint.region);
return result;
}
/**
* gdk_surface_get_visible_region:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Computes the region of the @window that is potentially visible.
- * This does not necessarily take into account if the window is
- * obscured by other windows, but no area outside of this region
+ * Computes the region of the @surface that is potentially visible.
+ * This does not necessarily take into account if the surface is
+ * obscured by other surfaces, but no area outside of this region
* is visible.
*
* Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
* when you are done.
**/
cairo_region_t *
-gdk_surface_get_visible_region (GdkSurface *window)
+gdk_surface_get_visible_region (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- return cairo_region_copy (window->clip_region);
+ return cairo_region_copy (surface->clip_region);
}
static void
-gdk_surface_clear_backing_region (GdkSurface *window)
+gdk_surface_clear_backing_region (GdkSurface *surface)
{
cairo_t *cr;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- cr = cairo_create (window->current_paint.surface);
+ cr = cairo_create (surface->current_paint.surface);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- gdk_cairo_region (cr, window->current_paint.region);
+ gdk_cairo_region (cr, surface->current_paint.region);
cairo_fill (cr);
cairo_destroy (cr);
}
/* This returns either the current working surface on the paint stack
- * or the actual impl surface of the window. This should not be used
+ * or the actual impl surface of the surface. This should not be used
* from very many places: be careful! */
static cairo_surface_t *
-ref_window_surface (GdkSurface *window)
+ref_surface_surface (GdkSurface *surface)
{
- if (window->impl_surface->current_paint.surface)
- return cairo_surface_reference (window->impl_surface->current_paint.surface);
+ if (surface->impl_surface->current_paint.surface)
+ return cairo_surface_reference (surface->impl_surface->current_paint.surface);
else
- return gdk_surface_ref_impl_surface (window);
+ return gdk_surface_ref_impl_surface (surface);
}
/* This is used in places like gdk_cairo_set_source_surface and
- * other places to take "screenshots" of windows. Thus, we allow
+ * other places to take "screenshots" of surfaces. Thus, we allow
* it to be used outside of a begin_paint / end_paint. */
cairo_surface_t *
-_gdk_surface_ref_cairo_surface (GdkSurface *window)
+_gdk_surface_ref_cairo_surface (GdkSurface *surface)
{
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- surface = ref_window_surface (window);
+ cairo_surface = ref_surface_surface (surface);
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- return surface;
+ return cairo_surface;
}
else
{
cairo_surface_t *subsurface;
- subsurface = cairo_surface_create_for_rectangle (surface,
- window->abs_x,
- window->abs_y,
- window->width,
- window->height);
- cairo_surface_destroy (surface);
+ subsurface = cairo_surface_create_for_rectangle (cairo_surface,
+ surface->abs_x,
+ surface->abs_y,
+ surface->width,
+ surface->height);
+ cairo_surface_destroy (cairo_surface);
return subsurface;
}
}
/* Code for dirty-region queueing
*/
-static GSList *update_windows = NULL;
+static GSList *update_surfaces = NULL;
static inline gboolean
-gdk_surface_is_ancestor (GdkSurface *window,
+gdk_surface_is_ancestor (GdkSurface *surface,
GdkSurface *ancestor)
{
- while (window)
+ while (surface)
{
- GdkSurface *parent = window->parent;
+ GdkSurface *parent = surface->parent;
if (parent == ancestor)
return TRUE;
- window = parent;
+ surface = parent;
}
return FALSE;
}
static void
-gdk_surface_add_update_window (GdkSurface *window)
+gdk_surface_add_update_surface (GdkSurface *surface)
{
GSList *tmp;
GSList *prev = NULL;
gboolean has_ancestor_in_list = FALSE;
- /* Check whether "window" is already in "update_windows" list.
+ /* Check whether "surface" is already in "update_surfaces" list.
* It could be added during execution of gtk_widget_destroy() when
* setting focus widget to NULL and redrawing old focus widget.
* See bug 711552.
*/
- tmp = g_slist_find (update_windows, window);
+ tmp = g_slist_find (update_surfaces, surface);
if (tmp != NULL)
return;
- for (tmp = update_windows; tmp; tmp = tmp->next)
+ for (tmp = update_surfaces; tmp; tmp = tmp->next)
{
- GdkSurface *parent = window->parent;
+ GdkSurface *parent = surface->parent;
- /* check if tmp is an ancestor of "window"; if it is, set a
- * flag indicating that all following windows are either
- * children of "window" or from a differen hierarchy
+ /* check if tmp is an ancestor of "surface"; if it is, set a
+ * flag indicating that all following surfaces are either
+ * children of "surface" or from a differen hierarchy
*/
- if (!has_ancestor_in_list && gdk_surface_is_ancestor (window, tmp->data))
+ if (!has_ancestor_in_list && gdk_surface_is_ancestor (surface, tmp->data))
has_ancestor_in_list = TRUE;
/* insert in reverse stacking order when adding around siblings,
- * so processing updates properly paints over lower stacked windows
+ * so processing updates properly paints over lower stacked surfaces
*/
if (parent == GDK_SURFACE (tmp->data)->parent)
{
if (parent != NULL)
{
- gint index = g_list_index (parent->children, window);
+ gint index = g_list_index (parent->children, surface);
for (; tmp && parent == GDK_SURFACE (tmp->data)->parent; tmp = tmp->next)
{
gint sibling_index = g_list_index (parent->children, tmp->data);
@@ -2250,25 +2250,25 @@ gdk_surface_add_update_window (GdkSurface *window)
}
}
/* here, tmp got advanced past all lower stacked siblings */
- tmp = g_slist_prepend (tmp, g_object_ref (window));
+ tmp = g_slist_prepend (tmp, g_object_ref (surface));
if (prev)
prev->next = tmp;
else
- update_windows = tmp;
+ update_surfaces = tmp;
return;
}
- /* if "window" has an ancestor in the list and tmp is one of
- * "window's" children, insert "window" before tmp
+ /* if "surface" has an ancestor in the list and tmp is one of
+ * "surface's" children, insert "surface" before tmp
*/
- if (has_ancestor_in_list && gdk_surface_is_ancestor (tmp->data, window))
+ if (has_ancestor_in_list && gdk_surface_is_ancestor (tmp->data, surface))
{
- tmp = g_slist_prepend (tmp, g_object_ref (window));
+ tmp = g_slist_prepend (tmp, g_object_ref (surface));
if (prev)
prev->next = tmp;
else
- update_windows = tmp;
+ update_surfaces = tmp;
return;
}
@@ -2277,83 +2277,83 @@ gdk_surface_add_update_window (GdkSurface *window)
*/
if (! tmp->next && has_ancestor_in_list)
{
- tmp = g_slist_append (tmp, g_object_ref (window));
+ tmp = g_slist_append (tmp, g_object_ref (surface));
return;
}
prev = tmp;
}
- /* if all above checks failed ("window" is from a different
+ /* if all above checks failed ("surface" is from a different
* hierarchy than what is already in the list) or the list is
* empty, prepend
*/
- update_windows = g_slist_prepend (update_windows, g_object_ref (window));
+ update_surfaces = g_slist_prepend (update_surfaces, g_object_ref (surface));
}
static void
-gdk_surface_remove_update_window (GdkSurface *window)
+gdk_surface_remove_update_surface (GdkSurface *surface)
{
GSList *link;
- link = g_slist_find (update_windows, window);
+ link = g_slist_find (update_surfaces, surface);
if (link != NULL)
{
- update_windows = g_slist_delete_link (update_windows, link);
- g_object_unref (window);
+ update_surfaces = g_slist_delete_link (update_surfaces, link);
+ g_object_unref (surface);
}
}
static gboolean
-gdk_surface_is_toplevel_frozen (GdkSurface *window)
+gdk_surface_is_toplevel_frozen (GdkSurface *surface)
{
GdkSurface *toplevel;
- toplevel = gdk_surface_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (surface);
return toplevel->update_and_descendants_freeze_count > 0;
}
static void
-gdk_surface_schedule_update (GdkSurface *window)
+gdk_surface_schedule_update (GdkSurface *surface)
{
GdkFrameClock *frame_clock;
- if (window &&
- (window->update_freeze_count ||
- gdk_surface_is_toplevel_frozen (window)))
+ if (surface &&
+ (surface->update_freeze_count ||
+ gdk_surface_is_toplevel_frozen (surface)))
return;
- /* If there's no frame clock (a foreign window), then the invalid
+ /* If there's no frame clock (a foreign surface), then the invalid
* region will just stick around unless gdk_surface_process_updates()
* is called. */
- frame_clock = gdk_surface_get_frame_clock (window);
+ frame_clock = gdk_surface_get_frame_clock (surface);
if (frame_clock)
- gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (window),
+ gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (surface),
GDK_FRAME_CLOCK_PHASE_PAINT);
}
void
-_gdk_surface_process_updates_recurse (GdkSurface *window,
+_gdk_surface_process_updates_recurse (GdkSurface *surface,
cairo_region_t *expose_region)
{
cairo_region_t *clipped_expose_region;
GdkEvent *event;
- if (window->destroyed)
+ if (surface->destroyed)
return;
clipped_expose_region = cairo_region_copy (expose_region);
- cairo_region_intersect (clipped_expose_region, window->clip_region);
+ cairo_region_intersect (clipped_expose_region, surface->clip_region);
if (cairo_region_is_empty (clipped_expose_region))
goto out;
- /* Paint the window before the children, clipped to the window region */
+ /* Paint the surface before the children, clipped to the surface region */
event = gdk_event_new (GDK_EXPOSE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = FALSE;
event->expose.count = 0;
event->expose.region = cairo_region_reference (clipped_expose_region);
@@ -2368,152 +2368,152 @@ _gdk_surface_process_updates_recurse (GdkSurface *window,
static void
-gdk_surface_update_native_shapes (GdkSurface *window)
+gdk_surface_update_native_shapes (GdkSurface *surface)
{
- if (should_apply_clip_as_shape (window))
- apply_clip_as_shape (window);
+ if (should_apply_clip_as_shape (surface))
+ apply_clip_as_shape (surface);
}
-/* Process and remove any invalid area on the native window by creating
- * expose events for the window and all non-native descendants.
+/* Process and remove any invalid area on the native surface by creating
+ * expose events for the surface and all non-native descendants.
*/
static void
-gdk_surface_process_updates_internal (GdkSurface *window)
+gdk_surface_process_updates_internal (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
GdkSurface *toplevel;
- toplevel = gdk_surface_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (surface);
if (toplevel->geometry_dirty)
{
gdk_surface_update_native_shapes (toplevel);
toplevel->geometry_dirty = FALSE;
}
- /* Ensure the window lives while updating it */
- g_object_ref (window);
+ /* Ensure the surface lives while updating it */
+ g_object_ref (surface);
- window->in_update = TRUE;
+ surface->in_update = TRUE;
/* If an update got queued during update processing, we can get a
- * window in the update queue that has an empty update_area.
+ * surface in the update queue that has an empty update_area.
* just ignore it.
*/
- if (window->update_area)
+ if (surface->update_area)
{
- g_assert (window->active_update_area == NULL); /* No reentrancy */
+ g_assert (surface->active_update_area == NULL); /* No reentrancy */
- window->active_update_area = window->update_area;
- window->update_area = NULL;
+ surface->active_update_area = surface->update_area;
+ surface->update_area = NULL;
- if (gdk_surface_is_viewable (window))
+ if (gdk_surface_is_viewable (surface))
{
cairo_region_t *expose_region;
- expose_region = cairo_region_copy (window->active_update_area);
+ expose_region = cairo_region_copy (surface->active_update_area);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
- /* Clip to part visible in impl window */
- cairo_region_intersect (expose_region, window->clip_region);
+ /* Clip to part visible in impl surface */
+ cairo_region_intersect (expose_region, surface->clip_region);
if (impl_class->queue_antiexpose)
- impl_class->queue_antiexpose (window, expose_region);
+ impl_class->queue_antiexpose (surface, expose_region);
- impl_class->process_updates_recurse (window, expose_region);
+ impl_class->process_updates_recurse (surface, expose_region);
- gdk_surface_append_old_updated_area (window, window->active_update_area);
+ gdk_surface_append_old_updated_area (surface, surface->active_update_area);
cairo_region_destroy (expose_region);
}
- cairo_region_destroy (window->active_update_area);
- window->active_update_area = NULL;
+ cairo_region_destroy (surface->active_update_area);
+ surface->active_update_area = NULL;
}
- window->in_update = FALSE;
+ surface->in_update = FALSE;
- g_object_unref (window);
+ g_object_unref (surface);
}
static void
gdk_surface_paint_on_clock (GdkFrameClock *clock,
void *data)
{
- GdkSurface *window;
+ GdkSurface *surface;
- window = GDK_SURFACE (data);
+ surface = GDK_SURFACE (data);
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (window->impl_surface == window);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->impl_surface == surface);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- g_object_ref (window);
+ g_object_ref (surface);
- if (window->update_area &&
- !window->update_freeze_count &&
- !gdk_surface_is_toplevel_frozen (window) &&
+ if (surface->update_area &&
+ !surface->update_freeze_count &&
+ !gdk_surface_is_toplevel_frozen (surface) &&
/* Don't recurse into process_updates_internal, we'll
* do the update later when idle instead. */
- !window->in_update)
+ !surface->in_update)
{
- gdk_surface_process_updates_internal (window);
- gdk_surface_remove_update_window (window);
+ gdk_surface_process_updates_internal (surface);
+ gdk_surface_remove_update_surface (surface);
}
- g_object_unref (window);
+ g_object_unref (surface);
}
static void
-gdk_surface_invalidate_rect_full (GdkSurface *window,
+gdk_surface_invalidate_rect_full (GdkSurface *surface,
const GdkRectangle *rect,
gboolean invalidate_children)
{
- GdkRectangle window_rect;
+ GdkRectangle surface_rect;
cairo_region_t *region;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (window->input_only || !window->viewable)
+ if (surface->input_only || !surface->viewable)
return;
if (!rect)
{
- window_rect.x = 0;
- window_rect.y = 0;
- window_rect.width = window->width;
- window_rect.height = window->height;
- rect = &window_rect;
+ surface_rect.x = 0;
+ surface_rect.y = 0;
+ surface_rect.width = surface->width;
+ surface_rect.height = surface->height;
+ rect = &surface_rect;
}
region = cairo_region_create_rectangle (rect);
- gdk_surface_invalidate_region_full (window, region, invalidate_children);
+ gdk_surface_invalidate_region_full (surface, region, invalidate_children);
cairo_region_destroy (region);
}
/**
* gdk_surface_invalidate_rect:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @rect: (allow-none): rectangle to invalidate or %NULL to invalidate the whole
- * window
- * @invalidate_children: whether to also invalidate child windows
+ * surface
+ * @invalidate_children: whether to also invalidate child surfaces
*
* A convenience wrapper around gdk_surface_invalidate_region() which
* invalidates a rectangular region. See
* gdk_surface_invalidate_region() for details.
**/
void
-gdk_surface_invalidate_rect (GdkSurface *window,
+gdk_surface_invalidate_rect (GdkSurface *surface,
const GdkRectangle *rect,
gboolean invalidate_children)
{
- gdk_surface_invalidate_rect_full (window, rect, invalidate_children);
+ gdk_surface_invalidate_rect_full (surface, rect, invalidate_children);
}
static void
@@ -2524,14 +2524,14 @@ impl_surface_add_update_area (GdkSurface *impl_surface,
cairo_region_union (impl_surface->update_area, region);
else
{
- gdk_surface_add_update_window (impl_surface);
+ gdk_surface_add_update_surface (impl_surface);
impl_surface->update_area = cairo_region_copy (region);
gdk_surface_schedule_update (impl_surface);
}
}
static void
-gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window,
+gdk_surface_invalidate_maybe_recurse_full (GdkSurface *surface,
const cairo_region_t *region,
GdkSurfaceChildFunc child_func,
gpointer user_data)
@@ -2539,15 +2539,15 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window,
cairo_region_t *visible_region;
cairo_rectangle_int_t r;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (window->input_only ||
- !window->viewable ||
+ if (surface->input_only ||
+ !surface->viewable ||
cairo_region_is_empty (region) ||
- window->surface_type == GDK_SURFACE_ROOT)
+ surface->surface_type == GDK_SURFACE_ROOT)
return;
r.x = 0;
@@ -2555,23 +2555,23 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window,
visible_region = cairo_region_copy (region);
- while (window != NULL &&
+ while (surface != NULL &&
!cairo_region_is_empty (visible_region))
{
- r.width = window->width;
- r.height = window->height;
+ r.width = surface->width;
+ r.height = surface->height;
cairo_region_intersect_rectangle (visible_region, &r);
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- impl_surface_add_update_area (window, visible_region);
+ impl_surface_add_update_area (surface, visible_region);
break;
}
else
{
cairo_region_translate (visible_region,
- window->x, window->y);
- window = window->parent;
+ surface->x, surface->y);
+ surface = surface->parent;
}
}
@@ -2580,13 +2580,13 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window,
/**
* gdk_surface_invalidate_maybe_recurse:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @region: a #cairo_region_t
* @child_func: (scope call) (allow-none): function to use to decide if to
* recurse to a child, %NULL means never recurse.
* @user_data: data passed to @child_func
*
- * Adds @region to the update area for @window. The update area is the
+ * Adds @region to the update area for @surface. The update area is the
* region that needs to be redrawn, or “dirty region.”
*
* GDK will process all updates whenever the frame clock schedules a redraw,
@@ -2594,33 +2594,33 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window,
* invalidate regions that you know should be redrawn.
*
* The @child_func parameter controls whether the region of
- * each child window that intersects @region will also be invalidated.
+ * each child surface that intersects @region will also be invalidated.
* Only children for which @child_func returns #TRUE will have the area
* invalidated.
**/
void
-gdk_surface_invalidate_maybe_recurse (GdkSurface *window,
+gdk_surface_invalidate_maybe_recurse (GdkSurface *surface,
const cairo_region_t *region,
GdkSurfaceChildFunc child_func,
gpointer user_data)
{
- gdk_surface_invalidate_maybe_recurse_full (window, region,
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
child_func, user_data);
}
static gboolean
-true_predicate (GdkSurface *window,
+true_predicate (GdkSurface *surface,
gpointer user_data)
{
return TRUE;
}
static void
-gdk_surface_invalidate_region_full (GdkSurface *window,
+gdk_surface_invalidate_region_full (GdkSurface *surface,
const cairo_region_t *region,
gboolean invalidate_children)
{
- gdk_surface_invalidate_maybe_recurse_full (window, region,
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
invalidate_children ?
true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
NULL);
@@ -2628,11 +2628,11 @@ gdk_surface_invalidate_region_full (GdkSurface *window,
/**
* gdk_surface_invalidate_region:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @region: a #cairo_region_t
- * @invalidate_children: %TRUE to also invalidate child windows
+ * @invalidate_children: %TRUE to also invalidate child surfaces
*
- * Adds @region to the update area for @window. The update area is the
+ * Adds @region to the update area for @surface. The update area is the
* region that needs to be redrawn, or “dirty region.”
*
* GDK will process all updates whenever the frame clock schedules a redraw,
@@ -2640,17 +2640,17 @@ gdk_surface_invalidate_region_full (GdkSurface *window,
* invalidate regions that you know should be redrawn.
*
* The @invalidate_children parameter controls whether the region of
- * each child window that intersects @region will also be invalidated.
- * If %FALSE, then the update area for child windows will remain
+ * each child surface that intersects @region will also be invalidated.
+ * If %FALSE, then the update area for child surfaces will remain
* unaffected. See gdk_surface_invalidate_maybe_recurse if you need
* fine grained control over which children are invalidated.
**/
void
-gdk_surface_invalidate_region (GdkSurface *window,
+gdk_surface_invalidate_region (GdkSurface *surface,
const cairo_region_t *region,
gboolean invalidate_children)
{
- gdk_surface_invalidate_maybe_recurse (window, region,
+ gdk_surface_invalidate_maybe_recurse (surface, region,
invalidate_children ?
true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
NULL);
@@ -2658,24 +2658,24 @@ gdk_surface_invalidate_region (GdkSurface *window,
/**
* _gdk_surface_invalidate_for_expose:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @region: a #cairo_region_t
*
- * Adds @region to the update area for @window.
+ * Adds @region to the update area for @surface.
*
* GDK will process all updates whenever the frame clock schedules a redraw,
* so there’s no need to do forces redraws manually, you just need to
* invalidate regions that you know should be redrawn.
*
* This version of invalidation is used when you recieve expose events
- * from the native window system. It exposes the native window, plus
- * any non-native child windows.
+ * from the native surface system. It exposes the native surface, plus
+ * any non-native child surfaces.
**/
void
-_gdk_surface_invalidate_for_expose (GdkSurface *window,
+_gdk_surface_invalidate_for_expose (GdkSurface *surface,
cairo_region_t *region)
{
- gdk_surface_invalidate_maybe_recurse_full (window, region,
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
(gboolean (*) (GdkSurface *, gpointer))gdk_surface_has_no_impl,
NULL);
}
@@ -2683,32 +2683,32 @@ _gdk_surface_invalidate_for_expose (GdkSurface *window,
/**
* gdk_surface_get_update_area:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Transfers ownership of the update area from @window to the caller
- * of the function. That is, after calling this function, @window will
+ * Transfers ownership of the update area from @surface to the caller
+ * of the function. That is, after calling this function, @surface will
* no longer have an invalid/dirty region; the update area is removed
- * from @window and handed to you. If a window has no update area,
+ * from @surface and handed to you. If a surface has no update area,
* gdk_surface_get_update_area() returns %NULL. You are responsible for
* calling cairo_region_destroy() on the returned region if it’s non-%NULL.
*
- * Returns: the update area for @window
+ * Returns: the update area for @surface
**/
cairo_region_t *
-gdk_surface_get_update_area (GdkSurface *window)
+gdk_surface_get_update_area (GdkSurface *surface)
{
GdkSurface *impl_surface;
cairo_region_t *tmp_region, *to_remove;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- impl_surface = gdk_surface_get_impl_surface (window);
+ impl_surface = gdk_surface_get_impl_surface (surface);
if (impl_surface->update_area)
{
- tmp_region = cairo_region_copy (window->clip_region);
+ tmp_region = cairo_region_copy (surface->clip_region);
/* Convert to impl coords */
- cairo_region_translate (tmp_region, window->abs_x, window->abs_y);
+ cairo_region_translate (tmp_region, surface->abs_x, surface->abs_y);
cairo_region_intersect (tmp_region, impl_surface->update_area);
if (cairo_region_is_empty (tmp_region))
@@ -2719,17 +2719,17 @@ gdk_surface_get_update_area (GdkSurface *window)
else
{
/* Convert from impl coords */
- cairo_region_translate (tmp_region, -window->abs_x, -window->abs_y);
+ cairo_region_translate (tmp_region, -surface->abs_x, -surface->abs_y);
- /* Don't remove any update area that is overlapped by sibling windows
- or child windows as these really need to be repainted independently of this window. */
+ /* Don't remove any update area that is overlapped by sibling surfaces
+ or child surfaces as these really need to be repainted independently of this surface. */
to_remove = cairo_region_copy (tmp_region);
- remove_child_area (window, FALSE, to_remove);
- remove_sibling_overlapped_area (window, to_remove);
+ remove_child_area (surface, FALSE, to_remove);
+ remove_sibling_overlapped_area (surface, to_remove);
/* Remove from update_area */
- cairo_region_translate (to_remove, window->abs_x, window->abs_y);
+ cairo_region_translate (to_remove, surface->abs_x, surface->abs_y);
cairo_region_subtract (impl_surface->update_area, to_remove);
cairo_region_destroy (to_remove);
@@ -2739,7 +2739,7 @@ gdk_surface_get_update_area (GdkSurface *window)
cairo_region_destroy (impl_surface->update_area);
impl_surface->update_area = NULL;
- gdk_surface_remove_update_window ((GdkSurface *)impl_surface);
+ gdk_surface_remove_update_surface ((GdkSurface *)impl_surface);
}
return tmp_region;
@@ -2751,60 +2751,60 @@ gdk_surface_get_update_area (GdkSurface *window)
/**
* _gdk_surface_clear_update_area:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
*
- * Internal function to clear the update area for a window. This
- * is called when the window is hidden or destroyed.
+ * Internal function to clear the update area for a surface. This
+ * is called when the surface is hidden or destroyed.
**/
void
-_gdk_surface_clear_update_area (GdkSurface *window)
+_gdk_surface_clear_update_area (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->update_area)
+ if (surface->update_area)
{
- gdk_surface_remove_update_window (window);
+ gdk_surface_remove_update_surface (surface);
- cairo_region_destroy (window->update_area);
- window->update_area = NULL;
+ cairo_region_destroy (surface->update_area);
+ surface->update_area = NULL;
}
}
/**
* gdk_surface_freeze_updates:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Temporarily freezes a window such that it won’t receive expose
- * events. The window will begin receiving expose events again when
+ * Temporarily freezes a surface such that it won’t receive expose
+ * events. The surface will begin receiving expose events again when
* gdk_surface_thaw_updates() is called. If gdk_surface_freeze_updates()
* has been called more than once, gdk_surface_thaw_updates() must be called
* an equal number of times to begin processing exposes.
**/
void
-gdk_surface_freeze_updates (GdkSurface *window)
+gdk_surface_freeze_updates (GdkSurface *surface)
{
GdkSurface *impl_surface;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl_surface = gdk_surface_get_impl_surface (window);
+ impl_surface = gdk_surface_get_impl_surface (surface);
impl_surface->update_freeze_count++;
}
/**
* gdk_surface_thaw_updates:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Thaws a window frozen with gdk_surface_freeze_updates().
+ * Thaws a surface frozen with gdk_surface_freeze_updates().
**/
void
-gdk_surface_thaw_updates (GdkSurface *window)
+gdk_surface_thaw_updates (GdkSurface *surface)
{
GdkSurface *impl_surface;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl_surface = gdk_surface_get_impl_surface (window);
+ impl_surface = gdk_surface_get_impl_surface (surface);
g_return_if_fail (impl_surface->update_freeze_count > 0);
@@ -2813,34 +2813,34 @@ gdk_surface_thaw_updates (GdkSurface *window)
}
void
-gdk_surface_freeze_toplevel_updates (GdkSurface *window)
+gdk_surface_freeze_toplevel_updates (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (window->surface_type != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
- window->update_and_descendants_freeze_count++;
- _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window));
+ surface->update_and_descendants_freeze_count++;
+ _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (surface));
}
void
-gdk_surface_thaw_toplevel_updates (GdkSurface *window)
+gdk_surface_thaw_toplevel_updates (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (window->surface_type != GDK_SURFACE_CHILD);
- g_return_if_fail (window->update_and_descendants_freeze_count > 0);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
+ g_return_if_fail (surface->update_and_descendants_freeze_count > 0);
- window->update_and_descendants_freeze_count--;
- _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (window));
+ surface->update_and_descendants_freeze_count--;
+ _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (surface));
- gdk_surface_schedule_update (window);
+ gdk_surface_schedule_update (surface);
}
/**
* gdk_surface_constrain_size:
* @geometry: a #GdkGeometry structure
* @flags: a mask indicating what portions of @geometry are set
- * @width: desired width of window
- * @height: desired height of the window
+ * @width: desired width of surface
+ * @height: desired height of the surface
* @new_width: (out): location to store resulting width
* @new_height: (out): location to store resulting height
*
@@ -2966,7 +2966,7 @@ gdk_surface_constrain_size (GdkGeometry *geometry,
/**
* gdk_surface_get_device_position_double:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
* @device: pointer #GdkDevice to query to.
* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
@@ -2974,14 +2974,14 @@ gdk_surface_constrain_size (GdkGeometry *geometry,
*
* Obtains the current device position in doubles and modifier state.
* The position is given in coordinates relative to the upper left
- * corner of @window.
+ * corner of @surface.
*
- * Returns: (nullable) (transfer none): The window underneath @device
+ * Returns: (nullable) (transfer none): The surface underneath @device
* (as with gdk_device_get_surface_at_position()), or %NULL if the
- * window is not known to GDK.
+ * surface is not known to GDK.
**/
GdkSurface *
-gdk_surface_get_device_position_double (GdkSurface *window,
+gdk_surface_get_device_position_double (GdkSurface *surface,
GdkDevice *device,
double *x,
double *y,
@@ -2991,19 +2991,19 @@ gdk_surface_get_device_position_double (GdkSurface *window,
GdkModifierType tmp_mask;
gboolean normal_child;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
tmp_x = tmp_y = 0;
tmp_mask = 0;
- normal_child = GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_device_state (window,
+ normal_child = GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
device,
&tmp_x, &tmp_y,
&tmp_mask);
- /* We got the coords on the impl, convert to the window */
- tmp_x -= window->abs_x;
- tmp_y -= window->abs_y;
+ /* We got the coords on the impl, convert to the surface */
+ tmp_x -= surface->abs_x;
+ tmp_y -= surface->abs_y;
if (x)
*x = tmp_x;
@@ -3013,13 +3013,13 @@ gdk_surface_get_device_position_double (GdkSurface *window,
*mask = tmp_mask;
if (normal_child)
- return _gdk_surface_find_child_at (window, tmp_x, tmp_y);
+ return _gdk_surface_find_child_at (surface, tmp_x, tmp_y);
return NULL;
}
/**
* gdk_surface_get_device_position:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
* @device: pointer #GdkDevice to query to.
* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
@@ -3027,16 +3027,16 @@ gdk_surface_get_device_position_double (GdkSurface *window,
*
* Obtains the current device position and modifier state.
* The position is given in coordinates relative to the upper left
- * corner of @window.
+ * corner of @surface.
*
* Use gdk_surface_get_device_position_double() if you need subpixel precision.
*
- * Returns: (nullable) (transfer none): The window underneath @device
+ * Returns: (nullable) (transfer none): The surface underneath @device
* (as with gdk_device_get_surface_at_position()), or %NULL if the
- * window is not known to GDK.
+ * surface is not known to GDK.
**/
GdkSurface *
-gdk_surface_get_device_position (GdkSurface *window,
+gdk_surface_get_device_position (GdkSurface *surface,
GdkDevice *device,
gint *x,
gint *y,
@@ -3044,40 +3044,40 @@ gdk_surface_get_device_position (GdkSurface *window,
{
gdouble tmp_x, tmp_y;
- window = gdk_surface_get_device_position_double (window, device,
+ surface = gdk_surface_get_device_position_double (surface, device,
&tmp_x, &tmp_y, mask);
if (x)
*x = round (tmp_x);
if (y)
*y = round (tmp_y);
- return window;
+ return surface;
}
static gboolean
-gdk_surface_raise_internal (GdkSurface *window)
+gdk_surface_raise_internal (GdkSurface *surface)
{
- GdkSurface *parent = window->parent;
+ GdkSurface *parent = surface->parent;
GdkSurfaceImplClass *impl_class;
gboolean did_raise = FALSE;
- if (parent && parent->children->data != window)
+ if (parent && parent->children->data != surface)
{
- parent->children = g_list_remove_link (parent->children, &window->children_list_node);
- parent->children = g_list_concat (&window->children_list_node, parent->children);
+ parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
+ parent->children = g_list_concat (&surface->children_list_node, parent->children);
did_raise = TRUE;
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
/* Just do native raise for toplevels */
- if (gdk_surface_has_impl (window))
- impl_class->raise (window);
+ if (gdk_surface_has_impl (surface))
+ impl_class->raise (surface);
return did_raise;
}
-/* Returns TRUE If the native window was mapped or unmapped */
+/* Returns TRUE If the native surface was mapped or unmapped */
static gboolean
set_viewable (GdkSurface *w,
gboolean val)
@@ -3104,156 +3104,156 @@ set_viewable (GdkSurface *w,
return FALSE;
}
-/* Returns TRUE If the native window was mapped or unmapped */
+/* Returns TRUE If the native surface was mapped or unmapped */
gboolean
-_gdk_surface_update_viewable (GdkSurface *window)
+_gdk_surface_update_viewable (GdkSurface *surface)
{
gboolean viewable;
- if (window->surface_type == GDK_SURFACE_FOREIGN ||
- window->surface_type == GDK_SURFACE_ROOT)
+ if (surface->surface_type == GDK_SURFACE_FOREIGN ||
+ surface->surface_type == GDK_SURFACE_ROOT)
viewable = TRUE;
- else if (gdk_surface_is_toplevel (window) ||
- window->parent->viewable)
- viewable = GDK_SURFACE_IS_MAPPED (window);
+ else if (gdk_surface_is_toplevel (surface) ||
+ surface->parent->viewable)
+ viewable = GDK_SURFACE_IS_MAPPED (surface);
else
viewable = FALSE;
- return set_viewable (window, viewable);
+ return set_viewable (surface, viewable);
}
static void
-gdk_surface_show_internal (GdkSurface *window, gboolean raise)
+gdk_surface_show_internal (GdkSurface *surface, gboolean raise)
{
GdkSurfaceImplClass *impl_class;
gboolean was_mapped, was_viewable;
gboolean did_show, did_raise = FALSE;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
- was_mapped = GDK_SURFACE_IS_MAPPED (window);
- was_viewable = window->viewable;
+ was_mapped = GDK_SURFACE_IS_MAPPED (surface);
+ was_viewable = surface->viewable;
if (raise)
{
/* Keep children in (reverse) stacking order */
- did_raise = gdk_surface_raise_internal (window);
+ did_raise = gdk_surface_raise_internal (surface);
}
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
if (!was_mapped)
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_WITHDRAWN,
0);
}
else
{
- window->state = 0;
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
+ surface->state = 0;
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
}
- did_show = _gdk_surface_update_viewable (window);
+ did_show = _gdk_surface_update_viewable (surface);
/* If it was already viewable the backend show op won't be called, call it
again to ensure things happen right if the mapped tracking was not right
- for e.g. a foreign window.
+ for e.g. a foreign surface.
Dunno if this is strictly needed but its what happened pre-csw.
Also show if not done by gdk_surface_update_viewable. */
- if (gdk_surface_has_impl (window) && (was_viewable || !did_show))
+ if (gdk_surface_has_impl (surface) && (was_viewable || !did_show))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->show (window, !did_show ? was_mapped : TRUE);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->show (surface, !did_show ? was_mapped : TRUE);
}
- if (!was_mapped && !gdk_surface_has_impl (window))
+ if (!was_mapped && !gdk_surface_has_impl (surface))
{
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_MAP, NULL, FALSE);
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_MAP, NULL, FALSE);
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_MAP, NULL, FALSE);
+ if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_MAP, NULL, FALSE);
}
if (!was_mapped || did_raise)
{
- recompute_visible_regions (window, FALSE);
+ recompute_visible_regions (surface, FALSE);
- if (gdk_surface_is_viewable (window))
- gdk_surface_invalidate_rect_full (window, NULL, TRUE);
+ if (gdk_surface_is_viewable (surface))
+ gdk_surface_invalidate_rect_full (surface, NULL, TRUE);
}
}
/**
* gdk_surface_show_unraised:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
* Shows a #GdkSurface onscreen, but does not modify its stacking
- * order. In contrast, gdk_surface_show() will raise the window
- * to the top of the window stack.
+ * order. In contrast, gdk_surface_show() will raise the surface
+ * to the top of the surface stack.
*
* On the X11 platform, in Xlib terms, this function calls
* XMapWindow() (it also updates some internal GDK state, which means
* that you can’t really use XMapWindow() directly on a GDK surface).
*/
void
-gdk_surface_show_unraised (GdkSurface *window)
+gdk_surface_show_unraised (GdkSurface *surface)
{
- gdk_surface_show_internal (window, FALSE);
+ gdk_surface_show_internal (surface, FALSE);
}
/**
* gdk_surface_raise:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Raises @window to the top of the Z-order (stacking order), so that
- * other windows with the same parent window appear below @window.
- * This is true whether or not the windows are visible.
+ * Raises @surface to the top of the Z-order (stacking order), so that
+ * other surfaces with the same parent surface appear below @surface.
+ * This is true whether or not the surfaces are visible.
*
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_surface_raise() only
+ * If @surface is a toplevel, the surface manager may choose to deny the
+ * request to move the surface in the Z-order, gdk_surface_raise() only
* requests the restack, does not guarantee it.
*/
void
-gdk_surface_raise (GdkSurface *window)
+gdk_surface_raise (GdkSurface *surface)
{
gboolean did_raise;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
/* Keep children in (reverse) stacking order */
- did_raise = gdk_surface_raise_internal (window);
+ did_raise = gdk_surface_raise_internal (surface);
if (did_raise &&
- !gdk_surface_is_toplevel (window) &&
- gdk_surface_is_viewable (window) &&
- !window->input_only)
- gdk_surface_invalidate_region_full (window, window->clip_region, TRUE);
+ !gdk_surface_is_toplevel (surface) &&
+ gdk_surface_is_viewable (surface) &&
+ !surface->input_only)
+ gdk_surface_invalidate_region_full (surface, surface->clip_region, TRUE);
}
static void
-gdk_surface_lower_internal (GdkSurface *window)
+gdk_surface_lower_internal (GdkSurface *surface)
{
- GdkSurface *parent = window->parent;
+ GdkSurface *parent = surface->parent;
GdkSurfaceImplClass *impl_class;
if (parent)
{
- parent->children = g_list_remove_link (parent->children, &window->children_list_node);
- parent->children = g_list_concat (parent->children, &window->children_list_node);
+ parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
+ parent->children = g_list_concat (parent->children, &surface->children_list_node);
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
/* Just do native lower for toplevels */
- if (gdk_surface_has_impl (window))
- impl_class->lower (window);
+ if (gdk_surface_has_impl (surface))
+ impl_class->lower (surface);
}
static void
@@ -3281,52 +3281,52 @@ gdk_surface_invalidate_in_parent (GdkSurface *private)
/**
* gdk_surface_lower:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Lowers @window to the bottom of the Z-order (stacking order), so that
- * other windows with the same parent window appear above @window.
- * This is true whether or not the other windows are visible.
+ * Lowers @surface to the bottom of the Z-order (stacking order), so that
+ * other surfaces with the same parent surface appear above @surface.
+ * This is true whether or not the other surfaces are visible.
*
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_surface_lower() only
+ * If @surface is a toplevel, the window manager may choose to deny the
+ * request to move the surface in the Z-order, gdk_surface_lower() only
* requests the restack, does not guarantee it.
*
- * Note that gdk_surface_show() raises the window again, so don’t call this
+ * Note that gdk_surface_show() raises the surface again, so don’t call this
* function before gdk_surface_show(). (Try gdk_surface_show_unraised().)
*/
void
-gdk_surface_lower (GdkSurface *window)
+gdk_surface_lower (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
/* Keep children in (reverse) stacking order */
- gdk_surface_lower_internal (window);
+ gdk_surface_lower_internal (surface);
- gdk_surface_invalidate_in_parent (window);
+ gdk_surface_invalidate_in_parent (surface);
}
/**
* gdk_surface_restack:
- * @window: a #GdkSurface
- * @sibling: (allow-none): a #GdkSurface that is a sibling of @window, or %NULL
+ * @surface: a #GdkSurface
+ * @sibling: (allow-none): a #GdkSurface that is a sibling of @surface, or %NULL
* @above: a boolean
*
- * Changes the position of @window in the Z-order (stacking order), so that
+ * Changes the position of @surface in the Z-order (stacking order), so that
* it is above @sibling (if @above is %TRUE) or below @sibling (if @above is
* %FALSE).
*
* If @sibling is %NULL, then this either raises (if @above is %TRUE) or
- * lowers the window.
+ * lowers the surface.
*
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_surface_restack() only
+ * If @surface is a toplevel, the window manager may choose to deny the
+ * request to move the surface in the Z-order, gdk_surface_restack() only
* requests the restack, does not guarantee it.
*/
void
-gdk_surface_restack (GdkSurface *window,
+gdk_surface_restack (GdkSurface *surface,
GdkSurface *sibling,
gboolean above)
{
@@ -3334,30 +3334,30 @@ gdk_surface_restack (GdkSurface *window,
GdkSurface *parent;
GList *sibling_link;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (sibling == NULL || GDK_IS_SURFACE (sibling));
- if (window->destroyed)
+ if (surface->destroyed)
return;
if (sibling == NULL)
{
if (above)
- gdk_surface_raise (window);
+ gdk_surface_raise (surface);
else
- gdk_surface_lower (window);
+ gdk_surface_lower (surface);
return;
}
- if (gdk_surface_is_toplevel (window))
+ if (gdk_surface_is_toplevel (surface))
{
g_return_if_fail (gdk_surface_is_toplevel (sibling));
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->restack_toplevel (window, sibling, above);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->restack_toplevel (surface, sibling, above);
return;
}
- parent = window->parent;
+ parent = surface->parent;
if (parent)
{
sibling_link = g_list_find (parent->children, sibling);
@@ -3365,75 +3365,75 @@ gdk_surface_restack (GdkSurface *window,
if (sibling_link == NULL)
return;
- parent->children = g_list_remove_link (parent->children, &window->children_list_node);
+ parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
if (above)
parent->children = list_insert_link_before (parent->children,
sibling_link,
- &window->children_list_node);
+ &surface->children_list_node);
else
parent->children = list_insert_link_before (parent->children,
sibling_link->next,
- &window->children_list_node);
+ &surface->children_list_node);
}
- gdk_surface_invalidate_in_parent (window);
+ gdk_surface_invalidate_in_parent (surface);
}
/**
* gdk_surface_show:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Like gdk_surface_show_unraised(), but also raises the window to the
- * top of the window stack (moves the window to the front of the
+ * Like gdk_surface_show_unraised(), but also raises the surface to the
+ * top of the surface stack (moves the surface to the front of the
* Z-order).
*
- * This function maps a window so it’s visible onscreen. Its opposite
+ * This function maps a surface so it’s visible onscreen. Its opposite
* is gdk_surface_hide().
*
* When implementing a #GtkWidget, you should call this function on the widget's
* #GdkSurface as part of the “map” method.
*/
void
-gdk_surface_show (GdkSurface *window)
+gdk_surface_show (GdkSurface *surface)
{
- gdk_surface_show_internal (window, TRUE);
+ gdk_surface_show_internal (surface, TRUE);
}
/**
* gdk_surface_hide:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * For toplevel windows, withdraws them, so they will no longer be
- * known to the window manager; for all windows, unmaps them, so
+ * For toplevel surfaces, withdraws them, so they will no longer be
+ * known to the window manager; for all surfaces, unmaps them, so
* they won’t be displayed. Normally done automatically as
* part of gtk_widget_hide().
*/
void
-gdk_surface_hide (GdkSurface *window)
+gdk_surface_hide (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
gboolean was_mapped, did_hide;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
- was_mapped = GDK_SURFACE_IS_MAPPED (window);
+ was_mapped = GDK_SURFACE_IS_MAPPED (surface);
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_synthesize_surface_state (window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_WITHDRAWN);
}
else if (was_mapped)
{
- window->state = GDK_SURFACE_STATE_WITHDRAWN;
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
+ surface->state = GDK_SURFACE_STATE_WITHDRAWN;
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
}
if (was_mapped)
@@ -3443,7 +3443,7 @@ gdk_surface_hide (GdkSurface *window)
GList *devices, *d;
/* May need to break grabs on children */
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
seat = gdk_display_get_default_seat (display);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
@@ -3457,7 +3457,7 @@ gdk_surface_hide (GdkSurface *window)
if (_gdk_display_end_device_grab (display,
device,
_gdk_display_get_next_serial (display),
- window,
+ surface,
TRUE))
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -3469,213 +3469,213 @@ G_GNUC_END_IGNORE_DEPRECATIONS
g_list_free (devices);
}
- did_hide = _gdk_surface_update_viewable (window);
+ did_hide = _gdk_surface_update_viewable (surface);
- /* Hide foreign window as those are not handled by update_viewable. */
- if (gdk_surface_has_impl (window) && (!did_hide))
+ /* Hide foreign surface as those are not handled by update_viewable. */
+ if (gdk_surface_has_impl (surface) && (!did_hide))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->hide (window);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->hide (surface);
}
- gdk_surface_clear_old_updated_area (window);
- recompute_visible_regions (window, FALSE);
+ gdk_surface_clear_old_updated_area (surface);
+ recompute_visible_regions (surface, FALSE);
- if (was_mapped && !gdk_surface_has_impl (window))
+ if (was_mapped && !gdk_surface_has_impl (surface))
{
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
+ if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
}
/* Invalidate the rect */
if (was_mapped)
- gdk_surface_invalidate_in_parent (window);
+ gdk_surface_invalidate_in_parent (surface);
}
/**
* gdk_surface_withdraw:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Withdraws a window (unmaps it and asks the window manager to forget about it).
+ * Withdraws a surface (unmaps it and asks the surface manager to forget about it).
* This function is not really useful as gdk_surface_hide() automatically
- * withdraws toplevel windows before hiding them.
+ * withdraws toplevel surfaces before hiding them.
**/
void
-gdk_surface_withdraw (GdkSurface *window)
+gdk_surface_withdraw (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
gboolean was_mapped;
GdkGLContext *current_context;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
- was_mapped = GDK_SURFACE_IS_MAPPED (window);
+ was_mapped = GDK_SURFACE_IS_MAPPED (surface);
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->withdraw (window);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->withdraw (surface);
if (was_mapped)
{
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
+ if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
}
current_context = gdk_gl_context_get_current ();
- if (current_context != NULL && gdk_gl_context_get_surface (current_context) == window)
+ if (current_context != NULL && gdk_gl_context_get_surface (current_context) == surface)
gdk_gl_context_clear_current ();
- recompute_visible_regions (window, FALSE);
- gdk_surface_clear_old_updated_area (window);
+ recompute_visible_regions (surface, FALSE);
+ gdk_surface_clear_old_updated_area (surface);
}
}
/**
* gdk_surface_set_events:
- * @window: a #GdkSurface
- * @event_mask: event mask for @window
+ * @surface: a #GdkSurface
+ * @event_mask: event mask for @surface
*
- * The event mask for a window determines which events will be reported
- * for that window from all master input devices. For example, an event mask
- * including #GDK_BUTTON_PRESS_MASK means the window should report button
+ * The event mask for a surface determines which events will be reported
+ * for that surface from all master input devices. For example, an event mask
+ * including #GDK_BUTTON_PRESS_MASK means the surface should report button
* press events. The event mask is the bitwise OR of values from the
* #GdkEventMask enumeration.
*
* See the [input handling overview][event-masks] for details.
**/
void
-gdk_surface_set_events (GdkSurface *window,
+gdk_surface_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
- window->event_mask = event_mask;
+ surface->event_mask = event_mask;
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->set_events (window,
- get_native_event_mask (window));
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->set_events (surface,
+ get_native_event_mask (surface));
}
}
/**
* gdk_surface_get_events:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Gets the event mask for @window for all master input devices. See
+ * Gets the event mask for @surface for all master input devices. See
* gdk_surface_set_events().
*
- * Returns: event mask for @window
+ * Returns: event mask for @surface
**/
GdkEventMask
-gdk_surface_get_events (GdkSurface *window)
+gdk_surface_get_events (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- if (window->destroyed)
+ if (surface->destroyed)
return 0;
- return window->event_mask;
+ return surface->event_mask;
}
/**
* gdk_surface_set_device_events:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @device: #GdkDevice to enable events for.
- * @event_mask: event mask for @window
+ * @event_mask: event mask for @surface
*
* Sets the event mask for a given device (Normally a floating device, not
- * attached to any visible pointer) to @window. For example, an event mask
- * including #GDK_BUTTON_PRESS_MASK means the window should report button
+ * attached to any visible pointer) to @surface. For example, an event mask
+ * including #GDK_BUTTON_PRESS_MASK means the surface should report button
* press events. The event mask is the bitwise OR of values from the
* #GdkEventMask enumeration.
*
* See the [input handling overview][event-masks] for details.
**/
void
-gdk_surface_set_device_events (GdkSurface *window,
+gdk_surface_set_device_events (GdkSurface *surface,
GdkDevice *device,
GdkEventMask event_mask)
{
GdkEventMask device_mask;
GdkSurface *native;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_DEVICE (device));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (G_UNLIKELY (!window->device_events))
- window->device_events = g_hash_table_new (NULL, NULL);
+ if (G_UNLIKELY (!surface->device_events))
+ surface->device_events = g_hash_table_new (NULL, NULL);
if (event_mask == 0)
{
/* FIXME: unsetting events on a master device
- * would restore window->event_mask
+ * would restore surface->event_mask
*/
- g_hash_table_remove (window->device_events, device);
+ g_hash_table_remove (surface->device_events, device);
}
else
- g_hash_table_insert (window->device_events, device,
+ g_hash_table_insert (surface->device_events, device,
GINT_TO_POINTER (event_mask));
- native = gdk_surface_get_toplevel (window);
+ native = gdk_surface_get_toplevel (surface);
- device_mask = get_native_device_event_mask (window, device);
+ device_mask = get_native_device_event_mask (surface, device);
GDK_DEVICE_GET_CLASS (device)->select_surface_events (device, native, device_mask);
}
/**
* gdk_surface_get_device_events:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
* @device: a #GdkDevice.
*
- * Returns the event mask for @window corresponding to an specific device.
+ * Returns the event mask for @surface corresponding to an specific device.
*
- * Returns: device event mask for @window
+ * Returns: device event mask for @surface
**/
GdkEventMask
-gdk_surface_get_device_events (GdkSurface *window,
+gdk_surface_get_device_events (GdkSurface *surface,
GdkDevice *device)
{
GdkEventMask mask;
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 0;
- if (!window->device_events)
+ if (!surface->device_events)
return 0;
- mask = GPOINTER_TO_INT (g_hash_table_lookup (window->device_events, device));
+ mask = GPOINTER_TO_INT (g_hash_table_lookup (surface->device_events, device));
- /* FIXME: device could be controlled by window->event_mask */
+ /* FIXME: device could be controlled by surface->event_mask */
return mask;
}
static void
-gdk_surface_move_resize_toplevel (GdkSurface *window,
+gdk_surface_move_resize_toplevel (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
@@ -3692,29 +3692,29 @@ gdk_surface_move_resize_toplevel (GdkSurface *window,
is_resize = (width != -1) || (height != -1);
- if (gdk_surface_is_viewable (window) &&
- !window->input_only)
+ if (gdk_surface_is_viewable (surface) &&
+ !surface->input_only)
{
expose = TRUE;
- old_region = cairo_region_copy (window->clip_region);
+ old_region = cairo_region_copy (surface->clip_region);
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->move_resize (window, with_move, x, y, width, height);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->move_resize (surface, with_move, x, y, width, height);
/* Avoid recomputing for pure toplevel moves, for performance reasons */
if (is_resize)
- recompute_visible_regions (window, FALSE);
+ recompute_visible_regions (surface, FALSE);
if (expose)
{
- new_region = cairo_region_copy (window->clip_region);
+ new_region = cairo_region_copy (surface->clip_region);
/* This is the newly exposed area (due to any resize),
* X will expose it, but lets do that without the roundtrip
*/
cairo_region_subtract (new_region, old_region);
- gdk_surface_invalidate_region_full (window, new_region, TRUE);
+ gdk_surface_invalidate_region_full (surface, new_region, TRUE);
cairo_region_destroy (old_region);
cairo_region_destroy (new_region);
@@ -3723,7 +3723,7 @@ gdk_surface_move_resize_toplevel (GdkSurface *window,
static void
-gdk_surface_move_resize_internal (GdkSurface *window,
+gdk_surface_move_resize_internal (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
@@ -3733,14 +3733,14 @@ gdk_surface_move_resize_internal (GdkSurface *window,
cairo_region_t *old_region, *new_region;
gboolean expose;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->destroyed)
+ if (surface->destroyed)
return;
- if (gdk_surface_is_toplevel (window))
+ if (gdk_surface_is_toplevel (surface))
{
- gdk_surface_move_resize_toplevel (window, with_move, x, y, width, height);
+ gdk_surface_move_resize_toplevel (surface, with_move, x, y, width, height);
return;
}
@@ -3750,29 +3750,29 @@ gdk_surface_move_resize_internal (GdkSurface *window,
height = 1;
/* Bail early if no change */
- if (window->width == width &&
- window->height == height &&
+ if (surface->width == width &&
+ surface->height == height &&
(!with_move ||
- (window->x == x &&
- window->y == y)))
+ (surface->x == x &&
+ surface->y == y)))
return;
- /* Handle child windows */
+ /* Handle child surfaces */
expose = FALSE;
old_region = NULL;
- if (gdk_surface_is_viewable (window) &&
- !window->input_only)
+ if (gdk_surface_is_viewable (surface) &&
+ !surface->input_only)
{
GdkRectangle r;
expose = TRUE;
- r.x = window->x;
- r.y = window->y;
- r.width = window->width;
- r.height = window->height;
+ r.x = surface->x;
+ r.y = surface->y;
+ r.width = surface->width;
+ r.height = surface->height;
old_region = cairo_region_create_rectangle (&r);
}
@@ -3780,31 +3780,31 @@ gdk_surface_move_resize_internal (GdkSurface *window,
/* Set the new position and size */
if (with_move)
{
- window->x = x;
- window->y = y;
+ surface->x = x;
+ surface->y = y;
}
if (!(width < 0 && height < 0))
{
- window->width = width;
- window->height = height;
+ surface->width = width;
+ surface->height = height;
}
- recompute_visible_regions (window, FALSE);
+ recompute_visible_regions (surface, FALSE);
if (expose)
{
GdkRectangle r;
- r.x = window->x;
- r.y = window->y;
- r.width = window->width;
- r.height = window->height;
+ r.x = surface->x;
+ r.y = surface->y;
+ r.width = surface->width;
+ r.height = surface->height;
new_region = cairo_region_create_rectangle (&r);
cairo_region_union (new_region, old_region);
- gdk_surface_invalidate_region_full (window->parent, new_region, TRUE);
+ gdk_surface_invalidate_region_full (surface->parent, new_region, TRUE);
cairo_region_destroy (old_region);
cairo_region_destroy (new_region);
@@ -3815,97 +3815,97 @@ gdk_surface_move_resize_internal (GdkSurface *window,
/**
* gdk_surface_move:
- * @window: a #GdkSurface
- * @x: X coordinate relative to window’s parent
- * @y: Y coordinate relative to window’s parent
+ * @surface: a #GdkSurface
+ * @x: X coordinate relative to surface’s parent
+ * @y: Y coordinate relative to surface’s parent
*
- * Repositions a window relative to its parent window.
- * For toplevel windows, window managers may ignore or modify the move;
+ * Repositions a surface relative to its parent surface.
+ * For toplevel surfaces, window managers may ignore or modify the move;
* you should probably use gtk_window_move() on a #GtkWindow widget
- * anyway, instead of using GDK functions. For child windows,
+ * anyway, instead of using GDK functions. For child surfaces,
* the move will reliably succeed.
*
- * If you’re also planning to resize the window, use gdk_surface_move_resize()
+ * If you’re also planning to resize the surface, use gdk_surface_move_resize()
* to both move and resize simultaneously, for a nicer visual effect.
**/
void
-gdk_surface_move (GdkSurface *window,
+gdk_surface_move (GdkSurface *surface,
gint x,
gint y)
{
- gdk_surface_move_resize_internal (window, TRUE, x, y, -1, -1);
+ gdk_surface_move_resize_internal (surface, TRUE, x, y, -1, -1);
}
/**
* gdk_surface_resize:
- * @window: a #GdkSurface
- * @width: new width of the window
- * @height: new height of the window
+ * @surface: a #GdkSurface
+ * @width: new width of the surface
+ * @height: new height of the surface
*
- * Resizes @window; for toplevel windows, asks the window manager to resize
- * the window. The window manager may not allow the resize. When using GTK+,
+ * Resizes @surface; for toplevel surfaces, asks the window manager to resize
+ * the surface. The window manager may not allow the resize. When using GTK+,
* use gtk_window_resize() instead of this low-level GDK function.
*
- * Windows may not be resized below 1x1.
+ * Surfaces may not be resized below 1x1.
*
- * If you’re also planning to move the window, use gdk_surface_move_resize()
+ * If you’re also planning to move the surface, use gdk_surface_move_resize()
* to both move and resize simultaneously, for a nicer visual effect.
**/
void
-gdk_surface_resize (GdkSurface *window,
+gdk_surface_resize (GdkSurface *surface,
gint width,
gint height)
{
- gdk_surface_move_resize_internal (window, FALSE, 0, 0, width, height);
+ gdk_surface_move_resize_internal (surface, FALSE, 0, 0, width, height);
}
/**
* gdk_surface_move_resize:
- * @window: a #GdkSurface
- * @x: new X position relative to window’s parent
- * @y: new Y position relative to window’s parent
+ * @surface: a #GdkSurface
+ * @x: new X position relative to surface’s parent
+ * @y: new Y position relative to surface’s parent
* @width: new width
* @height: new height
*
* Equivalent to calling gdk_surface_move() and gdk_surface_resize(),
* except that both operations are performed at once, avoiding strange
- * visual effects. (i.e. the user may be able to see the window first
+ * visual effects. (i.e. the user may be able to see the surface first
* move, then resize, if you don’t use gdk_surface_move_resize().)
**/
void
-gdk_surface_move_resize (GdkSurface *window,
+gdk_surface_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height)
{
- gdk_surface_move_resize_internal (window, TRUE, x, y, width, height);
+ gdk_surface_move_resize_internal (surface, TRUE, x, y, width, height);
}
/**
* gdk_surface_move_to_rect:
- * @window: the #GdkSurface to move
- * @rect: (not nullable): the destination #GdkRectangle to align @window with
- * @rect_anchor: the point on @rect to align with @window's anchor point
- * @surface_anchor: the point on @window to align with @rect's anchor point
+ * @surface: the #GdkSurface to move
+ * @rect: (not nullable): the destination #GdkRectangle to align @surface with
+ * @rect_anchor: the point on @rect to align with @surface's anchor point
+ * @surface_anchor: the point on @surface to align with @rect's anchor point
* @anchor_hints: positioning hints to use when limited on space
- * @rect_anchor_dx: horizontal offset to shift @window, i.e. @rect's anchor
+ * @rect_anchor_dx: horizontal offset to shift @surface, i.e. @rect's anchor
* point
- * @rect_anchor_dy: vertical offset to shift @window, i.e. @rect's anchor point
+ * @rect_anchor_dy: vertical offset to shift @surface, i.e. @rect's anchor point
*
- * Moves @window to @rect, aligning their anchor points.
+ * Moves @surface to @rect, aligning their anchor points.
*
- * @rect is relative to the top-left corner of the window that @window is
+ * @rect is relative to the top-left corner of the surface that @surface is
* transient for. @rect_anchor and @surface_anchor determine anchor points on
- * @rect and @window to pin together. @rect's anchor point can optionally be
+ * @rect and @surface to pin together. @rect's anchor point can optionally be
* offset by @rect_anchor_dx and @rect_anchor_dy, which is equivalent to
- * offsetting the position of @window.
+ * offsetting the position of @surface.
*
- * @anchor_hints determines how @window will be moved if the anchor points cause
+ * @anchor_hints determines how @surface will be moved if the anchor points cause
* it to move off-screen. For example, %GDK_ANCHOR_FLIP_X will replace
* %GDK_GRAVITY_NORTH_WEST with %GDK_GRAVITY_NORTH_EAST and vice versa if
- * @window extends beyond the left or right edges of the monitor.
+ * @surface extends beyond the left or right edges of the monitor.
*
* Connect to the #GdkSurface::moved-to-rect signal to find out how it was
* actually positioned.
@@ -3913,7 +3913,7 @@ gdk_surface_move_resize (GdkSurface *window,
* Stability: Private
*/
void
-gdk_surface_move_to_rect (GdkSurface *window,
+gdk_surface_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
@@ -3923,12 +3923,12 @@ gdk_surface_move_to_rect (GdkSurface *window,
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (window->transient_for);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->transient_for);
g_return_if_fail (rect);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->move_to_rect (window,
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->move_to_rect (surface,
rect,
rect_anchor,
surface_anchor,
@@ -3939,40 +3939,40 @@ gdk_surface_move_to_rect (GdkSurface *window,
/**
* gdk_surface_scroll:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @dx: Amount to scroll in the X direction
* @dy: Amount to scroll in the Y direction
*
- * Scroll the contents of @window, both pixels and children, by the
- * given amount. @window itself does not move. Portions of the window
+ * Scroll the contents of @surface, both pixels and children, by the
+ * given amount. @surface itself does not move. Portions of the surface
* that the scroll operation brings in from offscreen areas are
* invalidated. The invalidated region may be bigger than what would
* strictly be necessary.
*
- * For X11, a minimum area will be invalidated if the window has no
- * subwindows, or if the edges of the window’s parent do not extend
- * beyond the edges of the window. In other cases, a multi-step process
- * is used to scroll the window which may produce temporary visual
+ * For X11, a minimum area will be invalidated if the surface has no
+ * subsurfaces, or if the edges of the surface’s parent do not extend
+ * beyond the edges of the surface. In other cases, a multi-step process
+ * is used to scroll the surface which may produce temporary visual
* artifacts and unnecessary invalidations.
**/
void
-gdk_surface_scroll (GdkSurface *window,
+gdk_surface_scroll (GdkSurface *surface,
gint dx,
gint dy)
{
GList *tmp_list;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
if (dx == 0 && dy == 0)
return;
- if (window->destroyed)
+ if (surface->destroyed)
return;
- /* First move all child windows, without causing invalidation */
+ /* First move all child surfaces, without causing invalidation */
- tmp_list = window->children;
+ tmp_list = surface->children;
while (tmp_list)
{
GdkSurface *child = GDK_SURFACE (tmp_list->data);
@@ -3984,135 +3984,135 @@ gdk_surface_scroll (GdkSurface *window,
tmp_list = tmp_list->next;
}
- recompute_visible_regions (window, TRUE);
+ recompute_visible_regions (surface, TRUE);
- gdk_surface_invalidate_rect_full (window, NULL, TRUE);
+ gdk_surface_invalidate_rect_full (surface, NULL, TRUE);
}
/**
* gdk_surface_move_region:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @region: The #cairo_region_t to move
* @dx: Amount to move in the X direction
* @dy: Amount to move in the Y direction
*
- * Move the part of @window indicated by @region by @dy pixels in the Y
+ * Move the part of @surface indicated by @region by @dy pixels in the Y
* direction and @dx pixels in the X direction. The portions of @region
* that not covered by the new position of @region are invalidated.
*
- * Child windows are not moved.
+ * Child surfaces are not moved.
*/
void
-gdk_surface_move_region (GdkSurface *window,
+gdk_surface_move_region (GdkSurface *surface,
const cairo_region_t *region,
gint dx,
gint dy)
{
cairo_region_t *expose_area;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (region != NULL);
if (dx == 0 && dy == 0)
return;
- if (window->destroyed)
+ if (surface->destroyed)
return;
expose_area = cairo_region_copy (region);
cairo_region_translate (expose_area, dx, dy);
cairo_region_union (expose_area, region);
- gdk_surface_invalidate_region_full (window, expose_area, FALSE);
+ gdk_surface_invalidate_region_full (surface, expose_area, FALSE);
cairo_region_destroy (expose_area);
}
static void
-gdk_surface_set_cursor_internal (GdkSurface *window,
+gdk_surface_set_cursor_internal (GdkSurface *surface,
GdkDevice *device,
GdkCursor *cursor)
{
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- g_assert (gdk_surface_get_display (window) == gdk_device_get_display (device));
+ g_assert (gdk_surface_get_display (surface) == gdk_device_get_display (device));
- if (window->surface_type == GDK_SURFACE_ROOT ||
- window->surface_type == GDK_SURFACE_FOREIGN)
- GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, window, cursor);
+ if (surface->surface_type == GDK_SURFACE_ROOT ||
+ surface->surface_type == GDK_SURFACE_FOREIGN)
+ GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, surface, cursor);
else
{
GdkPointerSurfaceInfo *pointer_info;
GdkDisplay *display;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
pointer_info = _gdk_display_get_pointer_info (display, device);
- if (_gdk_surface_event_parent_of (window, pointer_info->surface_under_pointer))
+ if (_gdk_surface_event_parent_of (surface, pointer_info->surface_under_pointer))
update_cursor (display, device);
}
}
/**
* gdk_surface_get_cursor:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
* Retrieves a #GdkCursor pointer for the cursor currently set on the
* specified #GdkSurface, or %NULL. If the return value is %NULL then
- * there is no custom cursor set on the specified window, and it is
- * using the cursor for its parent window.
+ * there is no custom cursor set on the specified surface, and it is
+ * using the cursor for its parent surface.
*
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
* returned object is owned by the #GdkSurface and should not be
* unreferenced directly. Use gdk_surface_set_cursor() to unset the
- * cursor of the window
+ * cursor of the surface
*/
GdkCursor *
-gdk_surface_get_cursor (GdkSurface *window)
+gdk_surface_get_cursor (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- return window->cursor;
+ return surface->cursor;
}
/**
* gdk_surface_set_cursor:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @cursor: (allow-none): a cursor
*
* Sets the default mouse pointer for a #GdkSurface.
*
- * Note that @cursor must be for the same display as @window.
+ * Note that @cursor must be for the same display as @surface.
*
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to
* create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.
* Passing %NULL for the @cursor argument to gdk_surface_set_cursor() means
- * that @window will use the cursor of its parent window. Most windows
+ * that @surface will use the cursor of its parent surface. Most surfaces
* should use this default.
*/
void
-gdk_surface_set_cursor (GdkSurface *window,
+gdk_surface_set_cursor (GdkSurface *surface,
GdkCursor *cursor)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (window->cursor)
+ if (surface->cursor)
{
- g_object_unref (window->cursor);
- window->cursor = NULL;
+ g_object_unref (surface->cursor);
+ surface->cursor = NULL;
}
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
GdkDevice *device;
GList *seats, *s;
if (cursor)
- window->cursor = g_object_ref (cursor);
+ surface->cursor = g_object_ref (cursor);
seats = gdk_display_list_seats (display);
@@ -4121,103 +4121,103 @@ gdk_surface_set_cursor (GdkSurface *window,
GList *devices, *d;
device = gdk_seat_get_pointer (s->data);
- gdk_surface_set_cursor_internal (window, device, window->cursor);
+ gdk_surface_set_cursor_internal (surface, device, surface->cursor);
devices = gdk_seat_get_slaves (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
for (d = devices; d; d = d->next)
{
device = gdk_device_get_associated_device (d->data);
- gdk_surface_set_cursor_internal (window, device, window->cursor);
+ gdk_surface_set_cursor_internal (surface, device, surface->cursor);
}
g_list_free (devices);
}
g_list_free (seats);
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_CURSOR]);
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_CURSOR]);
}
}
/**
* gdk_surface_get_device_cursor:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
* @device: a master, pointer #GdkDevice.
*
* Retrieves a #GdkCursor pointer for the @device currently set on the
* specified #GdkSurface, or %NULL. If the return value is %NULL then
- * there is no custom cursor set on the specified window, and it is
- * using the cursor for its parent window.
+ * there is no custom cursor set on the specified surface, and it is
+ * using the cursor for its parent surface.
*
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
* returned object is owned by the #GdkSurface and should not be
* unreferenced directly. Use gdk_surface_set_cursor() to unset the
- * cursor of the window
+ * cursor of the surface
**/
GdkCursor *
-gdk_surface_get_device_cursor (GdkSurface *window,
+gdk_surface_get_device_cursor (GdkSurface *surface,
GdkDevice *device)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL);
- return g_hash_table_lookup (window->device_cursor, device);
+ return g_hash_table_lookup (surface->device_cursor, device);
}
/**
* gdk_surface_set_device_cursor:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @device: a master, pointer #GdkDevice
* @cursor: a #GdkCursor
*
- * Sets a specific #GdkCursor for a given device when it gets inside @window.
+ * Sets a specific #GdkCursor for a given device when it gets inside @surface.
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to create
* the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. Passing
* %NULL for the @cursor argument to gdk_surface_set_cursor() means that
- * @window will use the cursor of its parent window. Most windows should
+ * @surface will use the cursor of its parent surface. Most surfaces should
* use this default.
**/
void
-gdk_surface_set_device_cursor (GdkSurface *window,
+gdk_surface_set_device_cursor (GdkSurface *surface,
GdkDevice *device,
GdkCursor *cursor)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
if (!cursor)
- g_hash_table_remove (window->device_cursor, device);
+ g_hash_table_remove (surface->device_cursor, device);
else
- g_hash_table_replace (window->device_cursor, device, g_object_ref (cursor));
+ g_hash_table_replace (surface->device_cursor, device, g_object_ref (cursor));
- gdk_surface_set_cursor_internal (window, device, cursor);
+ gdk_surface_set_cursor_internal (surface, device, cursor);
}
/**
* gdk_surface_get_geometry:
- * @window: a #GdkSurface
- * @x: (out) (allow-none): return location for X coordinate of window (relative to its parent)
- * @y: (out) (allow-none): return location for Y coordinate of window (relative to its parent)
- * @width: (out) (allow-none): return location for width of window
- * @height: (out) (allow-none): return location for height of window
+ * @surface: a #GdkSurface
+ * @x: (out) (allow-none): return location for X coordinate of surface (relative to its parent)
+ * @y: (out) (allow-none): return location for Y coordinate of surface (relative to its parent)
+ * @width: (out) (allow-none): return location for width of surface
+ * @height: (out) (allow-none): return location for height of surface
*
* Any of the return location arguments to this function may be %NULL,
* if you aren’t interested in getting the value of that field.
*
- * The X and Y coordinates returned are relative to the parent window
- * of @window, which for toplevels usually means relative to the
- * window decorations (titlebar, etc.) rather than relative to the
+ * The X and Y coordinates returned are relative to the parent surface
+ * of @surface, which for toplevels usually means relative to the
+ * surface decorations (titlebar, etc.) rather than relative to the
* root window (screen-size background window).
*
* On the X11 platform, the geometry is obtained from the X server,
- * so reflects the latest position of @window; this may be out-of-sync
- * with the position of @window delivered in the most-recently-processed
+ * so reflects the latest position of @surface; this may be out-of-sync
+ * with the position of @surface delivered in the most-recently-processed
* #GdkEventConfigure. gdk_surface_get_position() in contrast gets the
* position from the most recent configure event.
*
- * Note: If @window is not a toplevel, it is much better
+ * Note: If @surface is not a toplevel, it is much better
* to call gdk_surface_get_position(), gdk_surface_get_width() and
* gdk_surface_get_height() instead, because it avoids the roundtrip to
* the X server and because these functions support the full 32-bit
@@ -4225,7 +4225,7 @@ gdk_surface_set_device_cursor (GdkSurface *window,
* the 16-bit coordinates of X11.
*/
void
-gdk_surface_get_geometry (GdkSurface *window,
+gdk_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
@@ -4234,18 +4234,18 @@ gdk_surface_get_geometry (GdkSurface *window,
GdkSurface *parent;
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->get_geometry (window, x, y,
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->get_geometry (surface, x, y,
width, height);
/* This reports the position wrt to the native parent, we need to convert
it to be relative to the client side parent */
- parent = window->parent;
+ parent = surface->parent;
if (parent && !gdk_surface_has_impl (parent))
{
if (x)
@@ -4257,80 +4257,80 @@ gdk_surface_get_geometry (GdkSurface *window,
else
{
if (x)
- *x = window->x;
+ *x = surface->x;
if (y)
- *y = window->y;
+ *y = surface->y;
if (width)
- *width = window->width;
+ *width = surface->width;
if (height)
- *height = window->height;
+ *height = surface->height;
}
}
}
/**
* gdk_surface_get_width:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Returns the width of the given @window.
+ * Returns the width of the given @surface.
*
* On the X11 platform the returned size is the size reported in the
* most-recently-processed configure event, rather than the current
* size on the X server.
*
- * Returns: The width of @window
+ * Returns: The width of @surface
*/
int
-gdk_surface_get_width (GdkSurface *window)
+gdk_surface_get_width (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- return window->width;
+ return surface->width;
}
/**
* gdk_surface_get_height:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Returns the height of the given @window.
+ * Returns the height of the given @surface.
*
* On the X11 platform the returned size is the size reported in the
* most-recently-processed configure event, rather than the current
* size on the X server.
*
- * Returns: The height of @window
+ * Returns: The height of @surface
*/
int
-gdk_surface_get_height (GdkSurface *window)
+gdk_surface_get_height (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- return window->height;
+ return surface->height;
}
/**
* gdk_surface_get_origin:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @x: (out) (allow-none): return location for X coordinate
* @y: (out) (allow-none): return location for Y coordinate
*
- * Obtains the position of a window in root window coordinates.
+ * Obtains the position of a surface in root window coordinates.
* (Compare with gdk_surface_get_position() and
- * gdk_surface_get_geometry() which return the position of a window
- * relative to its parent window.)
+ * gdk_surface_get_geometry() which return the position of a surface
+ * relative to its parent surface.)
*
* Returns: not meaningful, ignore
*/
gint
-gdk_surface_get_origin (GdkSurface *window,
+gdk_surface_get_origin (GdkSurface *surface,
gint *x,
gint *y)
{
gint dummy_x, dummy_y;
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- gdk_surface_get_root_coords (window,
+ gdk_surface_get_root_coords (surface,
0, 0,
x ? x : &dummy_x,
y ? y : &dummy_y);
@@ -4340,19 +4340,19 @@ gdk_surface_get_origin (GdkSurface *window,
/**
* gdk_surface_get_root_coords:
- * @window: a #GdkSurface
- * @x: X coordinate in window
- * @y: Y coordinate in window
+ * @surface: a #GdkSurface
+ * @x: X coordinate in surface
+ * @y: Y coordinate in surface
* @root_x: (out): return location for X coordinate
* @root_y: (out): return location for Y coordinate
*
- * Obtains the position of a window position in root
+ * Obtains the position of a surface position in root
* window coordinates. This is similar to
* gdk_surface_get_origin() but allows you to pass
- * in any position in the window, not just the origin.
+ * in any position in the surface, not just the origin.
*/
void
-gdk_surface_get_root_coords (GdkSurface *window,
+gdk_surface_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
@@ -4360,25 +4360,25 @@ gdk_surface_get_root_coords (GdkSurface *window,
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
{
*root_x = 0;
*root_y = 0;
return;
}
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->get_root_coords (window->impl_surface,
- x + window->abs_x,
- y + window->abs_y,
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->get_root_coords (surface->impl_surface,
+ x + surface->abs_x,
+ y + surface->abs_y,
root_x, root_y);
}
/**
* gdk_surface_coords_to_parent:
- * @window: a child window
+ * @surface: a child surface
* @x: X coordinate in child’s coordinate system
* @y: Y coordinate in child’s coordinate system
* @parent_x: (out) (allow-none): return location for X coordinate
@@ -4386,38 +4386,38 @@ gdk_surface_get_root_coords (GdkSurface *window,
* @parent_y: (out) (allow-none): return location for Y coordinate
* in parent’s coordinate system, or %NULL
*
- * Transforms window coordinates from a child window to its parent
- * window. Calling this function is equivalent to adding the return
+ * Transforms surface coordinates from a child surface to its parent
+ * surface. Calling this function is equivalent to adding the return
* values of gdk_surface_get_position() to the child coordinates.
*
* See also: gdk_surface_coords_from_parent()
**/
void
-gdk_surface_coords_to_parent (GdkSurface *window,
+gdk_surface_coords_to_parent (GdkSurface *surface,
gdouble x,
gdouble y,
gdouble *parent_x,
gdouble *parent_y)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
if (parent_x)
- *parent_x = x + window->x;
+ *parent_x = x + surface->x;
if (parent_y)
- *parent_y = y + window->y;
+ *parent_y = y + surface->y;
}
/**
* gdk_surface_coords_from_parent:
- * @window: a child window
+ * @surface: a child surface
* @parent_x: X coordinate in parent’s coordinate system
* @parent_y: Y coordinate in parent’s coordinate system
* @x: (out) (allow-none): return location for X coordinate in child’s coordinate system
* @y: (out) (allow-none): return location for Y coordinate in child’s coordinate system
*
- * Transforms window coordinates from a parent window to a child
- * window.
+ * Transforms surface coordinates from a parent surface to a child
+ * surface.
*
* Calling this function is equivalent to subtracting the return
* values of gdk_surface_get_position() from the parent coordinates.
@@ -4425,33 +4425,33 @@ gdk_surface_coords_to_parent (GdkSurface *window,
* See also: gdk_surface_coords_to_parent()
**/
void
-gdk_surface_coords_from_parent (GdkSurface *window,
+gdk_surface_coords_from_parent (GdkSurface *surface,
gdouble parent_x,
gdouble parent_y,
gdouble *x,
gdouble *y)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
if (x)
- *x = parent_x - window->x;
+ *x = parent_x - surface->x;
if (y)
- *y = parent_y - window->y;
+ *y = parent_y - surface->y;
}
/**
* gdk_surface_shape_combine_region:
- * @window: a #GdkSurface
- * @shape_region: (allow-none): region of window to be non-transparent
- * @offset_x: X position of @shape_region in @window coordinates
- * @offset_y: Y position of @shape_region in @window coordinates
+ * @surface: a #GdkSurface
+ * @shape_region: (allow-none): region of surface to be non-transparent
+ * @offset_x: X position of @shape_region in @surface coordinates
+ * @offset_y: Y position of @shape_region in @surface coordinates
*
- * Makes pixels in @window outside @shape_region be transparent,
- * so that the window may be nonrectangular.
+ * Makes pixels in @surface outside @shape_region be transparent,
+ * so that the surface may be nonrectangular.
*
* If @shape_region is %NULL, the shape will be unset, so the whole
- * window will be opaque again. @offset_x and @offset_y are ignored
+ * surface will be opaque again. @offset_x and @offset_y are ignored
* if @shape_region is %NULL.
*
* On the X11 platform, this uses an X server extension which is
@@ -4460,65 +4460,65 @@ gdk_surface_coords_from_parent (GdkSurface *window,
* buggy. On servers without the shape extension, this function
* will do nothing.
*
- * This function works on both toplevel and child windows.
+ * This function works on both toplevel and child surfaces.
*/
void
-gdk_surface_shape_combine_region (GdkSurface *window,
+gdk_surface_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
cairo_region_t *old_region, *new_region, *diff;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (!window->shape && shape_region == NULL)
+ if (!surface->shape && shape_region == NULL)
return;
- window->shaped = (shape_region != NULL);
+ surface->shaped = (shape_region != NULL);
- if (window->shape)
- cairo_region_destroy (window->shape);
+ if (surface->shape)
+ cairo_region_destroy (surface->shape);
old_region = NULL;
- if (GDK_SURFACE_IS_MAPPED (window))
- old_region = cairo_region_copy (window->clip_region);
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ old_region = cairo_region_copy (surface->clip_region);
if (shape_region)
{
- window->shape = cairo_region_copy (shape_region);
- cairo_region_translate (window->shape, offset_x, offset_y);
+ surface->shape = cairo_region_copy (shape_region);
+ cairo_region_translate (surface->shape, offset_x, offset_y);
}
else
- window->shape = NULL;
+ surface->shape = NULL;
- recompute_visible_regions (window, FALSE);
+ recompute_visible_regions (surface, FALSE);
if (old_region)
{
- new_region = cairo_region_copy (window->clip_region);
+ new_region = cairo_region_copy (surface->clip_region);
- /* New area in the window, needs invalidation */
+ /* New area in the surface, needs invalidation */
diff = cairo_region_copy (new_region);
cairo_region_subtract (diff, old_region);
- gdk_surface_invalidate_region_full (window, diff, TRUE);
+ gdk_surface_invalidate_region_full (surface, diff, TRUE);
cairo_region_destroy (diff);
- if (!gdk_surface_is_toplevel (window))
+ if (!gdk_surface_is_toplevel (surface))
{
- /* New area in the non-root parent window, needs invalidation */
+ /* New area in the non-root parent surface, needs invalidation */
diff = cairo_region_copy (old_region);
cairo_region_subtract (diff, new_region);
- /* Adjust region to parent window coords */
- cairo_region_translate (diff, window->x, window->y);
+ /* Adjust region to parent surface coords */
+ cairo_region_translate (diff, surface->x, surface->y);
- gdk_surface_invalidate_region_full (window->parent, diff, TRUE);
+ gdk_surface_invalidate_region_full (surface->parent, diff, TRUE);
cairo_region_destroy (diff);
}
@@ -4529,7 +4529,7 @@ gdk_surface_shape_combine_region (GdkSurface *window,
}
static void
-do_child_shapes (GdkSurface *window,
+do_child_shapes (GdkSurface *surface,
gboolean merge)
{
GdkRectangle r;
@@ -4537,76 +4537,76 @@ do_child_shapes (GdkSurface *window,
r.x = 0;
r.y = 0;
- r.width = window->width;
- r.height = window->height;
+ r.width = surface->width;
+ r.height = surface->height;
region = cairo_region_create_rectangle (&r);
- remove_child_area (window, FALSE, region);
+ remove_child_area (surface, FALSE, region);
- if (merge && window->shape)
- cairo_region_subtract (region, window->shape);
+ if (merge && surface->shape)
+ cairo_region_subtract (region, surface->shape);
cairo_region_xor_rectangle (region, &r);
- gdk_surface_shape_combine_region (window, region, 0, 0);
+ gdk_surface_shape_combine_region (surface, region, 0, 0);
cairo_region_destroy (region);
}
/**
* gdk_surface_set_child_shapes:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Sets the shape mask of @window to the union of shape masks
- * for all children of @window, ignoring the shape mask of @window
+ * Sets the shape mask of @surface to the union of shape masks
+ * for all children of @surface, ignoring the shape mask of @surface
* itself. Contrast with gdk_surface_merge_child_shapes() which includes
- * the shape mask of @window in the masks to be merged.
+ * the shape mask of @surface in the masks to be merged.
**/
void
-gdk_surface_set_child_shapes (GdkSurface *window)
+gdk_surface_set_child_shapes (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- do_child_shapes (window, FALSE);
+ do_child_shapes (surface, FALSE);
}
/**
* gdk_surface_merge_child_shapes:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Merges the shape masks for any child windows into the
- * shape mask for @window. i.e. the union of all masks
- * for @window and its children will become the new mask
- * for @window. See gdk_surface_shape_combine_region().
+ * Merges the shape masks for any child surfaces into the
+ * shape mask for @surface. i.e. the union of all masks
+ * for @surface and its children will become the new mask
+ * for @surface. See gdk_surface_shape_combine_region().
*
* This function is distinct from gdk_surface_set_child_shapes()
- * because it includes @window’s shape mask in the set of shapes to
+ * because it includes @surface’s shape mask in the set of shapes to
* be merged.
*/
void
-gdk_surface_merge_child_shapes (GdkSurface *window)
+gdk_surface_merge_child_shapes (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- do_child_shapes (window, TRUE);
+ do_child_shapes (surface, TRUE);
}
/**
* gdk_surface_input_shape_combine_region:
- * @window: a #GdkSurface
- * @shape_region: region of window to be non-transparent
- * @offset_x: X position of @shape_region in @window coordinates
- * @offset_y: Y position of @shape_region in @window coordinates
+ * @surface: a #GdkSurface
+ * @shape_region: region of surface to be non-transparent
+ * @offset_x: X position of @shape_region in @surface coordinates
+ * @offset_y: Y position of @shape_region in @surface coordinates
*
* Like gdk_surface_shape_combine_region(), but the shape applies
* only to event handling. Mouse events which happen while
* the pointer position corresponds to an unset bit in the
- * mask will be passed on the window below @window.
+ * mask will be passed on the surface below @surface.
*
- * An input shape is typically used with RGBA windows.
- * The alpha channel of the window defines which pixels are
+ * An input shape is typically used with RGBA surfaces.
+ * The alpha channel of the surface defines which pixels are
* invisible and allows for nicely antialiased borders,
- * and the input shape controls where the window is
+ * and the input shape controls where the surface is
* “clickable”.
*
* On the X11 platform, this requires version 1.1 of the
@@ -4616,38 +4616,38 @@ gdk_surface_merge_child_shapes (GdkSurface *window)
* function does nothing.
*/
void
-gdk_surface_input_shape_combine_region (GdkSurface *window,
+gdk_surface_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (window->input_shape)
- cairo_region_destroy (window->input_shape);
+ if (surface->input_shape)
+ cairo_region_destroy (surface->input_shape);
if (shape_region)
{
- window->input_shape = cairo_region_copy (shape_region);
- cairo_region_translate (window->input_shape, offset_x, offset_y);
+ surface->input_shape = cairo_region_copy (shape_region);
+ cairo_region_translate (surface->input_shape, offset_x, offset_y);
}
else
- window->input_shape = NULL;
+ surface->input_shape = NULL;
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
- impl_class->input_shape_combine_region (window, window->input_shape, 0, 0);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->input_shape_combine_region (surface, surface->input_shape, 0, 0);
}
}
static void
-do_child_input_shapes (GdkSurface *window,
+do_child_input_shapes (GdkSurface *surface,
gboolean merge)
{
GdkRectangle r;
@@ -4655,209 +4655,209 @@ do_child_input_shapes (GdkSurface *window,
r.x = 0;
r.y = 0;
- r.width = window->width;
- r.height = window->height;
+ r.width = surface->width;
+ r.height = surface->height;
region = cairo_region_create_rectangle (&r);
- remove_child_area (window, TRUE, region);
+ remove_child_area (surface, TRUE, region);
- if (merge && window->shape)
- cairo_region_subtract (region, window->shape);
- if (merge && window->input_shape)
- cairo_region_subtract (region, window->input_shape);
+ if (merge && surface->shape)
+ cairo_region_subtract (region, surface->shape);
+ if (merge && surface->input_shape)
+ cairo_region_subtract (region, surface->input_shape);
cairo_region_xor_rectangle (region, &r);
- gdk_surface_input_shape_combine_region (window, region, 0, 0);
+ gdk_surface_input_shape_combine_region (surface, region, 0, 0);
}
/**
* gdk_surface_set_child_input_shapes:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Sets the input shape mask of @window to the union of input shape masks
- * for all children of @window, ignoring the input shape mask of @window
+ * Sets the input shape mask of @surface to the union of input shape masks
+ * for all children of @surface, ignoring the input shape mask of @surface
* itself. Contrast with gdk_surface_merge_child_input_shapes() which includes
- * the input shape mask of @window in the masks to be merged.
+ * the input shape mask of @surface in the masks to be merged.
**/
void
-gdk_surface_set_child_input_shapes (GdkSurface *window)
+gdk_surface_set_child_input_shapes (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- do_child_input_shapes (window, FALSE);
+ do_child_input_shapes (surface, FALSE);
}
/**
* gdk_surface_set_pass_through:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @pass_through: a boolean
*
- * Sets whether input to the window is passed through to the window
+ * Sets whether input to the surface is passed through to the surface
* below.
*
* The default value of this is %FALSE, which means that pointer
- * events that happen inside the window are send first to the window,
+ * events that happen inside the surface are send first to the surface,
* but if the event is not selected by the event mask then the event
- * is sent to the parent window, and so on up the hierarchy.
+ * is sent to the parent surface, and so on up the hierarchy.
*
* If @pass_through is %TRUE then such pointer events happen as if the
- * window wasn't there at all, and thus will be sent first to any
- * windows below @window. This is useful if the window is used in a
+ * surface wasn't there at all, and thus will be sent first to any
+ * surfaces below @surface. This is useful if the surface is used in a
* transparent fashion. In the terminology of the web this would be called
* "pointer-events: none".
*
- * Note that a window with @pass_through %TRUE can still have a subwindow
- * without pass through, so you can get events on a subset of a window. And in
+ * Note that a surface with @pass_through %TRUE can still have a subsurface
+ * without pass through, so you can get events on a subset of a surface. And in
* that cases you would get the in-between related events such as the pointer
- * enter/leave events on its way to the destination window.
+ * enter/leave events on its way to the destination surface.
**/
void
-gdk_surface_set_pass_through (GdkSurface *window,
+gdk_surface_set_pass_through (GdkSurface *surface,
gboolean pass_through)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- window->pass_through = !!pass_through;
+ surface->pass_through = !!pass_through;
}
/**
* gdk_surface_get_pass_through:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Returns whether input to the window is passed through to the window
+ * Returns whether input to the surface is passed through to the surface
* below.
*
* See gdk_surface_set_pass_through() for details
**/
gboolean
-gdk_surface_get_pass_through (GdkSurface *window)
+gdk_surface_get_pass_through (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->pass_through;
+ return surface->pass_through;
}
/**
* gdk_surface_merge_child_input_shapes:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Merges the input shape masks for any child windows into the
- * input shape mask for @window. i.e. the union of all input masks
- * for @window and its children will become the new input mask
- * for @window. See gdk_surface_input_shape_combine_region().
+ * Merges the input shape masks for any child surfaces into the
+ * input shape mask for @surface. i.e. the union of all input masks
+ * for @surface and its children will become the new input mask
+ * for @surface. See gdk_surface_input_shape_combine_region().
*
* This function is distinct from gdk_surface_set_child_input_shapes()
- * because it includes @window’s input shape mask in the set of
+ * because it includes @surface’s input shape mask in the set of
* shapes to be merged.
**/
void
-gdk_surface_merge_child_input_shapes (GdkSurface *window)
+gdk_surface_merge_child_input_shapes (GdkSurface *surface)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- do_child_input_shapes (window, TRUE);
+ do_child_input_shapes (surface, TRUE);
}
/**
* gdk_surface_get_modal_hint:
- * @window: A toplevel #GdkSurface.
+ * @surface: A toplevel #GdkSurface.
*
- * Determines whether or not the window manager is hinted that @window
+ * Determines whether or not the surface manager is hinted that @surface
* has modal behaviour.
*
- * Returns: whether or not the window has the modal hint set.
+ * Returns: whether or not the surface has the modal hint set.
*/
gboolean
-gdk_surface_get_modal_hint (GdkSurface *window)
+gdk_surface_get_modal_hint (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->modal_hint;
+ return surface->modal_hint;
}
/**
* gdk_surface_get_accept_focus:
- * @window: a toplevel #GdkSurface.
+ * @surface: a toplevel #GdkSurface.
*
* Determines whether or not the desktop environment shuld be hinted that
- * the window does not want to receive input focus.
+ * the surface does not want to receive input focus.
*
- * Returns: whether or not the window should receive input focus.
+ * Returns: whether or not the surface should receive input focus.
*/
gboolean
-gdk_surface_get_accept_focus (GdkSurface *window)
+gdk_surface_get_accept_focus (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->accept_focus;
+ return surface->accept_focus;
}
/**
* gdk_surface_get_focus_on_map:
- * @window: a toplevel #GdkSurface.
+ * @surface: a toplevel #GdkSurface.
*
* Determines whether or not the desktop environment should be hinted that the
- * window does not want to receive input focus when it is mapped.
+ * surface does not want to receive input focus when it is mapped.
*
- * Returns: whether or not the window wants to receive input focus when
+ * Returns: whether or not the surface wants to receive input focus when
* it is mapped.
*/
gboolean
-gdk_surface_get_focus_on_map (GdkSurface *window)
+gdk_surface_get_focus_on_map (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->focus_on_map;
+ return surface->focus_on_map;
}
/**
* gdk_surface_is_input_only:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Determines whether or not the window is an input only window.
+ * Determines whether or not the surface is an input only surface.
*
- * Returns: %TRUE if @window is input only
+ * Returns: %TRUE if @surface is input only
*/
gboolean
-gdk_surface_is_input_only (GdkSurface *window)
+gdk_surface_is_input_only (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->input_only;
+ return surface->input_only;
}
/**
* gdk_surface_is_shaped:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Determines whether or not the window is shaped.
+ * Determines whether or not the surface is shaped.
*
- * Returns: %TRUE if @window is shaped
+ * Returns: %TRUE if @surface is shaped
*/
gboolean
-gdk_surface_is_shaped (GdkSurface *window)
+gdk_surface_is_shaped (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- return window->shaped;
+ return surface->shaped;
}
-/* Gets the toplevel for a window as used for events,
+/* Gets the toplevel for a surface as used for events,
i.e. including offscreen parents going up to the native
toplevel */
static GdkSurface *
-get_event_toplevel (GdkSurface *window)
+get_event_toplevel (GdkSurface *surface)
{
GdkSurface *parent;
- while ((parent = window->parent) != NULL &&
+ while ((parent = surface->parent) != NULL &&
(parent->surface_type != GDK_SURFACE_ROOT))
- window = parent;
+ surface = parent;
- return window;
+ return surface;
}
gboolean
@@ -4882,71 +4882,71 @@ static void
update_cursor (GdkDisplay *display,
GdkDevice *device)
{
- GdkSurface *cursor_window, *parent, *toplevel;
- GdkSurface *pointer_window;
+ GdkSurface *cursor_surface, *parent, *toplevel;
+ GdkSurface *pointer_surface;
GdkPointerSurfaceInfo *pointer_info;
GdkDeviceGrabInfo *grab;
GdkCursor *cursor;
pointer_info = _gdk_display_get_pointer_info (display, device);
- pointer_window = pointer_info->surface_under_pointer;
+ pointer_surface = pointer_info->surface_under_pointer;
/* We ignore the serials here and just pick the last grab
we've sent, as that would shortly be used anyway. */
grab = _gdk_display_get_last_device_grab (display, device);
if (/* have grab */
grab != NULL &&
- /* the pointer is not in a descendant of the grab window */
- !_gdk_surface_event_parent_of (grab->window, pointer_window))
+ /* the pointer is not in a descendant of the grab surface */
+ !_gdk_surface_event_parent_of (grab->surface, pointer_surface))
{
- /* use the cursor from the grab window */
- cursor_window = grab->window;
+ /* use the cursor from the grab surface */
+ cursor_surface = grab->surface;
}
else
{
- /* otherwise use the cursor from the pointer window */
- cursor_window = pointer_window;
+ /* otherwise use the cursor from the pointer surface */
+ cursor_surface = pointer_surface;
}
- /* Find the first window with the cursor actually set, as
+ /* Find the first surface with the cursor actually set, as
the cursor is inherited from the parent */
- while (cursor_window->cursor == NULL &&
- !g_hash_table_contains (cursor_window->device_cursor, device) &&
- (parent = cursor_window->parent) != NULL &&
+ while (cursor_surface->cursor == NULL &&
+ !g_hash_table_contains (cursor_surface->device_cursor, device) &&
+ (parent = cursor_surface->parent) != NULL &&
parent->surface_type != GDK_SURFACE_ROOT)
- cursor_window = parent;
+ cursor_surface = parent;
- cursor = g_hash_table_lookup (cursor_window->device_cursor, device);
+ cursor = g_hash_table_lookup (cursor_surface->device_cursor, device);
if (!cursor)
- cursor = cursor_window->cursor;
+ cursor = cursor_surface->cursor;
/* Set all cursors on toplevel, otherwise its tricky to keep track of
- * which native window has what cursor set. */
- toplevel = get_event_toplevel (pointer_window);
+ * which native surface has what cursor set. */
+ toplevel = get_event_toplevel (pointer_surface);
GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, toplevel, cursor);
}
static gboolean
-point_in_window (GdkSurface *window,
+point_in_surface (GdkSurface *surface,
gdouble x,
gdouble y)
{
return
- x >= 0 && x < window->width &&
- y >= 0 && y < window->height &&
- (window->shape == NULL ||
- cairo_region_contains_point (window->shape,
+ x >= 0 && x < surface->width &&
+ y >= 0 && y < surface->height &&
+ (surface->shape == NULL ||
+ cairo_region_contains_point (surface->shape,
x, y)) &&
- (window->input_shape == NULL ||
- cairo_region_contains_point (window->input_shape,
+ (surface->input_shape == NULL ||
+ cairo_region_contains_point (surface->input_shape,
x, y));
}
-/* Same as point_in_window, except it also takes pass_through and its
- interaction with child windows into account */
+/* Same as point_in_surface, except it also takes pass_through and its
+ interaction with child surfaces into account */
static gboolean
-point_in_input_surface (GdkSurface *window,
+point_in_input_surface (GdkSurface *surface,
gdouble x,
gdouble y,
GdkSurface **input_surface,
@@ -4957,24 +4957,24 @@ point_in_input_surface (GdkSurface *window,
double child_x, child_y;
GList *l;
- if (!point_in_window (window, x, y))
+ if (!point_in_surface (surface, x, y))
return FALSE;
- if (!window->pass_through)
+ if (!surface->pass_through)
{
if (input_surface)
{
- *input_surface = window;
+ *input_surface = surface;
*input_surface_x = x;
*input_surface_y = y;
}
return TRUE;
}
- /* For pass-through, must be over a child input window */
+ /* For pass-through, must be over a child input surface */
/* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = window->children; l != NULL; l = l->next)
+ for (l = surface->children; l != NULL; l = l->next)
{
sub = l->data;
@@ -5001,7 +5001,7 @@ point_in_input_surface (GdkSurface *window,
}
GdkSurface *
-_gdk_surface_find_child_at (GdkSurface *window,
+_gdk_surface_find_child_at (GdkSurface *surface,
double x,
double y)
{
@@ -5009,10 +5009,10 @@ _gdk_surface_find_child_at (GdkSurface *window,
double child_x, child_y;
GList *l;
- if (point_in_window (window, x, y))
+ if (point_in_surface (surface, x, y))
{
/* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = window->children; l != NULL; l = l->next)
+ for (l = surface->children; l != NULL; l = l->next)
{
sub = l->data;
@@ -5032,7 +5032,7 @@ _gdk_surface_find_child_at (GdkSurface *window,
}
GdkSurface *
-_gdk_surface_find_descendant_at (GdkSurface *window,
+_gdk_surface_find_descendant_at (GdkSurface *surface,
gdouble x,
gdouble y,
gdouble *found_x,
@@ -5043,13 +5043,13 @@ _gdk_surface_find_descendant_at (GdkSurface *window,
GList *l;
gboolean found;
- if (point_in_window (window, x, y))
+ if (point_in_surface (surface, x, y))
{
do
{
found = FALSE;
/* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = window->children; l != NULL; l = l->next)
+ for (l = surface->children; l != NULL; l = l->next)
{
sub = l->data;
@@ -5064,7 +5064,7 @@ _gdk_surface_find_descendant_at (GdkSurface *window,
{
x = child_x;
y = child_y;
- window = input_surface;
+ surface = input_surface;
found = TRUE;
break;
}
@@ -5074,8 +5074,8 @@ _gdk_surface_find_descendant_at (GdkSurface *window,
}
else
{
- /* Not in window at all */
- window = NULL;
+ /* Not in surface at all */
+ surface = NULL;
}
if (found_x)
@@ -5083,30 +5083,30 @@ _gdk_surface_find_descendant_at (GdkSurface *window,
if (found_y)
*found_y = y;
- return window;
+ return surface;
}
/**
* gdk_surface_beep:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Emits a short beep associated to @window in the appropriate
+ * Emits a short beep associated to @surface in the appropriate
* display, if supported. Otherwise, emits a short beep on
* the display just as gdk_display_beep().
**/
void
-gdk_surface_beep (GdkSurface *window)
+gdk_surface_beep (GdkSurface *surface)
{
GdkDisplay *display;
GdkSurface *toplevel;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- toplevel = get_event_toplevel (window);
- display = gdk_surface_get_display (window);
+ toplevel = get_event_toplevel (surface);
+ display = gdk_surface_get_display (surface);
if (toplevel)
{
@@ -5114,61 +5114,61 @@ gdk_surface_beep (GdkSurface *window)
return;
}
- /* If windows fail to beep, we beep the display. */
+ /* If surfaces fail to beep, we beep the display. */
gdk_display_beep (display);
}
/**
* gdk_surface_set_support_multidevice:
- * @window: a #GdkSurface.
- * @support_multidevice: %TRUE to enable multidevice support in @window.
+ * @surface: a #GdkSurface.
+ * @support_multidevice: %TRUE to enable multidevice support in @surface.
*
- * This function will enable multidevice features in @window.
+ * This function will enable multidevice features in @surface.
*
- * Multidevice aware windows will need to handle properly multiple,
+ * Multidevice aware surfaces will need to handle properly multiple,
* per device enter/leave events, device grabs and grab ownerships.
**/
void
-gdk_surface_set_support_multidevice (GdkSurface *window,
+gdk_surface_set_support_multidevice (GdkSurface *surface,
gboolean support_multidevice)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- if (window->support_multidevice == support_multidevice)
+ if (surface->support_multidevice == support_multidevice)
return;
- window->support_multidevice = support_multidevice;
+ surface->support_multidevice = support_multidevice;
- /* FIXME: What to do if called when some pointers are inside the window ? */
+ /* FIXME: What to do if called when some pointers are inside the surface ? */
}
/**
* gdk_surface_get_support_multidevice:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
*
- * Returns %TRUE if the window is aware of the existence of multiple
+ * Returns %TRUE if the surface is aware of the existence of multiple
* devices.
*
- * Returns: %TRUE if the window handles multidevice features.
+ * Returns: %TRUE if the surface handles multidevice features.
**/
gboolean
-gdk_surface_get_support_multidevice (GdkSurface *window)
+gdk_surface_get_support_multidevice (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return FALSE;
- return window->support_multidevice;
+ return surface->support_multidevice;
}
/* send motion events if the right buttons are down */
GdkEvent *
-_gdk_make_event (GdkSurface *window,
+_gdk_make_event (GdkSurface *surface,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event)
@@ -5180,7 +5180,7 @@ _gdk_make_event (GdkSurface *window,
the_time = gdk_event_get_time (event_in_queue);
gdk_event_get_state (event_in_queue, &the_state);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = FALSE;
if (event_in_queue && event_in_queue->any.send_event)
event->any.send_event = TRUE;
@@ -5262,12 +5262,12 @@ _gdk_make_event (GdkSurface *window,
if (event_in_queue)
{
if (before_event)
- _gdk_event_queue_insert_before (gdk_surface_get_display (window), event_in_queue, event);
+ _gdk_event_queue_insert_before (gdk_surface_get_display (surface), event_in_queue, event);
else
- _gdk_event_queue_insert_after (gdk_surface_get_display (window), event_in_queue, event);
+ _gdk_event_queue_insert_after (gdk_surface_get_display (surface), event_in_queue, event);
}
else
- _gdk_event_queue_append (gdk_surface_get_display (window), event);
+ _gdk_event_queue_append (gdk_surface_get_display (surface), event);
return event;
}
@@ -5275,7 +5275,7 @@ _gdk_make_event (GdkSurface *window,
void
_gdk_display_set_surface_under_pointer (GdkDisplay *display,
GdkDevice *device,
- GdkSurface *window)
+ GdkSurface *surface)
{
GdkPointerSurfaceInfo *device_info;
@@ -5283,11 +5283,11 @@ _gdk_display_set_surface_under_pointer (GdkDisplay *display,
if (device_info->surface_under_pointer)
g_object_unref (device_info->surface_under_pointer);
- device_info->surface_under_pointer = window;
+ device_info->surface_under_pointer = surface;
- if (window)
+ if (surface)
{
- g_object_ref (window);
+ g_object_ref (surface);
update_cursor (display, device);
}
}
@@ -5298,14 +5298,14 @@ _gdk_display_set_surface_under_pointer (GdkDisplay *display,
GDK_BUTTON4_MASK | \
GDK_BUTTON5_MASK)
-#ifdef DEBUG_WINDOW_PRINTING
+#ifdef DEBUG_SURFACE_PRINTING
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
#endif
static void
-gdk_surface_print (GdkSurface *window,
+gdk_surface_print (GdkSurface *surface,
int indent)
{
char *s;
@@ -5319,39 +5319,39 @@ gdk_surface_print (GdkSurface *window,
"subsurface"
};
- g_print ("%*s%p: [%s] %d,%d %dx%d", indent, "", window,
- window->user_data ? g_type_name_from_instance (window->user_data) : "no widget",
- window->x, window->y,
- window->width, window->height
+ g_print ("%*s%p: [%s] %d,%d %dx%d", indent, "", surface,
+ surface->user_data ? g_type_name_from_instance (surface->user_data) : "no widget",
+ surface->x, surface->y,
+ surface->width, surface->height
);
- if (gdk_surface_has_impl (window))
+ if (gdk_surface_has_impl (surface))
{
#ifdef GDK_WINDOWING_X11
g_print (" impl(0x%lx)", gdk_x11_surface_get_xid (window));
#endif
}
- if (window->surface_type != GDK_SURFACE_CHILD)
- g_print (" %s", surface_types[window->surface_type]);
+ if (surface->surface_type != GDK_SURFACE_CHILD)
+ g_print (" %s", surface_types[surface->surface_type]);
- if (window->input_only)
+ if (surface->input_only)
g_print (" input-only");
- if (window->shaped)
+ if (surface->shaped)
g_print (" shaped");
- if (!gdk_surface_is_visible ((GdkSurface *)window))
+ if (!gdk_surface_is_visible ((GdkSurface *)surface))
g_print (" hidden");
g_print (" abs[%d,%d]",
- window->abs_x, window->abs_y);
+ surface->abs_x, surface->abs_y);
- if (window->alpha != 255)
+ if (surface->alpha != 255)
g_print (" alpha[%d]",
- window->alpha);
+ surface->alpha);
- s = print_region (window->clip_region);
+ s = print_region (surface->clip_region);
g_print (" clipbox[%s]", s);
g_print ("\n");
@@ -5359,22 +5359,22 @@ gdk_surface_print (GdkSurface *window,
static void
-gdk_surface_print_tree (GdkSurface *window,
+gdk_surface_print_tree (GdkSurface *surface,
int indent,
gboolean include_input_only)
{
GList *l;
- if (window->input_only && !include_input_only)
+ if (surface->input_only && !include_input_only)
return;
- gdk_surface_print (window, indent);
+ gdk_surface_print (surface, indent);
- for (l = window->children; l != NULL; l = l->next)
+ for (l = surface->children; l != NULL; l = l->next)
gdk_surface_print_tree (l->data, indent + 4, include_input_only);
}
-#endif /* DEBUG_WINDOW_PRINTING */
+#endif /* DEBUG_SURFACE_PRINTING */
void
_gdk_windowing_got_event (GdkDisplay *display,
@@ -5420,11 +5420,11 @@ _gdk_windowing_got_event (GdkDisplay *display,
}
}
- event_surface = event->any.window;
+ event_surface = event->any.surface;
if (!event_surface)
goto out;
-#ifdef DEBUG_WINDOW_PRINTING
+#ifdef DEBUG_SURFACE_PRINTING
if (event->any.type == GDK_KEY_PRESS &&
(event->key.keyval == 0xa7 ||
event->key.keyval == 0xbd))
@@ -5481,15 +5481,15 @@ _gdk_windowing_got_event (GdkDisplay *display,
/**
* gdk_surface_create_similar_surface:
- * @window: window to make new surface similar to
+ * @surface: surface to make new surface similar to
* @content: the content for the new surface
* @width: width of the new surface
* @height: height of the new surface
*
* Create a new surface that is as compatible as possible with the
- * given @window. For example the new surface will have the same
- * fallback resolution and font options as @window. Generally, the new
- * surface will also use the same backend as @window, unless that is
+ * given @surface. For example the new surface will have the same
+ * fallback resolution and font options as @surface. Generally, the new
+ * surface will also use the same backend as @surface, unless that is
* not possible for some reason. The type of the returned surface may
* be examined with cairo_surface_get_type().
*
@@ -5505,69 +5505,69 @@ _gdk_windowing_got_event (GdkDisplay *display,
* or any other error occurs.
**/
cairo_surface_t *
-gdk_surface_create_similar_surface (GdkSurface * window,
+gdk_surface_create_similar_surface (GdkSurface * surface,
cairo_content_t content,
int width,
int height)
{
- cairo_surface_t *window_surface, *surface;
+ cairo_surface_t *surface_surface, *similar_surface;
double sx, sy;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- window_surface = gdk_surface_ref_impl_surface (window);
+ surface_surface = gdk_surface_ref_impl_surface (surface);
sx = sy = 1;
- cairo_surface_get_device_scale (window_surface, &sx, &sy);
+ cairo_surface_get_device_scale (surface_surface, &sx, &sy);
- if (GDK_DISPLAY_DEBUG_CHECK (window->display, CAIRO_IMAGE))
+ if (GDK_DISPLAY_DEBUG_CHECK (surface->display, CAIRO_IMAGE))
{
- surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
- content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
- width * sx, height * sy);
- cairo_surface_set_device_scale (surface, sx, sy);
+ similar_surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
+ content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
+ width * sx, height * sy);
+ cairo_surface_set_device_scale (similar_surface, sx, sy);
}
else
{
- surface = cairo_surface_create_similar (window_surface,
- content,
- width, height);
+ similar_surface = cairo_surface_create_similar (surface_surface,
+ content,
+ width, height);
}
- cairo_surface_destroy (window_surface);
+ cairo_surface_destroy (surface_surface);
- return surface;
+ return similar_surface;
}
/**
* gdk_surface_create_similar_image_surface:
- * @window: (nullable): window to make new surface similar to, or
+ * @surface: (nullable): surface to make new surface similar to, or
* %NULL if none
* @format: (type int): the format for the new surface
* @width: width of the new surface
* @height: height of the new surface
- * @scale: the scale of the new surface, or 0 to use same as @window
+ * @scale: the scale of the new surface, or 0 to use same as @surface
*
* Create a new image surface that is efficient to draw on the
- * given @window.
+ * given @surface.
*
* Initially the surface contents are all 0 (transparent if contents
* have transparency, black otherwise.)
*
* The @width and @height of the new surface are not affected by
- * the scaling factor of the @window, or by the @scale argument; they
+ * the scaling factor of the @surface, or by the @scale argument; they
* are the size of the surface in device pixels. If you wish to create
- * an image surface capable of holding the contents of @window you can
+ * an image surface capable of holding the contents of @surface you can
* use:
*
* |[<!-- language="C" -->
- * int scale = gdk_surface_get_scale_factor (window);
- * int width = gdk_surface_get_width (window) * scale;
- * int height = gdk_surface_get_height (window) * scale;
+ * int scale = gdk_surface_get_scale_factor (surface);
+ * int width = gdk_surface_get_width (surface) * scale;
+ * int height = gdk_surface_get_height (surface) * scale;
*
* // format is set elsewhere
* cairo_surface_t *surface =
- * gdk_surface_create_similar_image_surface (window,
+ * gdk_surface_create_similar_image_surface (surface,
* format,
* width, height,
* scale);
@@ -5575,7 +5575,7 @@ gdk_surface_create_similar_surface (GdkSurface * window,
*
* Note that unlike cairo_surface_create_similar_image(), the new
* surface's device scale is set to @scale, or to the scale factor of
- * @window if @scale is 0.
+ * @surface if @scale is 0.
*
* Returns: a pointer to the newly allocated surface. The caller
* owns the surface and should call cairo_surface_destroy() when done
@@ -5586,31 +5586,31 @@ gdk_surface_create_similar_surface (GdkSurface * window,
* or any other error occurs.
**/
cairo_surface_t *
-gdk_surface_create_similar_image_surface (GdkSurface * window,
+gdk_surface_create_similar_image_surface (GdkSurface * surface,
cairo_format_t format,
int width,
int height,
int scale)
{
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
- g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), NULL);
- if (window == NULL)
+ if (surface == NULL)
{
- surface = cairo_image_surface_create (format, width, height);
+ cairo_surface = cairo_image_surface_create (format, width, height);
}
- else if (GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_similar_image_surface)
+ else if (GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_similar_image_surface)
{
- surface =
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_similar_image_surface (window, format, width, height);
+ cairo_surface =
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_similar_image_surface (surface, format, width, height);
}
else
{
cairo_surface_t *window_surface;
- window_surface = gdk_surface_ref_impl_surface (window);
- surface =
+ window_surface = gdk_surface_ref_impl_surface (surface);
+ cairo_surface =
cairo_surface_create_similar_image (window_surface,
format,
width,
@@ -5619,158 +5619,158 @@ gdk_surface_create_similar_image_surface (GdkSurface * window,
}
if (scale == 0)
- scale = gdk_surface_get_scale_factor (window);
+ scale = gdk_surface_get_scale_factor (surface);
- cairo_surface_set_device_scale (surface, scale, scale);
+ cairo_surface_set_device_scale (cairo_surface, scale, scale);
- return surface;
+ return cairo_surface;
}
/**
* gdk_surface_focus:
- * @window: a #GdkSurface
- * @timestamp: timestamp of the event triggering the window focus
+ * @surface: a #GdkSurface
+ * @timestamp: timestamp of the event triggering the surface focus
*
- * Sets keyboard focus to @window. In most cases, gtk_window_present()
+ * Sets keyboard focus to @surface. In most cases, gtk_window_present()
* should be used on a #GtkWindow, rather than calling this function.
*
**/
void
-gdk_surface_focus (GdkSurface *window,
+gdk_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->focus (window, timestamp);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->focus (surface, timestamp);
}
/**
* gdk_surface_set_type_hint:
- * @window: A toplevel #GdkSurface
- * @hint: A hint of the function this window will have
+ * @surface: A toplevel #GdkSurface
+ * @hint: A hint of the function this surface will have
*
- * The application can use this call to provide a hint to the window
- * manager about the functionality of a window. The window manager
+ * The application can use this call to provide a hint to the surface
+ * manager about the functionality of a surface. The window manager
* can use this information when determining the decoration and behaviour
- * of the window.
+ * of the surface.
*
- * The hint must be set before the window is mapped.
+ * The hint must be set before the surface is mapped.
**/
void
-gdk_surface_set_type_hint (GdkSurface *window,
+gdk_surface_set_type_hint (GdkSurface *surface,
GdkSurfaceTypeHint hint)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_type_hint (window, hint);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_type_hint (surface, hint);
}
/**
* gdk_surface_get_type_hint:
- * @window: A toplevel #GdkSurface
+ * @surface: A toplevel #GdkSurface
*
- * This function returns the type hint set for a window.
+ * This function returns the type hint set for a surface.
*
- * Returns: The type hint set for @window
+ * Returns: The type hint set for @surface
**/
GdkSurfaceTypeHint
-gdk_surface_get_type_hint (GdkSurface *window)
+gdk_surface_get_type_hint (GdkSurface *surface)
{
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_type_hint (window);
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_type_hint (surface);
}
/**
* gdk_surface_set_modal_hint:
- * @window: A toplevel #GdkSurface
- * @modal: %TRUE if the window is modal, %FALSE otherwise.
+ * @surface: A toplevel #GdkSurface
+ * @modal: %TRUE if the surface is modal, %FALSE otherwise.
*
* The application can use this hint to tell the window manager
- * that a certain window has modal behaviour. The window manager
- * can use this information to handle modal windows in a special
+ * that a certain surface has modal behaviour. The window manager
+ * can use this information to handle modal surfaces in a special
* way.
*
- * You should only use this on windows for which you have
+ * You should only use this on surfaces for which you have
* previously called gdk_surface_set_transient_for()
**/
void
-gdk_surface_set_modal_hint (GdkSurface *window,
+gdk_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_modal_hint (window, modal);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_modal_hint (surface, modal);
}
/**
* gdk_surface_set_skip_taskbar_hint:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @skips_taskbar: %TRUE to skip the taskbar
*
- * Toggles whether a window should appear in a task list or window
- * list. If a window’s semantic type as specified with
- * gdk_surface_set_type_hint() already fully describes the window, this
+ * Toggles whether a surface should appear in a task list or surface
+ * list. If a surface’s semantic type as specified with
+ * gdk_surface_set_type_hint() already fully describes the surface, this
* function should not be called in addition,
- * instead you should allow the window to be treated according to
+ * instead you should allow the surface to be treated according to
* standard policy for its semantic type.
**/
void
-gdk_surface_set_skip_taskbar_hint (GdkSurface *window,
+gdk_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_skip_taskbar_hint (window, skips_taskbar);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_taskbar_hint (surface, skips_taskbar);
}
/**
* gdk_surface_set_skip_pager_hint:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @skips_pager: %TRUE to skip the pager
*
- * Toggles whether a window should appear in a pager (workspace
+ * Toggles whether a surface should appear in a pager (workspace
* switcher, or other desktop utility program that displays a small
- * thumbnail representation of the windows on the desktop). If a
- * window’s semantic type as specified with gdk_surface_set_type_hint()
- * already fully describes the window, this function should
+ * thumbnail representation of the surfaces on the desktop). If a
+ * surface’s semantic type as specified with gdk_surface_set_type_hint()
+ * already fully describes the surface, this function should
* not be called in addition, instead you should
- * allow the window to be treated according to standard policy for
+ * allow the surface to be treated according to standard policy for
* its semantic type.
**/
void
-gdk_surface_set_skip_pager_hint (GdkSurface *window,
+gdk_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_skip_pager_hint (window, skips_pager);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_pager_hint (surface, skips_pager);
}
/**
* gdk_surface_set_urgency_hint:
- * @window: a toplevel #GdkSurface
- * @urgent: %TRUE if the window is urgent
+ * @surface: a toplevel #GdkSurface
+ * @urgent: %TRUE if the surface is urgent
*
- * Toggles whether a window needs the user's
+ * Toggles whether a surface needs the user's
* urgent attention.
**/
void
-gdk_surface_set_urgency_hint (GdkSurface *window,
+gdk_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_urgency_hint (window, urgent);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_urgency_hint (surface, urgent);
}
/**
* gdk_surface_set_geometry_hints:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @geometry: geometry hints
* @geom_mask: bitmask indicating fields of @geometry to pay attention to
*
- * Sets the geometry hints for @window. Hints flagged in @geom_mask
+ * Sets the geometry hints for @surface. Hints flagged in @geom_mask
* are set, hints not flagged in @geom_mask are unset.
* To unset all hints, use a @geom_mask of 0 and a @geometry of %NULL.
*
- * This function provides hints to the windowing system about
- * acceptable sizes for a toplevel window. The purpose of
+ * This function provides hints to the surfaceing system about
+ * acceptable sizes for a toplevel surface. The purpose of
* this is to constrain user resizing, but the windowing system
* will typically (but is not required to) also constrain the
- * current size of the window to the provided values and
+ * current size of the surface to the provided values and
* constrain programatic resizing via gdk_surface_resize() or
* gdk_surface_move_resize().
*
- * Note that on X11, this effect has no effect on windows
- * of type %GDK_SURFACE_TEMP since these windows are not resizable
+ * Note that on X11, this effect has no effect on surfaces
+ * of type %GDK_SURFACE_TEMP since these surfaces are not resizable
* by the user.
*
* Since you can’t count on the windowing system doing the
@@ -5780,114 +5780,114 @@ gdk_surface_set_urgency_hint (GdkSurface *window,
*
**/
void
-gdk_surface_set_geometry_hints (GdkSurface *window,
+gdk_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask)
{
g_return_if_fail (geometry != NULL || geom_mask == 0);
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_geometry_hints (window, geometry, geom_mask);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_geometry_hints (surface, geometry, geom_mask);
}
/**
* gdk_surface_set_title:
- * @window: a toplevel #GdkSurface
- * @title: title of @window
+ * @surface: a toplevel #GdkSurface
+ * @title: title of @surface
*
- * Sets the title of a toplevel window, to be displayed in the titlebar.
- * If you haven’t explicitly set the icon name for the window
+ * Sets the title of a toplevel surface, to be displayed in the titlebar.
+ * If you haven’t explicitly set the icon name for the surface
* (using gdk_surface_set_icon_name()), the icon name will be set to
* @title as well. @title must be in UTF-8 encoding (as with all
* user-readable strings in GDK/GTK+). @title may not be %NULL.
**/
void
-gdk_surface_set_title (GdkSurface *window,
+gdk_surface_set_title (GdkSurface *surface,
const gchar *title)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_title (window, title);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_title (surface, title);
}
/**
* gdk_surface_set_role:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @role: a string indicating its role
*
* When using GTK+, typically you should use gtk_window_set_role() instead
* of this low-level function.
*
- * The window manager and session manager use a window’s role to
- * distinguish it from other kinds of window in the same application.
+ * The window manager and session manager use a surface’s role to
+ * distinguish it from other kinds of surface in the same application.
* When an application is restarted after being saved in a previous
- * session, all windows with the same title and role are treated as
- * interchangeable. So if you have two windows with the same title
+ * session, all surfaces with the same title and role are treated as
+ * interchangeable. So if you have two surfaces with the same title
* that should be distinguished for session management purposes, you
- * should set the role on those windows. It doesn’t matter what string
+ * should set the role on those surfaces. It doesn’t matter what string
* you use for the role, as long as you have a different role for each
- * non-interchangeable kind of window.
+ * non-interchangeable kind of surface.
*
**/
void
-gdk_surface_set_role (GdkSurface *window,
+gdk_surface_set_role (GdkSurface *surface,
const gchar *role)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_role (window, role);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_role (surface, role);
}
/**
* gdk_surface_set_startup_id:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @startup_id: a string with startup-notification identifier
*
* When using GTK+, typically you should use gtk_window_set_startup_id()
* instead of this low-level function.
**/
void
-gdk_surface_set_startup_id (GdkSurface *window,
+gdk_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_startup_id (window, startup_id);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_startup_id (surface, startup_id);
}
/**
* gdk_surface_set_transient_for:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @parent: another toplevel #GdkSurface
*
- * Indicates to the window manager that @window is a transient dialog
- * associated with the application window @parent. This allows the
- * window manager to do things like center @window on @parent and
- * keep @window above @parent.
+ * Indicates to the window manager that @surface is a transient dialog
+ * associated with the application surface @parent. This allows the
+ * window manager to do things like center @surface on @parent and
+ * keep @surface above @parent.
*
* See gtk_window_set_transient_for() if you’re using #GtkWindow or
* #GtkDialog.
**/
void
-gdk_surface_set_transient_for (GdkSurface *window,
+gdk_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
{
- window->transient_for = parent;
+ surface->transient_for = parent;
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_transient_for (window, parent);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_transient_for (surface, parent);
}
/**
* gdk_surface_get_root_origin:
- * @window: a toplevel #GdkSurface
- * @x: (out): return location for X position of window frame
- * @y: (out): return location for Y position of window frame
+ * @surface: a toplevel #GdkSurface
+ * @x: (out): return location for X position of surface frame
+ * @y: (out): return location for Y position of surface frame
*
- * Obtains the top-left corner of the window manager frame in root
- * window coordinates.
+ * Obtains the top-left corner of the surface manager frame in root
+ * surface coordinates.
*
**/
void
-gdk_surface_get_root_origin (GdkSurface *window,
+gdk_surface_get_root_origin (GdkSurface *surface,
gint *x,
gint *y)
{
GdkRectangle rect;
- gdk_surface_get_frame_extents (window, &rect);
+ gdk_surface_get_frame_extents (surface, &rect);
if (x)
*x = rect.x;
@@ -5898,48 +5898,48 @@ gdk_surface_get_root_origin (GdkSurface *window,
/**
* gdk_surface_get_frame_extents:
- * @window: a toplevel #GdkSurface
- * @rect: (out): rectangle to fill with bounding box of the window frame
+ * @surface: a toplevel #GdkSurface
+ * @rect: (out): rectangle to fill with bounding box of the surface frame
*
- * Obtains the bounding box of the window, including window manager
+ * Obtains the bounding box of the surface, including window manager
* titlebar/borders if any. The frame position is given in root window
- * coordinates. To get the position of the window itself (rather than
+ * coordinates. To get the position of the surface itself (rather than
* the frame) in root window coordinates, use gdk_surface_get_origin().
*
**/
void
-gdk_surface_get_frame_extents (GdkSurface *window,
+gdk_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_frame_extents (window, rect);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_frame_extents (surface, rect);
}
/**
* gdk_surface_set_accept_focus:
- * @window: a toplevel #GdkSurface
- * @accept_focus: %TRUE if the window should receive input focus
+ * @surface: a toplevel #GdkSurface
+ * @accept_focus: %TRUE if the surface should receive input focus
*
* Setting @accept_focus to %FALSE hints the desktop environment that the
- * window doesn’t want to receive input focus.
+ * surface doesn’t want to receive input focus.
*
* On X, it is the responsibility of the window manager to interpret this
* hint. ICCCM-compliant window manager usually respect it.
**/
void
-gdk_surface_set_accept_focus (GdkSurface *window,
+gdk_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_accept_focus (window, accept_focus);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_accept_focus (surface, accept_focus);
}
/**
* gdk_surface_set_focus_on_map:
- * @window: a toplevel #GdkSurface
- * @focus_on_map: %TRUE if the window should receive input focus when mapped
+ * @surface: a toplevel #GdkSurface
+ * @focus_on_map: %TRUE if the surface should receive input focus when mapped
*
* Setting @focus_on_map to %FALSE hints the desktop environment that the
- * window doesn’t want to receive input focus when it is mapped.
- * focus_on_map should be turned off for windows that aren’t triggered
+ * surface doesn’t want to receive input focus when it is mapped.
+ * focus_on_map should be turned off for surfaces that aren’t triggered
* interactively (such as popups from network activity).
*
* On X, it is the responsibility of the window manager to interpret
@@ -5947,41 +5947,41 @@ gdk_surface_set_accept_focus (GdkSurface *window,
* manager extension specification should respect it.
**/
void
-gdk_surface_set_focus_on_map (GdkSurface *window,
+gdk_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_focus_on_map (surface, focus_on_map);
}
/**
* gdk_surface_set_icon_list:
- * @window: The #GdkSurface toplevel window to set the icon of.
+ * @surface: The #GdkSurface toplevel surface to set the icon of.
* @surfaces: (transfer none) (element-type GdkTexture):
* A list of image surfaces, of different sizes.
*
- * Sets a list of icons for the window. One of these will be used
- * to represent the window when it has been iconified. The icon is
+ * Sets a list of icons for the surface. One of these will be used
+ * to represent the surface when it has been iconified. The icon is
* usually shown in an icon box or some sort of task bar. Which icon
* size is shown depends on the window manager. The window manager
* can scale the icon but setting several size icons can give better
* image quality since the window manager may only need to scale the
* icon by a small amount or not at all.
*
- * Note that some platforms don't support window icons.
+ * Note that some platforms don't support surface icons.
*/
void
-gdk_surface_set_icon_list (GdkSurface *window,
+gdk_surface_set_icon_list (GdkSurface *surface,
GList *textures)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_icon_list (window, textures);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_list (surface, textures);
}
/**
* gdk_surface_set_icon_name:
- * @window: a toplevel #GdkSurface
- * @name: (allow-none): name of window while iconified (minimized)
+ * @surface: a toplevel #GdkSurface
+ * @name: (allow-none): name of surface while iconified (minimized)
*
- * Windows may have a name used while minimized, distinct from the
+ * Surfaces may have a name used while minimized, distinct from the
* name they display in their titlebar. Most of the time this is a bad
* idea from a user interface standpoint. But you can set such a name
* with this function, if you like.
@@ -5992,141 +5992,141 @@ gdk_surface_set_icon_list (GdkSurface *window,
* Using %NULL for @name unsets the icon title; further calls to
* gdk_surface_set_title() will again update the icon title as well.
*
- * Note that some platforms don't support window icons.
+ * Note that some platforms don't support surface icons.
**/
void
-gdk_surface_set_icon_name (GdkSurface *window,
+gdk_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_icon_name (window, name);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_name (surface, name);
}
/**
* gdk_surface_iconify:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Asks to iconify (minimize) @window. The window manager may choose
+ * Asks to iconify (minimize) @surface. The window manager may choose
* to ignore the request, but normally will honor it. Using
* gtk_window_iconify() is preferred, if you have a #GtkWindow widget.
*
- * This function only makes sense when @window is a toplevel window.
+ * This function only makes sense when @surface is a toplevel surface.
*
**/
void
-gdk_surface_iconify (GdkSurface *window)
+gdk_surface_iconify (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->iconify (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->iconify (surface);
}
/**
* gdk_surface_deiconify:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Attempt to deiconify (unminimize) @window. On X11 the window manager may
+ * Attempt to deiconify (unminimize) @surface. On X11 the window manager may
* choose to ignore the request to deiconify. When using GTK+,
* use gtk_window_deiconify() instead of the #GdkSurface variant. Or better yet,
- * you probably want to use gtk_window_present(), which raises the window, focuses it,
+ * you probably want to use gtk_window_present(), which raises the surface, focuses it,
* unminimizes it, and puts it on the current desktop.
*
**/
void
-gdk_surface_deiconify (GdkSurface *window)
+gdk_surface_deiconify (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->deiconify (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->deiconify (surface);
}
/**
* gdk_surface_stick:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * “Pins” a window such that it’s on all workspaces and does not scroll
+ * “Pins” a surface such that it’s on all workspaces and does not scroll
* with viewports, for window managers that have scrollable viewports.
* (When using #GtkWindow, gtk_window_stick() may be more useful.)
*
* On the X11 platform, this function depends on window manager
* support, so may have no effect with many window managers. However,
* GDK will do the best it can to convince the window manager to stick
- * the window. For window managers that don’t support this operation,
+ * the surface. For window managers that don’t support this operation,
* there’s nothing you can do to force it to happen.
*
**/
void
-gdk_surface_stick (GdkSurface *window)
+gdk_surface_stick (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->stick (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->stick (surface);
}
/**
* gdk_surface_unstick:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
* Reverse operation for gdk_surface_stick(); see gdk_surface_stick(),
* and gtk_window_unstick().
*
**/
void
-gdk_surface_unstick (GdkSurface *window)
+gdk_surface_unstick (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unstick (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unstick (surface);
}
/**
* gdk_surface_maximize:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Maximizes the window. If the window was already maximized, then
+ * Maximizes the surface. If the surface was already maximized, then
* this function does nothing.
*
- * On X11, asks the window manager to maximize @window, if the window
+ * On X11, asks the window manager to maximize @surface, if the window
* manager supports this operation. Not all window managers support
* this, and some deliberately ignore it or don’t have a concept of
* “maximized”; so you can’t rely on the maximization actually
* happening. But it will happen with most standard window managers,
* and GDK makes a best effort to get it to happen.
*
- * On Windows, reliably maximizes the window.
+ * On Windows, reliably maximizes the surface.
*
**/
void
-gdk_surface_maximize (GdkSurface *window)
+gdk_surface_maximize (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->maximize (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->maximize (surface);
}
/**
* gdk_surface_unmaximize:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Unmaximizes the window. If the window wasn’t maximized, then this
+ * Unmaximizes the surface. If the surface wasn’t maximized, then this
* function does nothing.
*
- * On X11, asks the window manager to unmaximize @window, if the
+ * On X11, asks the window manager to unmaximize @surface, if the
* window manager supports this operation. Not all window managers
* support this, and some deliberately ignore it or don’t have a
* concept of “maximized”; so you can’t rely on the unmaximization
* actually happening. But it will happen with most standard window
* managers, and GDK makes a best effort to get it to happen.
*
- * On Windows, reliably unmaximizes the window.
+ * On Windows, reliably unmaximizes the surface.
*
**/
void
-gdk_surface_unmaximize (GdkSurface *window)
+gdk_surface_unmaximize (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unmaximize (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unmaximize (surface);
}
/**
* gdk_surface_fullscreen:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Moves the window into fullscreen mode. This means the
- * window covers the entire screen and is above any panels
+ * Moves the surface into fullscreen mode. This means the
+ * surface covers the entire screen and is above any panels
* or task bars.
*
- * If the window was already fullscreen, then this function does nothing.
+ * If the surface was already fullscreen, then this function does nothing.
*
- * On X11, asks the window manager to put @window in a fullscreen
+ * On X11, asks the window manager to put @surface in a fullscreen
* state, if the window manager supports this operation. Not all
* window managers support this, and some deliberately ignore it or
* don’t have a concept of “fullscreen”; so you can’t rely on the
@@ -6135,101 +6135,101 @@ gdk_surface_unmaximize (GdkSurface *window)
* it to happen.
**/
void
-gdk_surface_fullscreen (GdkSurface *window)
+gdk_surface_fullscreen (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen (surface);
}
/**
* gdk_surface_fullscreen_on_monitor:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @monitor: Which monitor to display fullscreen on.
*
- * Moves the window into fullscreen mode on the given monitor. This means
- * the window covers the entire screen and is above any panels or task bars.
+ * Moves the surface into fullscreen mode on the given monitor. This means
+ * the surface covers the entire screen and is above any panels or task bars.
*
- * If the window was already fullscreen, then this function does nothing.
+ * If the surface was already fullscreen, then this function does nothing.
**/
void
-gdk_surface_fullscreen_on_monitor (GdkSurface *window,
+gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_MONITOR (monitor));
- g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_surface_get_display (window));
+ g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_surface_get_display (surface));
g_return_if_fail (gdk_monitor_is_valid (monitor));
- if (GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor != NULL)
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor (window, monitor);
+ if (GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen_on_monitor != NULL)
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen_on_monitor (surface, monitor);
else
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen (surface);
}
/**
* gdk_surface_set_fullscreen_mode:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @mode: fullscreen mode
*
- * Specifies whether the @window should span over all monitors (in a multi-head
+ * Specifies whether the @surface should span over all monitors (in a multi-head
* setup) or only the current monitor when in fullscreen mode.
*
* The @mode argument is from the #GdkFullscreenMode enumeration.
- * If #GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen @window will
+ * If #GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen @surface will
* span over all monitors of the display.
*
* On X11, searches through the list of monitors display the ones
* which delimit the 4 edges of the entire display and will ask the window
- * manager to span the @window over these monitors.
+ * manager to span the @surface over these monitors.
*
* If the XINERAMA extension is not available or not usable, this function
* has no effect.
*
* Not all window managers support this, so you can’t rely on the fullscreen
- * window to span over the multiple monitors when #GDK_FULLSCREEN_ON_ALL_MONITORS
+ * surface to span over the multiple monitors when #GDK_FULLSCREEN_ON_ALL_MONITORS
* is specified.
**/
void
-gdk_surface_set_fullscreen_mode (GdkSurface *window,
+gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode)
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->fullscreen_mode != mode)
+ if (surface->fullscreen_mode != mode)
{
- window->fullscreen_mode = mode;
+ surface->fullscreen_mode = mode;
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->apply_fullscreen_mode != NULL)
- impl_class->apply_fullscreen_mode (window);
+ impl_class->apply_fullscreen_mode (surface);
}
}
/**
* gdk_surface_get_fullscreen_mode:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Obtains the #GdkFullscreenMode of the @window.
+ * Obtains the #GdkFullscreenMode of the @surface.
*
- * Returns: The #GdkFullscreenMode applied to the window when fullscreen.
+ * Returns: The #GdkFullscreenMode applied to the surface when fullscreen.
**/
GdkFullscreenMode
-gdk_surface_get_fullscreen_mode (GdkSurface *window)
+gdk_surface_get_fullscreen_mode (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
- return window->fullscreen_mode;
+ return surface->fullscreen_mode;
}
/**
* gdk_surface_unfullscreen:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Moves the window out of fullscreen mode. If the window was not
+ * Moves the surface out of fullscreen mode. If the surface was not
* fullscreen, does nothing.
*
- * On X11, asks the window manager to move @window out of the fullscreen
+ * On X11, asks the window manager to move @surface out of the fullscreen
* state, if the window manager supports this operation. Not all
* window managers support this, and some deliberately ignore it or
* don’t have a concept of “fullscreen”; so you can’t rely on the
@@ -6238,99 +6238,99 @@ gdk_surface_get_fullscreen_mode (GdkSurface *window)
* it to happen.
**/
void
-gdk_surface_unfullscreen (GdkSurface *window)
+gdk_surface_unfullscreen (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unfullscreen (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unfullscreen (surface);
}
/**
* gdk_surface_set_keep_above:
- * @window: a toplevel #GdkSurface
- * @setting: whether to keep @window above other windows
+ * @surface: a toplevel #GdkSurface
+ * @setting: whether to keep @surface above other surfaces
*
- * Set if @window must be kept above other windows. If the
- * window was already above, then this function does nothing.
+ * Set if @surface must be kept above other surfaces. If the
+ * surface was already above, then this function does nothing.
*
- * On X11, asks the window manager to keep @window above, if the window
+ * On X11, asks the window manager to keep @surface above, if the window
* manager supports this operation. Not all window managers support
* this, and some deliberately ignore it or don’t have a concept of
- * “keep above”; so you can’t rely on the window being kept above.
+ * “keep above”; so you can’t rely on the surface being kept above.
* But it will happen with most standard window managers,
* and GDK makes a best effort to get it to happen.
**/
void
-gdk_surface_set_keep_above (GdkSurface *window,
+gdk_surface_set_keep_above (GdkSurface *surface,
gboolean setting)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_keep_above (window, setting);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_above (surface, setting);
}
/**
* gdk_surface_set_keep_below:
- * @window: a toplevel #GdkSurface
- * @setting: whether to keep @window below other windows
+ * @surface: a toplevel #GdkSurface
+ * @setting: whether to keep @surface below other surfaces
*
- * Set if @window must be kept below other windows. If the
- * window was already below, then this function does nothing.
+ * Set if @surface must be kept below other surfaces. If the
+ * surface was already below, then this function does nothing.
*
- * On X11, asks the window manager to keep @window below, if the window
+ * On X11, asks the window manager to keep @surface below, if the window
* manager supports this operation. Not all window managers support
* this, and some deliberately ignore it or don’t have a concept of
- * “keep below”; so you can’t rely on the window being kept below.
+ * “keep below”; so you can’t rely on the surface being kept below.
* But it will happen with most standard window managers,
* and GDK makes a best effort to get it to happen.
**/
void
-gdk_surface_set_keep_below (GdkSurface *window, gboolean setting)
+gdk_surface_set_keep_below (GdkSurface *surface, gboolean setting)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_keep_below (window, setting);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_below (surface, setting);
}
/**
* gdk_surface_get_group:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
*
- * Returns the group leader window for @window. See gdk_surface_set_group().
+ * Returns the group leader surface for @surface. See gdk_surface_set_group().
*
- * Returns: (transfer none): the group leader window for @window
+ * Returns: (transfer none): the group leader surface for @surface
**/
GdkSurface *
-gdk_surface_get_group (GdkSurface *window)
+gdk_surface_get_group (GdkSurface *surface)
{
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_group (window);
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_group (surface);
}
/**
* gdk_surface_set_group:
- * @window: a toplevel #GdkSurface
- * @leader: (allow-none): group leader window, or %NULL to restore the default group leader window
+ * @surface: a toplevel #GdkSurface
+ * @leader: (allow-none): group leader surface, or %NULL to restore the default group leader surface
*
- * Sets the group leader window for @window. By default,
- * GDK sets the group leader for all toplevel windows
- * to a global window implicitly created by GDK. With this function
+ * Sets the group leader surface for @surface. By default,
+ * GDK sets the group leader for all toplevel surfaces
+ * to a global surface implicitly created by GDK. With this function
* you can override this default.
*
- * The group leader window allows the window manager to distinguish
- * all windows that belong to a single application. It may for example
- * allow users to minimize/unminimize all windows belonging to an
- * application at once. You should only set a non-default group window
+ * The group leader surface allows the window manager to distinguish
+ * all surfaces that belong to a single application. It may for example
+ * allow users to minimize/unminimize all surfaces belonging to an
+ * application at once. You should only set a non-default group surface
* if your application pretends to be multiple applications.
**/
void
-gdk_surface_set_group (GdkSurface *window,
+gdk_surface_set_group (GdkSurface *surface,
GdkSurface *leader)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_group (window, leader);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_group (surface, leader);
}
/**
* gdk_surface_set_decorations:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @decorations: decoration hint mask
*
* “Decorations” are the features the window manager adds to a toplevel #GdkSurface.
* This function sets the traditional Motif window manager hints that tell the
- * window manager which decorations you would like your window to have.
+ * window manager which decorations you would like your surface to have.
* Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
* using the GDK function directly.
*
@@ -6345,33 +6345,33 @@ gdk_surface_set_group (GdkSurface *window,
*
**/
void
-gdk_surface_set_decorations (GdkSurface *window,
+gdk_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_decorations (window, decorations);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_decorations (surface, decorations);
}
/**
* gdk_surface_get_decorations:
- * @window: The toplevel #GdkSurface to get the decorations from
- * @decorations: (out): The window decorations will be written here
+ * @surface: The toplevel #GdkSurface to get the decorations from
+ * @decorations: (out): The surface decorations will be written here
*
* Returns the decorations set on the GdkSurface with
* gdk_surface_set_decorations().
*
- * Returns: %TRUE if the window has decorations set, %FALSE otherwise.
+ * Returns: %TRUE if the surface has decorations set, %FALSE otherwise.
**/
gboolean
-gdk_surface_get_decorations(GdkSurface *window,
+gdk_surface_get_decorations(GdkSurface *surface,
GdkWMDecoration *decorations)
{
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_decorations (window, decorations);
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_decorations (surface, decorations);
}
/**
* gdk_surface_set_functions:
- * @window: a toplevel #GdkSurface
- * @functions: bitmask of operations to allow on @window
+ * @surface: a toplevel #GdkSurface
+ * @functions: bitmask of operations to allow on @surface
*
* Sets hints about the window management functions to make available
* via buttons on the window frame.
@@ -6389,15 +6389,15 @@ gdk_surface_get_decorations(GdkSurface *window,
*
**/
void
-gdk_surface_set_functions (GdkSurface *window,
+gdk_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_functions (window, functions);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_functions (surface, functions);
}
/**
* gdk_surface_begin_resize_drag_for_device:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @edge: the edge or corner from which the drag is started
* @device: the device used for the operation
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
@@ -6405,7 +6405,7 @@ gdk_surface_set_functions (GdkSurface *window,
* @root_y: root window Y coordinate of mouse click that began the drag
* @timestamp: timestamp of mouse click that began the drag (use gdk_event_get_time())
*
- * Begins a window resize operation (for a toplevel window).
+ * Begins a surface resize operation (for a toplevel surface).
* You might use this function to implement a “window resize grip,” for
* example; in fact #GtkStatusbar uses it. The function works best
* with window managers that support the
@@ -6413,7 +6413,7 @@ gdk_surface_set_functions (GdkSurface *window,
* but has a fallback implementation for other window managers.
*/
void
-gdk_surface_begin_resize_drag_for_device (GdkSurface *window,
+gdk_surface_begin_resize_drag_for_device (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -6421,26 +6421,26 @@ gdk_surface_begin_resize_drag_for_device (GdkSurface *window,
gint root_y,
guint32 timestamp)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->begin_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_resize_drag (surface, edge, device, button, root_x, root_y, timestamp);
}
/**
* gdk_surface_begin_resize_drag:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @edge: the edge or corner from which the drag is started
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
* @root_x: root window X coordinate of mouse click that began the drag
* @root_y: root window Y coordinate of mouse click that began the drag
* @timestamp: timestamp of mouse click that began the drag (use gdk_event_get_time())
*
- * Begins a window resize operation (for a toplevel window).
+ * Begins a surface resize operation (for a toplevel surface).
*
* This function assumes that the drag is controlled by the
* client pointer device, use gdk_surface_begin_resize_drag_for_device()
* to begin a drag with a different device.
*/
void
-gdk_surface_begin_resize_drag (GdkSurface *window,
+gdk_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
gint button,
gint root_x,
@@ -6450,55 +6450,55 @@ gdk_surface_begin_resize_drag (GdkSurface *window,
GdkDisplay *display;
GdkDevice *device;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_surface_begin_resize_drag_for_device (window, edge,
+ gdk_surface_begin_resize_drag_for_device (surface, edge,
device, button, root_x, root_y, timestamp);
}
/**
* gdk_surface_begin_move_drag_for_device:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @device: the device used for the operation
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
* @root_x: root window X coordinate of mouse click that began the drag
* @root_y: root window Y coordinate of mouse click that began the drag
* @timestamp: timestamp of mouse click that began the drag
*
- * Begins a window move operation (for a toplevel window).
+ * Begins a surface move operation (for a toplevel surface).
* You might use this function to implement a “window move grip,” for
* example. The function works best with window managers that support the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
* but has a fallback implementation for other window managers.
*/
void
-gdk_surface_begin_move_drag_for_device (GdkSurface *window,
+gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->begin_move_drag (window,
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_move_drag (surface,
device, button, root_x, root_y, timestamp);
}
/**
* gdk_surface_begin_move_drag:
- * @window: a toplevel #GdkSurface
+ * @surface: a toplevel #GdkSurface
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
* @root_x: root window X coordinate of mouse click that began the drag
* @root_y: root window Y coordinate of mouse click that began the drag
* @timestamp: timestamp of mouse click that began the drag
*
- * Begins a window move operation (for a toplevel window).
+ * Begins a surface move operation (for a toplevel surface).
*
* This function assumes that the drag is controlled by the
* client pointer device, use gdk_surface_begin_move_drag_for_device()
* to begin a drag with a different device.
*/
void
-gdk_surface_begin_move_drag (GdkSurface *window,
+gdk_surface_begin_move_drag (GdkSurface *surface,
gint button,
gint root_x,
gint root_y,
@@ -6507,33 +6507,33 @@ gdk_surface_begin_move_drag (GdkSurface *window,
GdkDisplay *display;
GdkDevice *device;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_surface_begin_move_drag_for_device (window, device, button, root_x, root_y, timestamp);
+ gdk_surface_begin_move_drag_for_device (surface, device, button, root_x, root_y, timestamp);
}
/**
* gdk_surface_set_opacity:
- * @window: a top-level or non-native #GdkSurface
+ * @surface: a top-level or non-native #GdkSurface
* @opacity: opacity
*
- * Set @window to render as partially transparent,
+ * Set @surface to render as partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Values
* of the opacity parameter are clamped to the [0,1] range.)
*
- * For toplevel windows this depends on support from the windowing system
+ * For toplevel surfaces this depends on support from the windowing system
* that may not always be there. For instance, On X11, this works only on
* X screens with a compositing manager running. On Wayland, there is no
- * per-window opacity value that the compositor would apply. Instead, use
- * `gdk_surface_set_opaque_region (window, NULL)` to tell the compositor
- * that the entire window is (potentially) non-opaque, and draw your content
+ * per-surface opacity value that the compositor would apply. Instead, use
+ * `gdk_surface_set_opaque_region (surface, NULL)` to tell the compositor
+ * that the entire surface is (potentially) non-opaque, and draw your content
* with alpha, or use gtk_widget_set_opacity() to set an overall opacity
* for your widgets.
*
- * Support for non-toplevel windows was added in 3.8.
+ * Support for non-toplevel surfaces was added in 3.8.
*/
void
-gdk_surface_set_opacity (GdkSurface *window,
+gdk_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
{
if (opacity < 0)
@@ -6541,43 +6541,43 @@ gdk_surface_set_opacity (GdkSurface *window,
else if (opacity > 1)
opacity = 1;
- window->alpha = round (opacity * 255);
+ surface->alpha = round (opacity * 255);
- if (window->destroyed)
+ if (surface->destroyed)
return;
- if (gdk_surface_has_impl (window))
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_opacity (window, opacity);
+ if (gdk_surface_has_impl (surface))
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_opacity (surface, opacity);
else
{
- recompute_visible_regions (window, FALSE);
- gdk_surface_invalidate_rect_full (window, NULL, TRUE);
+ recompute_visible_regions (surface, FALSE);
+ gdk_surface_invalidate_rect_full (surface, NULL, TRUE);
}
}
/* This function is called when the XWindow is really gone.
*/
void
-gdk_surface_destroy_notify (GdkSurface *window)
+gdk_surface_destroy_notify (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->destroy_notify (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->destroy_notify (surface);
}
/**
* gdk_surface_register_dnd:
- * @window: a #GdkSurface.
+ * @surface: a #GdkSurface.
*
- * Registers a window as a potential drop destination.
+ * Registers a surface as a potential drop destination.
*/
void
-gdk_surface_register_dnd (GdkSurface *window)
+gdk_surface_register_dnd (GdkSurface *surface)
{
- GDK_SURFACE_IMPL_GET_CLASS (window->impl)->register_dnd (window);
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->register_dnd (surface);
}
/**
* gdk_drag_begin:
- * @window: the source window for this drag
+ * @surface: the source surface for this drag
* @device: the device that controls this drag
* @content: (transfer none): the offered content
* @actions: the actions supported by this drag
@@ -6592,63 +6592,63 @@ gdk_surface_register_dnd (GdkSurface *window)
* %NULL on error.
*/
GdkDragContext *
-gdk_drag_begin (GdkSurface *window,
+gdk_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
gint dx,
gint dy)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
- g_return_val_if_fail (gdk_surface_get_display (window) == gdk_device_get_display (device), NULL);
+ g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_device_get_display (device), NULL);
g_return_val_if_fail (GDK_IS_CONTENT_PROVIDER (content), NULL);
- return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->drag_begin (window, device, content, actions, dx, dy);
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->drag_begin (surface, device, content, actions, dx, dy);
}
static void
gdk_surface_flush_events (GdkFrameClock *clock,
void *data)
{
- GdkSurface *window;
+ GdkSurface *surface;
GdkDisplay *display;
- window = GDK_SURFACE (data);
+ surface = GDK_SURFACE (data);
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
_gdk_event_queue_flush (display);
_gdk_display_pause_events (display);
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
- window->frame_clock_events_paused = TRUE;
+ surface->frame_clock_events_paused = TRUE;
}
static void
gdk_surface_resume_events (GdkFrameClock *clock,
void *data)
{
- GdkSurface *window;
+ GdkSurface *surface;
GdkDisplay *display;
- window = GDK_SURFACE (data);
+ surface = GDK_SURFACE (data);
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
_gdk_display_unpause_events (display);
- window->frame_clock_events_paused = FALSE;
+ surface->frame_clock_events_paused = FALSE;
}
static void
-gdk_surface_set_frame_clock (GdkSurface *window,
+gdk_surface_set_frame_clock (GdkSurface *surface,
GdkFrameClock *clock)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (clock == NULL || GDK_IS_FRAME_CLOCK (clock));
- g_return_if_fail (clock == NULL || gdk_surface_is_toplevel (window));
+ g_return_if_fail (clock == NULL || gdk_surface_is_toplevel (surface));
- if (clock == window->frame_clock)
+ if (clock == surface->frame_clock)
return;
if (clock)
@@ -6657,64 +6657,64 @@ gdk_surface_set_frame_clock (GdkSurface *window,
g_signal_connect (G_OBJECT (clock),
"flush-events",
G_CALLBACK (gdk_surface_flush_events),
- window);
+ surface);
g_signal_connect (G_OBJECT (clock),
"paint",
G_CALLBACK (gdk_surface_paint_on_clock),
- window);
+ surface);
g_signal_connect (G_OBJECT (clock),
"resume-events",
G_CALLBACK (gdk_surface_resume_events),
- window);
+ surface);
}
- if (window->frame_clock)
+ if (surface->frame_clock)
{
- if (window->frame_clock_events_paused)
- gdk_surface_resume_events (window->frame_clock, G_OBJECT (window));
+ if (surface->frame_clock_events_paused)
+ gdk_surface_resume_events (surface->frame_clock, G_OBJECT (surface));
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
G_CALLBACK (gdk_surface_flush_events),
- window);
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
+ surface);
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
G_CALLBACK (gdk_surface_paint_on_clock),
- window);
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
+ surface);
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
G_CALLBACK (gdk_surface_resume_events),
- window);
- g_object_unref (window->frame_clock);
+ surface);
+ g_object_unref (surface->frame_clock);
}
- window->frame_clock = clock;
+ surface->frame_clock = clock;
}
/**
* gdk_surface_get_frame_clock:
- * @window: window to get frame clock for
+ * @surface: surface to get frame clock for
*
- * Gets the frame clock for the window. The frame clock for a window
- * never changes unless the window is reparented to a new toplevel
- * window.
+ * Gets the frame clock for the surface. The frame clock for a surface
+ * never changes unless the surface is reparented to a new toplevel
+ * surface.
*
* Returns: (transfer none): the frame clock
*/
GdkFrameClock*
-gdk_surface_get_frame_clock (GdkSurface *window)
+gdk_surface_get_frame_clock (GdkSurface *surface)
{
GdkSurface *toplevel;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- toplevel = gdk_surface_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (surface);
return toplevel->frame_clock;
}
/**
* gdk_surface_get_scale_factor:
- * @window: window to get scale factor for
+ * @surface: surface to get scale factor for
*
- * Returns the internal scale factor that maps from window coordiantes
+ * Returns the internal scale factor that maps from surface coordiantes
* to the actual device pixels. On traditional systems this is 1, but
* on very high density outputs this can be a higher value (often 2).
*
@@ -6724,108 +6724,108 @@ gdk_surface_get_frame_clock (GdkSurface *window)
* value can be used to determine whether to use a pixel resource
* with higher resolution data.
*
- * The scale of a window may change during runtime, if this happens
- * a configure event will be sent to the toplevel window.
+ * The scale of a surface may change during runtime, if this happens
+ * a configure event will be sent to the toplevel surface.
*
* Returns: the scale factor
*/
gint
-gdk_surface_get_scale_factor (GdkSurface *window)
+gdk_surface_get_scale_factor (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
- g_return_val_if_fail (GDK_IS_SURFACE (window), 1);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 1);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 1;
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->get_scale_factor)
- return impl_class->get_scale_factor (window);
+ return impl_class->get_scale_factor (surface);
return 1;
}
/* Returns the *real* unscaled size, which may be a fractional size
- in window scale coordinates. We need this to properly handle GL
+ in surface scale coordinates. We need this to properly handle GL
coordinates which are y-flipped in the real coordinates. */
void
-gdk_surface_get_unscaled_size (GdkSurface *window,
+gdk_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height)
{
GdkSurfaceImplClass *impl_class;
gint scale;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (window->impl_surface == window)
+ if (surface->impl_surface == surface)
{
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->get_unscaled_size)
{
- impl_class->get_unscaled_size (window, unscaled_width, unscaled_height);
+ impl_class->get_unscaled_size (surface, unscaled_width, unscaled_height);
return;
}
}
- scale = gdk_surface_get_scale_factor (window);
+ scale = gdk_surface_get_scale_factor (surface);
if (unscaled_width)
- *unscaled_width = window->width * scale;
+ *unscaled_width = surface->width * scale;
if (unscaled_height)
- *unscaled_height = window->height * scale;
+ *unscaled_height = surface->height * scale;
}
/**
* gdk_surface_set_opaque_region:
- * @window: a top-level or non-native #GdkSurface
+ * @surface: a top-level or non-native #GdkSurface
* @region: (allow-none): a region, or %NULL
*
* For optimisation purposes, compositing window managers may
- * like to not draw obscured regions of windows, or turn off blending
+ * like to not draw obscured regions of surfaces, or turn off blending
* during for these regions. With RGB windows with no transparency,
* this is just the shape of the window, but with ARGB32 windows, the
* compositor does not know what regions of the window are transparent
* or not.
*
- * This function only works for toplevel windows.
+ * This function only works for toplevel surfaces.
*
* GTK+ will update this property automatically if
- * the @window background is opaque, as we know where the opaque regions
- * are. If your window background is not opaque, please update this
+ * the @surface background is opaque, as we know where the opaque regions
+ * are. If your surface background is not opaque, please update this
* property in your #GtkWidget::style-updated handler.
*/
void
-gdk_surface_set_opaque_region (GdkSurface *window,
+gdk_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (!GDK_SURFACE_DESTROYED (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (!GDK_SURFACE_DESTROYED (surface));
- if (cairo_region_equal (window->opaque_region, region))
+ if (cairo_region_equal (surface->opaque_region, region))
return;
- g_clear_pointer (&window->opaque_region, cairo_region_destroy);
+ g_clear_pointer (&surface->opaque_region, cairo_region_destroy);
if (region != NULL)
- window->opaque_region = cairo_region_reference (region);
+ surface->opaque_region = cairo_region_reference (region);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->set_opaque_region)
- impl_class->set_opaque_region (window, region);
+ impl_class->set_opaque_region (surface, region);
}
/**
* gdk_surface_set_shadow_width:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @left: The left extent
* @right: The right extent
* @top: The top extent
@@ -6839,10 +6839,10 @@ gdk_surface_set_opaque_region (GdkSurface *window,
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
- * to create toplevel windows.
+ * to create toplevel surfaces.
*/
void
-gdk_surface_set_shadow_width (GdkSurface *window,
+gdk_surface_set_shadow_width (GdkSurface *surface,
gint left,
gint right,
gint top,
@@ -6850,24 +6850,24 @@ gdk_surface_set_shadow_width (GdkSurface *window,
{
GdkSurfaceImplClass *impl_class;
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (!GDK_SURFACE_DESTROYED (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (!GDK_SURFACE_DESTROYED (surface));
g_return_if_fail (left >= 0 && right >= 0 && top >= 0 && bottom >= 0);
- window->shadow_top = top;
- window->shadow_left = left;
- window->shadow_right = right;
- window->shadow_bottom = bottom;
+ surface->shadow_top = top;
+ surface->shadow_left = left;
+ surface->shadow_right = right;
+ surface->shadow_bottom = bottom;
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->set_shadow_width)
- impl_class->set_shadow_width (window, left, right, top, bottom);
+ impl_class->set_shadow_width (surface, left, right, top, bottom);
}
/**
* gdk_surface_show_window_menu:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @event: a #GdkEvent to show the menu for
*
* Asks the windowing system to show the window menu. The window menu
@@ -6879,45 +6879,45 @@ gdk_surface_set_shadow_width (GdkSurface *window,
* Returns: %TRUE if the window menu was shown and %FALSE otherwise.
*/
gboolean
-gdk_surface_show_window_menu (GdkSurface *window,
+gdk_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
GdkSurfaceImplClass *impl_class;
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
- g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+ g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->show_window_menu)
- return impl_class->show_window_menu (window, event);
+ return impl_class->show_window_menu (surface, event);
else
return FALSE;
}
gboolean
-gdk_surface_supports_edge_constraints (GdkSurface *window)
+gdk_surface_supports_edge_constraints (GdkSurface *surface)
{
GdkSurfaceImplClass *impl_class;
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
- g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+ g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
- impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl);
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
if (impl_class->supports_edge_constraints)
- return impl_class->supports_edge_constraints (window);
+ return impl_class->supports_edge_constraints (surface);
else
return FALSE;
}
void
-gdk_surface_set_state (GdkSurface *window,
+gdk_surface_set_state (GdkSurface *surface,
GdkSurfaceState new_state)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (new_state == window->state)
+ if (new_state == surface->state)
return; /* No actual work to do, nothing changed. */
/* Actually update the field in GdkSurface, this is sort of an odd
@@ -6925,20 +6925,20 @@ gdk_surface_set_state (GdkSurface *window,
* inconsistent state to the user.
*/
- window->state = new_state;
+ surface->state = new_state;
- _gdk_surface_update_viewable (window);
+ _gdk_surface_update_viewable (surface);
/* We only really send the event to toplevels, since
- * all the window states don't apply to non-toplevels.
+ * all the surface states don't apply to non-toplevels.
* Non-toplevels do use the GDK_SURFACE_STATE_WITHDRAWN flag
- * internally so we needed to update window->state.
+ * internally so we needed to update surface->state.
*/
- switch (window->surface_type)
+ switch (surface->surface_type)
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP: /* ? */
- g_object_notify (G_OBJECT (window), "state");
+ g_object_notify (G_OBJECT (surface), "state");
break;
case GDK_SURFACE_FOREIGN:
case GDK_SURFACE_ROOT:
@@ -6949,9 +6949,9 @@ gdk_surface_set_state (GdkSurface *window,
}
void
-gdk_synthesize_surface_state (GdkSurface *window,
+gdk_synthesize_surface_state (GdkSurface *surface,
GdkSurfaceState unset_flags,
GdkSurfaceState set_flags)
{
- gdk_surface_set_state (window, (window->state | set_flags) & ~unset_flags);
+ gdk_surface_set_state (surface, (surface->state | set_flags) & ~unset_flags);
}
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 0332544ff7..33d3591e65 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -42,18 +42,18 @@ typedef struct _GdkGeometry GdkGeometry;
/**
* GdkSurfaceType:
- * @GDK_SURFACE_ROOT: root window; this window has no parent, covers the entire
+ * @GDK_SURFACE_ROOT: root window; this surface has no parent, covers the entire
* screen, and is created by the window system
* @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow)
- * @GDK_SURFACE_CHILD: child window (used to implement e.g. #GtkEntry)
- * @GDK_SURFACE_TEMP: override redirect temporary window (used to implement
+ * @GDK_SURFACE_CHILD: child surface (used to implement e.g. #GtkEntry)
+ * @GDK_SURFACE_TEMP: override redirect temporary surface (used to implement
* #GtkMenu)
- * @GDK_SURFACE_FOREIGN: foreign window (see gdk_surface_foreign_new())
- * @GDK_SURFACE_SUBSURFACE: subsurface-based window; This window is visually
+ * @GDK_SURFACE_FOREIGN: foreign surface (see gdk_surface_foreign_new())
+ * @GDK_SURFACE_SUBSURFACE: subsurface; This surface is visually
* tied to a toplevel, and is moved/stacked with it. Currently this window
* type is only implemented in Wayland. Since 3.14
*
- * Describes the kind of window.
+ * Describes the kind of surface.
*/
typedef enum
{
@@ -69,16 +69,16 @@ typedef enum
*/
/**
* GdkSurfaceHints:
- * @GDK_HINT_POS: indicates that the program has positioned the window
+ * @GDK_HINT_POS: indicates that the program has positioned the surface
* @GDK_HINT_MIN_SIZE: min size fields are set
* @GDK_HINT_MAX_SIZE: max size fields are set
* @GDK_HINT_BASE_SIZE: base size fields are set
* @GDK_HINT_ASPECT: aspect ratio fields are set
* @GDK_HINT_RESIZE_INC: resize increment fields are set
- * @GDK_HINT_WIN_GRAVITY: window gravity field is set
- * @GDK_HINT_USER_POS: indicates that the window’s position was explicitly set
+ * @GDK_HINT_WIN_GRAVITY: surface gravity field is set
+ * @GDK_HINT_USER_POS: indicates that the surface’s position was explicitly set
* by the user
- * @GDK_HINT_USER_SIZE: indicates that the window’s size was explicitly set by
+ * @GDK_HINT_USER_SIZE: indicates that the surface’s size was explicitly set by
* the user
*
* Used to indicate which fields of a #GdkGeometry struct should be paid
@@ -111,16 +111,16 @@ typedef enum
/**
* GdkWMDecoration:
* @GDK_DECOR_ALL: all decorations should be applied.
- * @GDK_DECOR_BORDER: a frame should be drawn around the window.
+ * @GDK_DECOR_BORDER: a frame should be drawn around the surface.
* @GDK_DECOR_RESIZEH: the frame should have resize handles.
- * @GDK_DECOR_TITLE: a titlebar should be placed above the window.
+ * @GDK_DECOR_TITLE: a titlebar should be placed above the surface.
* @GDK_DECOR_MENU: a button for opening a menu should be included.
* @GDK_DECOR_MINIMIZE: a minimize button should be included.
* @GDK_DECOR_MAXIMIZE: a maximize button should be included.
*
* These are hints originally defined by the Motif toolkit.
* The window manager can use them when determining how to decorate
- * the window. The hint must be set before mapping the window.
+ * the surface. The hint must be set before mapping the surface.
*/
typedef enum
{
@@ -136,15 +136,15 @@ typedef enum
/**
* GdkWMFunction:
* @GDK_FUNC_ALL: all functions should be offered.
- * @GDK_FUNC_RESIZE: the window should be resizable.
- * @GDK_FUNC_MOVE: the window should be movable.
- * @GDK_FUNC_MINIMIZE: the window should be minimizable.
- * @GDK_FUNC_MAXIMIZE: the window should be maximizable.
- * @GDK_FUNC_CLOSE: the window should be closable.
+ * @GDK_FUNC_RESIZE: the surface should be resizable.
+ * @GDK_FUNC_MOVE: the surface should be movable.
+ * @GDK_FUNC_MINIMIZE: the surface should be minimizable.
+ * @GDK_FUNC_MAXIMIZE: the surface should be maximizable.
+ * @GDK_FUNC_CLOSE: the surface should be closable.
*
* These are hints originally defined by the Motif toolkit. The window manager
- * can use them when determining the functions to offer for the window. The
- * hint must be set before mapping the window.
+ * can use them when determining the functions to offer for the surface. The
+ * hint must be set before mapping the surface.
*/
typedef enum
{
@@ -166,15 +166,15 @@ typedef enum
* @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge.
* @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner.
* @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge.
- * @GDK_GRAVITY_CENTER: the reference point is at the center of the window.
+ * @GDK_GRAVITY_CENTER: the reference point is at the center of the surface.
* @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge.
* @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner.
* @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge.
* @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner.
* @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the
- * window itself, ignoring window manager decorations.
+ * surface itself, ignoring window manager decorations.
*
- * Defines the reference point of a window and the meaning of coordinates
+ * Defines the reference point of a surface and the meaning of coordinates
* passed to gtk_window_move(). See gtk_window_move() and the "implementation
* notes" section of the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
@@ -198,25 +198,25 @@ typedef enum
* GdkAnchorHints:
* @GDK_ANCHOR_FLIP_X: allow flipping anchors horizontally
* @GDK_ANCHOR_FLIP_Y: allow flipping anchors vertically
- * @GDK_ANCHOR_SLIDE_X: allow sliding window horizontally
- * @GDK_ANCHOR_SLIDE_Y: allow sliding window vertically
- * @GDK_ANCHOR_RESIZE_X: allow resizing window horizontally
- * @GDK_ANCHOR_RESIZE_Y: allow resizing window vertically
+ * @GDK_ANCHOR_SLIDE_X: allow sliding surface horizontally
+ * @GDK_ANCHOR_SLIDE_Y: allow sliding surface vertically
+ * @GDK_ANCHOR_RESIZE_X: allow resizing surface horizontally
+ * @GDK_ANCHOR_RESIZE_Y: allow resizing surface vertically
* @GDK_ANCHOR_FLIP: allow flipping anchors on both axes
- * @GDK_ANCHOR_SLIDE: allow sliding window on both axes
- * @GDK_ANCHOR_RESIZE: allow resizing window on both axes
+ * @GDK_ANCHOR_SLIDE: allow sliding surface on both axes
+ * @GDK_ANCHOR_RESIZE: allow resizing surface on both axes
*
- * Positioning hints for aligning a window relative to a rectangle.
+ * Positioning hints for aligning a surface relative to a rectangle.
*
- * These hints determine how the window should be positioned in the case that
- * the window would fall off-screen if placed in its ideal position.
+ * These hints determine how the surface should be positioned in the case that
+ * the surface would fall off-screen if placed in its ideal position.
*
* For example, %GDK_ANCHOR_FLIP_X will replace %GDK_GRAVITY_NORTH_WEST with
- * %GDK_GRAVITY_NORTH_EAST and vice versa if the window extends beyond the left
+ * %GDK_GRAVITY_NORTH_EAST and vice versa if the surface extends beyond the left
* or right edges of the monitor.
*
- * If %GDK_ANCHOR_SLIDE_X is set, the window can be shifted horizontally to fit
- * on-screen. If %GDK_ANCHOR_RESIZE_X is set, the window can be shrunken
+ * If %GDK_ANCHOR_SLIDE_X is set, the surface can be shifted horizontally to fit
+ * on-screen. If %GDK_ANCHOR_RESIZE_X is set, the surface can be shrunken
* horizontally to fit.
*
* In general, when multiple flags are set, flipping should take precedence over
@@ -249,7 +249,7 @@ typedef enum
* @GDK_SURFACE_EDGE_SOUTH: the lower edge.
* @GDK_SURFACE_EDGE_SOUTH_EAST: the lower right corner.
*
- * Determines a window edge or corner.
+ * Determines a surface edge or corner.
*/
typedef enum
{
@@ -268,7 +268,7 @@ typedef enum
* @GDK_FULLSCREEN_ON_CURRENT_MONITOR: Fullscreen on current monitor only.
* @GDK_FULLSCREEN_ON_ALL_MONITORS: Span across all monitors when fullscreen.
*
- * Indicates which monitor (in a multi-head setup) a window should span over
+ * Indicates which monitor (in a multi-head setup) a surface should span over
* when in fullscreen mode.
*
* Since: 3.8
@@ -281,26 +281,26 @@ typedef enum
/**
* GdkGeometry:
- * @min_width: minimum width of window (or -1 to use requisition, with
+ * @min_width: minimum width of surface (or -1 to use requisition, with
* #GtkWindow only)
- * @min_height: minimum height of window (or -1 to use requisition, with
+ * @min_height: minimum height of surface (or -1 to use requisition, with
* #GtkWindow only)
- * @max_width: maximum width of window (or -1 to use requisition, with
+ * @max_width: maximum width of surface (or -1 to use requisition, with
* #GtkWindow only)
- * @max_height: maximum height of window (or -1 to use requisition, with
+ * @max_height: maximum height of surface (or -1 to use requisition, with
* #GtkWindow only)
- * @base_width: allowed window widths are @base_width + @width_inc * N where N
+ * @base_width: allowed surface widths are @base_width + @width_inc * N where N
* is any integer (-1 allowed with #GtkWindow)
- * @base_height: allowed window widths are @base_height + @height_inc * N where
+ * @base_height: allowed surface widths are @base_height + @height_inc * N where
* N is any integer (-1 allowed with #GtkWindow)
* @width_inc: width resize increment
* @height_inc: height resize increment
* @min_aspect: minimum width/height ratio
* @max_aspect: maximum width/height ratio
- * @win_gravity: window gravity, see gtk_window_set_gravity()
+ * @win_gravity: surface gravity, see gtk_window_set_gravity()
*
* The #GdkGeometry struct gives the window manager information about
- * a window’s geometry constraints. Normally you would set these on
+ * a surface’s geometry constraints. Normally you would set these on
* the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
* then sets the hints on the #GdkSurface it creates.
*
@@ -310,11 +310,11 @@ typedef enum
* #GtkWindow will apply the hints to the geometry widget instead of the
* toplevel window, if you set a geometry widget. Also, the
* @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
- * #GtkWindow will substitute the size request of the window or geometry widget.
+ * #GtkWindow will substitute the size request of the surface or geometry widget.
* If the minimum size hint is not provided, #GtkWindow will use its requisition
* as the minimum size. If the minimum size is provided and a geometry widget is
* set, #GtkWindow will take the minimum size as the minimum size of the
- * geometry widget rather than the entire window. The base size is treated
+ * geometry widget rather than the entire surface. The base size is treated
* similarly.
*
* The canonical use-case for gtk_window_set_geometry_hints() is to get a
@@ -372,16 +372,16 @@ struct _GdkGeometry
/**
* GdkSurfaceState:
- * @GDK_SURFACE_STATE_WITHDRAWN: the window is not shown.
- * @GDK_SURFACE_STATE_ICONIFIED: the window is minimized.
- * @GDK_SURFACE_STATE_MAXIMIZED: the window is maximized.
- * @GDK_SURFACE_STATE_STICKY: the window is sticky.
- * @GDK_SURFACE_STATE_FULLSCREEN: the window is maximized without
+ * @GDK_SURFACE_STATE_WITHDRAWN: the surface is not shown.
+ * @GDK_SURFACE_STATE_ICONIFIED: the surface is minimized.
+ * @GDK_SURFACE_STATE_MAXIMIZED: the surface is maximized.
+ * @GDK_SURFACE_STATE_STICKY: the surface is sticky.
+ * @GDK_SURFACE_STATE_FULLSCREEN: the surface is maximized without
* decorations.
- * @GDK_SURFACE_STATE_ABOVE: the window is kept above other windows.
- * @GDK_SURFACE_STATE_BELOW: the window is kept below other windows.
- * @GDK_SURFACE_STATE_FOCUSED: the window is presented as focused (with active decorations).
- * @GDK_SURFACE_STATE_TILED: the window is in a tiled state, Since 3.10. Since 3.91.2, this
+ * @GDK_SURFACE_STATE_ABOVE: the surface is kept above other surfaces.
+ * @GDK_SURFACE_STATE_BELOW: the surface is kept below other surfaces.
+ * @GDK_SURFACE_STATE_FOCUSED: the surface is presented as focused (with active decorations).
+ * @GDK_SURFACE_STATE_TILED: the surface is in a tiled state, Since 3.10. Since 3.91.2, this
* is deprecated in favor of per-edge information.
* @GDK_SURFACE_STATE_TOP_TILED: whether the top edge is tiled, Since 3.91.2
* @GDK_SURFACE_STATE_TOP_RESIZABLE: whether the top edge is resizable, Since 3.91.2
@@ -392,7 +392,7 @@ struct _GdkGeometry
* @GDK_SURFACE_STATE_LEFT_TILED: whether the left edge is tiled, Since 3.91.2
* @GDK_SURFACE_STATE_LEFT_RESIZABLE: whether the left edge is resizable, Since 3.91.2
*
- * Specifies the state of a toplevel window.
+ * Specifies the state of a toplevel surface.
*/
typedef enum
{
@@ -441,7 +441,7 @@ struct _GdkSurfaceClass
void (*_gdk_reserved8) (void);
};
-/* Windows
+/* Surfaces
*/
GDK_AVAILABLE_IN_ALL
GType gdk_surface_get_type (void) G_GNUC_CONST;
@@ -459,377 +459,377 @@ GdkSurface * gdk_surface_new_child (GdkSurface *parent,
const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_destroy (GdkSurface *window);
+void gdk_surface_destroy (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkSurfaceType gdk_surface_get_surface_type (GdkSurface *window);
+GdkSurfaceType gdk_surface_get_surface_type (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_is_destroyed (GdkSurface *window);
+gboolean gdk_surface_is_destroyed (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkDisplay * gdk_surface_get_display (GdkSurface *window);
+GdkDisplay * gdk_surface_get_display (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_show (GdkSurface *window);
+void gdk_surface_show (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_hide (GdkSurface *window);
+void gdk_surface_hide (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_withdraw (GdkSurface *window);
+void gdk_surface_withdraw (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_show_unraised (GdkSurface *window);
+void gdk_surface_show_unraised (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_move (GdkSurface *window,
+void gdk_surface_move (GdkSurface *surface,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_resize (GdkSurface *window,
+void gdk_surface_resize (GdkSurface *surface,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_move_resize (GdkSurface *window,
+void gdk_surface_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_raise (GdkSurface *window);
+void gdk_surface_raise (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_lower (GdkSurface *window);
+void gdk_surface_lower (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_restack (GdkSurface *window,
+void gdk_surface_restack (GdkSurface *surface,
GdkSurface *sibling,
gboolean above);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_focus (GdkSurface *window,
+void gdk_surface_focus (GdkSurface *surface,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_user_data (GdkSurface *window,
+void gdk_surface_set_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_accept_focus (GdkSurface *window);
+gboolean gdk_surface_get_accept_focus (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_accept_focus (GdkSurface *window,
+void gdk_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_focus_on_map (GdkSurface *window);
+gboolean gdk_surface_get_focus_on_map (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_focus_on_map (GdkSurface *window,
+void gdk_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_scroll (GdkSurface *window,
+void gdk_surface_scroll (GdkSurface *surface,
gint dx,
gint dy);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_move_region (GdkSurface *window,
+void gdk_surface_move_region (GdkSurface *surface,
const cairo_region_t *region,
gint dx,
gint dy);
/*
- * This allows for making shaped (partially transparent) windows
+ * This allows for making shaped (partially transparent) surfaces
* - cool feature, needed for Drag and Drag for example.
*/
GDK_AVAILABLE_IN_ALL
-void gdk_surface_shape_combine_region (GdkSurface *window,
+void gdk_surface_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y);
/*
- * This routine allows you to quickly take the shapes of all the child windows
- * of a window and use their shapes as the shape mask for this window - useful
- * for container windows that dont want to look like a big box
+ * This routine allows you to quickly take the shapes of all the child surfaces
+ * of a surface and use their shapes as the shape mask for this surface - useful
+ * for container surfaces that dont want to look like a big box
*
* - Raster
*/
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_child_shapes (GdkSurface *window);
+void gdk_surface_set_child_shapes (GdkSurface *surface);
/*
* This routine allows you to merge (ie ADD) child shapes to your
- * own window’s shape keeping its current shape and ADDING the child
+ * own surface’s shape keeping its current shape and ADDING the child
* shapes to it.
*
* - Raster
*/
GDK_AVAILABLE_IN_ALL
-void gdk_surface_merge_child_shapes (GdkSurface *window);
+void gdk_surface_merge_child_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_input_shape_combine_region (GdkSurface *window,
+void gdk_surface_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_child_input_shapes (GdkSurface *window);
+void gdk_surface_set_child_input_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_merge_child_input_shapes (GdkSurface *window);
+void gdk_surface_merge_child_input_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_pass_through (GdkSurface *window,
+void gdk_surface_set_pass_through (GdkSurface *surface,
gboolean pass_through);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_pass_through (GdkSurface *window);
+gboolean gdk_surface_get_pass_through (GdkSurface *surface);
/*
- * Check if a window has been shown, and whether all its
+ * Check if a surface has been shown, and whether all its
* parents up to a toplevel have been shown, respectively.
- * Note that a window that is_viewable below is not necessarily
+ * Note that a surface that is_viewable below is not necessarily
* viewable in the X sense.
*/
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_is_visible (GdkSurface *window);
+gboolean gdk_surface_is_visible (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_is_viewable (GdkSurface *window);
+gboolean gdk_surface_is_viewable (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_is_input_only (GdkSurface *window);
+gboolean gdk_surface_is_input_only (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_is_shaped (GdkSurface *window);
+gboolean gdk_surface_is_shaped (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkSurfaceState gdk_surface_get_state (GdkSurface *window);
+GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
/* GdkSurface */
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_has_native (GdkSurface *window);
+gboolean gdk_surface_has_native (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_type_hint (GdkSurface *window,
+void gdk_surface_set_type_hint (GdkSurface *surface,
GdkSurfaceTypeHint hint);
GDK_AVAILABLE_IN_ALL
-GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface *window);
+GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_modal_hint (GdkSurface *window);
+gboolean gdk_surface_get_modal_hint (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_modal_hint (GdkSurface *window,
+void gdk_surface_set_modal_hint (GdkSurface *surface,
gboolean modal);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_skip_taskbar_hint (GdkSurface *window,
+void gdk_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_skip_pager_hint (GdkSurface *window,
+void gdk_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_urgency_hint (GdkSurface *window,
+void gdk_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_geometry_hints (GdkSurface *window,
+void gdk_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_surface_get_clip_region (GdkSurface *window);
+cairo_region_t *gdk_surface_get_clip_region (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_surface_get_visible_region(GdkSurface *window);
+cairo_region_t *gdk_surface_get_visible_region(GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *window,
+GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *surface,
GdkDrawContext *context,
const cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_end_draw_frame (GdkSurface *window,
+void gdk_surface_end_draw_frame (GdkSurface *surface,
GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_title (GdkSurface *window,
+void gdk_surface_set_title (GdkSurface *surface,
const gchar *title);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_role (GdkSurface *window,
+void gdk_surface_set_role (GdkSurface *surface,
const gchar *role);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_startup_id (GdkSurface *window,
+void gdk_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_transient_for (GdkSurface *window,
+void gdk_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_cursor (GdkSurface *window,
+void gdk_surface_set_cursor (GdkSurface *surface,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
-GdkCursor *gdk_surface_get_cursor (GdkSurface *window);
+GdkCursor *gdk_surface_get_cursor (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_device_cursor (GdkSurface *window,
+void gdk_surface_set_device_cursor (GdkSurface *surface,
GdkDevice *device,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
-GdkCursor *gdk_surface_get_device_cursor (GdkSurface *window,
+GdkCursor *gdk_surface_get_device_cursor (GdkSurface *surface,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_user_data (GdkSurface *window,
+void gdk_surface_get_user_data (GdkSurface *surface,
gpointer *data);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_geometry (GdkSurface *window,
+void gdk_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height);
GDK_AVAILABLE_IN_ALL
-int gdk_surface_get_width (GdkSurface *window);
+int gdk_surface_get_width (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-int gdk_surface_get_height (GdkSurface *window);
+int gdk_surface_get_height (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_position (GdkSurface *window,
+void gdk_surface_get_position (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-gint gdk_surface_get_origin (GdkSurface *window,
+gint gdk_surface_get_origin (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_root_coords (GdkSurface *window,
+void gdk_surface_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_coords_to_parent (GdkSurface *window,
+void gdk_surface_coords_to_parent (GdkSurface *surface,
gdouble x,
gdouble y,
gdouble *parent_x,
gdouble *parent_y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_coords_from_parent (GdkSurface *window,
+void gdk_surface_coords_from_parent (GdkSurface *surface,
gdouble parent_x,
gdouble parent_y,
gdouble *x,
gdouble *y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_root_origin (GdkSurface *window,
+void gdk_surface_get_root_origin (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_get_frame_extents (GdkSurface *window,
+void gdk_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL
-gint gdk_surface_get_scale_factor (GdkSurface *window);
+gint gdk_surface_get_scale_factor (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkSurface * gdk_surface_get_device_position (GdkSurface *window,
+GdkSurface * gdk_surface_get_device_position (GdkSurface *surface,
GdkDevice *device,
gint *x,
gint *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
-GdkSurface * gdk_surface_get_device_position_double (GdkSurface *window,
+GdkSurface * gdk_surface_get_device_position_double (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
-GdkSurface * gdk_surface_get_parent (GdkSurface *window);
+GdkSurface * gdk_surface_get_parent (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkSurface * gdk_surface_get_toplevel (GdkSurface *window);
+GdkSurface * gdk_surface_get_toplevel (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_surface_get_children (GdkSurface *window);
+GList * gdk_surface_get_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_surface_peek_children (GdkSurface *window);
+GList * gdk_surface_peek_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_surface_get_children_with_user_data (GdkSurface *window,
+GList * gdk_surface_get_children_with_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-GdkEventMask gdk_surface_get_events (GdkSurface *window);
+GdkEventMask gdk_surface_get_events (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_events (GdkSurface *window,
+void gdk_surface_set_events (GdkSurface *surface,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_device_events (GdkSurface *window,
+void gdk_surface_set_device_events (GdkSurface *surface,
GdkDevice *device,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
-GdkEventMask gdk_surface_get_device_events (GdkSurface *window,
+GdkEventMask gdk_surface_get_device_events (GdkSurface *surface,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_icon_list (GdkSurface *window,
+void gdk_surface_set_icon_list (GdkSurface *surface,
GList *surfaces);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_icon_name (GdkSurface *window,
+void gdk_surface_set_icon_name (GdkSurface *surface,
const gchar *name);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_group (GdkSurface *window,
+void gdk_surface_set_group (GdkSurface *surface,
GdkSurface *leader);
GDK_AVAILABLE_IN_ALL
-GdkSurface* gdk_surface_get_group (GdkSurface *window);
+GdkSurface* gdk_surface_get_group (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_decorations (GdkSurface *window,
+void gdk_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_decorations (GdkSurface *window,
+gboolean gdk_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_functions (GdkSurface *window,
+void gdk_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
- gdk_surface_create_similar_surface (GdkSurface *window,
+ gdk_surface_create_similar_surface (GdkSurface *surface,
cairo_content_t content,
int width,
int height);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
- gdk_surface_create_similar_image_surface (GdkSurface *window,
+ gdk_surface_create_similar_image_surface (GdkSurface *surface,
cairo_format_t format,
int width,
int height,
int scale);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_beep (GdkSurface *window);
+void gdk_surface_beep (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_iconify (GdkSurface *window);
+void gdk_surface_iconify (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_deiconify (GdkSurface *window);
+void gdk_surface_deiconify (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_stick (GdkSurface *window);
+void gdk_surface_stick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_unstick (GdkSurface *window);
+void gdk_surface_unstick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_maximize (GdkSurface *window);
+void gdk_surface_maximize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_unmaximize (GdkSurface *window);
+void gdk_surface_unmaximize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_fullscreen (GdkSurface *window);
+void gdk_surface_fullscreen (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_fullscreen_on_monitor (GdkSurface *window,
+void gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_fullscreen_mode (GdkSurface *window,
+void gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode);
GDK_AVAILABLE_IN_ALL
GdkFullscreenMode
- gdk_surface_get_fullscreen_mode (GdkSurface *window);
+ gdk_surface_get_fullscreen_mode (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_unfullscreen (GdkSurface *window);
+void gdk_surface_unfullscreen (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_keep_above (GdkSurface *window,
+void gdk_surface_set_keep_above (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_keep_below (GdkSurface *window,
+void gdk_surface_set_keep_below (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_opacity (GdkSurface *window,
+void gdk_surface_set_opacity (GdkSurface *surface,
gdouble opacity);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_register_dnd (GdkSurface *window);
+void gdk_surface_register_dnd (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_begin_resize_drag (GdkSurface *window,
+void gdk_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
gint button,
gint root_x,
gint root_y,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_begin_resize_drag_for_device (GdkSurface *window,
+void gdk_surface_begin_resize_drag_for_device (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -837,13 +837,13 @@ void gdk_surface_begin_resize_drag_for_device (GdkSurface *window,
gint root_y,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_begin_move_drag (GdkSurface *window,
+void gdk_surface_begin_move_drag (GdkSurface *surface,
gint button,
gint root_x,
gint root_y,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_begin_move_drag_for_device (GdkSurface *window,
+void gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
@@ -852,40 +852,40 @@ void gdk_surface_begin_move_drag_for_device (GdkSurface *window,
/* Interface for dirty-region queueing */
GDK_AVAILABLE_IN_ALL
-void gdk_surface_invalidate_rect (GdkSurface *window,
+void gdk_surface_invalidate_rect (GdkSurface *surface,
const GdkRectangle *rect,
gboolean invalidate_children);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_invalidate_region (GdkSurface *window,
+void gdk_surface_invalidate_region (GdkSurface *surface,
const cairo_region_t *region,
gboolean invalidate_children);
/**
* GdkSurfaceChildFunc:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @user_data: user data
*
* A function of this type is passed to gdk_surface_invalidate_maybe_recurse().
- * It gets called for each child of the window to determine whether to
+ * It gets called for each child of the surface to determine whether to
* recursively invalidate it or now.
*
- * Returns: %TRUE to invalidate @window recursively
+ * Returns: %TRUE to invalidate @surface recursively
*/
-typedef gboolean (*GdkSurfaceChildFunc) (GdkSurface *window,
+typedef gboolean (*GdkSurfaceChildFunc) (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_invalidate_maybe_recurse (GdkSurface *window,
+void gdk_surface_invalidate_maybe_recurse (GdkSurface *surface,
const cairo_region_t *region,
GdkSurfaceChildFunc child_func,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_surface_get_update_area (GdkSurface *window);
+cairo_region_t *gdk_surface_get_update_area (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_freeze_updates (GdkSurface *window);
+void gdk_surface_freeze_updates (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_thaw_updates (GdkSurface *window);
+void gdk_surface_thaw_updates (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_constrain_size (GdkGeometry *geometry,
@@ -897,35 +897,35 @@ void gdk_surface_constrain_size (GdkGeometry *geometry,
/* Multidevice support */
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_support_multidevice (GdkSurface *window,
+void gdk_surface_set_support_multidevice (GdkSurface *surface,
gboolean support_multidevice);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_support_multidevice (GdkSurface *window);
+gboolean gdk_surface_get_support_multidevice (GdkSurface *surface);
/* Frame clock */
GDK_AVAILABLE_IN_ALL
-GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *window);
+GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_opaque_region (GdkSurface *window,
+void gdk_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_shadow_width (GdkSurface *window,
+void gdk_surface_set_shadow_width (GdkSurface *surface,
gint left,
gint right,
gint top,
gint bottom);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_show_window_menu (GdkSurface *window,
+gboolean gdk_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event);
GDK_AVAILABLE_IN_ALL
-GdkGLContext * gdk_surface_create_gl_context (GdkSurface *window,
+GdkGLContext * gdk_surface_create_gl_context (GdkSurface *surface,
GError **error);
GDK_AVAILABLE_IN_ALL
GdkVulkanContext *
- gdk_surface_create_vulkan_context(GdkSurface *window,
+ gdk_surface_create_vulkan_context(GdkSurface *surface,
GError **error);
G_END_DECLS
diff --git a/gdk/gdksurfaceimpl.c b/gdk/gdksurfaceimpl.c
index a228162330..e73d11748a 100644
--- a/gdk/gdksurfaceimpl.c
+++ b/gdk/gdksurfaceimpl.c
@@ -32,9 +32,9 @@
G_DEFINE_TYPE (GdkSurfaceImpl, gdk_surface_impl, G_TYPE_OBJECT);
static gboolean
-gdk_surface_impl_beep (GdkSurface *window)
+gdk_surface_impl_beep (GdkSurface *surface)
{
- /* FALSE means windows can't beep, so the display will be
+ /* FALSE means surfaces can't beep, so the display will be
* made to beep instead. */
return FALSE;
}
@@ -53,7 +53,7 @@ get_display_for_surface (GdkSurface *primary,
if (display)
return display;
- g_warning ("no display for window, using default");
+ g_warning ("no display for surface, using default");
return gdk_display_get_default ();
}
@@ -147,9 +147,9 @@ maybe_flip_position (gint bounds_pos,
gint bounds_size,
gint rect_pos,
gint rect_size,
- gint window_size,
+ gint surface_size,
gint rect_sign,
- gint window_sign,
+ gint surface_sign,
gint offset,
gboolean flip,
gboolean *flipped)
@@ -158,15 +158,15 @@ maybe_flip_position (gint bounds_pos,
gint secondary;
*flipped = FALSE;
- primary = rect_pos + (1 + rect_sign) * rect_size / 2 + offset - (1 + window_sign) * window_size / 2;
+ primary = rect_pos + (1 + rect_sign) * rect_size / 2 + offset - (1 + surface_sign) * surface_size / 2;
- if (!flip || (primary >= bounds_pos && primary + window_size <= bounds_pos + bounds_size))
+ if (!flip || (primary >= bounds_pos && primary + surface_size <= bounds_pos + bounds_size))
return primary;
*flipped = TRUE;
- secondary = rect_pos + (1 - rect_sign) * rect_size / 2 - offset - (1 - window_sign) * window_size / 2;
+ secondary = rect_pos + (1 - rect_sign) * rect_size / 2 - offset - (1 - surface_sign) * surface_size / 2;
- if (secondary >= bounds_pos && secondary + window_size <= bounds_pos + bounds_size)
+ if (secondary >= bounds_pos && secondary + surface_size <= bounds_pos + bounds_size)
return secondary;
*flipped = FALSE;
@@ -174,7 +174,7 @@ maybe_flip_position (gint bounds_pos,
}
static GdkSurface *
-traverse_to_toplevel (GdkSurface *window,
+traverse_to_toplevel (GdkSurface *surface,
gint x,
gint y,
gint *toplevel_x,
@@ -184,20 +184,20 @@ traverse_to_toplevel (GdkSurface *window,
gdouble xf = x;
gdouble yf = y;
- while ((parent = window->parent) != NULL &&
+ while ((parent = surface->parent) != NULL &&
(gdk_surface_get_surface_type (parent) != GDK_SURFACE_ROOT))
{
- gdk_surface_coords_to_parent (window, xf, yf, &xf, &yf);
- window = parent;
+ gdk_surface_coords_to_parent (surface, xf, yf, &xf, &yf);
+ surface = parent;
}
*toplevel_x = (gint) xf;
*toplevel_y = (gint) yf;
- return window;
+ return surface;
}
static void
-gdk_surface_impl_move_to_rect (GdkSurface *window,
+gdk_surface_impl_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
@@ -218,9 +218,9 @@ gdk_surface_impl_move_to_rect (GdkSurface *window,
/*
* First translate the anchor rect to toplevel coordinates. This is needed
* because not all backends will be able to get root coordinates for
- * non-toplevel windows.
+ * non-toplevel surfaces.
*/
- transient_for_toplevel = traverse_to_toplevel (window->transient_for,
+ transient_for_toplevel = traverse_to_toplevel (surface->transient_for,
root_rect.x,
root_rect.y,
&root_rect.x,
@@ -232,12 +232,12 @@ gdk_surface_impl_move_to_rect (GdkSurface *window,
&root_rect.x,
&root_rect.y);
- display = get_display_for_surface (window, window->transient_for);
+ display = get_display_for_surface (surface, surface->transient_for);
monitor = get_monitor_for_rect (display, &root_rect);
gdk_monitor_get_workarea (monitor, &bounds);
- flipped_rect.width = window->width - window->shadow_left - window->shadow_right;
- flipped_rect.height = window->height - window->shadow_top - window->shadow_bottom;
+ flipped_rect.width = surface->width - surface->shadow_left - surface->shadow_right;
+ flipped_rect.height = surface->height - surface->shadow_top - surface->shadow_bottom;
flipped_rect.x = maybe_flip_position (bounds.x,
bounds.width,
root_rect.x,
@@ -303,22 +303,22 @@ gdk_surface_impl_move_to_rect (GdkSurface *window,
final_rect.height = bounds.y + bounds.height - final_rect.y;
}
- flipped_rect.x -= window->shadow_left;
- flipped_rect.y -= window->shadow_top;
- flipped_rect.width += window->shadow_left + window->shadow_right;
- flipped_rect.height += window->shadow_top + window->shadow_bottom;
+ flipped_rect.x -= surface->shadow_left;
+ flipped_rect.y -= surface->shadow_top;
+ flipped_rect.width += surface->shadow_left + surface->shadow_right;
+ flipped_rect.height += surface->shadow_top + surface->shadow_bottom;
- final_rect.x -= window->shadow_left;
- final_rect.y -= window->shadow_top;
- final_rect.width += window->shadow_left + window->shadow_right;
- final_rect.height += window->shadow_top + window->shadow_bottom;
+ final_rect.x -= surface->shadow_left;
+ final_rect.y -= surface->shadow_top;
+ final_rect.width += surface->shadow_left + surface->shadow_right;
+ final_rect.height += surface->shadow_top + surface->shadow_bottom;
- if (final_rect.width != window->width || final_rect.height != window->height)
- gdk_surface_move_resize (window, final_rect.x, final_rect.y, final_rect.width, final_rect.height);
+ if (final_rect.width != surface->width || final_rect.height != surface->height)
+ gdk_surface_move_resize (surface, final_rect.x, final_rect.y, final_rect.width, final_rect.height);
else
- gdk_surface_move (window, final_rect.x, final_rect.y);
+ gdk_surface_move (surface, final_rect.x, final_rect.y);
- g_signal_emit_by_name (window,
+ g_signal_emit_by_name (surface,
"moved-to-rect",
&flipped_rect,
&final_rect,
@@ -327,10 +327,10 @@ gdk_surface_impl_move_to_rect (GdkSurface *window,
}
static void
-gdk_surface_impl_process_updates_recurse (GdkSurface *window,
+gdk_surface_impl_process_updates_recurse (GdkSurface *surface,
cairo_region_t *region)
{
- _gdk_surface_process_updates_recurse (window, region);
+ _gdk_surface_process_updates_recurse (surface, region);
}
static void
diff --git a/gdk/gdksurfaceimpl.h b/gdk/gdksurfaceimpl.h
index 66c07ef375..4617a7d2fb 100644
--- a/gdk/gdksurfaceimpl.h
+++ b/gdk/gdksurfaceimpl.h
@@ -50,30 +50,30 @@ struct _GdkSurfaceImplClass
GObjectClass parent_class;
cairo_surface_t *
- (* ref_cairo_surface) (GdkSurface *window);
+ (* ref_cairo_surface) (GdkSurface *surface);
cairo_surface_t *
- (* create_similar_image_surface) (GdkSurface * window,
+ (* create_similar_image_surface) (GdkSurface * surface,
cairo_format_t format,
int width,
int height);
- void (* show) (GdkSurface *window,
+ void (* show) (GdkSurface *surface,
gboolean already_mapped);
- void (* hide) (GdkSurface *window);
- void (* withdraw) (GdkSurface *window);
- void (* raise) (GdkSurface *window);
- void (* lower) (GdkSurface *window);
- void (* restack_toplevel) (GdkSurface *window,
+ void (* hide) (GdkSurface *surface);
+ void (* withdraw) (GdkSurface *surface);
+ void (* raise) (GdkSurface *surface);
+ void (* lower) (GdkSurface *surface);
+ void (* restack_toplevel) (GdkSurface *surface,
GdkSurface *sibling,
gboolean above);
- void (* move_resize) (GdkSurface *window,
+ void (* move_resize) (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
gint width,
gint height);
- void (* move_to_rect) (GdkSurface *window,
+ void (* move_to_rect) (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
@@ -81,171 +81,171 @@ struct _GdkSurfaceImplClass
gint rect_anchor_dx,
gint rect_anchor_dy);
- GdkEventMask (* get_events) (GdkSurface *window);
- void (* set_events) (GdkSurface *window,
+ GdkEventMask (* get_events) (GdkSurface *surface);
+ void (* set_events) (GdkSurface *surface,
GdkEventMask event_mask);
- void (* get_geometry) (GdkSurface *window,
+ void (* get_geometry) (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height);
- void (* get_root_coords) (GdkSurface *window,
+ void (* get_root_coords) (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y);
- gboolean (* get_device_state) (GdkSurface *window,
+ gboolean (* get_device_state) (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask);
- gboolean (* begin_paint) (GdkSurface *window);
- void (* end_paint) (GdkSurface *window);
+ gboolean (* begin_paint) (GdkSurface *surface);
+ void (* end_paint) (GdkSurface *surface);
- void (* shape_combine_region) (GdkSurface *window,
+ void (* shape_combine_region) (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y);
- void (* input_shape_combine_region) (GdkSurface *window,
+ void (* input_shape_combine_region) (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y);
- /* Called before processing updates for a window. This gives the windowing
+ /* Called before processing updates for a surface. This gives the windowing
* layer a chance to save the region for later use in avoiding duplicate
* exposes.
*/
- void (* queue_antiexpose) (GdkSurface *window,
+ void (* queue_antiexpose) (GdkSurface *surface,
cairo_region_t *update_area);
/* Called to do the windowing system specific part of gdk_surface_destroy(),
*
- * window: The window being destroyed
+ * surface: The window being destroyed
* recursing: If TRUE, then this is being called because a parent
* was destroyed. This generally means that the call to the windowing
- * system to destroy the window can be omitted, since it will be
+ * system to destroy the surface can be omitted, since it will be
* destroyed as a result of the parent being destroyed.
* Unless @foreign_destroy
- * foreign_destroy: If TRUE, the window or a parent was destroyed by some
- * external agency. The window has already been destroyed and no
+ * foreign_destroy: If TRUE, the surface or a parent was destroyed by some
+ * external agency. The surface has already been destroyed and no
* windowing system calls should be made. (This may never happen
* for some windowing systems.)
*/
- void (* destroy) (GdkSurface *window,
+ void (* destroy) (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy);
/* optional */
- gboolean (* beep) (GdkSurface *window);
+ gboolean (* beep) (GdkSurface *surface);
- void (* focus) (GdkSurface *window,
+ void (* focus) (GdkSurface *surface,
guint32 timestamp);
- void (* set_type_hint) (GdkSurface *window,
+ void (* set_type_hint) (GdkSurface *surface,
GdkSurfaceTypeHint hint);
- GdkSurfaceTypeHint (* get_type_hint) (GdkSurface *window);
- void (* set_modal_hint) (GdkSurface *window,
+ GdkSurfaceTypeHint (* get_type_hint) (GdkSurface *surface);
+ void (* set_modal_hint) (GdkSurface *surface,
gboolean modal);
- void (* set_skip_taskbar_hint) (GdkSurface *window,
+ void (* set_skip_taskbar_hint) (GdkSurface *surface,
gboolean skips_taskbar);
- void (* set_skip_pager_hint) (GdkSurface *window,
+ void (* set_skip_pager_hint) (GdkSurface *surface,
gboolean skips_pager);
- void (* set_urgency_hint) (GdkSurface *window,
+ void (* set_urgency_hint) (GdkSurface *surface,
gboolean urgent);
- void (* set_geometry_hints) (GdkSurface *window,
+ void (* set_geometry_hints) (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask);
- void (* set_title) (GdkSurface *window,
+ void (* set_title) (GdkSurface *surface,
const gchar *title);
- void (* set_role) (GdkSurface *window,
+ void (* set_role) (GdkSurface *surface,
const gchar *role);
- void (* set_startup_id) (GdkSurface *window,
+ void (* set_startup_id) (GdkSurface *surface,
const gchar *startup_id);
- void (* set_transient_for) (GdkSurface *window,
+ void (* set_transient_for) (GdkSurface *surface,
GdkSurface *parent);
- void (* get_frame_extents) (GdkSurface *window,
+ void (* get_frame_extents) (GdkSurface *surface,
GdkRectangle *rect);
- void (* set_accept_focus) (GdkSurface *window,
+ void (* set_accept_focus) (GdkSurface *surface,
gboolean accept_focus);
- void (* set_focus_on_map) (GdkSurface *window,
+ void (* set_focus_on_map) (GdkSurface *surface,
gboolean focus_on_map);
- void (* set_icon_list) (GdkSurface *window,
+ void (* set_icon_list) (GdkSurface *surface,
GList *pixbufs);
- void (* set_icon_name) (GdkSurface *window,
+ void (* set_icon_name) (GdkSurface *surface,
const gchar *name);
- void (* iconify) (GdkSurface *window);
- void (* deiconify) (GdkSurface *window);
- void (* stick) (GdkSurface *window);
- void (* unstick) (GdkSurface *window);
- void (* maximize) (GdkSurface *window);
- void (* unmaximize) (GdkSurface *window);
- void (* fullscreen) (GdkSurface *window);
- void (* fullscreen_on_monitor) (GdkSurface *window,
+ void (* iconify) (GdkSurface *surface);
+ void (* deiconify) (GdkSurface *surface);
+ void (* stick) (GdkSurface *surface);
+ void (* unstick) (GdkSurface *surface);
+ void (* maximize) (GdkSurface *surface);
+ void (* unmaximize) (GdkSurface *surface);
+ void (* fullscreen) (GdkSurface *surface);
+ void (* fullscreen_on_monitor) (GdkSurface *surface,
GdkMonitor *monitor);
- void (* apply_fullscreen_mode) (GdkSurface *window);
- void (* unfullscreen) (GdkSurface *window);
- void (* set_keep_above) (GdkSurface *window,
+ void (* apply_fullscreen_mode) (GdkSurface *surface);
+ void (* unfullscreen) (GdkSurface *surface);
+ void (* set_keep_above) (GdkSurface *surface,
gboolean setting);
- void (* set_keep_below) (GdkSurface *window,
+ void (* set_keep_below) (GdkSurface *surface,
gboolean setting);
- GdkSurface * (* get_group) (GdkSurface *window);
- void (* set_group) (GdkSurface *window,
+ GdkSurface * (* get_group) (GdkSurface *surface);
+ void (* set_group) (GdkSurface *surface,
GdkSurface *leader);
- void (* set_decorations) (GdkSurface *window,
+ void (* set_decorations) (GdkSurface *surface,
GdkWMDecoration decorations);
- gboolean (* get_decorations) (GdkSurface *window,
+ gboolean (* get_decorations) (GdkSurface *surface,
GdkWMDecoration *decorations);
- void (* set_functions) (GdkSurface *window,
+ void (* set_functions) (GdkSurface *surface,
GdkWMFunction functions);
- void (* begin_resize_drag) (GdkSurface *window,
+ void (* begin_resize_drag) (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp);
- void (* begin_move_drag) (GdkSurface *window,
+ void (* begin_move_drag) (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp);
- void (* enable_synchronized_configure) (GdkSurface *window);
- void (* configure_finished) (GdkSurface *window);
- void (* set_opacity) (GdkSurface *window,
+ void (* enable_synchronized_configure) (GdkSurface *surface);
+ void (* configure_finished) (GdkSurface *surface);
+ void (* set_opacity) (GdkSurface *surface,
gdouble opacity);
- void (* destroy_notify) (GdkSurface *window);
- void (* register_dnd) (GdkSurface *window);
- GdkDragContext * (*drag_begin) (GdkSurface *window,
+ void (* destroy_notify) (GdkSurface *surface);
+ void (* register_dnd) (GdkSurface *surface);
+ GdkDragContext * (*drag_begin) (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider*content,
GdkDragAction actions,
gint dx,
gint dy);
- void (*process_updates_recurse) (GdkSurface *window,
+ void (*process_updates_recurse) (GdkSurface *surface,
cairo_region_t *region);
- gint (* get_scale_factor) (GdkSurface *window);
- void (* get_unscaled_size) (GdkSurface *window,
+ gint (* get_scale_factor) (GdkSurface *surface);
+ void (* get_unscaled_size) (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height);
- void (* set_opaque_region) (GdkSurface *window,
+ void (* set_opaque_region) (GdkSurface *surface,
cairo_region_t *region);
- void (* set_shadow_width) (GdkSurface *window,
+ void (* set_shadow_width) (GdkSurface *surface,
gint left,
gint right,
gint top,
gint bottom);
- gboolean (* show_window_menu) (GdkSurface *window,
+ gboolean (* show_window_menu) (GdkSurface *surface,
GdkEvent *event);
- GdkGLContext *(*create_gl_context) (GdkSurface *window,
+ GdkGLContext *(*create_gl_context) (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error);
- gboolean (* supports_edge_constraints)(GdkSurface *window);
+ gboolean (* supports_edge_constraints)(GdkSurface *surface);
};
/* Interface Functions */
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index aeb38edb79..d4e3623309 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -57,7 +57,7 @@
* GDK_PARENT_RELATIVE:
*
* A special value, indicating that the background
- * for a window should be inherited from the parent window.
+ * for a surface should be inherited from the parent surface.
*/
#define GDK_PARENT_RELATIVE 1L
@@ -317,7 +317,7 @@ typedef enum
* @GDK_GRAB_ALREADY_GRABBED: the resource is actively grabbed by another client.
* @GDK_GRAB_INVALID_TIME: the resource was grabbed more recently than the
* specified time.
- * @GDK_GRAB_NOT_VIEWABLE: the grab window or the @confine_to window are not
+ * @GDK_GRAB_NOT_VIEWABLE: the grab surface or the @confine_to surface are not
* viewable.
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
* @GDK_GRAB_FAILED: the grab failed for some other reason. Since 3.16
@@ -338,7 +338,7 @@ typedef enum
/**
* GdkGrabOwnership:
* @GDK_OWNERSHIP_NONE: All other devices’ events are allowed.
- * @GDK_OWNERSHIP_WINDOW: Other devices’ events are blocked for the grab window.
+ * @GDK_OWNERSHIP_SURFACE: Other devices’ events are blocked for the grab surface.
* @GDK_OWNERSHIP_APPLICATION: Other devices’ events are blocked for the whole application.
*
* Defines how device grabs interact with other devices.
@@ -346,7 +346,7 @@ typedef enum
typedef enum
{
GDK_OWNERSHIP_NONE,
- GDK_OWNERSHIP_WINDOW,
+ GDK_OWNERSHIP_SURFACE,
GDK_OWNERSHIP_APPLICATION
} GdkGrabOwnership;
@@ -362,15 +362,15 @@ typedef enum
* @GDK_BUTTON_RELEASE_MASK: receive button release events
* @GDK_KEY_PRESS_MASK: receive key press events
* @GDK_KEY_RELEASE_MASK: receive key release events
- * @GDK_ENTER_NOTIFY_MASK: receive window enter events
- * @GDK_LEAVE_NOTIFY_MASK: receive window leave events
+ * @GDK_ENTER_NOTIFY_MASK: receive surface enter events
+ * @GDK_LEAVE_NOTIFY_MASK: receive surface leave events
* @GDK_FOCUS_CHANGE_MASK: receive focus change events
- * @GDK_STRUCTURE_MASK: receive events about window configuration change
+ * @GDK_STRUCTURE_MASK: receive events about surface configuration change
* @GDK_PROPERTY_CHANGE_MASK: receive property change events
* @GDK_PROXIMITY_IN_MASK: receive proximity in events
* @GDK_PROXIMITY_OUT_MASK: receive proximity out events
- * @GDK_SUBSTRUCTURE_MASK: receive events about window configuration changes of
- * child windows
+ * @GDK_SUBSTRUCTURE_MASK: receive events about surface configuration changes of
+ * child surfaces
* @GDK_SCROLL_MASK: receive scroll events
* @GDK_TOUCH_MASK: receive touch events. Since 3.4
* @GDK_SMOOTH_SCROLL_MASK: receive smooth scrolling events. Since 3.4
@@ -378,7 +378,7 @@ typedef enum
* @GDK_TABLET_PAD_MASK: receive tablet pad events. Since 3.22
* @GDK_ALL_EVENTS_MASK: the combination of all the above event masks.
*
- * A set of bit-flags to indicate which events a window is to receive.
+ * A set of bit-flags to indicate which events a surface is to receive.
* Most of these masks map onto one or more of the #GdkEventType event types
* above.
*
@@ -390,7 +390,7 @@ typedef enum
* gdk_surface_set_event_compression(). See the documentation of that function
* for details.
*
- * If %GDK_TOUCH_MASK is enabled, the window will receive touch events
+ * If %GDK_TOUCH_MASK is enabled, the surface will receive touch events
* from touch-enabled devices. Those will come as sequences of #GdkEventTouch
* with type %GDK_TOUCH_UPDATE, enclosed by two events with
* type %GDK_TOUCH_BEGIN and %GDK_TOUCH_END (or %GDK_TOUCH_CANCEL).
@@ -449,7 +449,7 @@ typedef enum {
* GdkVulkanError:
* @GDK_VULKAN_ERROR_UNSUPPORTED: Vulkan is not supported on this backend or has not been
* compiled in.
- * @GDK_VULKAN_ERROR_NOT_AVAILABLE: Vulkan support is not available on this Window
+ * @GDK_VULKAN_ERROR_NOT_AVAILABLE: Vulkan support is not available on this Surface
*
* Error enumeration for #GdkVulkanContext.
*
diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c
index fcb82f3b87..ba2c44b5c9 100644
--- a/gdk/gdkvulkancontext.c
+++ b/gdk/gdkvulkancontext.c
@@ -38,7 +38,7 @@
*
* #GdkVulkanContexts are created for a #GdkSurface using
* gdk_surface_create_vulkan_context(), and the context will match the
- * the characteristics of the window.
+ * the characteristics of the surface.
*
* Support for #GdkVulkanContext is platform-specific, context creation
* can fail, returning %NULL context.
@@ -250,7 +250,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
GError **error)
{
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
- GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
VkSurfaceCapabilitiesKHR capabilities;
VkCompositeAlphaFlagBitsKHR composite_alpha;
VkSwapchainKHR new_swapchain;
@@ -258,8 +258,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
VkDevice device;
guint i;
- if (gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_width &&
- gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_height)
+ if (gdk_surface_get_width (surface) * gdk_surface_get_scale_factor (surface) == priv->swapchain_width &&
+ gdk_surface_get_height (surface) * gdk_surface_get_scale_factor (surface) == priv->swapchain_height)
return TRUE;
device = gdk_vulkan_context_get_device (context);
@@ -291,12 +291,12 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
/*
* Per https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkSurfaceCapabilitiesKHR
* the current extent may assume a special value, meaning that the extend should assume whatever
- * value the window has.
+ * value the surface has.
*/
if (capabilities.currentExtent.width == -1 || capabilities.currentExtent.height == -1)
{
- capabilities.currentExtent.width = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window);
- capabilities.currentExtent.height = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window);
+ capabilities.currentExtent.width = gdk_surface_get_width (surface) * gdk_surface_get_scale_factor (surface);
+ capabilities.currentExtent.height = gdk_surface_get_height (surface) * gdk_surface_get_scale_factor (surface);
}
res = GDK_VK_CHECK (vkCreateSwapchainKHR, device,
@@ -361,15 +361,15 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
{
priv->regions[i] = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
0, 0,
- gdk_surface_get_width (window),
- gdk_surface_get_height (window),
+ gdk_surface_get_width (surface),
+ gdk_surface_get_height (surface),
});
}
}
else
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
- "Could not create swapchain for this window: %s", gdk_vulkan_strerror (res));
+ "Could not create swapchain for this surface: %s", gdk_vulkan_strerror (res));
priv->swapchain = VK_NULL_HANDLE;
priv->swapchain_width = 0;
priv->swapchain_height = 0;
@@ -457,7 +457,7 @@ gdk_vulkan_context_class_init (GdkVulkanContextClass *klass)
*
* This signal is emitted when the images managed by this context have
* changed. Usually this means that the swapchain had to be recreated,
- * for example in response to a change of the window size.
+ * for example in response to a change of the surface size.
*/
signals[IMAGES_UPDATED] =
g_signal_new (g_intern_static_string ("images-updated"),
@@ -493,7 +493,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
- "Could not create surface for this window: %s", gdk_vulkan_strerror (res));
+ "Could not create surface for this surface: %s", gdk_vulkan_strerror (res));
return FALSE;
}
@@ -504,7 +504,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
- "Could not check if queue family supports this window: %s", gdk_vulkan_strerror (res));
+ "Could not check if queue family supports this surface: %s", gdk_vulkan_strerror (res));
}
else if (!supported)
{
@@ -706,7 +706,7 @@ gdk_vulkan_context_get_image (GdkVulkanContext *context,
* Gets the index of the image that is currently being drawn.
*
* This function can only be used between gdk_surface_begin_draw_frame() and
- * gdk_surface_end_draw_frame() calls for the toplevel window that the
+ * gdk_surface_end_draw_frame() calls for the toplevel surface that the
* @context is associated with.
*
* Returns: the index of the images that is being drawn
@@ -730,7 +730,7 @@ gdk_vulkan_context_get_draw_index (GdkVulkanContext *context)
* currently being drawn.
*
* This function can only be used between gdk_surface_begin_draw_frame() and
- * gdk_surface_end_draw_frame() calls for the toplevel window that the
+ * gdk_surface_end_draw_frame() calls for the toplevel surface that the
* @context is associated with.
*
* Returns: (transfer none): the VkSemaphore
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index f17f27c4a0..e84104512f 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -150,8 +150,8 @@ fixup_event (GdkEvent *event)
g_object_ref (event->any.window);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
- (event->crossing.subwindow != NULL))
- g_object_ref (event->crossing.subwindow);
+ (event->crossing.child_window != NULL))
+ g_object_ref (event->crossing.child_window);
event->any.send_event = FALSE;
}
@@ -866,7 +866,7 @@ fill_crossing_event (GdkSurface *toplevel,
event->any.type = event_type;
event->crossing.window = toplevel;
- event->crossing.subwindow = NULL;
+ event->crossing.child_window = NULL;
event->crossing.time = get_time_from_ns_event (nsevent);
event->crossing.x = x;
event->crossing.y = y;
@@ -1684,8 +1684,8 @@ gdk_event_translate (GdkEvent *event,
g_object_ref (event->any.window);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
- (event->crossing.subwindow != NULL))
- g_object_ref (event->crossing.subwindow);
+ (event->crossing.child_window != NULL))
+ g_object_ref (event->crossing.child_window);
}
else
{
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 725a991cd4..faa41a5d46 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -69,7 +69,7 @@ struct _GdkWaylandTouchData
uint32_t id;
gdouble x;
gdouble y;
- GdkSurface *window;
+ GdkSurface *surface;
uint32_t touch_down_serial;
guint initial_touch : 1;
};
@@ -96,7 +96,7 @@ struct _GdkWaylandPointerData {
uint32_t enter_serial;
uint32_t press_serial;
- GdkSurface *grab_window;
+ GdkSurface *grab_surface;
uint32_t grab_time;
struct wl_surface *pointer_surface;
@@ -221,7 +221,7 @@ struct _GdkWaylandSeat
GdkModifierType key_modifiers;
GdkSurface *keyboard_focus;
- GdkSurface *grab_window;
+ GdkSurface *grab_surface;
uint32_t grab_time;
gboolean have_server_repeat;
uint32_t server_repeat_rate;
@@ -242,7 +242,7 @@ struct _GdkWaylandSeat
GdkDragContext *drop_context;
/* Source/dest for non-local dnd */
- GdkSurface *foreign_dnd_window;
+ GdkSurface *foreign_dnd_surface;
/* Some tracking on gesture events */
guint gesture_n_fingers;
@@ -298,7 +298,7 @@ static void deliver_key_event (GdkWaylandSeat *seat,
static gboolean
gdk_wayland_device_get_history (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -309,13 +309,13 @@ gdk_wayland_device_get_history (GdkDevice *device,
static void
gdk_wayland_device_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x, y;
- gdk_surface_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
if (axes)
{
@@ -470,7 +470,7 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
static void
gdk_wayland_device_set_surface_cursor (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
@@ -562,8 +562,8 @@ device_get_modifiers (GdkDevice *device)
static void
gdk_wayland_device_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -573,16 +573,16 @@ gdk_wayland_device_query_state (GdkDevice *device,
GdkWaylandPointerData *pointer;
GList *children;
- if (window == NULL)
- children = gdk_wayland_display_get_toplevel_windows (gdk_device_get_display (device));
+ if (surface == NULL)
+ children = gdk_wayland_display_get_toplevel_surfaces (gdk_device_get_display (device));
else
- children = window->children;
+ children = surface->children;
pointer = GDK_WAYLAND_DEVICE (device)->pointer;
- if (child_window)
- /* Set child only if actually a child of the given window, as XIQueryPointer() does */
- *child_window = g_list_find (children, pointer->focus) ? pointer->focus : NULL;
+ if (child_surface)
+ /* Set child only if actually a child of the given surface, as XIQueryPointer() does */
+ *child_surface = g_list_find (children, pointer->focus) ? pointer->focus : NULL;
if (mask)
*mask = device_get_modifiers (device);
@@ -590,8 +590,8 @@ gdk_wayland_device_query_state (GdkDevice *device,
}
static void
-emulate_crossing (GdkSurface *window,
- GdkSurface *subwindow,
+emulate_crossing (GdkSurface *surface,
+ GdkSurface *child_surface,
GdkDevice *device,
GdkEventType type,
GdkCrossingMode mode,
@@ -600,26 +600,26 @@ emulate_crossing (GdkSurface *window,
GdkEvent *event;
event = gdk_event_new (type);
- event->any.window = window ? g_object_ref (window) : NULL;
- event->crossing.subwindow = subwindow ? g_object_ref (subwindow) : NULL;
+ event->any.surface = surface ? g_object_ref (surface) : NULL;
+ event->crossing.child_surface = child_surface ? g_object_ref (child_surface) : NULL;
event->crossing.time = time_;
event->crossing.mode = mode;
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
- gdk_surface_get_device_position_double (window, device,
+ gdk_surface_get_device_position_double (surface, device,
&event->crossing.x, &event->crossing.y,
&event->crossing.state);
event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y;
- _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
-emulate_touch_crossing (GdkSurface *window,
- GdkSurface *subwindow,
+emulate_touch_crossing (GdkSurface *surface,
+ GdkSurface *child_surface,
GdkDevice *device,
GdkDevice *source,
GdkWaylandTouchData *touch,
@@ -630,8 +630,8 @@ emulate_touch_crossing (GdkSurface *window,
GdkEvent *event;
event = gdk_event_new (type);
- event->any.window = window ? g_object_ref (window) : NULL;
- event->crossing.subwindow = subwindow ? g_object_ref (subwindow) : NULL;
+ event->any.surface = surface ? g_object_ref (surface) : NULL;
+ event->crossing.child_surface = child_surface ? g_object_ref (child_surface) : NULL;
event->crossing.time = time_;
event->crossing.mode = mode;
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
@@ -643,11 +643,11 @@ emulate_touch_crossing (GdkSurface *window,
event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y;
- _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
-emulate_focus (GdkSurface *window,
+emulate_focus (GdkSurface *surface,
GdkDevice *device,
gboolean focus_in,
guint32 time_)
@@ -655,12 +655,12 @@ emulate_focus (GdkSurface *window,
GdkEvent *event;
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->focus_change.in = focus_in;
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
- _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
@@ -707,7 +707,7 @@ gdk_wayland_device_get_focus (GdkDevice *device)
static GdkGrabStatus
gdk_wayland_device_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -718,29 +718,29 @@ gdk_wayland_device_grab (GdkDevice *device,
GdkSurface *prev_focus = gdk_wayland_device_get_focus (device);
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
- if (gdk_surface_get_surface_type (window) == GDK_SURFACE_TEMP &&
- gdk_surface_is_visible (window))
+ if (gdk_surface_get_surface_type (surface) == GDK_SURFACE_TEMP &&
+ gdk_surface_is_visible (surface))
{
- g_warning ("Window %p is already mapped at the time of grabbing. "
+ g_warning ("Surface %p is already mapped at the time of grabbing. "
"gdk_seat_grab() should be used to simultanously grab input "
"and show this popup. You may find oddities ahead.",
- window);
+ surface);
}
- if (prev_focus != window)
- device_emit_grab_crossing (device, prev_focus, window, GDK_CROSSING_GRAB, time_);
+ if (prev_focus != surface)
+ device_emit_grab_crossing (device, prev_focus, surface, GDK_CROSSING_GRAB, time_);
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
{
/* Device is a keyboard */
- gdk_wayland_surface_inhibit_shortcuts (window,
+ gdk_wayland_surface_inhibit_shortcuts (surface,
gdk_device_get_seat (device));
return GDK_GRAB_SUCCESS;
}
else
{
/* Device is a pointer */
- if (pointer->grab_window != NULL &&
+ if (pointer->grab_surface != NULL &&
time_ != 0 && pointer->grab_time > time_)
{
return GDK_GRAB_ALREADY_GRABBED;
@@ -749,9 +749,9 @@ gdk_wayland_device_grab (GdkDevice *device,
if (time_ == 0)
time_ = pointer->time;
- pointer->grab_window = window;
+ pointer->grab_surface = surface;
pointer->grab_time = time_;
- _gdk_wayland_surface_set_grab_seat (window, GDK_SEAT (wayland_seat));
+ _gdk_wayland_surface_set_grab_seat (surface, GDK_SEAT (wayland_seat));
g_clear_object (&wayland_seat->cursor);
@@ -780,7 +780,7 @@ gdk_wayland_device_ungrab (GdkDevice *device,
if (grab)
{
grab->serial_end = grab->serial_start;
- prev_focus = grab->window;
+ prev_focus = grab->surface;
}
focus = gdk_wayland_device_get_focus (device);
@@ -800,8 +800,8 @@ gdk_wayland_device_ungrab (GdkDevice *device,
/* Device is a pointer */
gdk_wayland_device_update_surface_cursor (device);
- if (pointer->grab_window)
- _gdk_wayland_surface_set_grab_seat (pointer->grab_window,
+ if (pointer->grab_surface)
+ _gdk_wayland_surface_set_grab_seat (pointer->grab_surface,
NULL);
}
}
@@ -832,7 +832,7 @@ gdk_wayland_device_surface_at_position (GdkDevice *device,
static void
gdk_wayland_device_select_surface_events (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
}
@@ -1095,7 +1095,7 @@ data_device_enter (void *data,
gdk_wayland_drop_context_update_targets (seat->drop_context);
- dnd_owner = seat->foreign_dnd_window;
+ dnd_owner = seat->foreign_dnd_surface;
_gdk_wayland_drag_context_set_source_surface (seat->drop_context, dnd_owner);
@@ -1212,7 +1212,7 @@ create_scroll_event (GdkWaylandSeat *seat,
GdkEvent *event;
event = gdk_event_new (GDK_SCROLL);
- event->any.window = g_object_ref (pointer_info->focus);
+ event->any.surface = g_object_ref (pointer_info->focus);
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, source_device);
event->scroll.time = pointer_info->time;
@@ -1372,10 +1372,10 @@ pointer_handle_enter (void *data,
seat->pointer_info.enter_serial = serial;
event = gdk_wayland_seat_get_frame_event (seat, GDK_ENTER_NOTIFY);
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
- event->crossing.subwindow = NULL;
+ event->crossing.child_surface = NULL;
event->crossing.time = (guint32)(g_get_monotonic_time () / 1000);
event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
@@ -1420,10 +1420,10 @@ pointer_handle_leave (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
event = gdk_wayland_seat_get_frame_event (seat, GDK_LEAVE_NOTIFY);
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
- event->crossing.subwindow = NULL;
+ event->crossing.child_surface = NULL;
event->crossing.time = (guint32)(g_get_monotonic_time () / 1000);
event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
@@ -1470,7 +1470,7 @@ pointer_handle_motion (void *data,
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
event = gdk_wayland_seat_get_frame_event (seat, GDK_MOTION_NOTIFY);
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
event->motion.time = time;
@@ -1536,7 +1536,7 @@ pointer_handle_button (void *data,
event = gdk_wayland_seat_get_frame_event (seat,
state ? GDK_BUTTON_PRESS :
GDK_BUTTON_RELEASE);
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
event->button.time = time;
@@ -1781,7 +1781,7 @@ keyboard_handle_enter (void *data,
seat->repeat_key = 0;
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (seat->keyboard_focus);
+ event->any.surface = g_object_ref (seat->keyboard_focus);
event->any.send_event = FALSE;
event->focus_change.in = TRUE;
gdk_event_set_device (event, seat->master_keyboard);
@@ -1811,14 +1811,14 @@ keyboard_handle_leave (void *data,
/* gdk_surface_is_destroyed() might already return TRUE for
* seat->keyboard_focus here, which would happen if we destroyed the
- * window before loosing keyboard focus.
+ * surface before loosing keyboard focus.
*/
stop_key_repeat (seat);
_gdk_wayland_display_update_serial (display, serial);
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (seat->keyboard_focus);
+ event->any.surface = g_object_ref (seat->keyboard_focus);
event->any.send_event = FALSE;
event->focus_change.in = FALSE;
gdk_event_set_device (event, seat->master_keyboard);
@@ -2008,7 +2008,7 @@ deliver_key_event (GdkWaylandSeat *seat,
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
event = gdk_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
- event->any.window = seat->keyboard_focus ? g_object_ref (seat->keyboard_focus) : NULL;
+ event->any.surface = seat->keyboard_focus ? g_object_ref (seat->keyboard_focus) : NULL;
gdk_event_set_device (event, seat->master_keyboard);
gdk_event_set_source_device (event, seat->keyboard);
event->key.time = time_;
@@ -2181,7 +2181,7 @@ gdk_wayland_seat_add_touch (GdkWaylandSeat *seat,
touch = g_new0 (GdkWaylandTouchData, 1);
touch->id = id;
- touch->window = wl_surface_get_user_data (surface);
+ touch->surface = wl_surface_get_user_data (surface);
touch->initial_touch = (g_hash_table_size (seat->touches) == 0);
g_hash_table_insert (seat->touches, GUINT_TO_POINTER (id), touch);
@@ -2213,7 +2213,7 @@ _create_touch_event (GdkWaylandSeat *seat,
GdkEvent *event;
event = gdk_event_new (evtype);
- event->any.window = g_object_ref (touch->window);
+ event->any.surface = g_object_ref (touch->surface);
gdk_event_set_device (event, seat->touch_master);
gdk_event_set_source_device (event, seat->touch);
event->touch.time = time;
@@ -2227,7 +2227,7 @@ _create_touch_event (GdkWaylandSeat *seat,
event->touch.emulating_pointer = TRUE;
}
- gdk_surface_get_root_coords (touch->window,
+ gdk_surface_get_root_coords (touch->surface,
touch->x, touch->y,
&x_root, &y_root);
@@ -2246,7 +2246,7 @@ mimic_pointer_emulating_touch_info (GdkDevice *device,
GdkWaylandPointerData *pointer;
pointer = GDK_WAYLAND_DEVICE (device)->pointer;
- g_set_object (&pointer->focus, touch->window);
+ g_set_object (&pointer->focus, touch->surface);
pointer->press_serial = pointer->enter_serial = touch->touch_down_serial;
pointer->surface_x = touch->x;
pointer->surface_y = touch->y;
@@ -2261,7 +2261,7 @@ touch_handle_master_pointer_crossing (GdkWaylandSeat *seat,
pointer = GDK_WAYLAND_DEVICE (seat->touch_master)->pointer;
- if (pointer->focus == touch->window)
+ if (pointer->focus == touch->surface)
return;
if (pointer->focus)
@@ -2271,9 +2271,9 @@ touch_handle_master_pointer_crossing (GdkWaylandSeat *seat,
GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, time);
}
- if (touch->window)
+ if (touch->surface)
{
- emulate_touch_crossing (touch->window, NULL,
+ emulate_touch_crossing (touch->surface, NULL,
seat->touch_master, seat->touch, touch,
GDK_ENTER_NOTIFY, GDK_CROSSING_NORMAL, time);
}
@@ -2422,7 +2422,7 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
event = gdk_event_new (GDK_TOUCHPAD_SWIPE);
event->touchpad_swipe.phase = phase;
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
event->touchpad_swipe.time = _time;
@@ -2523,7 +2523,7 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
event = gdk_event_new (GDK_TOUCHPAD_PINCH);
event->touchpad_pinch.phase = phase;
- event->any.window = g_object_ref (seat->pointer_info.focus);
+ event->any.surface = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
event->touchpad_pinch.time = _time;
@@ -3251,7 +3251,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
}
if (event->any.type == GDK_PROXIMITY_OUT)
- emulate_crossing (event->any.window, NULL,
+ emulate_crossing (event->any.surface, NULL,
tablet->master, GDK_LEAVE_NOTIFY,
GDK_CROSSING_NORMAL, time);
@@ -3259,7 +3259,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
event);
if (event->any.type == GDK_PROXIMITY_IN)
- emulate_crossing (event->any.window, NULL,
+ emulate_crossing (event->any.surface, NULL,
tablet->master, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, time);
}
@@ -3364,18 +3364,18 @@ tablet_tool_handle_proximity_in (void *data,
struct zwp_tablet_tool_v2 *wp_tablet_tool,
uint32_t serial,
struct zwp_tablet_v2 *wp_tablet,
- struct wl_surface *surface)
+ struct wl_surface *wsurface)
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
- GdkSurface *window = wl_surface_get_user_data (surface);
+ GdkSurface *surface = wl_surface_get_user_data (wsurface);
GdkEvent *event;
if (!surface)
return;
- if (!GDK_IS_SURFACE (window))
+ if (!GDK_IS_SURFACE (surface))
return;
tool->current_tablet = tablet;
@@ -3384,7 +3384,7 @@ tablet_tool_handle_proximity_in (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
tablet->pointer_info.enter_serial = serial;
- tablet->pointer_info.focus = g_object_ref (window);
+ tablet->pointer_info.focus = g_object_ref (surface);
tablet->current_device =
tablet_select_device_for_tool (tablet, tool->tool);
@@ -3393,7 +3393,7 @@ tablet_tool_handle_proximity_in (void *data,
gdk_wayland_mimic_device_axes (tablet->master, tablet->current_device);
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_PROXIMITY_IN);
- event->any.window = g_object_ref (tablet->pointer_info.focus);
+ event->any.surface = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
@@ -3418,7 +3418,7 @@ tablet_tool_handle_proximity_out (void *data,
gdk_device_tool_get_tool_type (tool->tool)));
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_PROXIMITY_OUT);
- event->any.window = g_object_ref (tablet->pointer_info.focus);
+ event->any.surface = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
@@ -3442,7 +3442,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
GdkEvent *event;
event = gdk_wayland_tablet_get_frame_event (tablet, evtype);
- event->any.window = g_object_ref (tablet->pointer_info.focus);
+ event->any.surface = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tablet->current_tool->tool);
@@ -3512,7 +3512,7 @@ tablet_tool_handle_motion (void *data,
tablet->pointer_info.surface_y));
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_MOTION_NOTIFY);
- event->any.window = g_object_ref (tablet->pointer_info.focus);
+ event->any.surface = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
@@ -3798,7 +3798,7 @@ tablet_pad_ring_handle_frame (void *data,
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
event = gdk_event_new (GDK_PAD_RING);
- g_set_object (&event->any.window, seat->keyboard_focus);
+ g_set_object (&event->any.surface, seat->keyboard_focus);
event->pad_axis.time = time;
event->pad_axis.group = g_list_index (pad->mode_groups, group);
event->pad_axis.index = g_list_index (pad->rings, wp_tablet_pad_ring);
@@ -3880,7 +3880,7 @@ tablet_pad_strip_handle_frame (void *data,
wp_tablet_pad_strip));
event = gdk_event_new (GDK_PAD_STRIP);
- g_set_object (&event->any.window, seat->keyboard_focus);
+ g_set_object (&event->any.surface, seat->keyboard_focus);
event->pad_axis.time = time;
event->pad_axis.group = g_list_index (pad->mode_groups, group);
event->pad_axis.index = g_list_index (pad->strips, wp_tablet_pad_strip);
@@ -4016,7 +4016,7 @@ tablet_pad_group_handle_mode (void *data,
n_group = g_list_index (pad->mode_groups, group);
event = gdk_event_new (GDK_PAD_GROUP_MODE);
- g_set_object (&event->any.window, seat->keyboard_focus);
+ g_set_object (&event->any.surface, seat->keyboard_focus);
event->pad_group_mode.group = n_group;
event->pad_group_mode.mode = mode;
event->pad_group_mode.time = time;
@@ -4136,7 +4136,7 @@ tablet_pad_handle_button (void *data,
event = gdk_event_new (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ?
GDK_PAD_BUTTON_PRESS :
GDK_PAD_BUTTON_RELEASE);
- g_set_object (&event->any.window, seat->keyboard_focus);
+ g_set_object (&event->any.surface, seat->keyboard_focus);
event->pad_button.button = button;
event->pad_button.group = n_group;
event->pad_button.mode = group->current_mode;
@@ -4387,7 +4387,7 @@ static const struct wl_surface_listener pointer_surface_listener = {
};
static GdkSurface *
-create_foreign_dnd_window (GdkDisplay *display)
+create_foreign_dnd_surface (GdkDisplay *display)
{
return gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 });
}
@@ -4425,7 +4425,7 @@ gdk_wayland_seat_finalize (GObject *object)
g_clear_object (&seat->clipboard);
g_clear_object (&seat->primary_clipboard);
g_hash_table_destroy (seat->touches);
- gdk_surface_destroy (seat->foreign_dnd_window);
+ gdk_surface_destroy (seat->foreign_dnd_surface);
zwp_tablet_seat_v2_destroy (seat->wp_tablet_seat);
stop_key_repeat (seat);
@@ -4449,29 +4449,29 @@ gdk_wayland_seat_get_capabilities (GdkSeat *seat)
}
static void
-gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat,
- GdkSurface *window)
+gdk_wayland_seat_set_grab_surface (GdkWaylandSeat *seat,
+ GdkSurface *surface)
{
- if (seat->grab_window)
+ if (seat->grab_surface)
{
- _gdk_wayland_surface_set_grab_seat (seat->grab_window, NULL);
- g_object_remove_weak_pointer (G_OBJECT (seat->grab_window),
- (gpointer *) &seat->grab_window);
- seat->grab_window = NULL;
+ _gdk_wayland_surface_set_grab_seat (seat->grab_surface, NULL);
+ g_object_remove_weak_pointer (G_OBJECT (seat->grab_surface),
+ (gpointer *) &seat->grab_surface);
+ seat->grab_surface = NULL;
}
- if (window)
+ if (surface)
{
- seat->grab_window = window;
- g_object_add_weak_pointer (G_OBJECT (window),
- (gpointer *) &seat->grab_window);
- _gdk_wayland_surface_set_grab_seat (window, GDK_SEAT (seat));
+ seat->grab_surface = surface;
+ g_object_add_weak_pointer (G_OBJECT (surface),
+ (gpointer *) &seat->grab_surface);
+ _gdk_wayland_surface_set_grab_seat (surface, GDK_SEAT (seat));
}
}
static GdkGrabStatus
gdk_wayland_seat_grab (GdkSeat *seat,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
@@ -4485,22 +4485,22 @@ gdk_wayland_seat_grab (GdkSeat *seat,
GdkSurface *native;
GList *l;
- native = gdk_surface_get_toplevel (window);
+ native = gdk_surface_get_toplevel (surface);
if (native == NULL || GDK_SURFACE_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE;
- gdk_wayland_seat_set_grab_window (wayland_seat, native);
+ gdk_wayland_seat_set_grab_surface (wayland_seat, native);
wayland_seat->grab_time = evtime;
if (prepare_func)
- (prepare_func) (seat, window, prepare_func_data);
+ (prepare_func) (seat, surface, prepare_func_data);
- if (!gdk_surface_is_visible (window))
+ if (!gdk_surface_is_visible (surface))
{
- gdk_wayland_seat_set_grab_window (wayland_seat, NULL);
- g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc",
- window);
+ gdk_wayland_seat_set_grab_surface (wayland_seat, NULL);
+ g_critical ("Surface %p has not been made visible in GdkSeatGrabPrepareFunc",
+ surface);
return GDK_GRAB_NOT_VIEWABLE;
}
@@ -4515,7 +4515,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
_gdk_display_add_device_grab (display,
wayland_seat->master_pointer,
- window,
+ surface,
native,
GDK_OWNERSHIP_NONE,
owner_events,
@@ -4540,7 +4540,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
_gdk_display_add_device_grab (display,
wayland_seat->touch_master,
- window,
+ surface,
native,
GDK_OWNERSHIP_NONE,
owner_events,
@@ -4561,7 +4561,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
_gdk_display_add_device_grab (display,
wayland_seat->master_keyboard,
- window,
+ surface,
native,
GDK_OWNERSHIP_NONE,
owner_events,
@@ -4572,7 +4572,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
/* Inhibit shortcuts if the seat grab is for the keyboard only */
if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD)
- gdk_wayland_surface_inhibit_shortcuts (window, seat);
+ gdk_wayland_surface_inhibit_shortcuts (surface, seat);
}
if (wayland_seat->tablets &&
@@ -4589,7 +4589,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
_gdk_display_add_device_grab (display,
tablet->master,
- window,
+ surface,
native,
GDK_OWNERSHIP_NONE,
owner_events,
@@ -4615,7 +4615,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
g_clear_object (&wayland_seat->grab_cursor);
- gdk_wayland_seat_set_grab_window (wayland_seat, NULL);
+ gdk_wayland_seat_set_grab_surface (wayland_seat, NULL);
if (wayland_seat->master_pointer)
{
@@ -4626,7 +4626,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
if (grab)
{
grab->serial_end = grab->serial_start;
- prev_focus = grab->window;
+ prev_focus = grab->surface;
}
focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
@@ -4646,8 +4646,8 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
if (grab)
{
grab->serial_end = grab->serial_start;
- if (grab->window)
- gdk_wayland_surface_restore_shortcuts (grab->window, seat);
+ if (grab->surface)
+ gdk_wayland_surface_restore_shortcuts (grab->surface, seat);
}
}
@@ -4795,7 +4795,7 @@ _gdk_wayland_display_create_seat (GdkWaylandDisplay *display_wayland,
seat->keymap = _gdk_wayland_keymap_new (display);
seat->display = display;
seat->touches = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_free);
- seat->foreign_dnd_window = create_foreign_dnd_window (display);
+ seat->foreign_dnd_surface = create_foreign_dnd_surface (display);
seat->wl_seat = wl_seat;
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
@@ -4965,7 +4965,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
if (GDK_WAYLAND_DEVICE (seat->touch_master)->emulating_touch == touch)
{
GDK_WAYLAND_DEVICE (seat->touch_master)->emulating_touch = NULL;
- emulate_touch_crossing (touch->window, NULL,
+ emulate_touch_crossing (touch->surface, NULL,
seat->touch_master, seat->touch,
touch, GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL,
GDK_CURRENT_TIME);
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 3b57476ae9..2c35b65beb 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -996,7 +996,7 @@ gdk_wayland_display_init (GdkWaylandDisplay *display)
}
GList *
-gdk_wayland_display_get_toplevel_windows (GdkDisplay *display)
+gdk_wayland_display_get_toplevel_surfaces (GdkDisplay *display)
{
return GDK_WAYLAND_DISPLAY (display)->toplevels;
}
@@ -1847,7 +1847,7 @@ transform_to_string (int transform)
static void
update_scale (GdkDisplay *display)
{
- g_list_foreach (gdk_wayland_display_get_toplevel_windows (display),
+ g_list_foreach (gdk_wayland_display_get_toplevel_surfaces (display),
(GFunc)gdk_wayland_surface_update_scale,
NULL);
}
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index b9ea9dff71..c9893390af 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -47,8 +47,8 @@ typedef struct _GdkWaylandDragContextClass GdkWaylandDragContextClass;
struct _GdkWaylandDragContext
{
GdkDragContext context;
- GdkSurface *dnd_window;
- struct wl_surface *dnd_surface;
+ GdkSurface *dnd_surface;
+ struct wl_surface *dnd_wl_surface;
struct wl_data_source *data_source;
GdkDragAction selected_action;
uint32_t serial;
@@ -74,7 +74,7 @@ gdk_wayland_drag_context_finalize (GObject *object)
{
GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (object);
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
- GdkSurface *dnd_window;
+ GdkSurface *dnd_surface;
contexts = g_list_remove (contexts, context);
@@ -86,12 +86,12 @@ gdk_wayland_drag_context_finalize (GObject *object)
if (wayland_context->data_source)
wl_data_source_destroy (wayland_context->data_source);
- dnd_window = wayland_context->dnd_window;
+ dnd_surface = wayland_context->dnd_surface;
G_OBJECT_CLASS (gdk_wayland_drag_context_parent_class)->finalize (object);
- if (dnd_window)
- gdk_surface_destroy (dnd_window);
+ if (dnd_surface)
+ gdk_surface_destroy (dnd_surface);
}
void
@@ -99,7 +99,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
GdkEventType type,
guint32 time_)
{
- GdkSurface *window;
+ GdkSurface *surface;
GdkEvent *event;
switch ((guint) type)
@@ -114,19 +114,19 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
}
if (context->is_source)
- window = gdk_drag_context_get_source_surface (context);
+ surface = gdk_drag_context_get_source_surface (context);
else
- window = gdk_drag_context_get_dest_surface (context);
+ surface = gdk_drag_context_get_dest_surface (context);
event = gdk_event_new (type);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->dnd.context = g_object_ref (context);
event->dnd.time = time_;
event->dnd.x_root = GDK_WAYLAND_DRAG_CONTEXT (context)->x;
event->dnd.y_root = GDK_WAYLAND_DRAG_CONTEXT (context)->y;
gdk_event_set_device (event, gdk_drag_context_get_device (context));
- gdk_display_put_event (gdk_surface_get_display (window), event);
+ gdk_display_put_event (gdk_surface_get_display (surface), event);
g_object_unref (event);
}
@@ -363,7 +363,7 @@ gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland)
static GdkSurface *
gdk_wayland_drag_context_get_drag_surface (GdkDragContext *context)
{
- return GDK_WAYLAND_DRAG_CONTEXT (context)->dnd_window;
+ return GDK_WAYLAND_DRAG_CONTEXT (context)->dnd_surface;
}
static void
@@ -382,9 +382,9 @@ gdk_wayland_drag_context_set_hotspot (GdkDragContext *context,
if (prev_hot_x == hot_x && prev_hot_y == hot_y)
return;
- _gdk_wayland_surface_offset_next_wl_buffer (context_wayland->dnd_window,
+ _gdk_wayland_surface_offset_next_wl_buffer (context_wayland->dnd_surface,
-hot_x, -hot_y);
- gdk_surface_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE);
+ gdk_surface_invalidate_rect (context_wayland->dnd_surface, &damage_rect, FALSE);
}
static void
@@ -428,8 +428,8 @@ gdk_wayland_drag_context_drop_done (GdkDragContext *context,
if (success)
{
- if (context_wayland->dnd_window)
- gdk_surface_hide (context_wayland->dnd_window);
+ if (context_wayland->dnd_surface)
+ gdk_surface_hide (context_wayland->dnd_surface);
}
}
@@ -461,24 +461,24 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
}
void
-_gdk_wayland_surface_register_dnd (GdkSurface *window)
+_gdk_wayland_surface_register_dnd (GdkSurface *surface)
{
}
static GdkSurface *
-create_dnd_window (GdkDisplay *display)
+create_dnd_surface (GdkDisplay *display)
{
- GdkSurface *window;
+ GdkSurface *surface;
- window = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ surface = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_surface_set_type_hint (window, GDK_SURFACE_TYPE_HINT_DND);
+ gdk_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_DND);
- return window;
+ return surface;
}
GdkDragContext *
-_gdk_wayland_surface_drag_begin (GdkSurface *window,
+_gdk_wayland_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -498,15 +498,15 @@ _gdk_wayland_surface_drag_begin (GdkSurface *window,
"content", content,
NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
- context->source_surface = g_object_ref (window);
+ context->source_surface = g_object_ref (surface);
context->is_source = TRUE;
gdk_drag_context_set_device (context, device);
- context_wayland->dnd_window = create_dnd_window (gdk_surface_get_display (window));
- context_wayland->dnd_surface = gdk_wayland_surface_get_wl_surface (context_wayland->dnd_window);
+ context_wayland->dnd_surface = create_dnd_surface (gdk_surface_get_display (surface));
+ context_wayland->dnd_wl_surface = gdk_wayland_surface_get_wl_surface (context_wayland->dnd_surface);
context_wayland->data_source =
- gdk_wayland_selection_get_data_source (window);
+ gdk_wayland_selection_get_data_source (surface);
mimetypes = gdk_content_formats_get_mime_types (context->formats, &n_mimetypes);
for (i = 0; i < n_mimetypes; i++)
@@ -523,8 +523,8 @@ _gdk_wayland_surface_drag_begin (GdkSurface *window,
wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),
context_wayland->data_source,
- gdk_wayland_surface_get_wl_surface (window),
- context_wayland->dnd_surface,
+ gdk_wayland_surface_get_wl_surface (surface),
+ context_wayland->dnd_wl_surface,
_gdk_wayland_display_get_serial (display_wayland));
gdk_seat_ungrab (gdk_device_get_seat (device));
@@ -580,12 +580,12 @@ _gdk_wayland_drag_context_set_coords (GdkDragContext *context,
void
_gdk_wayland_drag_context_set_source_surface (GdkDragContext *context,
- GdkSurface *window)
+ GdkSurface *surface)
{
if (context->source_surface)
g_object_unref (context->source_surface);
- context->source_surface = window ? g_object_ref (window) : NULL;
+ context->source_surface = surface ? g_object_ref (surface) : NULL;
}
void
@@ -618,13 +618,13 @@ gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source)
}
GdkDragContext *
-gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *window)
+gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *surface)
{
GList *l;
for (l = contexts; l; l = l->next)
{
- if (window == gdk_drag_context_get_source_surface (l->data))
+ if (surface == gdk_drag_context_get_source_surface (l->data))
return l->data;
}
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index d3aa0d4a36..1e6f2ca28a 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -163,7 +163,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLSurface egl_surface;
- GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
int buffer_age = 0;
if (display_wayland->have_egl_buffer_age)
@@ -176,7 +176,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
shared = context;
shared_wayland = GDK_WAYLAND_GL_CONTEXT (shared);
- egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface,
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface,
shared_wayland->egl_config);
gdk_gl_context_make_current (shared);
eglQuerySurface (display_wayland->egl_display, egl_surface,
@@ -184,16 +184,16 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
if (buffer_age == 2)
{
- if (window->old_updated_area[0])
- return cairo_region_copy (window->old_updated_area[0]);
+ if (surface->old_updated_area[0])
+ return cairo_region_copy (surface->old_updated_area[0]);
}
else if (buffer_age == 3)
{
- if (window->old_updated_area[0] &&
- window->old_updated_area[1])
+ if (surface->old_updated_area[0] &&
+ surface->old_updated_area[1])
{
- cairo_region_t *damage = cairo_region_copy (window->old_updated_area[0]);
- cairo_region_union (damage, window->old_updated_area[1]);
+ cairo_region_t *damage = cairo_region_copy (surface->old_updated_area[0]);
+ cairo_region_union (damage, surface->old_updated_area[1]);
return damage;
}
}
@@ -208,8 +208,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
cairo_region_t *damage)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
- GdkSurface *window = gdk_gl_context_get_surface (context);
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkSurface *surface = gdk_gl_context_get_surface (context);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
EGLSurface egl_surface;
@@ -220,7 +220,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_gl_context_make_current (context);
- egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface,
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface,
context_wayland->egl_config);
if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL)
@@ -228,13 +228,13 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
int i, j, n_rects = cairo_region_num_rectangles (damage);
EGLint *rects = g_new (EGLint, n_rects * 4);
cairo_rectangle_int_t rect;
- int window_height = gdk_surface_get_height (window);
+ int surface_height = gdk_surface_get_height (surface);
for (i = 0, j = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (damage, i, &rect);
rects[j++] = rect.x;
- rects[j++] = window_height - rect.height - rect.y;
+ rects[j++] = surface_height - rect.height - rect.y;
rects[j++] = rect.width;
rects[j++] = rect.height;
}
@@ -244,7 +244,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
else
eglSwapBuffers (display_wayland->egl_display, egl_surface);
- gdk_wayland_surface_sync (window);
+ gdk_wayland_surface_sync (surface);
}
static void
@@ -360,11 +360,11 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
#define MAX_EGL_ATTRS 30
static gboolean
-find_eglconfig_for_surface (GdkSurface *window,
+find_eglconfig_for_surface (GdkSurface *surface,
EGLConfig *egl_config_out,
GError **error)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
@@ -418,12 +418,12 @@ find_eglconfig_for_surface (GdkSurface *window,
}
GdkGLContext *
-gdk_wayland_surface_create_gl_context (GdkSurface *window,
+gdk_wayland_surface_create_gl_context (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context;
EGLConfig config;
@@ -444,11 +444,11 @@ gdk_wayland_surface_create_gl_context (GdkSurface *window,
return NULL;
}
- if (!find_eglconfig_for_surface (window, &config, error))
+ if (!find_eglconfig_for_surface (surface, &config, error))
return NULL;
context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
- "window", window,
+ "surface", surface,
"shared-context", share,
NULL);
@@ -466,8 +466,8 @@ gdk_wayland_gl_context_dispose (GObject *gobject)
if (context_wayland->egl_context != NULL)
{
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
- GdkSurface *window = gdk_gl_context_get_surface (context);
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkSurface *surface = gdk_gl_context_get_surface (context);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (eglGetCurrentContext () == context_wayland->egl_context)
@@ -490,7 +490,7 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland;
- GdkSurface *window;
+ GdkSurface *surface;
EGLSurface egl_surface;
if (context == NULL)
@@ -501,16 +501,16 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
}
context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
- window = gdk_gl_context_get_surface (context);
+ surface = gdk_gl_context_get_surface (context);
if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)))
- egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_surface, context_wayland->egl_config);
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface, context_wayland->egl_config);
else
{
if (display_wayland->have_egl_surfaceless_context)
egl_surface = EGL_NO_SURFACE;
else
- egl_surface = gdk_wayland_surface_get_dummy_egl_surface (window->impl_surface,
+ egl_surface = gdk_wayland_surface_get_dummy_egl_surface (surface->impl_surface,
context_wayland->egl_config);
}
diff --git a/gdk/wayland/gdkglcontext-wayland.h b/gdk/wayland/gdkglcontext-wayland.h
index e402994979..48966b90ad 100644
--- a/gdk/wayland/gdkglcontext-wayland.h
+++ b/gdk/wayland/gdkglcontext-wayland.h
@@ -46,7 +46,7 @@ struct _GdkWaylandGLContextClass
};
gboolean gdk_wayland_display_init_gl (GdkDisplay *display);
-GdkGLContext * gdk_wayland_surface_create_gl_context (GdkSurface *window,
+GdkGLContext * gdk_wayland_surface_create_gl_context (GdkSurface *surface,
gboolean attach,
GdkGLContext *share,
GError **error);
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index b5fbce2d2d..5ef028c134 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -71,7 +71,7 @@ gboolean _gdk_wayland_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_wayland_display_supports_cursor_color (GdkDisplay *display);
void gdk_wayland_display_system_bell (GdkDisplay *display,
- GdkSurface *window);
+ GdkSurface *surface);
struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
GdkCursor *cursor,
@@ -88,22 +88,22 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint current_image_index,
guint *next_image_delay);
-void gdk_wayland_surface_sync (GdkSurface *window);
+void gdk_wayland_surface_sync (GdkSurface *surface);
-void _gdk_wayland_surface_register_dnd (GdkSurface *window);
-GdkDragContext *_gdk_wayland_surface_drag_begin (GdkSurface *window,
+void _gdk_wayland_surface_register_dnd (GdkSurface *surface);
+GdkDragContext *_gdk_wayland_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
gint dx,
gint dy);
-void _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *window,
+void _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface,
int x,
int y);
GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
struct wl_data_device *data_device);
void _gdk_wayland_drag_context_set_source_surface (GdkDragContext *context,
- GdkSurface *window);
+ GdkSurface *surface);
void _gdk_wayland_drag_context_set_dest_surface (GdkDragContext *context,
GdkSurface *dest_surface,
uint32_t serial);
@@ -118,13 +118,13 @@ void gdk_wayland_drag_context_set_action (GdkDragContext *context,
GdkDragAction action);
GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source);
-GdkDragContext * gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *window);
+GdkDragContext * gdk_wayland_drag_context_lookup_by_source_surface (GdkSurface *surface);
struct wl_data_source * gdk_wayland_drag_context_get_data_source (GdkDragContext *context);
void gdk_wayland_drop_context_update_targets (GdkDragContext *context);
void _gdk_wayland_display_create_surface_impl (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes);
@@ -166,7 +166,7 @@ GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *di
GdkDisplay *_gdk_wayland_display_open (const gchar *display_name);
-GList *gdk_wayland_display_get_toplevel_windows (GdkDisplay *display);
+GList *gdk_wayland_display_get_toplevel_surfaces (GdkDisplay *display);
int gdk_wayland_display_get_output_refresh_rate (GdkWaylandDisplay *display_wayland,
struct wl_output *output);
@@ -175,7 +175,7 @@ guint32 gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland
struct wl_output *gdk_wayland_display_get_wl_output (GdkDisplay *display,
int monitor_num);
-void _gdk_wayland_surface_set_grab_seat (GdkSurface *window,
+void _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
GdkSeat *seat);
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
@@ -210,24 +210,24 @@ void gdk_wayland_selection_unset_data_source (GdkDisplay *display);
gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
uint32_t actions);
-EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *window,
+EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config);
-EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window,
+EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
EGLConfig config);
-struct gtk_surface1 * gdk_wayland_surface_get_gtk_surface (GdkSurface *window);
+struct gtk_surface1 * gdk_wayland_surface_get_gtk_surface (GdkSurface *surface);
void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
GdkCursor *cursor);
-struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *window);
+struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *surface);
-void gdk_wayland_surface_inhibit_shortcuts (GdkSurface *window,
+void gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat);
-void gdk_wayland_surface_restore_shortcuts (GdkSurface *window,
+void gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat);
-void gdk_wayland_surface_update_scale (GdkSurface *window);
+void gdk_wayland_surface_update_scale (GdkSurface *surface);
#endif /* __GDK_PRIVATE_WAYLAND_H__ */
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index da51a9d58f..3e2998ddbc 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -48,8 +48,8 @@ enum {
static guint signals[LAST_SIGNAL];
-#define SURFACE_IS_TOPLEVEL(window) \
- (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
+#define SURFACE_IS_TOPLEVEL(surface) \
+ (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD)
#define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */
@@ -102,7 +102,7 @@ struct _GdkSurfaceImplWayland
GdkSurface *wrapper;
struct {
- /* The wl_outputs that this window currently touches */
+ /* The wl_outputs that this surface currently touches */
GSList *outputs;
struct wl_surface *wl_surface;
@@ -210,23 +210,23 @@ struct _GdkSurfaceImplWaylandClass
GdkSurfaceImplClass parent_class;
};
-static void gdk_wayland_surface_maybe_configure (GdkSurface *window,
+static void gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale);
-static void maybe_set_gtk_surface_dbus_properties (GdkSurface *window);
-static void maybe_set_gtk_surface_modal (GdkSurface *window);
+static void maybe_set_gtk_surface_dbus_properties (GdkSurface *surface);
+static void maybe_set_gtk_surface_modal (GdkSurface *surface);
-static void gdk_surface_request_transient_parent_commit (GdkSurface *window);
+static void gdk_surface_request_transient_parent_commit (GdkSurface *surface);
-static void gdk_wayland_surface_sync_margin (GdkSurface *window);
-static void gdk_wayland_surface_sync_input_region (GdkSurface *window);
-static void gdk_wayland_surface_sync_opaque_region (GdkSurface *window);
+static void gdk_wayland_surface_sync_margin (GdkSurface *surface);
+static void gdk_wayland_surface_sync_input_region (GdkSurface *surface);
+static void gdk_wayland_surface_sync_opaque_region (GdkSurface *surface);
-static void unset_transient_for_exported (GdkSurface *window);
+static void unset_transient_for_exported (GdkSurface *surface);
-static void calculate_moved_to_rect_result (GdkSurface *window,
+static void calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
@@ -236,7 +236,7 @@ static void calculate_moved_to_rect_result (GdkSurface *window,
gboolean *flipped_x,
gboolean *flipped_y);
-static gboolean gdk_wayland_surface_is_exported (GdkSurface *window);
+static gboolean gdk_wayland_surface_is_exported (GdkSurface *surface);
GType _gdk_surface_impl_wayland_get_type (void);
@@ -252,20 +252,20 @@ _gdk_surface_impl_wayland_init (GdkSurfaceImplWayland *impl)
}
static void
-_gdk_wayland_screen_add_orphan_dialog (GdkSurface *window)
+_gdk_wayland_screen_add_orphan_dialog (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
- if (!g_list_find (display_wayland->orphan_dialogs, window))
+ if (!g_list_find (display_wayland->orphan_dialogs, surface))
display_wayland->orphan_dialogs =
- g_list_prepend (display_wayland->orphan_dialogs, window);
+ g_list_prepend (display_wayland->orphan_dialogs, surface);
}
static void
-drop_cairo_surfaces (GdkSurface *window)
+drop_cairo_surfaces (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
g_clear_pointer (&impl->staging_cairo_surface, cairo_surface_destroy);
g_clear_pointer (&impl->backfill_cairo_surface, cairo_surface_destroy);
@@ -277,23 +277,23 @@ drop_cairo_surfaces (GdkSurface *window)
}
static void
-_gdk_wayland_surface_save_size (GdkSurface *window)
+_gdk_wayland_surface_save_size (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (window->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
+ if (surface->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
return;
- impl->saved_width = window->width - impl->margin_left - impl->margin_right;
- impl->saved_height = window->height - impl->margin_top - impl->margin_bottom;
+ impl->saved_width = surface->width - impl->margin_left - impl->margin_right;
+ impl->saved_height = surface->height - impl->margin_top - impl->margin_bottom;
}
static void
-_gdk_wayland_surface_clear_saved_size (GdkSurface *window)
+_gdk_wayland_surface_clear_saved_size (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (window->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
+ if (surface->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
return;
impl->saved_width = -1;
@@ -308,24 +308,24 @@ _gdk_wayland_surface_clear_saved_size (GdkSurface *window)
* cairo surface) when its size has changed.
*/
static void
-gdk_wayland_surface_update_size (GdkSurface *window,
+gdk_wayland_surface_update_size (GdkSurface *surface,
int32_t width,
int32_t height,
int scale)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle area;
cairo_region_t *region;
- if ((window->width == width) &&
- (window->height == height) &&
+ if ((surface->width == width) &&
+ (surface->height == height) &&
(impl->scale == scale))
return;
- drop_cairo_surfaces (window);
+ drop_cairo_surfaces (surface);
- window->width = width;
- window->height = height;
+ surface->width = width;
+ surface->height = height;
impl->scale = scale;
if (impl->display_server.egl_window)
@@ -335,11 +335,11 @@ gdk_wayland_surface_update_size (GdkSurface *window,
area.x = 0;
area.y = 0;
- area.width = window->width;
- area.height = window->height;
+ area.width = surface->width;
+ area.height = surface->height;
region = cairo_region_create_rectangle (&area);
- _gdk_surface_invalidate_for_expose (window, region);
+ _gdk_surface_invalidate_for_expose (surface, region);
cairo_region_destroy (region);
}
@@ -402,16 +402,16 @@ fill_presentation_time_from_frame_time (GdkFrameTimings *timings,
}
static void
-read_back_cairo_surface (GdkSurface *window)
+read_back_cairo_surface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
cairo_t *cr;
cairo_region_t *paint_region = NULL;
if (!impl->backfill_cairo_surface)
goto out;
- paint_region = cairo_region_copy (window->clip_region);
+ paint_region = cairo_region_copy (surface->clip_region);
cairo_region_subtract (paint_region, impl->staged_updates_region);
if (cairo_region_is_empty (paint_region))
@@ -437,18 +437,18 @@ frame_callback (void *data,
struct wl_callback *callback,
uint32_t time)
{
- GdkSurface *window = data;
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = data;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- GdkFrameClock *clock = gdk_surface_get_frame_clock (window);
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
GdkFrameTimings *timings;
- GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", window));
+ GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", surface));
wl_callback_destroy (callback);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (!impl->awaiting_frame)
@@ -466,7 +466,7 @@ frame_callback (void *data,
timings->refresh_interval = 16667; /* default to 1/60th of a second */
if (impl->display_server.outputs)
{
- /* We pick a random output out of the outputs that the window touches
+ /* We pick a random output out of the outputs that the surface touches
* The rate here is in milli-hertz */
int refresh_rate =
gdk_wayland_display_get_output_refresh_rate (display_wayland,
@@ -491,13 +491,13 @@ static const struct wl_callback_listener frame_listener = {
static void
on_frame_clock_before_paint (GdkFrameClock *clock,
- GdkSurface *window)
+ GdkSurface *surface)
{
GdkFrameTimings *timings = gdk_frame_clock_get_current_timings (clock);
gint64 presentation_time;
gint64 refresh_interval;
- if (window->update_freeze_count > 0)
+ if (surface->update_freeze_count > 0)
return;
gdk_frame_clock_get_refresh_info (clock,
@@ -524,26 +524,26 @@ on_frame_clock_before_paint (GdkFrameClock *clock,
static void
on_frame_clock_after_paint (GdkFrameClock *clock,
- GdkSurface *window)
+ GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_callback *callback;
if (!impl->pending_commit)
return;
- if (window->update_freeze_count > 0)
+ if (surface->update_freeze_count > 0)
return;
callback = wl_surface_frame (impl->display_server.wl_surface);
- wl_callback_add_listener (callback, &frame_listener, window);
+ wl_callback_add_listener (callback, &frame_listener, surface);
_gdk_frame_clock_freeze (clock);
/* Before we commit a new buffer, make sure we've backfilled
* undrawn parts from any old committed buffer
*/
if (impl->pending_buffer_attached)
- read_back_cairo_surface (window);
+ read_back_cairo_surface (surface);
/* From this commit forward, we can't write to the buffer,
* it's "live". In the future, if we need to stage more changes
@@ -567,10 +567,10 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
}
void
-gdk_wayland_surface_update_scale (GdkSurface *window)
+gdk_wayland_surface_update_scale (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
guint32 scale;
GSList *l;
GList *children, *c;
@@ -589,9 +589,9 @@ gdk_wayland_surface_update_scale (GdkSurface *window)
}
/* Notify app that scale changed */
- gdk_wayland_surface_maybe_configure (window, window->width, window->height, scale);
+ gdk_wayland_surface_maybe_configure (surface, surface->width, surface->height, scale);
- children = gdk_surface_get_children (window);
+ children = gdk_surface_get_children (surface);
for (c = children; c; c = c->next)
{
GdkSurface *child = c->data;
@@ -600,11 +600,11 @@ gdk_wayland_surface_update_scale (GdkSurface *window)
g_list_free (children);
}
-static void gdk_wayland_surface_create_surface (GdkSurface *window);
+static void gdk_wayland_surface_create_surface (GdkSurface *surface);
void
_gdk_wayland_display_create_surface_impl (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes)
@@ -614,22 +614,22 @@ _gdk_wayland_display_create_surface_impl (GdkDisplay *display,
GdkFrameClock *frame_clock;
impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WAYLAND, NULL);
- window->impl = GDK_SURFACE_IMPL (impl);
- impl->wrapper = GDK_SURFACE (window);
+ surface->impl = GDK_SURFACE_IMPL (impl);
+ impl->wrapper = GDK_SURFACE (surface);
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
- if (window->width > 65535)
+ if (surface->width > 65535)
{
- g_warning ("Native Windows wider than 65535 pixels are not supported");
- window->width = 65535;
+ g_warning ("Native Surfaces wider than 65535 pixels are not supported");
+ surface->width = 65535;
}
- if (window->height > 65535)
+ if (surface->height > 65535)
{
- g_warning ("Native Windows taller than 65535 pixels are not supported");
- window->height = 65535;
+ g_warning ("Native Surfaces taller than 65535 pixels are not supported");
+ surface->height = 65535;
}
- g_object_ref (window);
+ g_object_ref (surface);
/* More likely to be right than just assuming 1 */
if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
@@ -638,11 +638,11 @@ _gdk_wayland_display_create_surface_impl (GdkDisplay *display,
impl->title = NULL;
- switch (GDK_SURFACE_TYPE (window))
+ switch (GDK_SURFACE_TYPE (surface))
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP:
- gdk_surface_set_title (window, get_default_title ());
+ gdk_surface_set_title (surface, get_default_title ());
break;
case GDK_SURFACE_CHILD:
@@ -651,22 +651,22 @@ _gdk_wayland_display_create_surface_impl (GdkDisplay *display,
}
if (real_parent == NULL)
- display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, window);
+ display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, surface);
- gdk_wayland_surface_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
- frame_clock = gdk_surface_get_frame_clock (window);
- g_signal_connect (frame_clock, "before-paint", G_CALLBACK (on_frame_clock_before_paint), window);
- g_signal_connect (frame_clock, "after-paint", G_CALLBACK (on_frame_clock_after_paint), window);
+ frame_clock = gdk_surface_get_frame_clock (surface);
+ g_signal_connect (frame_clock, "before-paint", G_CALLBACK (on_frame_clock_before_paint), surface);
+ g_signal_connect (frame_clock, "after-paint", G_CALLBACK (on_frame_clock_after_paint), surface);
}
static void
-gdk_wayland_surface_attach_image (GdkSurface *window)
+gdk_wayland_surface_attach_image (GdkSurface *surface)
{
GdkWaylandDisplay *display;
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
g_assert (_gdk_wayland_is_shm_surface (impl->staging_cairo_surface));
@@ -680,7 +680,7 @@ gdk_wayland_surface_attach_image (GdkSurface *window)
impl->pending_buffer_offset_y = 0;
/* Only set the buffer scale if supported by the compositor */
- display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
if (display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
wl_surface_set_buffer_scale (impl->display_server.wl_surface, impl->scale);
@@ -752,9 +752,9 @@ static const struct wl_buffer_listener buffer_listener = {
};
static void
-gdk_wayland_surface_ensure_cairo_surface (GdkSurface *window)
+gdk_wayland_surface_ensure_cairo_surface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
/* If we are drawing using OpenGL then we only need a logical 1x1 surface. */
if (impl->display_server.egl_window)
@@ -799,14 +799,14 @@ gdk_wayland_surface_ensure_cairo_surface (GdkSurface *window)
* impl->staging_cairo_surface gets nullified.
*/
static cairo_surface_t *
-gdk_wayland_surface_ref_cairo_surface (GdkSurface *window)
+gdk_wayland_surface_ref_cairo_surface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (GDK_SURFACE_DESTROYED (impl->wrapper))
return NULL;
- gdk_wayland_surface_ensure_cairo_surface (window);
+ gdk_wayland_surface_ensure_cairo_surface (surface);
cairo_surface_reference (impl->staging_cairo_surface);
@@ -814,7 +814,7 @@ gdk_wayland_surface_ref_cairo_surface (GdkSurface *window)
}
static cairo_surface_t *
-gdk_wayland_surface_create_similar_image_surface (GdkSurface * window,
+gdk_wayland_surface_create_similar_image_surface (GdkSurface * surface,
cairo_format_t format,
int width,
int height)
@@ -823,25 +823,25 @@ gdk_wayland_surface_create_similar_image_surface (GdkSurface * window,
}
static gboolean
-gdk_surface_impl_wayland_begin_paint (GdkSurface *window)
+gdk_surface_impl_wayland_begin_paint (GdkSurface *surface)
{
- gdk_wayland_surface_ensure_cairo_surface (window);
+ gdk_wayland_surface_ensure_cairo_surface (surface);
return FALSE;
}
static void
-gdk_surface_impl_wayland_end_paint (GdkSurface *window)
+gdk_surface_impl_wayland_end_paint (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
cairo_rectangle_int_t rect;
int i, n;
if (impl->staging_cairo_surface &&
_gdk_wayland_is_shm_surface (impl->staging_cairo_surface) &&
- !cairo_region_is_empty (window->current_paint.region))
+ !cairo_region_is_empty (surface->current_paint.region))
{
- gdk_wayland_surface_attach_image (window);
+ gdk_wayland_surface_attach_image (surface);
/* If there's a committed buffer pending, then track which
* updates are staged until the next frame, so we can back
@@ -852,41 +852,41 @@ gdk_surface_impl_wayland_end_paint (GdkSurface *window)
{
if (impl->staged_updates_region == NULL)
{
- impl->staged_updates_region = cairo_region_copy (window->current_paint.region);
+ impl->staged_updates_region = cairo_region_copy (surface->current_paint.region);
impl->backfill_cairo_surface = cairo_surface_reference (impl->committed_cairo_surface);
}
else
{
- cairo_region_union (impl->staged_updates_region, window->current_paint.region);
+ cairo_region_union (impl->staged_updates_region, surface->current_paint.region);
}
}
- n = cairo_region_num_rectangles (window->current_paint.region);
+ n = cairo_region_num_rectangles (surface->current_paint.region);
for (i = 0; i < n; i++)
{
- cairo_region_get_rectangle (window->current_paint.region, i, &rect);
+ cairo_region_get_rectangle (surface->current_paint.region, i, &rect);
wl_surface_damage (impl->display_server.wl_surface, rect.x, rect.y, rect.width, rect.height);
}
impl->pending_commit = TRUE;
}
- gdk_wayland_surface_sync (window);
+ gdk_wayland_surface_sync (surface);
}
void
-gdk_wayland_surface_sync (GdkSurface *window)
+gdk_wayland_surface_sync (GdkSurface *surface)
{
- gdk_wayland_surface_sync_margin (window);
- gdk_wayland_surface_sync_opaque_region (window);
- gdk_wayland_surface_sync_input_region (window);
+ gdk_wayland_surface_sync_margin (surface);
+ gdk_wayland_surface_sync_opaque_region (surface);
+ gdk_wayland_surface_sync_input_region (surface);
}
static gboolean
-gdk_surface_impl_wayland_beep (GdkSurface *window)
+gdk_surface_impl_wayland_beep (GdkSurface *surface)
{
- gdk_wayland_display_system_bell (gdk_surface_get_display (window),
- window);
+ gdk_wayland_display_system_bell (gdk_surface_get_display (surface),
+ surface);
return TRUE;
}
@@ -894,15 +894,15 @@ gdk_surface_impl_wayland_beep (GdkSurface *window)
static void
gdk_surface_impl_wayland_finalize (GObject *object)
{
- GdkSurface *window = GDK_SURFACE (object);
+ GdkSurface *surface = GDK_SURFACE (object);
GdkSurfaceImplWayland *impl;
g_return_if_fail (GDK_IS_SURFACE_IMPL_WAYLAND (object));
impl = GDK_SURFACE_IMPL_WAYLAND (object);
- if (gdk_wayland_surface_is_exported (window))
- gdk_wayland_surface_unexport_handle (window);
+ if (gdk_wayland_surface_is_exported (surface))
+ gdk_wayland_surface_unexport_handle (surface);
g_free (impl->title);
@@ -923,7 +923,7 @@ gdk_surface_impl_wayland_finalize (GObject *object)
}
static void
-gdk_wayland_surface_configure (GdkSurface *window,
+gdk_wayland_surface_configure (GdkSurface *surface,
int width,
int height,
int scale)
@@ -932,30 +932,30 @@ gdk_wayland_surface_configure (GdkSurface *window,
GdkEvent *event;
event = gdk_event_new (GDK_CONFIGURE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = FALSE;
event->configure.width = width;
event->configure.height = height;
- gdk_wayland_surface_update_size (window, width, height, scale);
- _gdk_surface_update_size (window);
+ gdk_wayland_surface_update_size (surface, width, height, scale);
+ _gdk_surface_update_size (surface);
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
_gdk_wayland_display_deliver_event (display, event);
}
static void
-gdk_wayland_surface_maybe_configure (GdkSurface *window,
+gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
gboolean is_xdg_popup;
gboolean is_visible;
- if (window->width == width &&
- window->height == height &&
+ if (surface->width == width &&
+ surface->height == height &&
impl->scale == scale)
return;
@@ -966,27 +966,27 @@ gdk_wayland_surface_maybe_configure (GdkSurface *window,
*/
is_xdg_popup = (impl->display_server.xdg_popup != NULL);
- is_visible = gdk_surface_is_visible (window);
+ is_visible = gdk_surface_is_visible (surface);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
- gdk_surface_hide (window);
+ gdk_surface_hide (surface);
- gdk_wayland_surface_configure (window, width, height, scale);
+ gdk_wayland_surface_configure (surface, width, height, scale);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
- gdk_surface_show (window);
+ gdk_surface_show (surface);
}
static void
-gdk_wayland_surface_sync_parent (GdkSurface *window,
+gdk_wayland_surface_sync_parent (GdkSurface *surface,
GdkSurface *parent)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceImplWayland *impl_parent = NULL;
struct zxdg_toplevel_v6 *parent_toplevel;
g_assert (parent == NULL ||
- gdk_surface_get_display (window) == gdk_surface_get_display (parent));
+ gdk_surface_get_display (surface) == gdk_surface_get_display (parent));
if (!impl->display_server.xdg_toplevel)
return;
@@ -1012,9 +1012,9 @@ gdk_wayland_surface_sync_parent (GdkSurface *window,
}
static void
-gdk_wayland_surface_sync_parent_of_imported (GdkSurface *window)
+gdk_wayland_surface_sync_parent_of_imported (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
return;
@@ -1030,10 +1030,10 @@ gdk_wayland_surface_sync_parent_of_imported (GdkSurface *window)
}
static void
-gdk_wayland_surface_update_dialogs (GdkSurface *window)
+gdk_wayland_surface_update_dialogs (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GList *l;
if (!display_wayland->orphan_dialogs)
@@ -1048,7 +1048,7 @@ gdk_wayland_surface_update_dialogs (GdkSurface *window)
continue;
impl = GDK_SURFACE_IMPL_WAYLAND (w->impl);
- if (w == window)
+ if (w == surface)
continue;
if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG)
continue;
@@ -1056,14 +1056,14 @@ gdk_wayland_surface_update_dialogs (GdkSurface *window)
continue;
/* Update the parent relationship only for dialogs without transients */
- gdk_wayland_surface_sync_parent (w, window);
+ gdk_wayland_surface_sync_parent (w, surface);
}
}
static void
-gdk_wayland_surface_sync_title (GdkSurface *window)
+gdk_wayland_surface_sync_title (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.xdg_toplevel)
return;
@@ -1075,30 +1075,30 @@ gdk_wayland_surface_sync_title (GdkSurface *window)
}
static void
-gdk_wayland_surface_get_window_geometry (GdkSurface *window,
- GdkRectangle *geometry)
+gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
+ GdkRectangle *geometry)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
*geometry = (GdkRectangle) {
.x = impl->margin_left,
.y = impl->margin_top,
- .width = window->width - (impl->margin_left + impl->margin_right),
- .height = window->height - (impl->margin_top + impl->margin_bottom)
+ .width = surface->width - (impl->margin_left + impl->margin_right),
+ .height = surface->height - (impl->margin_top + impl->margin_bottom)
};
}
static void
-gdk_wayland_surface_sync_margin (GdkSurface *window)
+gdk_wayland_surface_sync_margin (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle geometry;
if (!impl->display_server.xdg_surface)
return;
- gdk_wayland_surface_get_window_geometry (window, &geometry);
- gdk_surface_set_geometry_hints (window,
+ gdk_wayland_surface_get_window_geometry (surface, &geometry);
+ gdk_surface_set_geometry_hints (surface,
&impl->geometry_hints,
impl->geometry_mask);
zxdg_surface_v6_set_window_geometry (impl->display_server.xdg_surface,
@@ -1131,9 +1131,9 @@ wl_region_from_cairo_region (GdkWaylandDisplay *display,
}
static void
-gdk_wayland_surface_sync_opaque_region (GdkSurface *window)
+gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_region *wl_region = NULL;
if (!impl->display_server.wl_surface)
@@ -1143,7 +1143,7 @@ gdk_wayland_surface_sync_opaque_region (GdkSurface *window)
return;
if (impl->opaque_region != NULL)
- wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)),
+ wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)),
impl->opaque_region);
wl_surface_set_opaque_region (impl->display_server.wl_surface, wl_region);
@@ -1155,9 +1155,9 @@ gdk_wayland_surface_sync_opaque_region (GdkSurface *window)
}
static void
-gdk_wayland_surface_sync_input_region (GdkSurface *window)
+gdk_wayland_surface_sync_input_region (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_region *wl_region = NULL;
if (!impl->display_server.wl_surface)
@@ -1167,7 +1167,7 @@ gdk_wayland_surface_sync_input_region (GdkSurface *window)
return;
if (impl->input_region != NULL)
- wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)),
+ wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)),
impl->input_region);
wl_surface_set_input_region (impl->display_server.wl_surface, wl_region);
@@ -1179,9 +1179,9 @@ gdk_wayland_surface_sync_input_region (GdkSurface *window)
}
static void
-gdk_wayland_set_input_region_if_empty (GdkSurface *window)
+gdk_wayland_set_input_region_if_empty (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display;
struct wl_region *empty;
@@ -1194,7 +1194,7 @@ gdk_wayland_set_input_region_if_empty (GdkSurface *window)
if (!cairo_region_is_empty (impl->input_region))
return;
- display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
empty = wl_compositor_create_region (display->compositor);
wl_surface_set_input_region (impl->display_server.wl_surface, empty);
@@ -1208,15 +1208,15 @@ surface_enter (void *data,
struct wl_surface *wl_surface,
struct wl_output *output)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS,
- g_message ("surface enter, window %p output %p", window, output));
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
+ g_message ("surface enter, surface %p output %p", surface, output));
impl->display_server.outputs = g_slist_prepend (impl->display_server.outputs, output);
- gdk_wayland_surface_update_scale (window);
+ gdk_wayland_surface_update_scale (surface);
}
static void
@@ -1224,16 +1224,16 @@ surface_leave (void *data,
struct wl_surface *wl_surface,
struct wl_output *output)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS,
- g_message ("surface leave, window %p output %p", window, output));
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
+ g_message ("surface leave, surface %p output %p", surface, output));
impl->display_server.outputs = g_slist_remove (impl->display_server.outputs, output);
if (impl->display_server.outputs)
- gdk_wayland_surface_update_scale (window);
+ gdk_wayland_surface_update_scale (surface);
}
static const struct wl_surface_listener surface_listener = {
@@ -1243,9 +1243,9 @@ static const struct wl_surface_listener surface_listener = {
static void
on_parent_surface_committed (GdkSurfaceImplWayland *parent_impl,
- GdkSurface *window)
+ GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
g_signal_handler_disconnect (parent_impl,
impl->parent_surface_committed_handler);
@@ -1254,16 +1254,16 @@ on_parent_surface_committed (GdkSurfaceImplWayland *parent_impl,
wl_subsurface_set_desync (impl->display_server.wl_subsurface);
/* Special case if the input region is empty, it won't change on resize */
- gdk_wayland_set_input_region_if_empty (window);
+ gdk_wayland_set_input_region_if_empty (surface);
}
static void
-gdk_wayland_surface_create_subsurface (GdkSurface *window)
+gdk_wayland_surface_create_subsurface (GdkSurface *surface)
{
GdkSurfaceImplWayland *impl, *parent_impl = NULL;
GdkWaylandDisplay *display_wayland;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
return; /* Bail out, surface and subsurface will be created later when shown */
@@ -1276,13 +1276,13 @@ gdk_wayland_surface_create_subsurface (GdkSurface *window)
if (parent_impl && parent_impl->display_server.wl_surface)
{
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
impl->display_server.wl_subsurface =
wl_subcompositor_get_subsurface (display_wayland->subcompositor,
impl->display_server.wl_surface, parent_impl->display_server.wl_surface);
wl_subsurface_set_position (impl->display_server.wl_subsurface,
- window->x + window->abs_x,
- window->y + window->abs_y);
+ surface->x + surface->abs_x,
+ surface->y + surface->abs_y);
/* In order to synchronize the initial position with the initial frame
* content, wait with making the subsurface desynchronized until after
@@ -1291,19 +1291,19 @@ gdk_wayland_surface_create_subsurface (GdkSurface *window)
impl->parent_surface_committed_handler =
g_signal_connect_object (parent_impl, "committed",
G_CALLBACK (on_parent_surface_committed),
- window, 0);
- gdk_surface_request_transient_parent_commit (window);
+ surface, 0);
+ gdk_surface_request_transient_parent_commit (surface);
}
}
static void
-gdk_wayland_surface_create_surface (GdkSurface *window)
+gdk_wayland_surface_create_surface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
impl->display_server.wl_surface = wl_compositor_create_surface (display_wayland->compositor);
- wl_surface_add_listener (impl->display_server.wl_surface, &surface_listener, window);
+ wl_surface_add_listener (impl->display_server.wl_surface, &surface_listener, surface);
}
static void
@@ -1311,8 +1311,8 @@ xdg_surface_configure (void *data,
struct zxdg_surface_v6 *xdg_surface,
uint32_t serial)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceState new_state;
int width = impl->pending.width;
int height = impl->pending.height;
@@ -1321,7 +1321,7 @@ xdg_surface_configure (void *data,
if (!impl->initial_configure_received)
{
- gdk_surface_thaw_updates (window);
+ gdk_surface_thaw_updates (surface);
impl->initial_configure_received = TRUE;
}
@@ -1356,7 +1356,7 @@ xdg_surface_configure (void *data,
{
GdkSurfaceHints geometry_mask = impl->geometry_mask;
- /* Ignore size increments for maximized/fullscreen windows */
+ /* Ignore size increments for maximized/fullscreen surfaces */
if (fixed_size)
geometry_mask &= ~GDK_HINT_RESIZE_INC;
if (!saved_size)
@@ -1370,25 +1370,25 @@ xdg_surface_configure (void *data,
&height);
/* Save size for next time we get 0x0 */
- _gdk_wayland_surface_save_size (window);
+ _gdk_wayland_surface_save_size (surface);
}
- gdk_wayland_surface_configure (window, width, height, impl->scale);
+ gdk_wayland_surface_configure (surface, width, height, impl->scale);
}
- GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS,
- g_message ("configure, window %p %dx%d,%s%s%s%s",
- window, width, height,
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
+ g_message ("configure, surface %p %dx%d,%s%s%s%s",
+ surface, width, height,
(new_state & GDK_SURFACE_STATE_FULLSCREEN) ? " fullscreen" : "",
(new_state & GDK_SURFACE_STATE_MAXIMIZED) ? " maximized" : "",
(new_state & GDK_SURFACE_STATE_FOCUSED) ? " focused" : "",
(new_state & GDK_SURFACE_STATE_TILED) ? " tiled" : ""));
- gdk_surface_set_state (window, new_state);
+ gdk_surface_set_state (surface, new_state);
zxdg_surface_v6_ack_configure (xdg_surface, serial);
if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG &&
new_state & GDK_SURFACE_STATE_FOCUSED)
- gdk_wayland_surface_update_dialogs (window);
+ gdk_wayland_surface_update_dialogs (surface);
}
static const struct zxdg_surface_v6_listener xdg_surface_listener = {
@@ -1402,8 +1402,8 @@ xdg_toplevel_configure (void *data,
int32_t height,
struct wl_array *states)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
uint32_t *p;
wl_array_for_each (p, states)
@@ -1436,16 +1436,16 @@ static void
xdg_toplevel_close (void *data,
struct zxdg_toplevel_v6 *xdg_toplevel)
{
- GdkSurface *window = GDK_SURFACE (data);
+ GdkSurface *surface = GDK_SURFACE (data);
GdkDisplay *display;
GdkEvent *event;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- GDK_DISPLAY_NOTE (display, EVENTS, g_message ("close %p", window));
+ GDK_DISPLAY_NOTE (display, EVENTS, g_message ("close %p", surface));
event = gdk_event_new (GDK_DELETE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = TRUE;
_gdk_wayland_display_deliver_event (display, event);
@@ -1457,10 +1457,10 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
};
static void
-gdk_wayland_surface_create_xdg_toplevel (GdkSurface *window)
+gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
const gchar *app_id;
impl->display_server.xdg_surface =
@@ -1468,22 +1468,22 @@ gdk_wayland_surface_create_xdg_toplevel (GdkSurface *window)
impl->display_server.wl_surface);
zxdg_surface_v6_add_listener (impl->display_server.xdg_surface,
&xdg_surface_listener,
- window);
- gdk_surface_freeze_updates (window);
+ surface);
+ gdk_surface_freeze_updates (surface);
impl->display_server.xdg_toplevel =
zxdg_surface_v6_get_toplevel (impl->display_server.xdg_surface);
zxdg_toplevel_v6_add_listener (impl->display_server.xdg_toplevel,
&xdg_toplevel_listener,
- window);
+ surface);
- gdk_wayland_surface_sync_parent (window, NULL);
- gdk_wayland_surface_sync_parent_of_imported (window);
- gdk_wayland_surface_sync_title (window);
+ gdk_wayland_surface_sync_parent (surface, NULL);
+ gdk_wayland_surface_sync_parent_of_imported (surface);
+ gdk_wayland_surface_sync_title (surface);
- if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
+ if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel);
- if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
+ if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel,
impl->initial_fullscreen_output);
@@ -1496,11 +1496,11 @@ gdk_wayland_surface_create_xdg_toplevel (GdkSurface *window)
zxdg_toplevel_v6_set_app_id (impl->display_server.xdg_toplevel, app_id);
- maybe_set_gtk_surface_dbus_properties (window);
- maybe_set_gtk_surface_modal (window);
+ maybe_set_gtk_surface_dbus_properties (surface);
+ maybe_set_gtk_surface_modal (surface);
if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG)
- _gdk_wayland_screen_add_orphan_dialog (window);
+ _gdk_wayland_screen_add_orphan_dialog (surface);
wl_surface_commit (impl->display_server.wl_surface);
}
@@ -1513,8 +1513,8 @@ xdg_popup_configure (void *data,
int32_t width,
int32_t height)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle flipped_rect;
GdkRectangle final_rect;
gboolean flipped_x;
@@ -1525,13 +1525,13 @@ xdg_popup_configure (void *data,
if (impl->position_method != POSITION_METHOD_MOVE_TO_RECT)
return;
- calculate_moved_to_rect_result (window, x, y, width, height,
+ calculate_moved_to_rect_result (surface, x, y, width, height,
&flipped_rect,
&final_rect,
&flipped_x,
&flipped_y);
- g_signal_emit_by_name (window,
+ g_signal_emit_by_name (surface,
"moved-to-rect",
&flipped_rect,
&final_rect,
@@ -1543,11 +1543,11 @@ static void
xdg_popup_done (void *data,
struct zxdg_popup_v6 *xdg_popup)
{
- GdkSurface *window = GDK_SURFACE (data);
+ GdkSurface *surface = GDK_SURFACE (data);
- GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("done %p", window));
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS, g_message ("done %p", surface));
- gdk_surface_hide (window);
+ gdk_surface_hide (surface);
}
static const struct zxdg_popup_v6_listener xdg_popup_listener = {
@@ -1628,10 +1628,10 @@ surface_anchor_to_gravity (GdkGravity rect_anchor)
}
void
-gdk_wayland_surface_announce_csd (GdkSurface *window)
+gdk_wayland_surface_announce_csd (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!display_wayland->server_decoration_manager)
return;
impl->display_server.server_decoration =
@@ -1643,11 +1643,11 @@ gdk_wayland_surface_announce_csd (GdkSurface *window)
}
static GdkSurface *
-get_real_parent_and_translate (GdkSurface *window,
+get_real_parent_and_translate (GdkSurface *surface,
gint *x,
gint *y)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurface *parent = impl->transient_for;
while (parent)
@@ -1675,20 +1675,20 @@ get_real_parent_and_translate (GdkSurface *window,
}
static void
-translate_to_real_parent_window_geometry (GdkSurface *window,
+translate_to_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
{
GdkSurface *parent;
- parent = get_real_parent_and_translate (window, x, y);
+ parent = get_real_parent_and_translate (surface, x, y);
*x -= parent->shadow_left;
*y -= parent->shadow_top;
}
static GdkSurface *
-translate_from_real_parent_window_geometry (GdkSurface *window,
+translate_from_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
{
@@ -1696,7 +1696,7 @@ translate_from_real_parent_window_geometry (GdkSurface *window,
gint dx = 0;
gint dy = 0;
- parent = get_real_parent_and_translate (window, &dx, &dy);
+ parent = get_real_parent_and_translate (surface, &dx, &dy);
*x -= dx - parent->shadow_left;
*y -= dy - parent->shadow_top;
@@ -1705,17 +1705,17 @@ translate_from_real_parent_window_geometry (GdkSurface *window,
}
static void
-calculate_popup_rect (GdkSurface *window,
+calculate_popup_rect (GdkSurface *surface,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
GdkRectangle *out_rect)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle geometry;
GdkRectangle anchor_rect;
int x = 0, y = 0;
- gdk_wayland_surface_get_window_geometry (window, &geometry);
+ gdk_wayland_surface_get_window_geometry (surface, &geometry);
anchor_rect = (GdkRectangle) {
.x = (impl->pending_move_to_rect.rect.x +
@@ -1873,7 +1873,7 @@ flip_anchor_vertically (GdkGravity anchor)
}
static void
-calculate_moved_to_rect_result (GdkSurface *window,
+calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
@@ -1883,13 +1883,13 @@ calculate_moved_to_rect_result (GdkSurface *window,
gboolean *flipped_x,
gboolean *flipped_y)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurface *parent;
- gint window_x, window_y;
- gint window_width, window_height;
+ gint surface_x, surface_y;
+ gint surface_width, surface_height;
GdkRectangle best_rect;
- parent = translate_from_real_parent_window_geometry (window, &x, &y);
+ parent = translate_from_real_parent_surface_geometry (surface, &x, &y);
*final_rect = (GdkRectangle) {
.x = x,
.y = y,
@@ -1897,16 +1897,16 @@ calculate_moved_to_rect_result (GdkSurface *window,
.height = height,
};
- window_x = parent->x + x;
- window_y = parent->y + y;
- window_width = width + window->shadow_left + window->shadow_right;
- window_height = height + window->shadow_top + window->shadow_bottom;
+ surface_x = parent->x + x;
+ surface_y = parent->y + y;
+ surface_width = width + surface->shadow_left + surface->shadow_right;
+ surface_height = height + surface->shadow_top + surface->shadow_bottom;
- gdk_surface_move_resize (window,
- window_x, window_y,
- window_width, window_height);
+ gdk_surface_move_resize (surface,
+ surface_x, surface_y,
+ surface_width, surface_height);
- calculate_popup_rect (window,
+ calculate_popup_rect (surface,
impl->pending_move_to_rect.rect_anchor,
impl->pending_move_to_rect.surface_anchor,
&best_rect);
@@ -1924,7 +1924,7 @@ calculate_moved_to_rect_result (GdkSurface *window,
flip_anchor_horizontally (impl->pending_move_to_rect.rect_anchor);
flipped_surface_anchor =
flip_anchor_horizontally (impl->pending_move_to_rect.surface_anchor),
- calculate_popup_rect (window,
+ calculate_popup_rect (surface,
flipped_rect_anchor,
flipped_surface_anchor,
&flipped_x_rect);
@@ -1943,7 +1943,7 @@ calculate_moved_to_rect_result (GdkSurface *window,
flip_anchor_vertically (impl->pending_move_to_rect.rect_anchor);
flipped_surface_anchor =
flip_anchor_vertically (impl->pending_move_to_rect.surface_anchor),
- calculate_popup_rect (window,
+ calculate_popup_rect (surface,
flipped_rect_anchor,
flipped_surface_anchor,
&flipped_y_rect);
@@ -1957,11 +1957,11 @@ calculate_moved_to_rect_result (GdkSurface *window,
}
static struct zxdg_positioner_v6 *
-create_dynamic_positioner (GdkSurface *window)
+create_dynamic_positioner (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
struct zxdg_positioner_v6 *positioner;
GdkRectangle geometry;
enum zxdg_positioner_v6_anchor anchor;
@@ -1972,14 +1972,14 @@ create_dynamic_positioner (GdkSurface *window)
positioner = zxdg_shell_v6_create_positioner (display->xdg_shell);
- gdk_wayland_surface_get_window_geometry (window, &geometry);
+ gdk_wayland_surface_get_window_geometry (surface, &geometry);
zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height);
real_anchor_rect_x = impl->pending_move_to_rect.rect.x;
real_anchor_rect_y = impl->pending_move_to_rect.rect.y;
- translate_to_real_parent_window_geometry (window,
- &real_anchor_rect_x,
- &real_anchor_rect_y);
+ translate_to_real_parent_surface_geometry (surface,
+ &real_anchor_rect_x,
+ &real_anchor_rect_y);
anchor_rect_width = impl->pending_move_to_rect.rect.width;
anchor_rect_height = impl->pending_move_to_rect.rect.height;
@@ -2019,11 +2019,11 @@ create_dynamic_positioner (GdkSurface *window)
}
static struct zxdg_positioner_v6 *
-create_simple_positioner (GdkSurface *window,
+create_simple_positioner (GdkSurface *surface,
GdkSurface *parent)
{
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
struct zxdg_positioner_v6 *positioner;
GdkRectangle geometry;
GdkRectangle parent_geometry;
@@ -2031,7 +2031,7 @@ create_simple_positioner (GdkSurface *window,
positioner = zxdg_shell_v6_create_positioner (display->xdg_shell);
- gdk_wayland_surface_get_window_geometry (window, &geometry);
+ gdk_wayland_surface_get_window_geometry (surface, &geometry);
zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height);
parent_x = parent->x;
@@ -2042,8 +2042,8 @@ create_simple_positioner (GdkSurface *window,
parent_y += parent_geometry.y;
zxdg_positioner_v6_set_anchor_rect (positioner,
- (window->x + geometry.x) - parent_x,
- (window->y + geometry.y) - parent_y,
+ (surface->x + geometry.x) - parent_x,
+ (surface->y + geometry.y) - parent_y,
1, 1);
zxdg_positioner_v6_set_anchor (positioner,
(ZXDG_POSITIONER_V6_ANCHOR_TOP |
@@ -2056,12 +2056,12 @@ create_simple_positioner (GdkSurface *window,
}
static void
-gdk_wayland_surface_create_xdg_popup (GdkSurface *window,
+gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
GdkSurface *parent,
struct wl_seat *seat)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceImplWayland *parent_impl = GDK_SURFACE_IMPL_WAYLAND (parent->impl);
struct zxdg_positioner_v6 *positioner;
GdkSeat *gdk_seat;
@@ -2097,13 +2097,13 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *window,
impl->display_server.wl_surface);
zxdg_surface_v6_add_listener (impl->display_server.xdg_surface,
&xdg_surface_listener,
- window);
- gdk_surface_freeze_updates (window);
+ surface);
+ gdk_surface_freeze_updates (surface);
if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT)
- positioner = create_dynamic_positioner (window);
+ positioner = create_dynamic_positioner (surface);
else
- positioner = create_simple_positioner (window, parent);
+ positioner = create_simple_positioner (surface, parent);
impl->display_server.xdg_popup =
zxdg_surface_v6_get_popup (impl->display_server.xdg_surface,
@@ -2111,7 +2111,7 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *window,
positioner);
zxdg_popup_v6_add_listener (impl->display_server.xdg_popup,
&xdg_popup_listener,
- window);
+ surface);
zxdg_positioner_v6_destroy (positioner);
@@ -2125,33 +2125,33 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *window,
wl_surface_commit (impl->display_server.wl_surface);
impl->popup_parent = parent;
- display->current_popups = g_list_append (display->current_popups, window);
+ display->current_popups = g_list_append (display->current_popups, surface);
}
static struct wl_seat *
-find_grab_input_seat (GdkSurface *window, GdkSurface *transient_for)
+find_grab_input_seat (GdkSurface *surface, GdkSurface *transient_for)
{
- GdkSurface *attached_grab_window;
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *attached_grab_surface;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceImplWayland *tmp_impl;
/* Use the device that was used for the grab as the device for
- * the popup window setup - so this relies on GTK+ taking the
- * grab before showing the popup window.
+ * the popup surface setup - so this relies on GTK+ taking the
+ * grab before showing the popup surface.
*/
if (impl->grab_input_seat)
return gdk_wayland_seat_get_wl_seat (impl->grab_input_seat);
- /* HACK: GtkMenu grabs a special window known as the "grab transfer window"
- * and then transfers the grab over to the correct window later. Look for
- * this window when taking the grab to know it's correct.
+ /* HACK: GtkMenu grabs a special surface known as the "grab transfer surface"
+ * and then transfers the grab over to the correct surface later. Look for
+ * this surface when taking the grab to know it's correct.
*
- * See: associate_menu_grab_transfer_window in gtkmenu.c
+ * See: associate_menu_grab_transfer_surface in gtkmenu.c
*/
- attached_grab_window = g_object_get_data (G_OBJECT (window), "gdk-attached-grab-window");
- if (attached_grab_window)
+ attached_grab_surface = g_object_get_data (G_OBJECT (surface), "gdk-attached-grab-surface");
+ if (attached_grab_surface)
{
- tmp_impl = GDK_SURFACE_IMPL_WAYLAND (attached_grab_window->impl);
+ tmp_impl = GDK_SURFACE_IMPL_WAYLAND (attached_grab_surface->impl);
if (tmp_impl->grab_input_seat)
return gdk_wayland_seat_get_wl_seat (tmp_impl->grab_input_seat);
}
@@ -2170,12 +2170,12 @@ find_grab_input_seat (GdkSurface *window, GdkSurface *transient_for)
}
static gboolean
-should_be_mapped (GdkSurface *window)
+should_be_mapped (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
/* Don't map crazy temp that GTK+ uses for internal X11 shenanigans. */
- if (window->surface_type == GDK_SURFACE_TEMP && window->x < 0 && window->y < 0)
+ if (surface->surface_type == GDK_SURFACE_TEMP && surface->x < 0 && surface->y < 0)
return FALSE;
if (impl->hint == GDK_SURFACE_TYPE_HINT_DND)
@@ -2185,26 +2185,26 @@ should_be_mapped (GdkSurface *window)
}
static gboolean
-should_map_as_popup (GdkSurface *window)
+should_map_as_popup (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- /* Ideally, popup would be temp windows with a parent and grab */
- if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP)
+ /* Ideally, popup would be temp surfaces with a parent and grab */
+ if (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TEMP)
{
- /* If a temp window has a parent and a grab, we can use a popup */
+ /* If a temp surface has a parent and a grab, we can use a popup */
if (impl->transient_for)
{
if (impl->grab_input_seat)
return TRUE;
}
else
- g_message ("Window %p is a temporary window without parent, "
+ g_message ("Surface %p is a temporary surface without parent, "
"application will not be able to position it on screen.",
- window);
+ surface);
}
- /* Yet we need to keep the window type hint tests for compatibility */
+ /* Yet we need to keep the surface type hint tests for compatibility */
switch ((guint) impl->hint)
{
case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
@@ -2220,18 +2220,18 @@ should_map_as_popup (GdkSurface *window)
}
static gboolean
-should_map_as_subsurface (GdkSurface *window)
+should_map_as_subsurface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_SUBSURFACE)
+ if (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_SUBSURFACE)
return TRUE;
- if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TEMP)
+ if (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_TEMP)
return FALSE;
/* if we want a popup, we do not want a subsurface */
- if (should_map_as_popup (window))
+ if (should_map_as_popup (surface))
return FALSE;
if (impl->transient_for)
@@ -2243,55 +2243,55 @@ should_map_as_subsurface (GdkSurface *window)
if (impl_parent->mapped)
return TRUE;
else
- g_warning ("Couldn't map window %p as subsurface because its parent is not mapped.",
- window);
+ g_warning ("Couldn't map surface %p as subsurface because its parent is not mapped.",
+ surface);
}
return FALSE;
}
-/* Get the window that can be used as a parent for a popup, i.e. a xdg_toplevel
- * or xdg_popup. If the window is not, traverse up the transiency parents until
+/* Get the surface that can be used as a parent for a popup, i.e. a xdg_toplevel
+ * or xdg_popup. If the surface is not, traverse up the transiency parents until
* we find one.
*/
static GdkSurface *
-get_popup_parent (GdkSurface *window)
+get_popup_parent (GdkSurface *surface)
{
- while (window)
+ while (surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->display_server.xdg_popup || impl->display_server.xdg_toplevel)
- return window;
+ return surface;
- window = impl->transient_for;
+ surface = impl->transient_for;
}
return NULL;
}
static void
-gdk_wayland_surface_map (GdkSurface *window)
+gdk_wayland_surface_map (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurface *transient_for = NULL;
- if (!should_be_mapped (window))
+ if (!should_be_mapped (surface))
return;
if (impl->mapped || impl->use_custom_surface)
return;
- if (should_map_as_subsurface (window))
+ if (should_map_as_subsurface (surface))
{
if (impl->transient_for)
- gdk_wayland_surface_create_subsurface (window);
+ gdk_wayland_surface_create_subsurface (surface);
else
- g_warning ("Couldn't map window %p as susburface yet because it doesn't have a parent",
- window);
+ g_warning ("Couldn't map surface %p as susburface yet because it doesn't have a parent",
+ surface);
}
- else if (should_map_as_popup (window))
+ else if (should_map_as_popup (surface))
{
gboolean create_fallback = FALSE;
struct wl_seat *grab_input_seat;
@@ -2299,27 +2299,27 @@ gdk_wayland_surface_map (GdkSurface *window)
/* Popup menus can appear without a transient parent, which means they
* cannot be positioned properly on Wayland. This attempts to guess the
* surface they should be positioned with by finding the surface beneath
- * the device that created the grab for the popup window.
+ * the device that created the grab for the popup surface.
*/
if (!impl->transient_for && impl->hint == GDK_SURFACE_TYPE_HINT_POPUP_MENU)
{
GdkDevice *grab_device = NULL;
- /* The popup menu window is not the grabbed window. This may mean
- * that a "transfer window" (see gtkmenu.c) is used, and we need
- * to find that window to get the grab device. If so is the case
- * the "transfer window" can be retrieved via the
- * "gdk-attached-grab-window" associated data field.
+ /* The popup menu surface is not the grabbed surface. This may mean
+ * that a "transfer surface" (see gtkmenu.c) is used, and we need
+ * to find that surface to get the grab device. If so is the case
+ * the "transfer surface" can be retrieved via the
+ * "gdk-attached-grab-surface" associated data field.
*/
if (!impl->grab_input_seat)
{
- GdkSurface *attached_grab_window =
- g_object_get_data (G_OBJECT (window),
- "gdk-attached-grab-window");
- if (attached_grab_window)
+ GdkSurface *attached_grab_surface =
+ g_object_get_data (G_OBJECT (surface),
+ "gdk-attached-grab-surface");
+ if (attached_grab_surface)
{
GdkSurfaceImplWayland *attached_impl =
- GDK_SURFACE_IMPL_WAYLAND (attached_grab_window->impl);
+ GDK_SURFACE_IMPL_WAYLAND (attached_grab_surface->impl);
grab_device = gdk_seat_get_pointer (attached_impl->grab_input_seat);
transient_for =
gdk_device_get_surface_at_position (grab_device,
@@ -2341,7 +2341,7 @@ gdk_wayland_surface_map (GdkSurface *window)
*/
if (impl->position_method == POSITION_METHOD_NONE && grab_device)
gdk_surface_get_device_position (transient_for, grab_device,
- &window->x, &window->y, NULL);
+ &surface->x, &surface->y, NULL);
}
else
{
@@ -2351,57 +2351,57 @@ gdk_wayland_surface_map (GdkSurface *window)
if (!transient_for)
{
- g_warning ("Couldn't map as window %p as popup because it doesn't have a parent",
- window);
+ g_warning ("Couldn't map as surface %p as popup because it doesn't have a parent",
+ surface);
create_fallback = TRUE;
}
else
{
- grab_input_seat = find_grab_input_seat (window, transient_for);
+ grab_input_seat = find_grab_input_seat (surface, transient_for);
}
if (!create_fallback)
{
- gdk_wayland_surface_create_xdg_popup (window,
+ gdk_wayland_surface_create_xdg_popup (surface,
transient_for,
grab_input_seat);
}
else
{
- gdk_wayland_surface_create_xdg_toplevel (window);
+ gdk_wayland_surface_create_xdg_toplevel (surface);
}
}
else
{
- gdk_wayland_surface_create_xdg_toplevel (window);
+ gdk_wayland_surface_create_xdg_toplevel (surface);
}
impl->mapped = TRUE;
}
static void
-gdk_wayland_surface_show (GdkSurface *window,
+gdk_wayland_surface_show (GdkSurface *surface,
gboolean already_mapped)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
- gdk_wayland_surface_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
- gdk_wayland_surface_map (window);
+ gdk_wayland_surface_map (surface);
- _gdk_make_event (window, GDK_MAP, NULL, FALSE);
+ _gdk_make_event (surface, GDK_MAP, NULL, FALSE);
if (impl->staging_cairo_surface &&
_gdk_wayland_is_shm_surface (impl->staging_cairo_surface))
- gdk_wayland_surface_attach_image (window);
+ gdk_wayland_surface_attach_image (surface);
}
static void
-unmap_subsurface (GdkSurface *window)
+unmap_subsurface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceImplWayland *parent_impl;
g_return_if_fail (impl->display_server.wl_subsurface);
@@ -2419,18 +2419,18 @@ unmap_subsurface (GdkSurface *window)
}
static void
-unmap_popups_for_surface (GdkSurface *window)
+unmap_popups_for_surface (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland;
GList *l;
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
for (l = display_wayland->current_popups; l; l = l->next)
{
GdkSurface *popup = l->data;
GdkSurfaceImplWayland *popup_impl = GDK_SURFACE_IMPL_WAYLAND (popup->impl);
- if (popup_impl->popup_parent == window)
+ if (popup_impl->popup_parent == surface)
{
g_warning ("Tried to unmap the parent of a popup");
gdk_surface_hide (popup);
@@ -2441,12 +2441,12 @@ unmap_popups_for_surface (GdkSurface *window)
}
static void
-gdk_wayland_surface_hide_surface (GdkSurface *window)
+gdk_wayland_surface_hide_surface (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- unmap_popups_for_surface (window);
+ unmap_popups_for_surface (surface);
if (impl->display_server.wl_surface)
{
@@ -2484,27 +2484,27 @@ gdk_wayland_surface_hide_surface (GdkSurface *window)
zxdg_popup_v6_destroy (impl->display_server.xdg_popup);
impl->display_server.xdg_popup = NULL;
display_wayland->current_popups =
- g_list_remove (display_wayland->current_popups, window);
+ g_list_remove (display_wayland->current_popups, surface);
}
if (impl->display_server.xdg_surface)
{
zxdg_surface_v6_destroy (impl->display_server.xdg_surface);
impl->display_server.xdg_surface = NULL;
if (!impl->initial_configure_received)
- gdk_surface_thaw_updates (window);
+ gdk_surface_thaw_updates (surface);
else
impl->initial_configure_received = FALSE;
}
if (impl->display_server.wl_subsurface)
- unmap_subsurface (window);
+ unmap_subsurface (surface);
if (impl->awaiting_frame)
{
GdkFrameClock *frame_clock;
impl->awaiting_frame = FALSE;
- frame_clock = gdk_surface_get_frame_clock (window);
+ frame_clock = gdk_surface_get_frame_clock (surface);
if (frame_clock)
_gdk_frame_clock_thaw (frame_clock);
}
@@ -2524,77 +2524,77 @@ gdk_wayland_surface_hide_surface (GdkSurface *window)
if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG && !impl->transient_for)
display_wayland->orphan_dialogs =
- g_list_remove (display_wayland->orphan_dialogs, window);
+ g_list_remove (display_wayland->orphan_dialogs, surface);
}
- unset_transient_for_exported (window);
+ unset_transient_for_exported (surface);
- _gdk_wayland_surface_clear_saved_size (window);
+ _gdk_wayland_surface_clear_saved_size (surface);
impl->pending_commit = FALSE;
impl->mapped = FALSE;
}
static void
-gdk_wayland_surface_hide (GdkSurface *window)
+gdk_wayland_surface_hide (GdkSurface *surface)
{
- gdk_wayland_surface_hide_surface (window);
- _gdk_surface_clear_update_area (window);
+ gdk_wayland_surface_hide_surface (surface);
+ _gdk_surface_clear_update_area (surface);
}
static void
-gdk_surface_wayland_withdraw (GdkSurface *window)
+gdk_surface_wayland_withdraw (GdkSurface *surface)
{
- if (!window->destroyed)
+ if (!surface->destroyed)
{
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN);
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_WITHDRAWN);
- g_assert (!GDK_SURFACE_IS_MAPPED (window));
+ g_assert (!GDK_SURFACE_IS_MAPPED (surface));
- gdk_wayland_surface_hide_surface (window);
+ gdk_wayland_surface_hide_surface (surface);
}
}
static void
-gdk_surface_wayland_set_events (GdkSurface *window,
+gdk_surface_wayland_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
- GDK_SURFACE (window)->event_mask = event_mask;
+ GDK_SURFACE (surface)->event_mask = event_mask;
}
static GdkEventMask
-gdk_surface_wayland_get_events (GdkSurface *window)
+gdk_surface_wayland_get_events (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 0;
else
- return GDK_SURFACE (window)->event_mask;
+ return GDK_SURFACE (surface)->event_mask;
}
static void
-gdk_surface_wayland_raise (GdkSurface *window)
+gdk_surface_wayland_raise (GdkSurface *surface)
{
}
static void
-gdk_surface_wayland_lower (GdkSurface *window)
+gdk_surface_wayland_lower (GdkSurface *surface)
{
}
static void
-gdk_surface_wayland_restack_toplevel (GdkSurface *window,
+gdk_surface_wayland_restack_toplevel (GdkSurface *surface,
GdkSurface *sibling,
gboolean above)
{
}
static void
-gdk_surface_request_transient_parent_commit (GdkSurface *window)
+gdk_surface_request_transient_parent_commit (GdkSurface *surface)
{
GdkSurfaceImplWayland *surface_impl, *impl;
GdkFrameClock *frame_clock;
- surface_impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ surface_impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!surface_impl->transient_for)
return;
@@ -2615,44 +2615,44 @@ gdk_surface_request_transient_parent_commit (GdkSurface *window)
}
static void
-gdk_surface_wayland_move_resize (GdkSurface *window,
+gdk_surface_wayland_move_resize (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (with_move)
{
/* Each toplevel has in its own "root" coordinate system */
- if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TOPLEVEL)
+ if (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_TOPLEVEL)
{
- window->x = x;
- window->y = y;
+ surface->x = x;
+ surface->y = y;
impl->position_method = POSITION_METHOD_MOVE_RESIZE;
if (impl->display_server.wl_subsurface)
{
wl_subsurface_set_position (impl->display_server.wl_subsurface,
- window->x + window->abs_x,
- window->y + window->abs_y);
- gdk_surface_request_transient_parent_commit (window);
+ surface->x + surface->abs_x,
+ surface->y + surface->abs_y);
+ gdk_surface_request_transient_parent_commit (surface);
}
}
}
/* If this function is called with width and height = -1 then that means
- * just move the window - don't update its size
+ * just move the surface - don't update its size
*/
if (width > 0 && height > 0)
- gdk_wayland_surface_maybe_configure (window, width, height, impl->scale);
+ gdk_wayland_surface_maybe_configure (surface, width, height, impl->scale);
}
/* Avoid zero width/height as this is a protocol error */
static void
-sanitize_anchor_rect (GdkSurface *window,
+sanitize_anchor_rect (GdkSurface *surface,
GdkRectangle *rect)
{
gint original_width = rect->width;
@@ -2665,7 +2665,7 @@ sanitize_anchor_rect (GdkSurface *window,
}
static void
-gdk_surface_wayland_move_to_rect (GdkSurface *window,
+gdk_surface_wayland_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
@@ -2673,10 +2673,10 @@ gdk_surface_wayland_move_to_rect (GdkSurface *window,
gint rect_anchor_dx,
gint rect_anchor_dy)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->pending_move_to_rect.rect = *rect;
- sanitize_anchor_rect (window, &impl->pending_move_to_rect.rect);
+ sanitize_anchor_rect (surface, &impl->pending_move_to_rect.rect);
impl->pending_move_to_rect.rect_anchor = rect_anchor;
impl->pending_move_to_rect.surface_anchor = surface_anchor;
@@ -2688,27 +2688,27 @@ gdk_surface_wayland_move_to_rect (GdkSurface *window,
}
static void
-gdk_surface_wayland_get_geometry (GdkSurface *window,
+gdk_surface_wayland_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
{
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
if (x)
- *x = window->x;
+ *x = surface->x;
if (y)
- *y = window->y;
+ *y = surface->y;
if (width)
- *width = window->width;
+ *width = surface->width;
if (height)
- *height = window->height;
+ *height = surface->height;
}
}
static void
-gdk_surface_wayland_get_root_coords (GdkSurface *window,
+gdk_surface_wayland_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
@@ -2720,31 +2720,31 @@ gdk_surface_wayland_get_root_coords (GdkSurface *window,
* positioned, relatively.
*
* However, there are some cases like popups and subsurfaces where we do have
- * some amount of control over the placement of our window, and we can
- * semi-accurately control the x/y position of these windows, if they are
+ * some amount of control over the placement of our surface, and we can
+ * semi-accurately control the x/y position of these surfaces, if they are
* relative to another surface.
*
* To pretend we have something called a root coordinate space, assume all
- * parent-less windows are positioned in (0, 0), and all relative positioned
+ * parent-less surfaces are positioned in (0, 0), and all relative positioned
* popups and subsurfaces are placed within this fake root coordinate space.
*
- * For example a 200x200 large toplevel window will have the position (0, 0).
+ * For example a 200x200 large toplevel surface will have the position (0, 0).
* If a popup positioned in the middle of the toplevel will have the fake
* position (100,100). Furthermore, if a positioned is placed in the middle
* that popup, will have the fake position (150,150), even though it has the
- * relative position (50,50). These three windows would make up one single
+ * relative position (50,50). These three surfaces would make up one single
* fake root coordinate space.
*/
if (root_x)
- *root_x = window->x + x;
+ *root_x = surface->x + x;
if (root_y)
- *root_y = window->y + y;
+ *root_y = surface->y + y;
}
static gboolean
-gdk_surface_wayland_get_device_state (GdkSurface *window,
+gdk_surface_wayland_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
@@ -2752,15 +2752,15 @@ gdk_surface_wayland_get_device_state (GdkSurface *window,
{
gboolean return_val;
- g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE);
+ g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), FALSE);
return_val = TRUE;
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
GdkSurface *child;
- GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
+ GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
&child,
NULL, NULL,
x, y, mask);
@@ -2771,7 +2771,7 @@ gdk_surface_wayland_get_device_state (GdkSurface *window,
}
static void
-gdk_surface_wayland_shape_combine_region (GdkSurface *window,
+gdk_surface_wayland_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
@@ -2779,14 +2779,14 @@ gdk_surface_wayland_shape_combine_region (GdkSurface *window,
}
static void
-gdk_surface_wayland_input_shape_combine_region (GdkSurface *window,
+gdk_surface_wayland_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
g_clear_pointer (&impl->input_region, cairo_region_destroy);
@@ -2801,32 +2801,32 @@ gdk_surface_wayland_input_shape_combine_region (GdkSurface *window,
}
static void
-gdk_wayland_surface_destroy (GdkSurface *window,
+gdk_wayland_surface_destroy (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- /* Wayland windows can't be externally destroyed; we may possibly
+ /* Wayland surfaces can't be externally destroyed; we may possibly
* eventually want to use this path at display close-down
*/
g_return_if_fail (!foreign_destroy);
- gdk_wayland_surface_hide_surface (window);
- drop_cairo_surfaces (window);
+ gdk_wayland_surface_hide_surface (surface);
+ drop_cairo_surfaces (surface);
- if (window->parent == NULL)
+ if (surface->parent == NULL)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- display->toplevels = g_list_remove (display->toplevels, window);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ display->toplevels = g_list_remove (display->toplevels, surface);
}
}
static void
-gdk_wayland_surface_focus (GdkSurface *window,
+gdk_wayland_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.gtk_surface)
return;
@@ -2842,28 +2842,28 @@ gdk_wayland_surface_focus (GdkSurface *window,
}
static void
-gdk_wayland_surface_set_type_hint (GdkSurface *window,
+gdk_wayland_surface_set_type_hint (GdkSurface *surface,
GdkSurfaceTypeHint hint)
{
GdkSurfaceImplWayland *impl;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->hint = hint;
}
static GdkSurfaceTypeHint
-gdk_wayland_surface_get_type_hint (GdkSurface *window)
+gdk_wayland_surface_get_type_hint (GdkSurface *surface)
{
GdkSurfaceImplWayland *impl;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return GDK_SURFACE_TYPE_HINT_NORMAL;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
return impl->hint;
}
@@ -2873,8 +2873,8 @@ gtk_surface_configure (void *data,
struct gtk_surface1 *gtk_surface,
struct wl_array *states)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceState new_state = 0;
uint32_t *p;
@@ -2915,8 +2915,8 @@ gtk_surface_configure_edges (void *data,
struct gtk_surface1 *gtk_surface,
struct wl_array *edge_constraints)
{
- GdkSurface *window = GDK_SURFACE (data);
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurfaceState new_state = 0;
uint32_t *p;
@@ -2953,11 +2953,11 @@ static const struct gtk_surface1_listener gtk_surface_listener = {
};
static void
-gdk_wayland_surface_init_gtk_surface (GdkSurface *window)
+gdk_wayland_surface_init_gtk_surface (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
if (impl->display_server.gtk_surface != NULL)
return;
@@ -2969,24 +2969,24 @@ gdk_wayland_surface_init_gtk_surface (GdkSurface *window)
impl->display_server.gtk_surface =
gtk_shell1_get_gtk_surface (display->gtk_shell,
impl->display_server.wl_surface);
- gdk_surface_set_geometry_hints (window,
+ gdk_surface_set_geometry_hints (surface,
&impl->geometry_hints,
impl->geometry_mask);
gtk_surface1_add_listener (impl->display_server.gtk_surface,
&gtk_surface_listener,
- window);
+ surface);
}
static void
-maybe_set_gtk_surface_modal (GdkSurface *window)
+maybe_set_gtk_surface_modal (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- gdk_wayland_surface_init_gtk_surface (window);
+ gdk_wayland_surface_init_gtk_surface (surface);
if (impl->display_server.gtk_surface == NULL)
return;
- if (window->modal_hint)
+ if (surface->modal_hint)
gtk_surface1_set_modal (impl->display_server.gtk_surface);
else
gtk_surface1_unset_modal (impl->display_server.gtk_surface);
@@ -2994,44 +2994,44 @@ maybe_set_gtk_surface_modal (GdkSurface *window)
}
static void
-gdk_wayland_surface_set_modal_hint (GdkSurface *window,
+gdk_wayland_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
{
- window->modal_hint = modal;
- maybe_set_gtk_surface_modal (window);
+ surface->modal_hint = modal;
+ maybe_set_gtk_surface_modal (surface);
}
static void
-gdk_wayland_surface_set_skip_taskbar_hint (GdkSurface *window,
+gdk_wayland_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
{
}
static void
-gdk_wayland_surface_set_skip_pager_hint (GdkSurface *window,
+gdk_wayland_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
{
}
static void
-gdk_wayland_surface_set_urgency_hint (GdkSurface *window,
+gdk_wayland_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
{
}
static void
-gdk_wayland_surface_set_geometry_hints (GdkSurface *window,
+gdk_wayland_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask)
{
GdkSurfaceImplWayland *impl;
int width, height;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->geometry_hints = *geometry;
impl->geometry_mask = geom_mask;
@@ -3067,7 +3067,7 @@ gdk_wayland_surface_set_geometry_hints (GdkSurface *window,
}
static void
-gdk_wayland_surface_set_title (GdkSurface *window,
+gdk_wayland_surface_set_title (GdkSurface *surface,
const gchar *title)
{
GdkSurfaceImplWayland *impl;
@@ -3076,10 +3076,10 @@ gdk_wayland_surface_set_title (GdkSurface *window,
g_return_if_fail (title != NULL);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (g_strcmp0 (impl->title, title) == 0)
return;
@@ -3099,23 +3099,23 @@ gdk_wayland_surface_set_title (GdkSurface *window,
g_warning ("Invalid utf8 passed to gdk_surface_set_title: '%s'", title);
}
- gdk_wayland_surface_sync_title (window);
+ gdk_wayland_surface_sync_title (surface);
}
static void
-gdk_wayland_surface_set_role (GdkSurface *window,
+gdk_wayland_surface_set_role (GdkSurface *surface,
const gchar *role)
{
}
static void
-gdk_wayland_surface_set_startup_id (GdkSurface *window,
+gdk_wayland_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
}
static gboolean
-check_transient_for_loop (GdkSurface *window,
+check_transient_for_loop (GdkSurface *surface,
GdkSurface *parent)
{
while (parent)
@@ -3126,7 +3126,7 @@ check_transient_for_loop (GdkSurface *window,
return FALSE;
impl = GDK_SURFACE_IMPL_WAYLAND (parent->impl);
- if (impl->transient_for == window)
+ if (impl->transient_for == surface)
return TRUE;
parent = impl->transient_for;
}
@@ -3134,27 +3134,27 @@ check_transient_for_loop (GdkSurface *window,
}
static void
-gdk_wayland_surface_set_transient_for (GdkSurface *window,
+gdk_wayland_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurface *previous_parent;
g_assert (parent == NULL ||
- gdk_surface_get_display (window) == gdk_surface_get_display (parent));
+ gdk_surface_get_display (surface) == gdk_surface_get_display (parent));
- if (check_transient_for_loop (window, parent))
+ if (check_transient_for_loop (surface, parent))
{
- g_warning ("Setting %p transient for %p would create a loop", window, parent);
+ g_warning ("Setting %p transient for %p would create a loop", surface, parent);
return;
}
- unset_transient_for_exported (window);
+ unset_transient_for_exported (surface);
if (impl->display_server.wl_subsurface)
- unmap_subsurface (window);
+ unmap_subsurface (surface);
previous_parent = impl->transient_for;
impl->transient_for = parent;
@@ -3162,62 +3162,62 @@ gdk_wayland_surface_set_transient_for (GdkSurface *window,
if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG)
{
if (!parent)
- _gdk_wayland_screen_add_orphan_dialog (window);
+ _gdk_wayland_screen_add_orphan_dialog (surface);
else if (!previous_parent)
display_wayland->orphan_dialogs =
- g_list_remove (display_wayland->orphan_dialogs, window);
+ g_list_remove (display_wayland->orphan_dialogs, surface);
}
- gdk_wayland_surface_sync_parent (window, NULL);
- if (should_map_as_subsurface (window) &&
- parent && gdk_surface_is_visible (window))
- gdk_wayland_surface_create_subsurface (window);
+ gdk_wayland_surface_sync_parent (surface, NULL);
+ if (should_map_as_subsurface (surface) &&
+ parent && gdk_surface_is_visible (surface))
+ gdk_wayland_surface_create_subsurface (surface);
}
static void
-gdk_wayland_surface_get_frame_extents (GdkSurface *window,
+gdk_wayland_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
{
*rect = (GdkRectangle) {
- .x = window->x,
- .y = window->y,
- .width = window->width,
- .height = window->height
+ .x = surface->x,
+ .y = surface->y,
+ .width = surface->width,
+ .height = surface->height
};
}
static void
-gdk_wayland_surface_set_accept_focus (GdkSurface *window,
+gdk_wayland_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
{
}
static void
-gdk_wayland_surface_set_focus_on_map (GdkSurface *window,
+gdk_wayland_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
{
}
static void
-gdk_wayland_surface_set_icon_list (GdkSurface *window,
+gdk_wayland_surface_set_icon_list (GdkSurface *surface,
GList *surfaces)
{
}
static void
-gdk_wayland_surface_set_icon_name (GdkSurface *window,
+gdk_wayland_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
}
static void
-gdk_wayland_surface_iconify (GdkSurface *window)
+gdk_wayland_surface_iconify (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
if (!impl->display_server.xdg_toplevel)
@@ -3227,103 +3227,103 @@ gdk_wayland_surface_iconify (GdkSurface *window)
}
static void
-gdk_wayland_surface_deiconify (GdkSurface *window)
+gdk_wayland_surface_deiconify (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_surface_show (window);
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_surface_show (surface);
else
/* Flip our client side flag, the real work happens on map. */
- gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_ICONIFIED, 0);
}
static void
-gdk_wayland_surface_stick (GdkSurface *window)
+gdk_wayland_surface_stick (GdkSurface *surface)
{
}
static void
-gdk_wayland_surface_unstick (GdkSurface *window)
+gdk_wayland_surface_unstick (GdkSurface *surface)
{
}
static void
-gdk_wayland_surface_maximize (GdkSurface *window)
+gdk_wayland_surface_maximize (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- _gdk_wayland_surface_save_size (window);
+ _gdk_wayland_surface_save_size (surface);
if (impl->display_server.xdg_toplevel)
zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel);
else
- gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MAXIMIZED);
}
static void
-gdk_wayland_surface_unmaximize (GdkSurface *window)
+gdk_wayland_surface_unmaximize (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (impl->display_server.xdg_toplevel)
zxdg_toplevel_v6_unset_maximized (impl->display_server.xdg_toplevel);
else
- gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MAXIMIZED, 0);
}
static void
-gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *window,
+gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_output *output = ((GdkWaylandMonitor *)monitor)->output;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- _gdk_wayland_surface_save_size (window);
+ _gdk_wayland_surface_save_size (surface);
if (impl->display_server.xdg_toplevel)
{
zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, output);
}
else
{
- gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
impl->initial_fullscreen_output = output;
}
}
static void
-gdk_wayland_surface_fullscreen (GdkSurface *window)
+gdk_wayland_surface_fullscreen (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->initial_fullscreen_output = NULL;
- _gdk_wayland_surface_save_size (window);
+ _gdk_wayland_surface_save_size (surface);
if (impl->display_server.xdg_toplevel)
zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, NULL);
else
- gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
}
static void
-gdk_wayland_surface_unfullscreen (GdkSurface *window)
+gdk_wayland_surface_unfullscreen (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->initial_fullscreen_output = NULL;
@@ -3331,52 +3331,52 @@ gdk_wayland_surface_unfullscreen (GdkSurface *window)
if (impl->display_server.xdg_toplevel)
zxdg_toplevel_v6_unset_fullscreen (impl->display_server.xdg_toplevel);
else
- gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_FULLSCREEN, 0);
}
static void
-gdk_wayland_surface_set_keep_above (GdkSurface *window, gboolean setting)
+gdk_wayland_surface_set_keep_above (GdkSurface *surface, gboolean setting)
{
}
static void
-gdk_wayland_surface_set_keep_below (GdkSurface *window, gboolean setting)
+gdk_wayland_surface_set_keep_below (GdkSurface *surface, gboolean setting)
{
}
static GdkSurface *
-gdk_wayland_surface_get_group (GdkSurface *window)
+gdk_wayland_surface_get_group (GdkSurface *surface)
{
return NULL;
}
static void
-gdk_wayland_surface_set_group (GdkSurface *window,
+gdk_wayland_surface_set_group (GdkSurface *surface,
GdkSurface *leader)
{
}
static void
-gdk_wayland_surface_set_decorations (GdkSurface *window,
+gdk_wayland_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
}
static gboolean
-gdk_wayland_surface_get_decorations (GdkSurface *window,
+gdk_wayland_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations)
{
return FALSE;
}
static void
-gdk_wayland_surface_set_functions (GdkSurface *window,
+gdk_wayland_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
}
static void
-gdk_wayland_surface_begin_resize_drag (GdkSurface *window,
+gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -3388,8 +3388,8 @@ gdk_wayland_surface_begin_resize_drag (GdkSurface *window,
GdkEventSequence *sequence;
uint32_t resize_edges, serial;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
switch (edge)
@@ -3431,7 +3431,7 @@ gdk_wayland_surface_begin_resize_drag (GdkSurface *window,
return;
}
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.xdg_toplevel)
return;
@@ -3453,7 +3453,7 @@ gdk_wayland_surface_begin_resize_drag (GdkSurface *window,
}
static void
-gdk_wayland_surface_begin_move_drag (GdkSurface *window,
+gdk_wayland_surface_begin_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
@@ -3464,11 +3464,11 @@ gdk_wayland_surface_begin_move_drag (GdkSurface *window,
GdkEventSequence *sequence;
uint32_t serial;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.xdg_toplevel)
return;
@@ -3488,41 +3488,41 @@ gdk_wayland_surface_begin_move_drag (GdkSurface *window,
}
static void
-gdk_wayland_surface_set_opacity (GdkSurface *window,
+gdk_wayland_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
{
}
static void
-gdk_wayland_surface_destroy_notify (GdkSurface *window)
+gdk_wayland_surface_destroy_notify (GdkSurface *surface)
{
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- g_warning ("GdkSurface %p unexpectedly destroyed", window);
- _gdk_surface_destroy (window, TRUE);
+ g_warning ("GdkSurface %p unexpectedly destroyed", surface);
+ _gdk_surface_destroy (surface, TRUE);
}
- g_object_unref (window);
+ g_object_unref (surface);
}
static gint
-gdk_wayland_surface_get_scale_factor (GdkSurface *window)
+gdk_wayland_surface_get_scale_factor (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 1;
return impl->scale;
}
static void
-gdk_wayland_surface_set_opaque_region (GdkSurface *window,
+gdk_wayland_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
g_clear_pointer (&impl->opaque_region, cairo_region_destroy);
@@ -3531,24 +3531,24 @@ gdk_wayland_surface_set_opaque_region (GdkSurface *window,
}
static void
-gdk_wayland_surface_set_shadow_width (GdkSurface *window,
+gdk_wayland_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
gint new_width, new_height;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- /* Reconfigure window to keep the same window geometry */
- new_width = window->width -
+ /* Reconfigure surface to keep the same surface geometry */
+ new_width = surface->width -
(impl->margin_left + impl->margin_right) + (left + right);
- new_height = window->height -
+ new_height = surface->height -
(impl->margin_top + impl->margin_bottom) + (top + bottom);
- gdk_wayland_surface_maybe_configure (window, new_width, new_height, impl->scale);
+ gdk_wayland_surface_maybe_configure (surface, new_width, new_height, impl->scale);
impl->margin_left = left;
impl->margin_right = right;
@@ -3557,10 +3557,10 @@ gdk_wayland_surface_set_shadow_width (GdkSurface *window,
}
static gboolean
-gdk_wayland_surface_show_window_menu (GdkSurface *window,
+gdk_wayland_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_seat *seat;
GdkWaylandDevice *device;
double x, y;
@@ -3591,9 +3591,9 @@ gdk_wayland_surface_show_window_menu (GdkSurface *window,
}
static gboolean
-gdk_wayland_surface_supports_edge_constraints (GdkSurface *window)
+gdk_wayland_surface_supports_edge_constraints (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct gtk_surface1 *gtk_surface = impl->display_server.gtk_surface;
if (!gtk_surface)
@@ -3687,23 +3687,23 @@ _gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass)
}
void
-_gdk_wayland_surface_set_grab_seat (GdkSurface *window,
+_gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
GdkSeat *seat)
{
GdkSurfaceImplWayland *impl;
- g_return_if_fail (window != NULL);
+ g_return_if_fail (surface != NULL);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->grab_input_seat = seat;
}
/**
* gdk_wayland_surface_new_subsurface: (constructor)
- * @display: the display to create the window on
- * @position: position relative to the transient window
+ * @display: the display to create the surface on
+ * @position: position relative to the transient surface
*
- * Creates a new subsurface window.
+ * Creates a new subsurface surface.
*
* Returns: (transfer full): the new #GdkSurface
**/
@@ -3728,28 +3728,28 @@ gdk_wayland_surface_new_subsurface (GdkDisplay *display,
/**
* gdk_wayland_surface_get_wl_surface:
- * @window: (type GdkWaylandSurface): a #GdkSurface
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
*
* Returns the Wayland surface of a #GdkSurface.
*
* Returns: (transfer none): a Wayland wl_surface
*/
struct wl_surface *
-gdk_wayland_surface_get_wl_surface (GdkSurface *window)
+gdk_wayland_surface_get_wl_surface (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- return GDK_SURFACE_IMPL_WAYLAND (window->impl)->display_server.wl_surface;
+ return GDK_SURFACE_IMPL_WAYLAND (surface->impl)->display_server.wl_surface;
}
struct wl_output *
-gdk_wayland_surface_get_wl_output (GdkSurface *window)
+gdk_wayland_surface_get_wl_output (GdkSurface *surface)
{
GdkSurfaceImplWayland *impl;
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
/* We pick the head of the list as this is the last entered output */
if (impl->display_server.outputs)
return (struct wl_output *) impl->display_server.outputs->data;
@@ -3758,9 +3758,9 @@ gdk_wayland_surface_get_wl_output (GdkSurface *window)
}
static struct wl_egl_window *
-gdk_wayland_surface_get_wl_egl_window (GdkSurface *window)
+gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->display_server.egl_window == NULL)
{
@@ -3775,20 +3775,20 @@ gdk_wayland_surface_get_wl_egl_window (GdkSurface *window)
}
EGLSurface
-gdk_wayland_surface_get_egl_surface (GdkSurface *window,
+gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurfaceImplWayland *impl;
struct wl_egl_window *egl_window;
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->egl_surface == NULL)
{
- egl_window = gdk_wayland_surface_get_wl_egl_window (window);
+ egl_window = gdk_wayland_surface_get_wl_egl_window (surface);
impl->egl_surface =
eglCreateWindowSurface (display->egl_display, config, egl_window, NULL);
@@ -3798,15 +3798,15 @@ gdk_wayland_surface_get_egl_surface (GdkSurface *window,
}
EGLSurface
-gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window,
+gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
EGLConfig config)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurfaceImplWayland *impl;
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->dummy_egl_surface == NULL)
{
@@ -3821,16 +3821,16 @@ gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window,
}
struct gtk_surface1 *
-gdk_wayland_surface_get_gtk_surface (GdkSurface *window)
+gdk_wayland_surface_get_gtk_surface (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- return GDK_SURFACE_IMPL_WAYLAND (window->impl)->display_server.gtk_surface;
+ return GDK_SURFACE_IMPL_WAYLAND (surface->impl)->display_server.gtk_surface;
}
/**
* gdk_wayland_surface_set_use_custom_surface:
- * @window: (type GdkWaylandSurface): a #GdkSurface
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
*
* Marks a #GdkSurface as a custom Wayland surface. The application is
* expected to register the surface as some type of surface using
@@ -3851,14 +3851,14 @@ gdk_wayland_surface_get_gtk_surface (GdkSurface *window)
* static void
* widget_realize_cb (GtkWidget *widget)
* {
- * GdkSurface *window;
+ * GdkSurface *surface;
* struct wl_surface *surface;
* struct input_panel_surface *ip_surface;
*
- * window = gtk_widget_get_window (widget);
- * gdk_wayland_surface_set_custom_surface (window);
+ * surface = gtk_widget_get_window (widget);
+ * gdk_wayland_surface_set_custom_surface (surface);
*
- * surface = gdk_wayland_surface_get_wl_surface (window);
+ * surface = gdk_wayland_surface_get_wl_surface (surface);
* ip_surface = input_panel_get_input_panel_surface (input_panel, surface);
* input_panel_surface_set_panel (ip_surface);
* }
@@ -3871,24 +3871,24 @@ gdk_wayland_surface_get_gtk_surface (GdkSurface *window)
* ]|
*/
void
-gdk_wayland_surface_set_use_custom_surface (GdkSurface *window)
+gdk_wayland_surface_set_use_custom_surface (GdkSurface *surface)
{
GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
- gdk_wayland_surface_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
impl->use_custom_surface = TRUE;
}
static void
-maybe_set_gtk_surface_dbus_properties (GdkSurface *window)
+maybe_set_gtk_surface_dbus_properties (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->application.was_set)
return;
@@ -3901,7 +3901,7 @@ maybe_set_gtk_surface_dbus_properties (GdkSurface *window)
impl->application.unique_bus_name == NULL)
return;
- gdk_wayland_surface_init_gtk_surface (window);
+ gdk_wayland_surface_init_gtk_surface (surface);
if (impl->display_server.gtk_surface == NULL)
return;
@@ -3916,7 +3916,7 @@ maybe_set_gtk_surface_dbus_properties (GdkSurface *window)
}
void
-gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window,
+gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
@@ -3926,9 +3926,9 @@ gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window,
{
GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->application.application_id = g_strdup (application_id);
impl->application.app_menu_path = g_strdup (app_menu_path);
@@ -3938,19 +3938,19 @@ gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window,
g_strdup (application_object_path);
impl->application.unique_bus_name = g_strdup (unique_bus_name);
- maybe_set_gtk_surface_dbus_properties (window);
+ maybe_set_gtk_surface_dbus_properties (surface);
}
void
-_gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *window,
+_gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface,
int x,
int y)
{
GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->pending_buffer_offset_x = x;
impl->pending_buffer_offset_y = y;
@@ -3961,10 +3961,10 @@ xdg_exported_handle (void *data,
struct zxdg_exported_v1 *zxdg_exported_v1,
const char *handle)
{
- GdkSurface *window = data;
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = data;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- impl->exported.callback (window, handle, impl->exported.user_data);
+ impl->exported.callback (surface, handle, impl->exported.user_data);
g_clear_pointer (&impl->exported.user_data,
impl->exported.destroy_func);
}
@@ -3975,27 +3975,27 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = {
/**
* GdkWaylandSurfaceExported:
- * @window: the #GdkSurface that is exported
+ * @surface: the #GdkSurface that is exported
* @handle: the handle
* @user_data: user data that was passed to gdk_wayland_surface_export_handle()
*
- * Callback that gets called when the handle for a window has been
+ * Callback that gets called when the handle for a surface has been
* obtained from the Wayland compositor. The handle can be passed
- * to other processes, for the purpose of marking windows as transient
+ * to other processes, for the purpose of marking surfaces as transient
* for out-of-process surfaces.
*/
static gboolean
-gdk_wayland_surface_is_exported (GdkSurface *window)
+gdk_wayland_surface_is_exported (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
return !!impl->display_server.xdg_exported;
}
/**
* gdk_wayland_surface_export_handle:
- * @window: the #GdkSurface to obtain a handle for
+ * @surface: the #GdkSurface to obtain a handle for
* @callback: callback to call with the handle
* @user_data: user data for @callback
* @destroy_func: destroy notify for @user_data
@@ -4004,14 +4004,14 @@ gdk_wayland_surface_is_exported (GdkSurface *window)
* to other processes. When the handle has been obtained, @callback
* will be called.
*
- * It is an error to call this function on a window that is already
+ * It is an error to call this function on a surface that is already
* exported.
*
* When the handle is no longer needed, gdk_wayland_surface_unexport_handle()
* should be called to clean up resources.
*
* The main purpose for obtaining a handle is to mark a surface
- * from another window as transient for this one, see
+ * from another surface as transient for this one, see
* gdk_wayland_surface_set_transient_for_exported().
*
* Note that this API depends on an unstable Wayland protocol,
@@ -4021,20 +4021,20 @@ gdk_wayland_surface_is_exported (GdkSurface *window)
* an error occurred.
*/
gboolean
-gdk_wayland_surface_export_handle (GdkSurface *window,
+gdk_wayland_surface_export_handle (GdkSurface *surface,
GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
struct zxdg_exported_v1 *xdg_exported;
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), FALSE);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), FALSE);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
display_wayland = GDK_WAYLAND_DISPLAY (display);
g_return_val_if_fail (!impl->display_server.xdg_exported, FALSE);
@@ -4047,7 +4047,7 @@ gdk_wayland_surface_export_handle (GdkSurface *window,
xdg_exported = zxdg_exporter_v1_export (display_wayland->xdg_exporter,
impl->display_server.wl_surface);
- zxdg_exported_v1_add_listener (xdg_exported, &xdg_exported_listener, window);
+ zxdg_exported_v1_add_listener (xdg_exported, &xdg_exported_listener, surface);
impl->display_server.xdg_exported = xdg_exported;
impl->exported.callback = callback;
@@ -4059,25 +4059,25 @@ gdk_wayland_surface_export_handle (GdkSurface *window,
/**
* gdk_wayland_surface_unexport_handle:
- * @window: the #GdkSurface to unexport
+ * @surface: the #GdkSurface to unexport
*
* Destroys the handle that was obtained with
* gdk_wayland_surface_export_handle().
*
- * It is an error to call this function on a window that
+ * It is an error to call this function on a surface that
* does not have a handle.
*
* Note that this API depends on an unstable Wayland protocol,
* and thus may require changes in the future.
*/
void
-gdk_wayland_surface_unexport_handle (GdkSurface *window)
+gdk_wayland_surface_unexport_handle (GdkSurface *surface)
{
GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
g_return_if_fail (impl->display_server.xdg_exported);
@@ -4088,9 +4088,9 @@ gdk_wayland_surface_unexport_handle (GdkSurface *window)
}
static void
-unset_transient_for_exported (GdkSurface *window)
+unset_transient_for_exported (GdkSurface *surface)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
g_clear_pointer (&impl->imported_transient_for, zxdg_imported_v1_destroy);
}
@@ -4099,9 +4099,9 @@ static void
xdg_imported_destroyed (void *data,
struct zxdg_imported_v1 *zxdg_imported_v1)
{
- GdkSurface *window = data;
+ GdkSurface *surface = data;
- unset_transient_for_exported (window);
+ unset_transient_for_exported (surface);
}
static const struct zxdg_imported_v1_listener xdg_imported_listener = {
@@ -4110,33 +4110,33 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = {
/**
* gdk_wayland_surface_set_transient_for_exported:
- * @window: the #GdkSurface to make as transient
+ * @surface: the #GdkSurface to make as transient
* @parent_handle_str: an exported handle for a surface
*
- * Marks @window as transient for the surface to which the given
+ * Marks @surface as transient for the surface to which the given
* @parent_handle_str refers. Typically, the handle will originate
* from a gdk_wayland_surface_export_handle() call in another process.
*
* Note that this API depends on an unstable Wayland protocol,
* and thus may require changes in the future.
*
- * Return value: %TRUE if the window has been marked as transient,
+ * Return value: %TRUE if the surface has been marked as transient,
* %FALSE if an error occurred.
*/
gboolean
-gdk_wayland_surface_set_transient_for_exported (GdkSurface *window,
+gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
char *parent_handle_str)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
- g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), FALSE);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), FALSE);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), FALSE);
- g_return_val_if_fail (!should_map_as_subsurface (window) &&
- !should_map_as_popup (window), FALSE);
+ g_return_val_if_fail (!should_map_as_subsurface (surface) &&
+ !should_map_as_popup (surface), FALSE);
- impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (!display_wayland->xdg_importer)
@@ -4145,15 +4145,15 @@ gdk_wayland_surface_set_transient_for_exported (GdkSurface *window,
return FALSE;
}
- gdk_surface_set_transient_for (window, NULL);
+ gdk_surface_set_transient_for (surface, NULL);
impl->imported_transient_for =
zxdg_importer_v1_import (display_wayland->xdg_importer, parent_handle_str);
zxdg_imported_v1_add_listener (impl->imported_transient_for,
&xdg_imported_listener,
- window);
+ surface);
- gdk_wayland_surface_sync_parent_of_imported (window);
+ gdk_wayland_surface_sync_parent_of_imported (surface);
return TRUE;
}
@@ -4166,12 +4166,12 @@ gdk_wayland_surface_get_inhibitor (GdkSurfaceImplWayland *impl,
}
void
-gdk_wayland_surface_inhibit_shortcuts (GdkSurface *window,
+gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
{
- GdkSurfaceImplWayland *impl= GDK_SURFACE_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window));
- struct wl_surface *surface = impl->display_server.wl_surface;
+ GdkSurfaceImplWayland *impl= GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ struct wl_surface *wl_surface = impl->display_server.wl_surface;
struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor;
@@ -4183,16 +4183,16 @@ gdk_wayland_surface_inhibit_shortcuts (GdkSurface *window,
inhibitor =
zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts (
- display->keyboard_shortcuts_inhibit, surface, seat);
+ display->keyboard_shortcuts_inhibit, wl_surface, seat);
g_hash_table_insert (impl->shortcuts_inhibitors, seat, inhibitor);
}
void
-gdk_wayland_surface_restore_shortcuts (GdkSurface *window,
+gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
{
- GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor;
diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c
index ad121be393..4e85469741 100644
--- a/gdk/wayland/gdkvulkancontext-wayland.c
+++ b/gdk/wayland/gdkvulkancontext-wayland.c
@@ -35,12 +35,12 @@ G_DEFINE_TYPE (GdkWaylandVulkanContext, gdk_wayland_vulkan_context, GDK_TYPE_VUL
static VkResult
gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context,
- VkSurfaceKHR *surface)
+ VkSurfaceKHR *vr_surface)
{
- GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = 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.
+ /* This is necessary so that Vulkan sees the Surface.
* Usually, vkCreateXlibSurfaceKHR() will not cause a problem to happen as
* it just creates resources, but futher calls with the resulting surface
* do cause issues.
@@ -53,10 +53,10 @@ gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context,
NULL,
0,
gdk_wayland_display_get_wl_display (display),
- gdk_wayland_surface_get_wl_surface (window)
+ gdk_wayland_surface_get_wl_surface (surface)
},
NULL,
- surface);
+ vr_surface);
}
static void
@@ -64,11 +64,11 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
- GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage);
- gdk_wayland_surface_sync (window);
+ gdk_wayland_surface_sync (surface);
}
static void
diff --git a/gdk/wayland/gdkwaylandsurface.h b/gdk/wayland/gdkwaylandsurface.h
index b9747b6ca8..49dafde67f 100644
--- a/gdk/wayland/gdkwaylandsurface.h
+++ b/gdk/wayland/gdkwaylandsurface.h
@@ -49,13 +49,13 @@ GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_wayland_surface_new_subsurface (GdkDisplay *display,
const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL
-struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *window);
+struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_surface_set_use_custom_surface (GdkSurface *window);
+void gdk_wayland_surface_set_use_custom_surface (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window,
+void gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
@@ -63,24 +63,24 @@ void gdk_wayland_surface_set_dbus_properties_libgtk_only (Gd
const char *application_object_path,
const char *unique_bus_name);
-typedef void (*GdkWaylandSurfaceExported) (GdkSurface *window,
+typedef void (*GdkWaylandSurfaceExported) (GdkSurface *surface,
const char *handle,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_wayland_surface_export_handle (GdkSurface *window,
+gboolean gdk_wayland_surface_export_handle (GdkSurface *surface,
GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_surface_unexport_handle (GdkSurface *window);
+void gdk_wayland_surface_unexport_handle (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *window,
+gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
char *parent_handle_str);
-void gdk_wayland_surface_announce_csd (GdkSurface *window);
+void gdk_wayland_surface_announce_csd (GdkSurface *surface);
G_END_DECLS
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 2c9bf3ffa9..6aa3da3e0e 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -846,7 +846,7 @@ _gdk_win32_print_event (const GdkEvent *event)
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
g_print ("%p (%.4g,%.4g) (%.4g,%.4g) %s %s%s",
- event->crossing.subwindow == NULL ? NULL : GDK_SURFACE_HWND (event->crossing.subwindow),
+ event->crossing.child_window == NULL ? NULL : GDK_SURFACE_HWND (event->crossing.subwindow),
event->crossing.x, event->crossing.y,
event->crossing.x_root, event->crossing.y_root,
(event->crossing.mode == GDK_CROSSING_NORMAL ? "NORMAL" :
@@ -949,8 +949,8 @@ fixup_event (GdkEvent *event)
g_object_ref (event->any.window);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
- (event->crossing.subwindow != NULL))
- g_object_ref (event->crossing.subwindow);
+ (event->crossing.child_window != NULL))
+ g_object_ref (event->crossing.child_window);
if (((event->any.type == GDK_SELECTION_CLEAR) ||
(event->any.type == GDK_SELECTION_NOTIFY) ||
(event->any.type == GDK_SELECTION_REQUEST)) &&
@@ -1242,7 +1242,7 @@ send_crossing_event (GdkDisplay *display,
event = gdk_event_new (type);
event->crossing.window = window;
- event->crossing.subwindow = subwindow;
+ event->crossing.child_window = subwindow;
event->crossing.time = _gdk_win32_get_next_tick (time_);
event->crossing.x = pt.x / impl->surface_scale;
event->crossing.y = pt.y / impl->surface_scale;
diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c
index 38b42173bd..3f875422a9 100644
--- a/gdk/x11/gdkdevice-core-x11.c
+++ b/gdk/x11/gdkdevice-core-x11.c
@@ -40,31 +40,31 @@ struct _GdkX11DeviceCoreClass
};
static gboolean gdk_x11_device_core_get_history (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_x11_device_core_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
static void gdk_x11_device_core_set_surface_cursor (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor);
static void gdk_x11_device_core_warp (GdkDevice *device,
gdouble x,
gdouble y);
static void gdk_x11_device_core_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_x11_device_core_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -78,7 +78,7 @@ static GdkSurface * gdk_x11_device_core_surface_at_position (GdkDevice *de
GdkModifierType *mask,
gboolean get_toplevel);
static void gdk_x11_device_core_select_surface_events (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkX11DeviceCore, gdk_x11_device_core, GDK_TYPE_DEVICE)
@@ -111,16 +111,16 @@ gdk_x11_device_core_init (GdkX11DeviceCore *device_core)
}
static gboolean
-impl_coord_in_window (GdkSurface *window,
+impl_coord_in_surface (GdkSurface *surface,
int impl_x,
int impl_y)
{
- if (impl_x < window->abs_x ||
- impl_x >= window->abs_x + window->width)
+ if (impl_x < surface->abs_x ||
+ impl_x >= surface->abs_x + surface->width)
return FALSE;
- if (impl_y < window->abs_y ||
- impl_y >= window->abs_y + window->height)
+ if (impl_y < surface->abs_y ||
+ impl_y >= surface->abs_y + surface->height)
return FALSE;
return TRUE;
@@ -128,7 +128,7 @@ impl_coord_in_window (GdkSurface *window,
static gboolean
gdk_x11_device_core_get_history (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -141,9 +141,9 @@ gdk_x11_device_core_get_history (GdkDevice *device,
int tmp_n_events;
int i, j;
- impl_surface = _gdk_surface_get_impl_surface (window);
+ impl_surface = _gdk_surface_get_impl_surface (surface);
impl = GDK_SURFACE_IMPL_X11 (impl_surface->impl);
- xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (window),
+ xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (surface),
GDK_SURFACE_XID (impl_surface),
start, stop, &tmp_n_events);
if (!xcoords)
@@ -153,13 +153,13 @@ gdk_x11_device_core_get_history (GdkDevice *device,
for (i = 0, j = 0; i < tmp_n_events; i++)
{
- if (impl_coord_in_window (window,
+ if (impl_coord_in_surface (surface,
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->surface_scale - window->abs_x;
- coords[j]->axes[1] = (double)xcoords[i].y / impl->surface_scale - window->abs_y;
+ coords[j]->axes[0] = (double)xcoords[i].x / impl->surface_scale - surface->abs_x;
+ coords[j]->axes[1] = (double)xcoords[i].y / impl->surface_scale - surface->abs_y;
j++;
}
}
@@ -194,13 +194,13 @@ gdk_x11_device_core_get_history (GdkDevice *device,
static void
gdk_x11_device_core_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x, y;
- gdk_surface_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
if (axes)
{
@@ -211,7 +211,7 @@ gdk_x11_device_core_get_state (GdkDevice *device,
static void
gdk_x11_device_core_set_surface_cursor (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkDisplay *display = gdk_device_get_display (device);
@@ -223,7 +223,7 @@ gdk_x11_device_core_set_surface_cursor (GdkDevice *device,
xcursor = gdk_x11_display_get_xcursor (display, cursor);
XDefineCursor (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
xcursor);
}
@@ -249,8 +249,8 @@ gdk_x11_device_core_warp (GdkDevice *device,
static void
gdk_x11_device_core_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -267,19 +267,19 @@ gdk_x11_device_core_query_state (GdkDevice *device,
display = gdk_device_get_display (device);
screen = GDK_X11_DISPLAY (display)->screen;
- if (window == NULL)
+ if (surface == NULL)
{
xwindow = GDK_SCREEN_XROOTWIN (screen);
scale = screen->surface_scale;
}
else
{
- xwindow = GDK_SURFACE_XID (window);
- scale = GDK_SURFACE_IMPL_X11 (window->impl)->surface_scale;
+ xwindow = GDK_SURFACE_XID (surface);
+ scale = GDK_SURFACE_IMPL_X11 (surface->impl)->surface_scale;
}
if (!GDK_X11_DISPLAY (display)->trusted_client ||
- !XQueryPointer (GDK_SURFACE_XDISPLAY (window),
+ !XQueryPointer (GDK_SURFACE_XDISPLAY (surface),
xwindow,
&xroot_window,
&xchild_window,
@@ -306,8 +306,8 @@ gdk_x11_device_core_query_state (GdkDevice *device,
XDestroyWindow (xdisplay, w);
}
- if (child_window)
- *child_window = gdk_x11_surface_lookup_for_display (display, xchild_window);
+ if (child_surface)
+ *child_surface = gdk_x11_surface_lookup_for_display (display, xchild_window);
if (root_x)
*root_x = (double)xroot_x / scale;
@@ -327,7 +327,7 @@ gdk_x11_device_core_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_x11_device_core_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -340,7 +340,7 @@ gdk_x11_device_core_grab (GdkDevice *device,
display = gdk_device_get_display (device);
- xwindow = GDK_SURFACE_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (confine_to)
confine_to = _gdk_surface_get_impl_surface (confine_to);
@@ -434,7 +434,7 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device,
GdkSurfaceImplX11 *impl;
GdkDisplay *display;
Display *xdisplay;
- GdkSurface *window;
+ GdkSurface *surface;
GdkX11Screen *screen;
Window xwindow, root, child, last;
int xroot_x, xroot_y, xwin_x, xwin_y;
@@ -480,9 +480,9 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device,
toplevels = gdk_x11_display_get_toplevel_windows (display);
for (list = toplevels; list != NULL; list = list->next)
{
- window = GDK_SURFACE (list->data);
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
- xwindow = GDK_SURFACE_XID (window);
+ surface = GDK_SURFACE (list->data);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ xwindow = GDK_SURFACE_XID (surface);
gdk_x11_display_error_trap_push (display);
XQueryPointer (xdisplay, xwindow,
&root, &child,
@@ -496,7 +496,7 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device,
pointer_window = child;
break;
}
- gdk_surface_get_geometry (window, NULL, NULL, &width, &height);
+ gdk_surface_get_geometry (surface, NULL, NULL, &width, &height);
if (winx >= 0 && winy >= 0 && winx < width * impl->surface_scale && winy < height * impl->surface_scale)
{
/* A childless toplevel, or below another window? */
@@ -537,8 +537,8 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device,
break;
if (get_toplevel && last != root &&
- (window = gdk_x11_surface_lookup_for_display (display, last)) != NULL &&
- window->surface_type != GDK_SURFACE_FOREIGN)
+ (surface = gdk_x11_surface_lookup_for_display (display, last)) != NULL &&
+ surface->surface_type != GDK_SURFACE_FOREIGN)
{
xwindow = last;
break;
@@ -547,33 +547,33 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device,
gdk_x11_display_ungrab (display);
- window = gdk_x11_surface_lookup_for_display (display, last);
+ surface = gdk_x11_surface_lookup_for_display (display, last);
impl = NULL;
- if (window)
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ if (surface)
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (win_x)
- *win_x = (window) ? (double)xwin_x / impl->surface_scale : -1;
+ *win_x = (surface) ? (double)xwin_x / impl->surface_scale : -1;
if (win_y)
- *win_y = (window) ? (double)xwin_y / impl->surface_scale : -1;
+ *win_y = (surface) ? (double)xwin_y / impl->surface_scale : -1;
if (mask)
*mask = xmask;
- return window;
+ return surface;
}
static void
gdk_x11_device_core_select_surface_events (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
- GdkEventMask filter_mask, window_mask;
+ GdkEventMask filter_mask, surface_mask;
guint xmask = 0;
gint i;
- window_mask = gdk_surface_get_events (window);
+ surface_mask = gdk_surface_get_events (surface);
filter_mask = GDK_POINTER_MOTION_MASK
| GDK_BUTTON_MOTION_MASK
| GDK_BUTTON1_MOTION_MASK
@@ -593,11 +593,11 @@ gdk_x11_device_core_select_surface_events (GdkDevice *device,
/* Filter out non-device events */
event_mask &= filter_mask;
- /* Unset device events on window mask */
- window_mask &= ~filter_mask;
+ /* Unset device events on surface mask */
+ surface_mask &= ~filter_mask;
/* Combine masks */
- event_mask |= window_mask;
+ event_mask |= surface_mask;
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
@@ -605,10 +605,10 @@ gdk_x11_device_core_select_surface_events (GdkDevice *device,
xmask |= _gdk_x11_event_mask_table[i];
}
- if (GDK_SURFACE_XID (window) != GDK_SURFACE_XROOTWIN (window))
+ if (GDK_SURFACE_XID (surface) != GDK_SURFACE_XROOTWIN (surface))
xmask |= StructureNotifyMask | PropertyChangeMask;
- XSelectInput (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XSelectInput (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
xmask);
}
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index acbcce047f..81f1f19b29 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -71,18 +71,18 @@ static void gdk_x11_device_xi2_set_property (GObject *object,
GParamSpec *pspec);
static void gdk_x11_device_xi2_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
static void gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor);
static void gdk_x11_device_xi2_warp (GdkDevice *device,
gdouble x,
gdouble y);
static void gdk_x11_device_xi2_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -90,7 +90,7 @@ static void gdk_x11_device_xi2_query_state (GdkDevice *device,
GdkModifierType *mask);
static GdkGrabStatus gdk_x11_device_xi2_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -105,7 +105,7 @@ static GdkSurface * gdk_x11_device_xi2_surface_at_position (GdkDevice *dev
GdkModifierType *mask,
gboolean get_toplevel);
static void gdk_x11_device_xi2_select_surface_events (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask);
@@ -200,7 +200,7 @@ gdk_x11_device_xi2_set_property (GObject *object,
static void
gdk_x11_device_xi2_get_state (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
@@ -239,14 +239,14 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
case GDK_AXIS_Y:
case GDK_AXIS_IGNORE:
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
- _gdk_device_translate_surface_coord (device, window, j, value, &axes[j]);
+ _gdk_device_translate_surface_coord (device, surface, j, value, &axes[j]);
else
{
gint root_x, root_y;
/* FIXME: Maybe root coords chaching should happen here */
- gdk_surface_get_origin (window, &root_x, &root_y);
- _gdk_device_translate_screen_coord (device, window,
+ gdk_surface_get_origin (surface, &root_x, &root_y);
+ _gdk_device_translate_screen_coord (device, surface,
root_x, root_y,
WidthOfScreen (xscreen),
HeightOfScreen (xscreen),
@@ -267,7 +267,7 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
}
if (mask)
- gdk_x11_device_xi2_query_state (device, window,
+ gdk_x11_device_xi2_query_state (device, surface,
NULL,
NULL, NULL,
NULL, NULL,
@@ -276,7 +276,7 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
static void
gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
@@ -286,14 +286,14 @@ gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
return;
if (cursor)
- XIDefineCursor (GDK_SURFACE_XDISPLAY (window),
+ XIDefineCursor (GDK_SURFACE_XDISPLAY (surface),
device_xi2->device_id,
- GDK_SURFACE_XID (window),
- gdk_x11_display_get_xcursor (GDK_SURFACE_DISPLAY (window), cursor));
+ GDK_SURFACE_XID (surface),
+ gdk_x11_display_get_xcursor (GDK_SURFACE_DISPLAY (surface), cursor));
else
- XIUndefineCursor (GDK_SURFACE_XDISPLAY (window),
+ XIUndefineCursor (GDK_SURFACE_XDISPLAY (surface),
device_xi2->device_id,
- GDK_SURFACE_XID (window));
+ GDK_SURFACE_XID (surface));
}
static void
@@ -316,8 +316,8 @@ gdk_x11_device_xi2_warp (GdkDevice *device,
static void
gdk_x11_device_xi2_query_state (GdkDevice *device,
- GdkSurface *window,
- GdkSurface **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -336,15 +336,15 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
display = gdk_device_get_display (device);
default_screen = GDK_X11_DISPLAY (display)->screen;
- if (window == NULL)
+ if (surface == NULL)
{
xwindow = GDK_DISPLAY_XROOTWIN (display);
scale = default_screen->surface_scale;
}
else
{
- xwindow = GDK_SURFACE_XID (window);
- scale = GDK_SURFACE_IMPL_X11 (window->impl)->surface_scale;
+ xwindow = GDK_SURFACE_XID (surface);
+ scale = GDK_SURFACE_IMPL_X11 (surface->impl)->surface_scale;
}
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE)
@@ -352,7 +352,7 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
GdkDevice *master = gdk_device_get_associated_device (device);
if (master)
- _gdk_device_query_state (master, window, child_window,
+ _gdk_device_query_state (master, surface, child_surface,
root_x, root_y, win_x, win_y, mask);
return;
}
@@ -392,8 +392,8 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
XDestroyWindow (xdisplay, w);
}
- if (child_window)
- *child_window = gdk_x11_surface_lookup_for_display (display, xchild_window);
+ if (child_surface)
+ *child_surface = gdk_x11_surface_lookup_for_display (display, xchild_window);
if (root_x)
*root_x = xroot_x / scale;
@@ -415,7 +415,7 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_x11_device_xi2_grab (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
@@ -435,7 +435,7 @@ gdk_x11_device_xi2_grab (GdkDevice *device,
/* FIXME: confine_to is actually unused */
- xwindow = GDK_SURFACE_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (!cursor)
xcursor = None;
@@ -498,7 +498,7 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
GdkDisplay *display;
GdkX11Screen *screen;
Display *xdisplay;
- GdkSurface *window;
+ GdkSurface *surface;
Window xwindow, root, child, last = None;
gdouble xroot_x, xroot_y, xwin_x, xwin_y;
XIButtonState button_state = { 0 };
@@ -550,8 +550,8 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
toplevels = gdk_x11_display_get_toplevel_windows (display);
for (list = toplevels; list != NULL; list = list->next)
{
- window = GDK_SURFACE (list->data);
- xwindow = GDK_SURFACE_XID (window);
+ surface = GDK_SURFACE (list->data);
+ xwindow = GDK_SURFACE_XID (surface);
/* Free previous button mask, if any */
g_free (button_state.mask);
@@ -573,7 +573,7 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
pointer_window = child;
break;
}
- gdk_surface_get_geometry (window, NULL, NULL, &width, &height);
+ gdk_surface_get_geometry (surface, NULL, NULL, &width, &height);
if (xwin_x >= 0 && xwin_y >= 0 && xwin_x < width && xwin_y < height)
{
/* A childless toplevel, or below another window? */
@@ -628,8 +628,8 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
break;
if (get_toplevel && last != root &&
- (window = gdk_x11_surface_lookup_for_display (display, last)) != NULL &&
- GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
+ (surface = gdk_x11_surface_lookup_for_display (display, last)) != NULL &&
+ GDK_SURFACE_TYPE (surface) != GDK_SURFACE_FOREIGN)
{
xwindow = last;
break;
@@ -640,10 +640,10 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
if (gdk_x11_display_error_trap_pop (display) == 0)
{
- window = gdk_x11_surface_lookup_for_display (display, last);
+ surface = gdk_x11_surface_lookup_for_display (display, last);
impl = NULL;
- if (window)
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ if (surface)
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (mask)
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state, &group_state);
@@ -652,25 +652,25 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
}
else
{
- window = NULL;
+ surface = NULL;
if (mask)
*mask = 0;
}
if (win_x)
- *win_x = (window) ? (xwin_x / impl->surface_scale) : -1;
+ *win_x = (surface) ? (xwin_x / impl->surface_scale) : -1;
if (win_y)
- *win_y = (window) ? (xwin_y / impl->surface_scale) : -1;
+ *win_y = (surface) ? (xwin_y / impl->surface_scale) : -1;
- return window;
+ return surface;
}
static void
gdk_x11_device_xi2_select_surface_events (GdkDevice *device,
- GdkSurface *window,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
@@ -686,8 +686,8 @@ gdk_x11_device_xi2_select_surface_events (GdkDevice *device,
event_mask,
&evmask.mask_len);
- XISelectEvents (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XISelectEvents (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&evmask, 1);
g_free (evmask.mask);
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 0dc6ca1148..6ae5fc8a8e 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -261,19 +261,19 @@ static const char notify_details[][23] = {
#endif
static void
-set_user_time (GdkSurface *window,
+set_user_time (GdkSurface *surface,
GdkEvent *event)
{
g_return_if_fail (event != NULL);
- window = gdk_surface_get_toplevel (event->any.window);
- g_return_if_fail (GDK_IS_SURFACE (window));
+ surface = gdk_surface_get_toplevel (event->any.surface);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
/* If an event doesn't have a valid timestamp, we shouldn't use it
* to update the latest user interaction time.
*/
if (gdk_event_get_time (event) != GDK_CURRENT_TIME)
- gdk_x11_surface_set_user_time (gdk_surface_get_toplevel (window),
+ gdk_x11_surface_set_user_time (gdk_surface_get_toplevel (surface),
gdk_event_get_time (event));
}
@@ -338,10 +338,10 @@ get_event_surface (GdkEventTranslator *translator,
const XEvent *xevent)
{
GdkDisplay *display;
- GdkSurface *window;
+ GdkSurface *surface;
display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display;
- window = gdk_x11_surface_lookup_for_display (display, xevent->xany.window);
+ surface = gdk_x11_surface_lookup_for_display (display, xevent->xany.window);
/* Apply keyboard grabs to non-native windows */
if (xevent->type == KeyPress || xevent->type == KeyRelease)
@@ -354,15 +354,15 @@ get_event_surface (GdkEventTranslator *translator,
GDK_X11_DEVICE_MANAGER_CORE (translator)->core_keyboard,
serial);
if (info &&
- (!is_parent_of (info->window, window) ||
+ (!is_parent_of (info->surface, surface) ||
!info->owner_events))
{
- /* Report key event against grab window */
- window = info->window;
+ /* Report key event against grab surface */
+ surface = info->surface;
}
}
- return window;
+ return surface;
}
static gboolean
@@ -373,30 +373,30 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
{
GdkSurfaceImplX11 *impl;
GdkX11DeviceManagerCore *device_manager;
- GdkSurface *window;
+ GdkSurface *surface;
gboolean return_val;
int scale;
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
device_manager = GDK_X11_DEVICE_MANAGER_CORE (translator);
- window = get_event_surface (translator, xevent);
+ surface = get_event_surface (translator, xevent);
scale = 1;
- if (window)
+ if (surface)
{
- if (GDK_SURFACE_DESTROYED (window) || !GDK_IS_SURFACE (window))
+ if (GDK_SURFACE_DESTROYED (surface) || !GDK_IS_SURFACE (surface))
return FALSE;
- g_object_ref (window);
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ g_object_ref (surface);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
scale = impl->surface_scale;
}
- event->any.window = window;
+ event->any.surface = surface;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
- if (window && GDK_SURFACE_DESTROYED (window))
+ if (surface && GDK_SURFACE_DESTROYED (surface))
{
if (xevent->type != DestroyNotify)
{
@@ -405,7 +405,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
}
}
- if (window &&
+ if (surface &&
(xevent->type == MotionNotify ||
xevent->type == ButtonRelease))
{
@@ -428,17 +428,17 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
switch (xevent->type)
{
case KeyPress:
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
}
translate_key_event (display, device_manager, event, xevent);
- set_user_time (window, event);
+ set_user_time (surface, event);
break;
case KeyRelease:
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -474,7 +474,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -499,7 +499,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
else
event->scroll.direction = GDK_SCROLL_RIGHT;
- event->any.window = window;
+ event->any.surface = surface;
event->scroll.time = xevent->xbutton.time;
event->scroll.x = (gdouble) xevent->xbutton.x / scale;
event->scroll.y = (gdouble) xevent->xbutton.y / scale;
@@ -517,7 +517,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
default:
event->any.type = GDK_BUTTON_PRESS;
- event->any.window = window;
+ event->any.surface = surface;
event->button.time = xevent->xbutton.time;
event->button.x = (gdouble) xevent->xbutton.x / scale;
event->button.y = (gdouble) xevent->xbutton.y / scale;
@@ -533,7 +533,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
break;
}
- set_user_time (window, event);
+ set_user_time (surface, event);
break;
@@ -544,7 +544,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -559,7 +559,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
}
event->any.type = GDK_BUTTON_RELEASE;
- event->any.window = window;
+ event->any.surface = surface;
event->button.time = xevent->xbutton.time;
event->button.x = (gdouble) xevent->xbutton.x / scale;
event->button.y = (gdouble) xevent->xbutton.y / scale;
@@ -581,14 +581,14 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xmotion.x, xevent->xmotion.y,
(xevent->xmotion.is_hint) ? "true" : "false"));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
}
event->any.type = GDK_MOTION_NOTIFY;
- event->any.window = window;
+ event->any.surface = surface;
event->motion.time = xevent->xmotion.time;
event->motion.x = (gdouble) xevent->xmotion.x / scale;
event->motion.y = (gdouble) xevent->xmotion.y / scale;
@@ -609,7 +609,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xcrossing.detail,
xevent->xcrossing.subwindow));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -618,16 +618,16 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
gdk_event_set_display (event, display);
event->any.type = GDK_ENTER_NOTIFY;
- event->any.window = window;
+ event->any.surface = surface;
gdk_event_set_device (event, device_manager->core_pointer);
/* If the subwindow field of the XEvent is non-NULL, then
* lookup the corresponding GdkSurface.
*/
if (xevent->xcrossing.subwindow != None)
- event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow);
+ event->crossing.child_surface = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow);
else
- event->crossing.subwindow = NULL;
+ event->crossing.child_surface = NULL;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = (gdouble) xevent->xcrossing.x / scale;
@@ -649,7 +649,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xcrossing.window,
xevent->xcrossing.detail, xevent->xcrossing.subwindow));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -658,16 +658,16 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
gdk_event_set_display (event, display);
event->any.type = GDK_LEAVE_NOTIFY;
- event->any.window = window;
+ event->any.surface = surface;
gdk_event_set_device (event, device_manager->core_pointer);
/* If the subwindow field of the XEvent is non-NULL, then
* lookup the corresponding GdkSurface.
*/
if (xevent->xcrossing.subwindow != None)
- event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow);
+ event->crossing.child_surface = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow);
else
- event->crossing.subwindow = NULL;
+ event->crossing.child_surface = NULL;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = (gdouble) xevent->xcrossing.x / scale;
@@ -685,8 +685,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
case FocusIn:
case FocusOut:
- if (window)
- _gdk_device_manager_core_handle_focus (window,
+ if (surface)
+ _gdk_device_manager_core_handle_focus (surface,
xevent->xfocus.window,
device_manager->core_keyboard,
NULL,
@@ -703,23 +703,23 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
done:
if (return_val)
{
- if (event->any.window)
- g_object_ref (event->any.window);
+ if (event->any.surface)
+ g_object_ref (event->any.surface);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
- (event->crossing.subwindow != NULL))
- g_object_ref (event->crossing.subwindow);
+ (event->crossing.child_surface != NULL))
+ g_object_ref (event->crossing.child_surface);
}
else
{
/* Mark this event as having no resources to be freed */
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.type = GDK_NOTHING;
}
- if (window)
- g_object_unref (window);
+ if (surface)
+ g_object_unref (surface);
return return_val;
}
@@ -789,10 +789,10 @@ _gdk_x11_event_translate_keyboard_string (GdkEventKey *event)
}
/* We only care about focus events that indicate that _this_
- * window (not a ancestor or child) got or lost the focus
+ * surface (not a ancestor or child) got or lost the focus
*/
void
-_gdk_device_manager_core_handle_focus (GdkSurface *window,
+_gdk_device_manager_core_handle_focus (GdkSurface *surface,
Window original,
GdkDevice *device,
GdkDevice *source_device,
@@ -804,17 +804,17 @@ _gdk_device_manager_core_handle_focus (GdkSurface *window,
GdkX11Screen *x11_screen;
gboolean had_focus;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (source_device == NULL || GDK_IS_DEVICE (source_device));
- GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS,
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
g_message ("focus out:\t\twindow: %ld, detail: %s, mode: %s",
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
notify_details[detail],
notify_modes[mode]));
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (!toplevel)
return;
@@ -823,7 +823,7 @@ _gdk_device_manager_core_handle_focus (GdkSurface *window,
return;
had_focus = HAS_FOCUS (toplevel);
- x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (window));
+ x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (surface));
switch (detail)
{
@@ -889,14 +889,14 @@ _gdk_device_manager_core_handle_focus (GdkSurface *window,
GdkEvent *event;
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = FALSE;
event->focus_change.in = focus_in;
gdk_event_set_device (event, device);
if (source_device)
gdk_event_set_source_device (event, source_device);
- gdk_display_put_event (gdk_surface_get_display (window), event);
+ gdk_display_put_event (gdk_surface_get_display (surface), event);
g_object_unref (event);
}
}
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index c39c43656d..4c873790ff 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -85,7 +85,7 @@ static GdkEventMask gdk_x11_device_manager_xi2_get_handled_events (GdkEventTra
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,
+static GdkSurface * gdk_x11_device_manager_xi2_get_surface (GdkEventTranslator *translator,
const XEvent *xevent);
enum {
@@ -836,7 +836,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_surface_events = gdk_x11_device_manager_xi2_select_surface_events;
- iface->get_window = gdk_x11_device_manager_xi2_get_window;
+ iface->get_surface = gdk_x11_device_manager_xi2_get_surface;
}
static void
@@ -1061,11 +1061,11 @@ translate_notify_type (gint detail)
static void
set_user_time (GdkEvent *event)
{
- GdkSurface *window;
+ GdkSurface *surface;
guint32 time;
- window = gdk_surface_get_toplevel (event->any.window);
- g_return_if_fail (GDK_IS_SURFACE (window));
+ surface = gdk_surface_get_toplevel (event->any.surface);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
time = gdk_event_get_time (event);
@@ -1073,14 +1073,14 @@ set_user_time (GdkEvent *event)
* to update the latest user interaction time.
*/
if (time != GDK_CURRENT_TIME)
- gdk_x11_surface_set_user_time (window, time);
+ gdk_x11_surface_set_user_time (surface, time);
}
static gdouble *
translate_axes (GdkDevice *device,
gdouble x,
gdouble y,
- GdkSurface *window,
+ GdkSurface *surface,
XIValuatorState *valuators)
{
guint n_axes, i;
@@ -1111,7 +1111,7 @@ translate_axes (GdkDevice *device,
case GDK_AXIS_X:
case GDK_AXIS_Y:
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
- _gdk_device_translate_surface_coord (device, window, i, val, &axes[i]);
+ _gdk_device_translate_surface_coord (device, surface, i, val, &axes[i]);
else
{
if (use == GDK_AXIS_X)
@@ -1152,10 +1152,10 @@ is_parent_of (GdkSurface *parent,
static gboolean
get_event_surface (GdkEventTranslator *translator,
XIEvent *ev,
- GdkSurface **window_p)
+ GdkSurface **surface_p)
{
GdkDisplay *display;
- GdkSurface *window = NULL;
+ GdkSurface *surface = NULL;
gboolean should_have_window = TRUE;
display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display;
@@ -1175,7 +1175,7 @@ get_event_surface (GdkEventTranslator *translator,
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
- window = gdk_x11_surface_lookup_for_display (display, xev->event);
+ surface = gdk_x11_surface_lookup_for_display (display, xev->event);
/* Apply keyboard grabs to non-native windows */
if (ev->evtype == XI_KeyPress || ev->evtype == XI_KeyRelease)
@@ -1191,11 +1191,11 @@ get_event_surface (GdkEventTranslator *translator,
info = _gdk_display_has_device_grab (display, device, serial);
if (info &&
- (!is_parent_of (info->window, window) ||
+ (!is_parent_of (info->surface, surface) ||
!info->owner_events))
{
- /* Report key event against grab window */
- window = info->window;
+ /* Report key event against grab surface */
+ surface = info->surface;
}
}
}
@@ -1207,7 +1207,7 @@ get_event_surface (GdkEventTranslator *translator,
{
XIEnterEvent *xev = (XIEnterEvent *) ev;
- window = gdk_x11_surface_lookup_for_display (display, xev->event);
+ surface = gdk_x11_surface_lookup_for_display (display, xev->event);
}
break;
default:
@@ -1215,9 +1215,9 @@ get_event_surface (GdkEventTranslator *translator,
break;
}
- *window_p = window;
+ *surface_p = surface;
- if (should_have_window && !window)
+ if (should_have_window && !surface)
return FALSE;
return TRUE;
@@ -1257,7 +1257,7 @@ gdk_x11_device_manager_xi2_translate_core_event (GdkEventTranslator *translator,
* (At the moment, it's not possible to send XI2 events anyway.
* In the future, an app that was trying to decide whether to
* send core or XI2 events could look at the event mask on the
- * window to see which kind we are listening to.)
+ * surface to see which kind we are listening to.)
*/
switch (xevent->type)
{
@@ -1349,7 +1349,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
const XGenericEventCookie *cookie;
GdkDevice *device, *source_device;
gboolean return_val = TRUE;
- GdkSurface *window;
+ GdkSurface *surface;
GdkSurfaceImplX11 *impl;
int scale;
XIEvent *ev;
@@ -1367,16 +1367,16 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
if (!ev)
return FALSE;
- if (!get_event_surface (translator, ev, &window))
+ if (!get_event_surface (translator, ev, &surface))
return FALSE;
- if (window && GDK_SURFACE_DESTROYED (window))
+ if (surface && GDK_SURFACE_DESTROYED (surface))
return FALSE;
scale = 1;
- if (window)
+ if (surface)
{
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
scale = impl->surface_scale;
}
@@ -1424,7 +1424,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->any.type = xev->evtype == XI_KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
- event->any.window = window;
+ event->any.surface = surface;
event->key.time = xev->time;
event->key.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
@@ -1507,7 +1507,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
else
event->scroll.direction = GDK_SCROLL_RIGHT;
- event->any.window = window;
+ event->any.surface = surface;
event->scroll.time = xev->time;
event->scroll.x = (gdouble) xev->event_x / scale;
event->scroll.y = (gdouble) xev->event_y / scale;
@@ -1530,7 +1530,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
{
event->any.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
- event->any.window = window;
+ event->any.surface = surface;
event->button.time = xev->time;
event->button.x = (gdouble) xev->event_x / scale;
event->button.y = (gdouble) xev->event_y / scale;
@@ -1549,7 +1549,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->button.axes = translate_axes (device,
event->button.x,
event->button.y,
- event->any.window,
+ event->any.surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
@@ -1614,7 +1614,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->event, delta_x, delta_y));
- event->any.window = window;
+ event->any.surface = surface;
event->scroll.time = xev->time;
event->scroll.x = (gdouble) xev->event_x / scale;
event->scroll.y = (gdouble) xev->event_y / scale;
@@ -1631,7 +1631,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
}
event->any.type = GDK_MOTION_NOTIFY;
- event->any.window = window;
+ event->any.surface = surface;
event->motion.time = xev->time;
event->motion.x = (gdouble) xev->event_x / scale;
event->motion.y = (gdouble) xev->event_y / scale;
@@ -1647,7 +1647,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->motion.axes = translate_axes (device,
event->motion.x,
event->motion.y,
- event->any.window,
+ event->any.surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
@@ -1677,7 +1677,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
else if (ev->evtype == XI_TouchEnd)
event->any.type = GDK_TOUCH_END;
- event->any.window = window;
+ event->any.surface = surface;
event->touch.time = xev->time;
event->touch.x = (gdouble) xev->event_x / scale;
event->touch.y = (gdouble) xev->event_y / scale;
@@ -1695,7 +1695,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->touch.axes = translate_axes (device,
event->touch.x,
event->touch.y,
- event->any.window,
+ event->any.surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
@@ -1738,7 +1738,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->detail,
xev->flags & XITouchEmulatingPointer ? "true" : "false"));
- event->any.window = window;
+ event->any.surface = surface;
event->touch.sequence = GUINT_TO_POINTER (xev->detail);
event->any.type = GDK_TOUCH_UPDATE;
event->touch.time = xev->time;
@@ -1768,7 +1768,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->touch.axes = translate_axes (device,
event->touch.x,
event->touch.y,
- event->any.window,
+ event->any.surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
@@ -1804,8 +1804,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->crossing.time = xev->time;
event->crossing.focus = xev->focus;
- event->any.window = window;
- event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xev->child);
+ event->any.surface = surface;
+ event->crossing.child_surface = gdk_x11_surface_lookup_for_display (display, xev->child);
device = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (xev->deviceid));
@@ -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_surface_type (window) == GDK_SURFACE_TOPLEVEL)
+ gdk_surface_get_surface_type (surface) == 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));
@@ -1842,7 +1842,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
case XI_FocusIn:
case XI_FocusOut:
{
- if (window)
+ if (surface)
{
XIEnterEvent *xev = (XIEnterEvent *) ev;
@@ -1852,7 +1852,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
- _gdk_device_manager_core_handle_focus (window,
+ _gdk_device_manager_core_handle_focus (surface,
xev->event,
device,
source_device,
@@ -1873,18 +1873,18 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
if (return_val)
{
- if (event->any.window)
- g_object_ref (event->any.window);
+ if (event->any.surface)
+ g_object_ref (event->any.surface);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
- (event->crossing.subwindow != NULL))
- g_object_ref (event->crossing.subwindow);
+ (event->crossing.child_surface != NULL))
+ g_object_ref (event->crossing.child_surface);
}
else
{
/* Mark this event as having no resources to be freed */
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.type = GDK_NOTHING;
}
@@ -1927,12 +1927,12 @@ gdk_x11_device_manager_xi2_select_surface_events (GdkEventTranslator *translator
}
static GdkSurface *
-gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
- const XEvent *xevent)
+gdk_x11_device_manager_xi2_get_surface (GdkEventTranslator *translator,
+ const XEvent *xevent)
{
GdkX11DeviceManagerXI2 *device_manager;
XIEvent *ev;
- GdkSurface *window = NULL;
+ GdkSurface *surface = NULL;
device_manager = (GdkX11DeviceManagerXI2 *) translator;
@@ -1944,8 +1944,8 @@ gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
if (!ev)
return NULL;
- get_event_surface (translator, ev, &window);
- return window;
+ get_event_surface (translator, ev, &surface);
+ return surface;
}
GdkDevice *
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index d871dbc944..4432a3efe4 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -205,12 +205,12 @@ gdk_x11_display_event_translator_init (GdkEventTranslatorIface *iface)
GDK_SURFACE_STATE_BOTTOM_TILED)
static void
-do_edge_constraint_state_check (GdkSurface *window,
+do_edge_constraint_state_check (GdkSurface *surface,
GdkSurfaceState old_state,
GdkSurfaceState *set,
GdkSurfaceState *unset)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
GdkSurfaceState local_set, local_unset;
guint edge_constraints;
@@ -223,7 +223,7 @@ do_edge_constraint_state_check (GdkSurface *window,
* GDK_SURFACE_STATE_TILED to be set if any edge is tiled, and cleared
* if no edge is tiled.
*/
- if (!gdk_surface_supports_edge_constraints (window))
+ if (!gdk_surface_supports_edge_constraints (surface))
{
/* FIXME: we rely on implementation details of mutter here:
* mutter only tiles horizontally, and sets maxvert when it does
@@ -351,16 +351,16 @@ do_edge_constraint_state_check (GdkSurface *window,
}
static void
-do_net_wm_state_changes (GdkSurface *window)
+do_net_wm_state_changes (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
GdkSurfaceState old_state, set, unset;
- if (GDK_SURFACE_DESTROYED (window) ||
- gdk_surface_get_surface_type (window) != GDK_SURFACE_TOPLEVEL)
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ gdk_surface_get_surface_type (surface) != GDK_SURFACE_TOPLEVEL)
return;
- old_state = gdk_surface_get_state (window);
+ old_state = gdk_surface_get_state (surface);
set = unset = 0;
@@ -426,16 +426,16 @@ do_net_wm_state_changes (GdkSurface *window)
}
/* Update edge constraints and tiling */
- do_edge_constraint_state_check (window, old_state, &set, &unset);
+ do_edge_constraint_state_check (surface, old_state, &set, &unset);
- gdk_synthesize_surface_state (window, unset, set);
+ gdk_synthesize_surface_state (surface, unset, set);
}
static void
-gdk_check_wm_desktop_changed (GdkSurface *window)
+gdk_check_wm_desktop_changed (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
Atom type;
gint format;
@@ -447,7 +447,7 @@ gdk_check_wm_desktop_changed (GdkSurface *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
@@ -463,15 +463,15 @@ gdk_check_wm_desktop_changed (GdkSurface *window)
else
toplevel->on_all_desktops = FALSE;
- do_net_wm_state_changes (window);
+ do_net_wm_state_changes (surface);
}
static void
-gdk_check_wm_state_changed (GdkSurface *window)
+gdk_check_wm_state_changed (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
- GdkX11Screen *screen = GDK_SURFACE_SCREEN (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
+ GdkX11Screen *screen = GDK_SURFACE_SCREEN (surface);
Atom type;
gint format;
@@ -492,7 +492,7 @@ gdk_check_wm_state_changed (GdkSurface *window)
type = None;
gdk_x11_display_error_trap_push (display);
- XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
&bytes_after, &data);
@@ -539,16 +539,16 @@ gdk_check_wm_state_changed (GdkSurface *window)
* as well.
*/
if (toplevel->have_sticky && !had_sticky)
- gdk_check_wm_desktop_changed (window);
+ gdk_check_wm_desktop_changed (surface);
else
- do_net_wm_state_changes (window);
+ do_net_wm_state_changes (surface);
}
static void
-gdk_check_edge_constraints_changed (GdkSurface *window)
+gdk_check_edge_constraints_changed (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
Atom type;
gint format;
@@ -560,7 +560,7 @@ gdk_check_edge_constraints_changed (GdkSurface *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_GTK_EDGE_CONSTRAINTS"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
@@ -584,7 +584,7 @@ gdk_check_edge_constraints_changed (GdkSurface *window)
toplevel->edge_constraints = 0;
}
- do_net_wm_state_changes (window);
+ do_net_wm_state_changes (surface);
}
static Atom
@@ -635,7 +635,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
const XEvent *xevent)
{
Window xwindow;
- GdkSurface *window;
+ GdkSurface *surface;
gboolean is_substructure;
GdkSurfaceImplX11 *surface_impl = NULL;
GdkX11Screen *x11_screen = NULL;
@@ -644,7 +644,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
gboolean return_val;
/* Find the GdkSurface that this event relates to. If that's
- * not the same as the window that the event was sent to,
+ * not the same as the surface that the event was sent to,
* we are getting an event from SubstructureNotifyMask.
* We ignore such events for internal operation, but we
* need to report them to the application because of
@@ -656,26 +656,26 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xwindow = get_event_xwindow (xevent);
is_substructure = xwindow != xevent->xany.window;
- window = gdk_x11_surface_lookup_for_display (display, xwindow);
- if (window)
+ surface = gdk_x11_surface_lookup_for_display (display, xwindow);
+ if (surface)
{
/* We may receive events such as NoExpose/GraphicsExpose
* and ShmCompletion for pixmaps
*/
- if (!GDK_IS_SURFACE (window))
+ if (!GDK_IS_SURFACE (surface))
return FALSE;
- x11_screen = GDK_SURFACE_SCREEN (window);
- toplevel = _gdk_x11_surface_get_toplevel (window);
- surface_impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ x11_screen = GDK_SURFACE_SCREEN (surface);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
+ surface_impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- g_object_ref (window);
+ g_object_ref (surface);
}
- event->any.window = window;
+ event->any.surface = surface;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
- if (window && GDK_SURFACE_DESTROYED (window))
+ if (surface && GDK_SURFACE_DESTROYED (surface))
{
if (xevent->type != DestroyNotify)
{
@@ -729,7 +729,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xexpose.width, xevent->xexpose.height,
event->any.send_event ? " (send)" : ""));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -748,7 +748,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
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);
+ _gdk_x11_surface_process_expose (surface, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
@@ -763,7 +763,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
g_message ("graphics expose:\tdrawable: %ld",
xevent->xgraphicsexpose.drawable));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -778,7 +778,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
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);
+ _gdk_x11_surface_process_expose (surface, xevent->xgraphicsexpose.serial, &expose_rect);
return_val = FALSE;
}
break;
@@ -830,12 +830,12 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (!is_substructure)
{
event->any.type = GDK_DESTROY;
- event->any.window = window;
+ event->any.surface = surface;
- return_val = window && !GDK_SURFACE_DESTROYED (window);
+ return_val = surface && !GDK_SURFACE_DESTROYED (surface);
- if (window && GDK_SURFACE_XID (window) != x11_screen->xroot_window)
- gdk_surface_destroy_notify (window);
+ if (surface && GDK_SURFACE_XID (surface) != x11_screen->xroot_window)
+ gdk_surface_destroy_notify (surface);
}
else
return_val = FALSE;
@@ -848,9 +848,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xmap.window));
event->any.type = GDK_UNMAP;
- event->any.window = window;
+ event->any.surface = surface;
- if (window && !is_substructure)
+ if (surface && !is_substructure)
{
/* If the WM supports the _NET_WM_STATE_HIDDEN hint, we do not want to
* interpret UnmapNotify events as implying iconic state.
@@ -865,8 +865,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
* means we hid the window ourselves, so we will have already flipped
* the iconified bit off.
*/
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_synthesize_surface_state (window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_ICONIFIED);
}
@@ -875,13 +875,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
surface_impl->toplevel->frame_pending)
{
surface_impl->toplevel->frame_pending = FALSE;
- _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.window));
+ _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.surface));
}
if (toplevel)
- gdk_surface_freeze_toplevel_updates (window);
+ gdk_surface_freeze_toplevel_updates (surface);
- _gdk_x11_surface_grab_check_unmap (window, xevent->xany.serial);
+ _gdk_x11_surface_grab_check_unmap (surface, xevent->xany.serial);
}
break;
@@ -892,18 +892,18 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xmap.window));
event->any.type = GDK_MAP;
- event->any.window = window;
+ event->any.surface = surface;
- if (window && !is_substructure)
+ if (surface && !is_substructure)
{
/* Unset iconified if it was set */
- if (window->state & GDK_SURFACE_STATE_ICONIFIED)
- gdk_synthesize_surface_state (window,
+ if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_ICONIFIED,
0);
if (toplevel)
- gdk_surface_thaw_toplevel_updates (window);
+ gdk_surface_thaw_toplevel_updates (surface);
}
break;
@@ -932,9 +932,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xconfigure.border_width,
xevent->xconfigure.above,
xevent->xconfigure.override_redirect,
- !window
+ !surface
? " (discarding)"
- : window->surface_type == GDK_SURFACE_CHILD
+ : surface->surface_type == GDK_SURFACE_CHILD
? " (discarding child)"
: xevent->xconfigure.event != xevent->xconfigure.window
? " (discarding substructure)"
@@ -953,28 +953,28 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
}
#endif
- if (!window ||
+ if (!surface ||
xevent->xconfigure.event != xevent->xconfigure.window ||
- GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD)
+ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_CHILD)
return_val = FALSE;
else
{
event->any.type = GDK_CONFIGURE;
- event->any.window = window;
+ event->any.surface = surface;
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 &&
- !GDK_SURFACE_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (surface))
{
gint tx = 0;
gint ty = 0;
Window child_window = 0;
gdk_x11_display_error_trap_push (display);
- if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
x11_screen->xroot_window,
0, 0,
&tx, &ty,
@@ -992,27 +992,27 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
}
if (!is_substructure)
{
- window->x = event->configure.x;
- window->y = event->configure.y;
+ surface->x = event->configure.x;
+ surface->y = event->configure.y;
if (surface_impl->unscaled_width != xevent->xconfigure.width ||
surface_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;
+ surface->width = event->configure.width;
+ surface->height = event->configure.height;
- _gdk_surface_update_size (window);
+ _gdk_surface_update_size (surface);
_gdk_x11_surface_update_size (surface_impl);
}
- if (window->resize_count >= 1)
+ if (surface->resize_count >= 1)
{
- window->resize_count -= 1;
+ surface->resize_count -= 1;
- if (window->resize_count == 0)
- _gdk_x11_moveresize_configure_done (display, window);
+ if (surface->resize_count == 0)
+ _gdk_x11_moveresize_configure_done (display, surface);
}
}
}
@@ -1027,7 +1027,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
gdk_x11_get_xatom_name_for_display (display, xevent->xproperty.atom),
"\""));
- if (window == NULL)
+ if (surface == NULL)
{
return_val = FALSE;
break;
@@ -1040,13 +1040,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xproperty.serial >= toplevel->map_serial)
{
if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"))
- gdk_check_wm_state_changed (window);
+ gdk_check_wm_state_changed (surface);
if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"))
- gdk_check_wm_desktop_changed (window);
+ gdk_check_wm_desktop_changed (surface);
if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_GTK_EDGE_CONSTRAINTS"))
- gdk_check_edge_constraints_changed (window);
+ gdk_check_edge_constraints_changed (surface);
}
return_val = FALSE;
@@ -1120,18 +1120,18 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
done:
if (return_val)
{
- if (event->any.window)
- g_object_ref (event->any.window);
+ if (event->any.surface)
+ g_object_ref (event->any.surface);
}
else
{
/* Mark this event as having no resources to be freed */
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.type = GDK_NOTHING;
}
- if (window)
- g_object_unref (window);
+ if (surface)
+ g_object_unref (surface);
return return_val;
}
@@ -1201,7 +1201,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkSurface *win = event->any.window;
+ GdkSurface *win = event->any.surface;
GdkDisplay *display;
Atom atom;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index f2ddce6f29..659923fb66 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -113,7 +113,7 @@ struct _GdkX11DragContext
GdkSurface *drag_surface;
- GdkSurface *ipc_window;
+ GdkSurface *ipc_surface;
GdkCursor *cursor;
GdkSeat *grab_seat;
GdkDragAction actions;
@@ -190,7 +190,7 @@ static GdkFilterReturn xdnd_drop_filter (const XEvent *xevent,
gpointer data);
static void xdnd_manage_source_filter (GdkDragContext *context,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean add_filter);
gboolean gdk_x11_drag_context_handle_event (GdkDragContext *context,
@@ -223,7 +223,7 @@ 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,
+static GdkSurface * gdk_x11_drag_context_find_surface (GdkDragContext *context,
GdkSurface *drag_surface,
gint x_root,
gint y_root,
@@ -423,7 +423,7 @@ gdk_x11_drag_context_finalize (GObject *object)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (object);
- GdkSurface *drag_surface, *ipc_window;
+ GdkSurface *drag_surface, *ipc_surface;
if (context->source_surface)
{
@@ -437,14 +437,14 @@ gdk_x11_drag_context_finalize (GObject *object)
contexts = g_list_remove (contexts, context);
drag_surface = context->drag_surface;
- ipc_window = x11_context->ipc_window;
+ ipc_surface = x11_context->ipc_surface;
G_OBJECT_CLASS (gdk_x11_drag_context_parent_class)->finalize (object);
if (drag_surface)
gdk_surface_destroy (drag_surface);
- if (ipc_window)
- gdk_surface_destroy (ipc_window);
+ if (ipc_surface)
+ gdk_surface_destroy (ipc_surface);
}
/* Drag Contexts */
@@ -726,21 +726,21 @@ gdk_surface_cache_new (GdkDisplay *display)
if (G_UNLIKELY (!GDK_X11_DISPLAY (display)->trusted_client))
{
GList *toplevel_windows, *list;
- GdkSurface *window;
+ GdkSurface *surface;
GdkSurfaceImplX11 *impl;
gint x, y, width, height;
toplevel_windows = gdk_x11_display_get_toplevel_windows (display);
for (list = toplevel_windows; list; list = list->next)
{
- window = GDK_SURFACE (list->data);
- 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),
+ surface = GDK_SURFACE (list->data);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ gdk_surface_get_geometry (surface, &x, &y, &width, &height);
+ gdk_surface_cache_add (result, GDK_SURFACE_XID (surface),
x * impl->surface_scale, y * impl->surface_scale,
width * impl->surface_scale,
height * impl->surface_scale,
- gdk_surface_is_visible (window));
+ gdk_surface_is_visible (surface));
}
return result;
}
@@ -1069,11 +1069,11 @@ xdnd_status_filter (const XEvent *xevent,
Atom action = xevent->xclient.data.l[4];
GdkDragContext *context;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- display = gdk_surface_get_display (event->any.window);
+ display = gdk_surface_get_display (event->any.surface);
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_surface);
GDK_DISPLAY_NOTE (display, DND,
@@ -1115,11 +1115,11 @@ xdnd_finished_filter (const XEvent *xevent,
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- display = gdk_surface_get_display (event->any.window);
+ display = gdk_surface_get_display (event->any.surface);
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_surface);
GDK_DISPLAY_NOTE (display, DND,
@@ -1157,7 +1157,7 @@ xdnd_set_targets (GdkX11DragContext *context_x11)
atomlist[i] = gdk_x11_get_xatom_by_name_for_display (display, atoms[i]);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (context_x11->ipc_window),
+ GDK_SURFACE_XID (context_x11->ipc_surface),
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -1203,7 +1203,7 @@ xdnd_set_actions (GdkX11DragContext *context_x11)
}
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (context_x11->ipc_window),
+ GDK_SURFACE_XID (context_x11->ipc_surface),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -1265,7 +1265,7 @@ send_client_message_async (GdkDragContext *context,
static gboolean
xdnd_send_xevent (GdkX11DragContext *context_x11,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean propagate,
XEvent *event_send)
{
@@ -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_surface_type (window) != GDK_SURFACE_FOREIGN)
+ if (gdk_surface_get_surface_type (surface) != GDK_SURFACE_FOREIGN)
{
gint i;
@@ -1289,7 +1289,7 @@ xdnd_send_xevent (GdkX11DragContext *context_x11,
GdkEvent *temp_event;
temp_event = gdk_event_new (GDK_NOTHING);
- temp_event->any.window = g_object_ref (window);
+ temp_event->any.surface = g_object_ref (surface);
if ((*xdnd_filters[i].func) (event_send, temp_event, NULL) == GDK_FILTER_TRANSLATE)
gdk_display_put_event (display, temp_event);
@@ -1301,7 +1301,7 @@ xdnd_send_xevent (GdkX11DragContext *context_x11,
}
}
- xwindow = GDK_SURFACE_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (_gdk_x11_display_is_root_window (display, xwindow))
event_mask = ButtonPressMask;
@@ -1329,7 +1329,7 @@ xdnd_send_enter (GdkX11DragContext *context_x11)
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
: GDK_SURFACE_XID (context->dest_surface);
- xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_surface);
xev.xclient.data.l[1] = (context_x11->version << 24); /* version */
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
@@ -1337,7 +1337,7 @@ xdnd_send_enter (GdkX11DragContext *context_x11)
GDK_DISPLAY_NOTE (display, DND,
g_message ("Sending enter source window %#lx XDND protocol version %d\n",
- GDK_SURFACE_XID (context_x11->ipc_window), context_x11->version));
+ GDK_SURFACE_XID (context_x11->ipc_surface), context_x11->version));
atoms = gdk_content_formats_get_mime_types (context->formats, &n_atoms);
if (n_atoms > 3)
@@ -1377,7 +1377,7 @@ xdnd_send_leave (GdkX11DragContext *context_x11)
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
: GDK_SURFACE_XID (context->dest_surface);
- xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_surface);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
@@ -1407,7 +1407,7 @@ xdnd_send_drop (GdkX11DragContext *context_x11,
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
: GDK_SURFACE_XID (context->dest_surface);
- xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_surface);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0;
@@ -1440,7 +1440,7 @@ xdnd_send_motion (GdkX11DragContext *context_x11,
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
: GDK_SURFACE_XID (context->dest_surface);
- xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_surface);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
xev.xclient.data.l[3] = time;
@@ -1644,11 +1644,11 @@ xdnd_source_surface_filter (const XEvent *xevent,
static void
xdnd_manage_source_filter (GdkDragContext *context,
- GdkSurface *window,
+ GdkSurface *surface,
gboolean add_filter)
{
- if (!GDK_SURFACE_DESTROYED (window) &&
- gdk_surface_get_surface_type (window) == GDK_SURFACE_FOREIGN)
+ if (!GDK_SURFACE_DESTROYED (surface) &&
+ gdk_surface_get_surface_type (surface) == GDK_SURFACE_FOREIGN)
{
GdkDisplay *display = gdk_drag_context_get_display (context);
@@ -1656,14 +1656,14 @@ xdnd_manage_source_filter (GdkDragContext *context,
if (add_filter)
{
- gdk_surface_set_events (window,
- gdk_surface_get_events (window) |
+ gdk_surface_set_events (surface,
+ gdk_surface_get_events (surface) |
GDK_PROPERTY_CHANGE_MASK);
- g_object_set_data (G_OBJECT (window), "xdnd-source-context", context);
+ g_object_set_data (G_OBJECT (surface), "xdnd-source-context", context);
}
else
{
- g_object_set_data (G_OBJECT (window), "xdnd-source-context", NULL);
+ g_object_set_data (G_OBJECT (surface), "xdnd-source-context", NULL);
/* Should we remove the GDK_PROPERTY_NOTIFY mask?
* but we might want it for other reasons. (Like
* INCR selection transactions).
@@ -1746,15 +1746,15 @@ xdnd_enter_filter (const XEvent *xevent,
gboolean get_types;
gint version;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
source_surface = xevent->xclient.data.l[0];
get_types = ((xevent->xclient.data.l[1] & 1) != 0);
version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
- display = GDK_SURFACE_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
xdnd_precache_atoms (display);
@@ -1794,14 +1794,14 @@ xdnd_enter_filter (const XEvent *xevent,
g_object_unref (context);
return GDK_FILTER_REMOVE;
}
- context->dest_surface = event->any.window;
+ context->dest_surface = event->any.surface;
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),
+ XGetWindowProperty (GDK_SURFACE_XDISPLAY (event->any.surface),
source_surface,
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
0, 65536,
@@ -1863,11 +1863,11 @@ xdnd_leave_filter (const XEvent *xevent,
GdkDisplay *display;
GdkX11Display *display_x11;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- display = GDK_SURFACE_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
@@ -1909,11 +1909,11 @@ xdnd_position_filter (const XEvent *xevent,
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- display = GDK_SURFACE_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
@@ -1928,7 +1928,7 @@ xdnd_position_filter (const XEvent *xevent,
(GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_SURFACE_XID (context->source_surface) == source_surface))
{
- impl = GDK_SURFACE_IMPL_X11 (event->any.window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (event->any.surface->impl);
context_x11 = GDK_X11_DRAG_CONTEXT (context);
@@ -1968,11 +1968,11 @@ xdnd_drop_filter (const XEvent *xevent,
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_surface_get_surface_type (event->any.window) == GDK_SURFACE_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- display = GDK_SURFACE_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
@@ -1998,7 +1998,7 @@ xdnd_drop_filter (const XEvent *xevent,
event->dnd.x_root = context_x11->last_x;
event->dnd.y_root = context_x11->last_y;
- gdk_x11_surface_set_user_time (event->any.window, time);
+ gdk_x11_surface_set_user_time (event->any.surface, time);
return GDK_FILTER_TRANSLATE;
}
@@ -2014,13 +2014,13 @@ _gdk_x11_dnd_filter (const XEvent *xevent,
GdkDisplay *display;
int i;
- if (!GDK_IS_X11_SURFACE (event->any.window))
+ if (!GDK_IS_X11_SURFACE (event->any.surface))
return GDK_FILTER_CONTINUE;
if (xevent->type != ClientMessage)
return GDK_FILTER_CONTINUE;
- display = GDK_SURFACE_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
for (i = 0; i < G_N_ELEMENTS (xdnd_filters); i++)
{
@@ -2062,13 +2062,13 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11,
static GdkSurface *
create_drag_surface (GdkDisplay *display)
{
- GdkSurface *window;
+ GdkSurface *surface;
- window = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ surface = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_surface_set_type_hint (window, GDK_SURFACE_TYPE_HINT_DND);
+ gdk_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_DND);
- return window;
+ return surface;
}
static Window
@@ -2078,16 +2078,16 @@ _gdk_x11_display_get_drag_protocol (GdkDisplay *display,
guint *version)
{
- GdkSurface *window;
+ GdkSurface *surface;
Window retval;
base_precache_atoms (display);
/* Check for a local drag */
- window = gdk_x11_surface_lookup_for_display (display, xid);
- if (window && gdk_surface_get_surface_type (window) != GDK_SURFACE_FOREIGN)
+ surface = gdk_x11_surface_lookup_for_display (display, xid);
+ if (surface && gdk_surface_get_surface_type (surface) != GDK_SURFACE_FOREIGN)
{
- if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
+ if (g_object_get_data (G_OBJECT (surface), "gdk-dnd-registered") != NULL)
{
*protocol = GDK_DRAG_PROTO_XDND;
*version = 5;
@@ -2141,11 +2141,11 @@ drag_context_find_window_cache (GdkX11DragContext *context_x11,
}
static GdkSurface *
-gdk_x11_drag_context_find_window (GdkDragContext *context,
- GdkSurface *drag_surface,
- gint x_root,
- gint y_root,
- GdkDragProtocol *protocol)
+gdk_x11_drag_context_find_surface (GdkDragContext *context,
+ GdkSurface *drag_surface,
+ gint x_root,
+ gint y_root,
+ GdkDragProtocol *protocol)
{
GdkX11Screen *screen_x11 = GDK_X11_SCREEN(GDK_X11_DISPLAY (context->display)->screen);
GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context);
@@ -2511,25 +2511,25 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
}
void
-_gdk_x11_surface_register_dnd (GdkSurface *window)
+_gdk_x11_surface_register_dnd (GdkSurface *surface)
{
static const gulong xdnd_version = 5;
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
- g_return_if_fail (window != NULL);
+ g_return_if_fail (surface != NULL);
base_precache_atoms (display);
- if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
+ if (g_object_get_data (G_OBJECT (surface), "gdk-dnd-registered") != NULL)
return;
else
- g_object_set_data (G_OBJECT (window), "gdk-dnd-registered", GINT_TO_POINTER (TRUE));
+ g_object_set_data (G_OBJECT (surface), "gdk-dnd-registered", GINT_TO_POINTER (TRUE));
/* Set XdndAware */
/* The property needs to be of type XA_ATOM, not XA_INTEGER. Blech */
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "XdndAware"),
XA_ATOM, 32, PropModeReplace,
(guchar *)&xdnd_version, 1);
@@ -2603,7 +2603,7 @@ gdk_x11_drag_context_xevent (GdkDisplay *display,
Window xwindow;
Atom xselection;
- xwindow = GDK_SURFACE_XID (x11_context->ipc_window);
+ xwindow = GDK_SURFACE_XID (x11_context->ipc_surface);
xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection");
if (xevent->xany.window != xwindow)
@@ -2734,7 +2734,7 @@ gdk_x11_drag_context_release_selection (GdkDragContext *context)
display = gdk_drag_context_get_display (context);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection");
- xwindow = GDK_SURFACE_XID (x11_context->ipc_window);
+ xwindow = GDK_SURFACE_XID (x11_context->ipc_surface);
if (XGetSelectionOwner (xdisplay, xselection) == xwindow)
XSetSelectionOwner (xdisplay, xselection, None, CurrentTime);
@@ -2805,7 +2805,7 @@ drag_context_grab (GdkDragContext *context)
gint keycode, i;
GdkCursor *cursor;
- if (!x11_context->ipc_window)
+ if (!x11_context->ipc_surface)
return FALSE;
display = gdk_drag_context_get_display (context);
@@ -2822,7 +2822,7 @@ drag_context_grab (GdkDragContext *context)
cursor = gdk_drag_get_cursor (context, x11_context->current_action);
g_set_object (&x11_context->cursor, cursor);
- if (gdk_seat_grab (seat, x11_context->ipc_window,
+ if (gdk_seat_grab (seat, x11_context->ipc_surface,
capabilities, FALSE,
x11_context->cursor, NULL, NULL, NULL) != GDK_GRAB_SUCCESS)
return FALSE;
@@ -2939,7 +2939,7 @@ drag_context_ungrab (GdkDragContext *context)
}
GdkDragContext *
-_gdk_x11_surface_drag_begin (GdkSurface *window,
+_gdk_x11_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -2952,7 +2952,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *window,
int x_root, y_root;
Atom xselection;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT,
"display", display,
@@ -2978,12 +2978,12 @@ _gdk_x11_surface_drag_begin (GdkSurface *window,
x11_context->protocol = GDK_DRAG_PROTO_XDND;
x11_context->actions = actions;
- x11_context->ipc_window = gdk_surface_new_popup (display, &(GdkRectangle) { -99, -99, 1, 1 });
- if (gdk_surface_get_group (window))
- gdk_surface_set_group (x11_context->ipc_window, window);
- gdk_surface_show (x11_context->ipc_window);
+ x11_context->ipc_surface = gdk_surface_new_popup (display, &(GdkRectangle) { -99, -99, 1, 1 });
+ if (gdk_surface_get_group (surface))
+ gdk_surface_set_group (x11_context->ipc_surface, surface);
+ gdk_surface_show (x11_context->ipc_surface);
- context->source_surface = x11_context->ipc_window;
+ context->source_surface = x11_context->ipc_surface;
g_object_ref (context->source_surface);
x11_context->drag_surface = create_drag_surface (display);
@@ -3000,9 +3000,9 @@ _gdk_x11_surface_drag_begin (GdkSurface *window,
xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection");
XSetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
xselection,
- GDK_SURFACE_XID (x11_context->ipc_window),
+ GDK_SURFACE_XID (x11_context->ipc_surface),
x11_context->timestamp);
- if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_SURFACE_XID (x11_context->ipc_window))
+ if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_SURFACE_XID (x11_context->ipc_surface))
{
GDK_DISPLAY_NOTE (display, DND, g_printerr ("failed XSetSelectionOwner() on \"XdndSelection\", aborting DND\n"));
g_object_unref (context);
@@ -3025,7 +3025,7 @@ gdk_x11_drag_context_set_cursor (GdkDragContext *context,
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gdk_device_grab (gdk_seat_get_pointer (x11_context->grab_seat),
- x11_context->ipc_window,
+ x11_context->ipc_surface,
GDK_OWNERSHIP_APPLICATION, FALSE,
GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
cursor, GDK_CURRENT_TIME);
@@ -3124,9 +3124,9 @@ gdk_drag_update (GdkDragContext *context,
gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_context->actions,
&action, &possible_actions);
- dest_surface = gdk_x11_drag_context_find_window (context,
- x11_context->drag_surface,
- x_root, y_root, &protocol);
+ dest_surface = gdk_x11_drag_context_find_surface (context,
+ x11_context->drag_surface,
+ x_root, y_root, &protocol);
gdk_x11_drag_context_drag_motion (context, dest_surface, protocol, x_root, y_root,
action, possible_actions, evtime);
@@ -3238,8 +3238,8 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context,
* example, when changing the drag cursor.
*/
if (event->implicit ||
- event->grab_window == x11_context->drag_surface ||
- event->grab_window == x11_context->ipc_window)
+ event->grab_surface == x11_context->drag_surface ||
+ event->grab_surface == x11_context->ipc_surface)
return FALSE;
if (gdk_event_get_device ((GdkEvent *) event) !=
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 88007c2e89..a4bbea0079 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -56,12 +56,12 @@ static GSourceFuncs event_funcs = {
};
static GdkSurface *
-gdk_event_source_get_filter_window (GdkEventSource *event_source,
- const XEvent *xevent,
- GdkEventTranslator **event_translator)
+gdk_event_source_get_filter_surface (GdkEventSource *event_source,
+ const XEvent *xevent,
+ GdkEventTranslator **event_translator)
{
GList *list = event_source->translators;
- GdkSurface *window;
+ GdkSurface *surface;
*event_translator = NULL;
@@ -70,23 +70,23 @@ gdk_event_source_get_filter_window (GdkEventSource *event_source,
GdkEventTranslator *translator = list->data;
list = list->next;
- window = _gdk_x11_event_translator_get_window (translator,
+ surface = _gdk_x11_event_translator_get_surface (translator,
event_source->display,
xevent);
- if (window)
+ if (surface)
{
*event_translator = translator;
- return window;
+ return surface;
}
}
- window = gdk_x11_surface_lookup_for_display (event_source->display,
+ surface = gdk_x11_surface_lookup_for_display (event_source->display,
xevent->xany.window);
- if (window && !GDK_IS_SURFACE (window))
- window = NULL;
+ if (surface && !GDK_IS_SURFACE (surface))
+ surface = NULL;
- return window;
+ return surface;
}
static void
@@ -96,8 +96,8 @@ handle_focus_change (GdkEventCrossing *event)
GdkX11Screen *x11_screen;
gboolean focus_in, had_focus;
- toplevel = _gdk_x11_surface_get_toplevel (event->any.window);
- x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (event->any.window));
+ toplevel = _gdk_x11_surface_get_toplevel (event->any.surface);
+ x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (event->any.surface));
focus_in = (event->any.type == GDK_ENTER_NOTIFY);
if (x11_screen->wmspec_check_window)
@@ -119,12 +119,12 @@ handle_focus_change (GdkEventCrossing *event)
GdkEvent *focus_event;
focus_event = gdk_event_new (GDK_FOCUS_CHANGE);
- focus_event->any.window = g_object_ref (event->any.window);
+ focus_event->any.surface = g_object_ref (event->any.surface);
focus_event->any.send_event = FALSE;
focus_event->focus_change.in = focus_in;
gdk_event_set_device (focus_event, gdk_event_get_device ((GdkEvent *) event));
- gdk_display_put_event (gdk_surface_get_display (event->any.window), focus_event);
+ gdk_display_put_event (gdk_surface_get_display (event->any.surface), focus_event);
g_object_unref (focus_event);
}
}
@@ -142,7 +142,7 @@ create_synth_crossing_event (GdkEventType evtype,
event = gdk_event_new (evtype);
event->any.send_event = TRUE;
- event->any.window = g_object_ref (real_event->any.window);
+ event->any.surface = g_object_ref (real_event->any.surface);
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
event->crossing.mode = mode;
event->crossing.time = gdk_event_get_time (real_event);
@@ -232,7 +232,7 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
GdkFilterReturn result = GDK_FILTER_CONTINUE;
GdkDisplay *display = GDK_DISPLAY (x11_display);
GdkEventTranslator *event_translator;
- GdkSurface *filter_window;
+ GdkSurface *filter_surface;
Display *dpy;
GdkX11Screen *x11_screen;
gpointer cache;
@@ -241,10 +241,10 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
dpy = GDK_DISPLAY_XDISPLAY (display);
- filter_window = gdk_event_source_get_filter_window (event_source, xevent,
+ filter_surface = gdk_event_source_get_filter_surface (event_source, xevent,
&event_translator);
- if (filter_window)
- event->any.window = g_object_ref (filter_window);
+ if (filter_surface)
+ event->any.surface = g_object_ref (filter_surface);
/* apply XSettings filters */
if (xevent->xany.window == XRootWindow (dpy, 0))
@@ -271,9 +271,9 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
if (result == GDK_FILTER_CONTINUE)
result = _gdk_x11_dnd_filter (xevent, event, NULL);
- if (result == GDK_FILTER_CONTINUE && filter_window)
+ if (result == GDK_FILTER_CONTINUE && filter_surface)
{
- gpointer context = g_object_get_data (G_OBJECT (filter_window), "xdnd-source-context");
+ gpointer context = g_object_get_data (G_OBJECT (filter_surface), "xdnd-source-context");
result = xdnd_source_surface_filter (xevent, event, context);
}
@@ -316,7 +316,7 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
if (event &&
(event->any.type == GDK_ENTER_NOTIFY ||
event->any.type == GDK_LEAVE_NOTIFY) &&
- event->any.window != NULL)
+ event->any.surface != NULL)
{
/* Handle focusing (in the case where no window manager is running */
handle_focus_change (&event->crossing);
diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c
index 5e3f4770b2..7344b882bc 100644
--- a/gdk/x11/gdkeventtranslator.c
+++ b/gdk/x11/gdkeventtranslator.c
@@ -87,9 +87,9 @@ _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator,
}
GdkSurface *
-_gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
- GdkDisplay *display,
- const XEvent *xevent)
+_gdk_x11_event_translator_get_surface (GdkEventTranslator *translator,
+ GdkDisplay *display,
+ const XEvent *xevent)
{
GdkEventTranslatorIface *iface;
@@ -97,8 +97,8 @@ _gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator);
- if (iface->get_window)
- return iface->get_window (translator, xevent);
+ if (iface->get_surface)
+ return iface->get_surface (translator, xevent);
return NULL;
}
diff --git a/gdk/x11/gdkeventtranslator.h b/gdk/x11/gdkeventtranslator.h
index f72eb451de..5cbc41d539 100644
--- a/gdk/x11/gdkeventtranslator.h
+++ b/gdk/x11/gdkeventtranslator.h
@@ -47,7 +47,7 @@ struct _GdkEventTranslatorIface
void (* select_surface_events) (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask);
- GdkSurface * (* get_window) (GdkEventTranslator *translator,
+ GdkSurface * (* get_surface) (GdkEventTranslator *translator,
const XEvent *xevent);
};
@@ -60,7 +60,7 @@ GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator
void _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask);
-GdkSurface * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
+GdkSurface * _gdk_x11_event_translator_get_surface (GdkEventTranslator *translator,
GdkDisplay *display,
const XEvent *xevent);
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index d75acffbd6..268f852fc7 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -30,7 +30,7 @@ typedef struct _GdkSurfaceParentPos GdkSurfaceParentPos;
struct _GdkSurfaceQueueItem
{
- GdkSurface *window;
+ GdkSurface *surface;
gulong serial;
cairo_region_t *antiexpose_area;
};
@@ -78,10 +78,10 @@ queue_delete_link (GQueue *queue,
static void
queue_item_free (GdkSurfaceQueueItem *item)
{
- if (item->window)
+ if (item->surface)
{
- g_object_remove_weak_pointer (G_OBJECT (item->window),
- (gpointer *)&(item->window));
+ g_object_remove_weak_pointer (G_OBJECT (item->surface),
+ (gpointer *)&(item->surface));
}
cairo_region_destroy (item->antiexpose_area);
@@ -102,10 +102,10 @@ _gdk_x11_display_free_translate_queue (GdkDisplay *display)
}
static void
-gdk_surface_queue (GdkSurface *window,
+gdk_surface_queue (GdkSurface *surface,
GdkSurfaceQueueItem *new_item)
{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (window));
+ GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (surface));
if (!display_x11->translate_queue)
display_x11->translate_queue = g_queue_new ();
@@ -116,7 +116,7 @@ gdk_surface_queue (GdkSurface *window,
*/
if (display_x11->translate_queue->length >= 64)
{
- gulong serial = find_current_serial (GDK_SURFACE_XDISPLAY (window));
+ gulong serial = find_current_serial (GDK_SURFACE_XDISPLAY (surface));
GList *tmp_list = display_x11->translate_queue->head;
while (tmp_list)
@@ -157,32 +157,32 @@ gdk_surface_queue (GdkSurface *window,
}
}
- new_item->window = window;
- new_item->serial = NextRequest (GDK_SURFACE_XDISPLAY (window));
+ new_item->surface = surface;
+ new_item->serial = NextRequest (GDK_SURFACE_XDISPLAY (surface));
- g_object_add_weak_pointer (G_OBJECT (window),
- (gpointer *)&(new_item->window));
+ g_object_add_weak_pointer (G_OBJECT (surface),
+ (gpointer *)&(new_item->surface));
g_queue_push_tail (display_x11->translate_queue, new_item);
}
void
-_gdk_x11_surface_queue_antiexpose (GdkSurface *window,
+_gdk_x11_surface_queue_antiexpose (GdkSurface *surface,
cairo_region_t *area)
{
GdkSurfaceQueueItem *item = g_new (GdkSurfaceQueueItem, 1);
item->antiexpose_area = cairo_region_reference (area);
- gdk_surface_queue (window, item);
+ gdk_surface_queue (surface, item);
}
void
-_gdk_x11_surface_process_expose (GdkSurface *window,
+_gdk_x11_surface_process_expose (GdkSurface *surface,
gulong serial,
GdkRectangle *area)
{
cairo_region_t *invalidate_region = cairo_region_create_rectangle (area);
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (window));
+ GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (surface));
if (display_x11->translate_queue)
{
@@ -196,7 +196,7 @@ _gdk_x11_surface_process_expose (GdkSurface *window,
/* an overflow-safe (serial < item->serial) */
if (serial - item->serial > (gulong) G_MAXLONG)
{
- if (item->window == window)
+ if (item->surface == surface)
cairo_region_subtract (invalidate_region, item->antiexpose_area);
}
else
@@ -209,7 +209,7 @@ _gdk_x11_surface_process_expose (GdkSurface *window,
}
if (!cairo_region_is_empty (invalidate_region))
- _gdk_surface_invalidate_for_expose (window, invalidate_region);
+ _gdk_surface_invalidate_for_expose (surface, invalidate_region);
cairo_region_destroy (invalidate_region);
}
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 9cf8714551..c5f104fde5 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -79,16 +79,16 @@ drawable_info_free (gpointer data_)
}
static DrawableInfo *
-get_glx_drawable_info (GdkSurface *window)
+get_glx_drawable_info (GdkSurface *surface)
{
- return g_object_get_data (G_OBJECT (window), "-gdk-x11-window-glx-info");
+ return g_object_get_data (G_OBJECT (surface), "-gdk-x11-surface-glx-info");
}
static void
-set_glx_drawable_info (GdkSurface *window,
+set_glx_drawable_info (GdkSurface *surface,
DrawableInfo *info)
{
- g_object_set_data_full (G_OBJECT (window), "-gdk-x11-window-glx-info",
+ g_object_set_data_full (G_OBJECT (surface), "-gdk-x11-surface-glx-info",
info,
drawable_info_free);
}
@@ -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_surface (context);
+ GdkSurface *surface = 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);
@@ -139,14 +139,14 @@ gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_gl_context_make_current (context);
- info = get_glx_drawable_info (window);
+ info = get_glx_drawable_info (surface);
drawable = context_x11->attached_drawable;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Flushing GLX buffers for drawable %lu (window: %lu), frame sync: %s",
(unsigned long) drawable,
- (unsigned long) gdk_x11_surface_get_xid (window),
+ (unsigned long) gdk_x11_surface_get_xid (surface),
context_x11->do_frame_sync ? "yes" : "no"));
/* if we are going to wait for the vertical refresh manually
@@ -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_surface (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
unsigned int buffer_age = 0;
if (display_x11->has_glx_buffer_age)
@@ -213,16 +213,16 @@ gdk_x11_gl_context_get_damage (GdkGLContext *context)
if (buffer_age == 2)
{
- if (window->old_updated_area[0])
- return cairo_region_copy (window->old_updated_area[0]);
+ if (surface->old_updated_area[0])
+ return cairo_region_copy (surface->old_updated_area[0]);
}
else if (buffer_age == 3)
{
- if (window->old_updated_area[0] &&
- window->old_updated_area[1])
+ if (surface->old_updated_area[0] &&
+ surface->old_updated_area[1])
{
- cairo_region_t *damage = cairo_region_copy (window->old_updated_area[0]);
- cairo_region_union (damage, window->old_updated_area[1]);
+ cairo_region_t *damage = cairo_region_copy (surface->old_updated_area[0]);
+ cairo_region_union (damage, surface->old_updated_area[1]);
return damage;
}
}
@@ -363,15 +363,15 @@ glx_pixmap_get (cairo_surface_t *surface, guint texture_target)
static gboolean
gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
- cairo_surface_t *surface,
+ cairo_surface_t *cairo_surface,
cairo_region_t *region)
{
GdkGLXPixmap *glx_pixmap;
double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect;
int n_rects, i;
- GdkSurface *window;
- int unscaled_window_height;
+ GdkSurface *surface;
+ int unscaled_surface_height;
int surface_scale;
unsigned int texture_id;
gboolean use_texture_rectangle;
@@ -385,7 +385,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
if (!display_x11->has_glx_texture_from_pixmap)
return FALSE;
- if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_XLIB)
+ if (cairo_surface_get_type (cairo_surface) != CAIRO_SURFACE_TYPE_XLIB)
return FALSE;
use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context);
@@ -394,19 +394,19 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
else
target = GL_TEXTURE_2D;
- glx_pixmap = glx_pixmap_get (surface, target);
+ glx_pixmap = glx_pixmap_get (cairo_surface, target);
if (glx_pixmap == NULL)
return FALSE;
GDK_DISPLAY_NOTE (GDK_DISPLAY (display_x11), OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface"));
- 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);
+ surface = gdk_gl_context_get_surface (paint_context)->impl_surface;
+ surface_scale = gdk_surface_get_scale_factor (surface);
+ gdk_surface_get_unscaled_size (surface, NULL, &unscaled_surface_height);
sx = sy = 1;
- cairo_surface_get_device_scale (surface, &sx, &sy);
- cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset);
+ cairo_surface_get_device_scale (cairo_surface, &sx, &sy);
+ cairo_surface_get_device_offset (cairo_surface, &device_x_offset, &device_y_offset);
/* Ensure all the X stuff are synced before we read it back via texture-from-pixmap */
glXWaitX();
@@ -427,7 +427,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
n_rects = cairo_region_num_rectangles (region);
quads = g_new (GdkTexturedQuad, n_rects);
-#define FLIP_Y(_y) (unscaled_window_height - (_y))
+#define FLIP_Y(_y) (unscaled_surface_height - (_y))
cairo_region_get_extents (region, &rect);
glScissor (rect.x * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale),
@@ -451,8 +451,8 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
}
else
{
- uscale = 1.0 / cairo_xlib_surface_get_width (surface);
- vscale = 1.0 / cairo_xlib_surface_get_height (surface);
+ uscale = 1.0 / cairo_xlib_surface_get_width (cairo_surface);
+ vscale = 1.0 / cairo_xlib_surface_get_height (cairo_surface);
}
{
@@ -566,12 +566,12 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
Display *dpy;
DrawableInfo *info;
GdkGLContext *share;
- GdkSurface *window;
+ GdkSurface *surface;
gboolean debug_bit, compat_bit, legacy_bit, es_bit;
int major, minor, flags;
- window = gdk_gl_context_get_surface (context);
- display = gdk_surface_get_display (window);
+ surface = gdk_gl_context_get_surface (context);
+ display = gdk_surface_get_display (surface);
dpy = gdk_x11_display_get_xdisplay (display);
context_x11 = GDK_X11_GL_CONTEXT (context);
display_x11 = GDK_X11_DISPLAY (display);
@@ -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_surface);
+ info = get_glx_drawable_info (surface->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_surface),
+ gdk_x11_surface_get_xid (surface->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_surface, info);
+ set_glx_drawable_info (surface->impl_surface, info);
}
XFree (xvisinfo);
- context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (window->impl_surface);
+ context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (surface->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);
@@ -1193,7 +1193,7 @@ _gdk_x11_screen_update_visuals_for_gl (GdkX11Screen *x11_screen)
}
GdkGLContext *
-gdk_x11_surface_create_gl_context (GdkSurface *window,
+gdk_x11_surface_create_gl_context (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error)
@@ -1202,9 +1202,9 @@ gdk_x11_surface_create_gl_context (GdkSurface *window,
GdkX11GLContext *context;
GLXFBConfig config;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (!gdk_x11_screen_init_gl (GDK_SURFACE_SCREEN (window)))
+ if (!gdk_x11_screen_init_gl (GDK_SURFACE_SCREEN (surface)))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
@@ -1216,7 +1216,7 @@ gdk_x11_surface_create_gl_context (GdkSurface *window,
return NULL;
context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
- "window", window,
+ "surface", surface,
"shared-context", share,
NULL);
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 53347328d4..4fe1d36b19 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -131,19 +131,19 @@ _gdk_x11_convert_grab_status (gint status)
/*
* _gdk_x11_surface_grab_check_unmap:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
* @serial: serial from Unmap event (or from NextRequest(display)
* if the unmap is being done by this client.)
*
* Checks to see if an unmap request or event causes the current
- * grab window to become not viewable, and if so, clear the
+ * grab surface to become not viewable, and if so, clear the
* the pointer we keep to it.
**/
void
-_gdk_x11_surface_grab_check_unmap (GdkSurface *window,
+_gdk_x11_surface_grab_check_unmap (GdkSurface *surface,
gulong serial)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkSeat *seat;
GList *devices, *d;
@@ -153,24 +153,24 @@ _gdk_x11_surface_grab_check_unmap (GdkSurface *window,
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
- /* End all grabs on the newly hidden window */
+ /* End all grabs on the newly hidden surface */
for (d = devices; d; d = d->next)
- _gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
+ _gdk_display_end_device_grab (display, d->data, serial, surface, TRUE);
g_list_free (devices);
}
/*
* _gdk_x11_surface_grab_check_destroy:
- * @window: a #GdkSurface
+ * @surface: a #GdkSurface
*
- * Checks to see if window is the current grab window, and if
- * so, clear the current grab window.
+ * Checks to see if surface is the current grab surface, and if
+ * so, clear the current grab surface.
**/
void
-_gdk_x11_surface_grab_check_destroy (GdkSurface *window)
+_gdk_x11_surface_grab_check_destroy (GdkSurface *surface)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkSeat *seat;
GdkDeviceGrabInfo *grab;
GList *devices, *d;
@@ -183,10 +183,10 @@ _gdk_x11_surface_grab_check_destroy (GdkSurface *window)
for (d = devices; d; d = d->next)
{
- /* Make sure there is no lasting grab in this native window */
+ /* Make sure there is no lasting grab in this native surface */
grab = _gdk_display_get_last_device_grab (display, d->data);
- if (grab && grab->native_surface == window)
+ if (grab && grab->native_surface == surface)
{
/* 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 35f519a7df..34d88e98f8 100644
--- a/gdk/x11/gdkmonitor-x11.c
+++ b/gdk/x11/gdkmonitor-x11.c
@@ -34,7 +34,7 @@ static gboolean
gdk_monitor_has_fullscreen_window (GdkMonitor *monitor)
{
GList *toplevels, *l;
- GdkSurface *window;
+ GdkSurface *surface;
gboolean has_fullscreen;
toplevels = gdk_x11_display_get_toplevel_windows (monitor->display);
@@ -42,13 +42,13 @@ gdk_monitor_has_fullscreen_window (GdkMonitor *monitor)
has_fullscreen = FALSE;
for (l = toplevels; l; l = l->next)
{
- window = l->data;
+ surface = l->data;
- if ((gdk_surface_get_state (window) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
+ if ((gdk_surface_get_state (surface) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
continue;
- if (gdk_surface_get_fullscreen_mode (window) == GDK_FULLSCREEN_ON_ALL_MONITORS ||
- gdk_display_get_monitor_at_surface (monitor->display, window) == monitor)
+ if (gdk_surface_get_fullscreen_mode (surface) == GDK_FULLSCREEN_ON_ALL_MONITORS ||
+ gdk_display_get_monitor_at_surface (monitor->display, surface) == monitor)
{
has_fullscreen = TRUE;
break;
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 83b6818e55..4554c6ccd4 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -805,9 +805,9 @@ _gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen,
for (l = toplevels; l != NULL; l = l->next)
{
- GdkSurface *window = l->data;
+ GdkSurface *surface = l->data;
- _gdk_x11_surface_set_surface_scale (window, scale);
+ _gdk_x11_surface_set_surface_scale (surface, scale);
}
for (i = 0; i < x11_display->monitors->len; i++)
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 288271c64a..17a51c3fa6 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -101,23 +101,23 @@ const int _gdk_x11_event_mask_table[21] =
const gint _gdk_x11_event_mask_table_size = G_N_ELEMENTS (_gdk_x11_event_mask_table);
/* Forward declarations */
-static void gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window);
-static gboolean gdk_surface_icon_name_set (GdkSurface *window);
+static void gdk_x11_surface_apply_fullscreen_mode (GdkSurface *surface);
+static gboolean gdk_surface_icon_name_set (GdkSurface *surface);
static void set_wm_name (GdkDisplay *display,
Window xwindow,
const gchar *name);
-static void move_to_current_desktop (GdkSurface *window);
+static void move_to_current_desktop (GdkSurface *surface);
static void gdk_surface_impl_x11_finalize (GObject *object);
-#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 SURFACE_IS_TOPLEVEL_OR_FOREIGN(surface) \
+ (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TOPLEVEL || \
+ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TEMP || \
+ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_FOREIGN)
-#define SURFACE_IS_TOPLEVEL(window) \
- (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL || \
- GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP)
+#define SURFACE_IS_TOPLEVEL(surface) \
+ (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TOPLEVEL || \
+ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TEMP)
/* Return whether time1 is considered later than time2 as far as xserver
* time is concerned. Accounts for wraparound.
@@ -158,16 +158,16 @@ gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl)
}
GdkToplevelX11 *
-_gdk_x11_surface_get_toplevel (GdkSurface *window)
+_gdk_x11_surface_get_toplevel (GdkSurface *surface)
{
GdkSurfaceImplX11 *impl;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (!SURFACE_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return NULL;
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (!impl->toplevel)
{
@@ -182,7 +182,7 @@ _gdk_x11_surface_get_toplevel (GdkSurface *window)
* _gdk_x11_surface_update_size:
* @impl: a #GdkSurfaceImplX11.
*
- * Updates the state of the window (in particular the drawable's
+ * Updates the state of the surface (in particular the drawable's
* cairo surface) when its size has changed.
**/
void
@@ -196,11 +196,11 @@ _gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl)
}
static void
-gdk_x11_surface_get_unscaled_size (GdkSurface *window,
+gdk_x11_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (unscaled_width)
*unscaled_width = impl->unscaled_width;
@@ -210,9 +210,9 @@ gdk_x11_surface_get_unscaled_size (GdkSurface *window,
}
static gboolean
-gdk_x11_surface_supports_edge_constraints (GdkSurface *window)
+gdk_x11_surface_supports_edge_constraints (GdkSurface *surface)
{
- return gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ return gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_GTK_EDGE_CONSTRAINTS"));
}
@@ -230,15 +230,15 @@ set_sync_counter(Display *display,
}
static void
-window_pre_damage (GdkSurface *window)
+surface_pre_damage (GdkSurface *surface)
{
- GdkSurface *toplevel_window = gdk_surface_get_toplevel (window);
+ GdkSurface *toplevel_surface = gdk_surface_get_toplevel (surface);
GdkSurfaceImplX11 *impl;
- if (!toplevel_window || !SURFACE_IS_TOPLEVEL (toplevel_window))
+ if (!toplevel_surface || !SURFACE_IS_TOPLEVEL (toplevel_surface))
return;
- impl = GDK_SURFACE_IMPL_X11 (toplevel_window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (toplevel_surface->impl);
if (impl->toplevel->in_frame &&
impl->toplevel->current_counter_value % 2 == 0)
@@ -253,11 +253,11 @@ window_pre_damage (GdkSurface *window)
static void
on_surface_changed (void *data)
{
- GdkSurface *window = data;
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurface *surface = data;
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (impl->tracking_damage)
- window_pre_damage (window);
+ surface_pre_damage (surface);
}
/* We want to know when cairo drawing causes damage to the window,
@@ -270,9 +270,9 @@ on_surface_changed (void *data)
*/
static void
-hook_surface_changed (GdkSurface *window)
+hook_surface_changed (GdkSurface *surface)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (impl->cairo_surface)
{
@@ -281,15 +281,15 @@ hook_surface_changed (GdkSurface *window)
(unsigned char *)"X",
1,
on_surface_changed,
- window);
+ surface);
impl->tracking_damage = 1;
}
}
static void
-unhook_surface_changed (GdkSurface *window)
+unhook_surface_changed (GdkSurface *surface)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (impl->cairo_surface)
{
@@ -302,18 +302,18 @@ unhook_surface_changed (GdkSurface *window)
}
static void
-gdk_x11_surface_predict_presentation_time (GdkSurface *window)
+gdk_x11_surface_predict_presentation_time (GdkSurface *surface)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkFrameClock *clock;
GdkFrameTimings *timings;
gint64 presentation_time;
gint64 refresh_interval;
- if (!SURFACE_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return;
- clock = gdk_surface_get_frame_clock (window);
+ clock = gdk_surface_get_frame_clock (surface);
timings = gdk_frame_clock_get_current_timings (clock);
@@ -348,16 +348,16 @@ gdk_x11_surface_predict_presentation_time (GdkSurface *window)
}
static void
-gdk_x11_surface_begin_frame (GdkSurface *window,
+gdk_x11_surface_begin_frame (GdkSurface *surface,
gboolean force_frame)
{
GdkSurfaceImplX11 *impl;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (!SURFACE_IS_TOPLEVEL (window) ||
+ if (!SURFACE_IS_TOPLEVEL (surface) ||
impl->toplevel->extended_update_counter == None)
return;
@@ -372,48 +372,48 @@ gdk_x11_surface_begin_frame (GdkSurface *window,
impl->toplevel->configure_counter_value = 0;
- window_pre_damage (window);
+ surface_pre_damage (surface);
}
else if (force_frame)
{
- /* When mapping the window, we really want to freeze the
- rendering of the window by the compositor until we've
- actually painted something into the window's buffer. */
- window_pre_damage (window);
+ /* When mapping the surface, we really want to freeze the
+ rendering of the surface by the compositor until we've
+ actually painted something into the surface's buffer. */
+ surface_pre_damage (surface);
}
else
{
- hook_surface_changed (window);
+ hook_surface_changed (surface);
}
}
static void
-gdk_x11_surface_end_frame (GdkSurface *window)
+gdk_x11_surface_end_frame (GdkSurface *surface)
{
GdkFrameClock *clock;
GdkFrameTimings *timings;
GdkSurfaceImplX11 *impl;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (!SURFACE_IS_TOPLEVEL (window) ||
+ if (!SURFACE_IS_TOPLEVEL (surface) ||
impl->toplevel->extended_update_counter == None ||
!impl->toplevel->in_frame)
return;
- clock = gdk_surface_get_frame_clock (window);
+ clock = gdk_surface_get_frame_clock (surface);
timings = gdk_frame_clock_get_current_timings (clock);
impl->toplevel->in_frame = FALSE;
if (impl->toplevel->current_counter_value % 2 == 1)
{
- if (GDK_DISPLAY_DEBUG_CHECK (gdk_surface_get_display (window), FRAMES))
+ if (GDK_DISPLAY_DEBUG_CHECK (gdk_surface_get_display (surface), FRAMES))
{
- XImage *image = XGetImage (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XImage *image = XGetImage (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
0, 0, 1, 1,
(1 << 24) - 1,
ZPixmap);
@@ -434,21 +434,21 @@ gdk_x11_surface_end_frame (GdkSurface *window)
impl->toplevel->current_counter_value);
if (impl->frame_sync_enabled &&
- gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_WM_FRAME_DRAWN")))
{
impl->toplevel->frame_pending = TRUE;
- _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window));
+ _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (surface));
timings->cookie = impl->toplevel->current_counter_value;
}
}
- unhook_surface_changed (window);
+ unhook_surface_changed (surface);
if (impl->toplevel->configure_counter_value != 0 &&
!impl->toplevel->configure_counter_value_is_extended)
{
- set_sync_counter (GDK_SURFACE_XDISPLAY (window),
+ set_sync_counter (GDK_SURFACE_XDISPLAY (surface),
impl->toplevel->update_counter,
impl->toplevel->configure_counter_value);
@@ -478,22 +478,22 @@ gdk_x11_create_cairo_surface (GdkSurfaceImplX11 *impl,
}
static cairo_surface_t *
-gdk_x11_ref_cairo_surface (GdkSurface *window)
+gdk_x11_ref_cairo_surface (GdkSurface *surface)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
if (!impl->cairo_surface)
{
impl->cairo_surface = gdk_x11_create_cairo_surface (impl,
- gdk_surface_get_width (window) * impl->surface_scale,
- gdk_surface_get_height (window) * impl->surface_scale);
+ gdk_surface_get_width (surface) * impl->surface_scale,
+ gdk_surface_get_height (surface) * impl->surface_scale);
cairo_surface_set_device_scale (impl->cairo_surface, impl->surface_scale, impl->surface_scale);
- if (SURFACE_IS_TOPLEVEL (window) && impl->toplevel->in_frame)
- hook_surface_changed (window);
+ if (SURFACE_IS_TOPLEVEL (surface) && impl->toplevel->in_frame)
+ hook_surface_changed (surface);
}
cairo_surface_reference (impl->cairo_surface);
@@ -595,37 +595,37 @@ _gdk_x11_display_create_bitmap_surface (GdkDisplay *display,
return surface;
}
-/* Create a surface backed with a pixmap without alpha on the same screen as window */
+/* Create a surface backed with a pixmap without alpha on the same screen as surface */
static cairo_surface_t *
-gdk_x11_surface_create_pixmap_surface (GdkSurface *window,
+gdk_x11_surface_create_pixmap_surface (GdkSurface *surface,
int width,
int height)
{
GdkDisplay *display;
Display *dpy;
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
Pixmap pixmap;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
dpy = GDK_DISPLAY_XDISPLAY (display);
pixmap = XCreatePixmap (dpy,
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
width, height,
DefaultDepth (dpy, DefaultScreen (dpy)));
- surface = cairo_xlib_surface_create (dpy,
+ cairo_surface = cairo_xlib_surface_create (dpy,
pixmap,
DefaultVisual (dpy, DefaultScreen (dpy)),
width, height);
- attach_free_pixmap_handler (surface, display, pixmap);
+ attach_free_pixmap_handler (cairo_surface, display, pixmap);
- return surface;
+ return cairo_surface;
}
static void
-set_wm_protocols (GdkSurface *window)
+set_wm_protocols (GdkSurface *surface)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
Atom protocols[4];
int n = 0;
@@ -638,7 +638,7 @@ set_wm_protocols (GdkSurface *window)
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST");
#endif
- XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), protocols, n);
+ XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface), protocols, n);
}
static const gchar *
@@ -704,13 +704,13 @@ create_focus_window (GdkDisplay *display,
}
static void
-ensure_sync_counter (GdkSurface *window)
+ensure_sync_counter (GdkSurface *surface)
{
#ifdef HAVE_XSYNC
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel &&
toplevel->update_counter == None &&
@@ -731,7 +731,7 @@ ensure_sync_counter (GdkSurface *window)
counters[0] = toplevel->update_counter;
counters[1] = toplevel->extended_update_counter;
- XChangeProperty (xdisplay, GDK_SURFACE_XID (window),
+ XChangeProperty (xdisplay, GDK_SURFACE_XID (surface),
atom, XA_CARDINAL,
32, PropModeReplace,
(guchar *)counters, 2);
@@ -743,29 +743,29 @@ ensure_sync_counter (GdkSurface *window)
}
static void
-setup_toplevel_window (GdkSurface *window,
+setup_toplevel_window (GdkSurface *surface,
GdkX11Screen *x11_screen)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
- GdkDisplay *display = gdk_surface_get_display (window);
- Display *xdisplay = GDK_SURFACE_XDISPLAY (window);
- XID xid = GDK_SURFACE_XID (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ GdkDisplay *display = gdk_surface_get_display (surface);
+ Display *xdisplay = GDK_SURFACE_XDISPLAY (surface);
+ XID xid = GDK_SURFACE_XID (surface);
XSizeHints size_hints;
long pid;
Window leader_window;
- set_wm_protocols (window);
+ set_wm_protocols (surface);
- if (!window->input_only)
+ if (!surface->input_only)
{
- /* The focus window is off the visible area, and serves to receive key
- * press events so they don't get sent to child windows.
+ /* The focus surface is off the visible area, and serves to receive key
+ * press events so they don't get sent to child surfaces.
*/
toplevel->focus_window = create_focus_window (display, xid);
_gdk_x11_display_add_window (x11_screen->display,
&toplevel->focus_window,
- window);
+ surface);
}
check_leader_window_title (x11_screen->display);
@@ -775,8 +775,8 @@ setup_toplevel_window (GdkSurface *window,
* correct value???
*/
size_hints.flags = PSize;
- size_hints.width = window->width * impl->surface_scale;
- size_hints.height = window->height * impl->surface_scale;
+ size_hints.width = surface->width * impl->surface_scale;
+ size_hints.height = surface->height * impl->surface_scale;
XSetWMNormalHints (xdisplay, xid, &size_hints);
@@ -804,47 +804,47 @@ setup_toplevel_window (GdkSurface *window,
XA_WINDOW, 32, PropModeReplace,
(guchar *) &toplevel->focus_window, 1);
- if (!window->focus_on_map)
- gdk_x11_surface_set_user_time (window, 0);
+ if (!surface->focus_on_map)
+ gdk_x11_surface_set_user_time (surface, 0);
else if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0)
- gdk_x11_surface_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time);
+ gdk_x11_surface_set_user_time (surface, GDK_X11_DISPLAY (x11_screen->display)->user_time);
- ensure_sync_counter (window);
+ ensure_sync_counter (surface);
/* Start off in a frozen state - we'll finish this when we first paint */
- gdk_x11_surface_begin_frame (window, TRUE);
+ gdk_x11_surface_begin_frame (surface, TRUE);
}
static void
on_frame_clock_before_paint (GdkFrameClock *clock,
- GdkSurface *window)
+ GdkSurface *surface)
{
- gdk_x11_surface_predict_presentation_time (window);
- gdk_x11_surface_begin_frame (window, FALSE);
+ gdk_x11_surface_predict_presentation_time (surface);
+ gdk_x11_surface_begin_frame (surface, FALSE);
}
static void
on_frame_clock_after_paint (GdkFrameClock *clock,
- GdkSurface *window)
+ GdkSurface *surface)
{
- gdk_x11_surface_end_frame (window);
+ gdk_x11_surface_end_frame (surface);
}
static void
-connect_frame_clock (GdkSurface *window)
+connect_frame_clock (GdkSurface *surface)
{
GdkSurfaceImplX11 *impl;
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
- if (SURFACE_IS_TOPLEVEL (window) && !impl->frame_clock_connected)
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ if (SURFACE_IS_TOPLEVEL (surface) && !impl->frame_clock_connected)
{
- GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window);
+ GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
g_signal_connect (frame_clock, "before-paint",
- G_CALLBACK (on_frame_clock_before_paint), window);
+ G_CALLBACK (on_frame_clock_before_paint), surface);
g_signal_connect (frame_clock, "after-paint",
- G_CALLBACK (on_frame_clock_after_paint), window);
+ G_CALLBACK (on_frame_clock_after_paint), surface);
impl->frame_clock_connected = TRUE;
}
@@ -852,7 +852,7 @@ connect_frame_clock (GdkSurface *window)
void
_gdk_x11_display_create_surface_impl (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes)
@@ -883,8 +883,8 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
xparent = GDK_SCREEN_XROOTWIN (x11_screen);
impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL);
- window->impl = GDK_SURFACE_IMPL (impl);
- impl->wrapper = GDK_SURFACE (window);
+ surface->impl = GDK_SURFACE_IMPL (impl);
+ impl->wrapper = GDK_SURFACE (surface);
impl->surface_scale = x11_screen->surface_scale;
xdisplay = x11_screen->xdisplay;
@@ -896,11 +896,11 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
impl->override_redirect = FALSE;
/* Sanity checks */
- switch (window->surface_type)
+ switch (surface->surface_type)
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP:
- if (window->parent)
+ if (surface->parent)
{
/* The common code warns for this case */
xparent = GDK_SCREEN_XROOTWIN (x11_screen);
@@ -913,7 +913,7 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
break;
}
- if (!window->input_only)
+ if (!surface->input_only)
{
class = InputOutput;
@@ -928,7 +928,7 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
xattributes.colormap = gdk_x11_display_get_window_colormap (display_x11);
xattributes_mask |= CWColormap;
- if (window->surface_type == GDK_SURFACE_TEMP)
+ if (surface->surface_type == GDK_SURFACE_TEMP)
{
xattributes.save_under = True;
xattributes.override_redirect = True;
@@ -944,7 +944,7 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
{
class = InputOnly;
- if (window->surface_type == GDK_SURFACE_TEMP)
+ if (surface->surface_type == GDK_SURFACE_TEMP)
{
xattributes.override_redirect = True;
xattributes_mask |= CWOverrideRedirect;
@@ -955,24 +955,24 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
depth = 0;
}
- if (window->width * impl->surface_scale > 32767 ||
- window->height * impl->surface_scale > 32767)
+ if (surface->width * impl->surface_scale > 32767 ||
+ surface->height * impl->surface_scale > 32767)
{
g_warning ("Native Windows wider or taller than 32767 pixels are not supported");
- 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;
+ if (surface->width * impl->surface_scale > 32767)
+ surface->width = 32767 / impl->surface_scale;
+ if (surface->height * impl->surface_scale > 32767)
+ surface->height = 32767 / impl->surface_scale;
}
- impl->unscaled_width = window->width * impl->surface_scale;
- impl->unscaled_height = window->height * impl->surface_scale;
+ impl->unscaled_width = surface->width * impl->surface_scale;
+ impl->unscaled_height = surface->height * impl->surface_scale;
- if (window->parent)
+ if (surface->parent)
{
- abs_x = window->parent->abs_x;
- abs_y = window->parent->abs_y;
+ abs_x = surface->parent->abs_x;
+ abs_y = surface->parent->abs_y;
}
else
{
@@ -981,20 +981,20 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
}
impl->xid = XCreateWindow (xdisplay, xparent,
- (window->x + abs_x) * impl->surface_scale,
- (window->y + abs_y) * impl->surface_scale,
- window->width * impl->surface_scale, window->height * impl->surface_scale,
+ (surface->x + abs_x) * impl->surface_scale,
+ (surface->y + abs_y) * impl->surface_scale,
+ surface->width * impl->surface_scale, surface->height * impl->surface_scale,
0, depth, class, xvisual,
xattributes_mask, &xattributes);
- g_object_ref (window);
- _gdk_x11_display_add_window (x11_screen->display, &impl->xid, window);
+ g_object_ref (surface);
+ _gdk_x11_display_add_window (x11_screen->display, &impl->xid, surface);
- switch (GDK_SURFACE_TYPE (window))
+ switch (GDK_SURFACE_TYPE (surface))
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP:
- gdk_surface_set_title (window, get_default_title ());
+ gdk_surface_set_title (surface, get_default_title ());
class_hint = XAllocClassHint ();
class_hint->res_name = (char *) g_get_prgname ();
@@ -1002,7 +1002,7 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
XSetClassHint (xdisplay, impl->xid, class_hint);
XFree (class_hint);
- setup_toplevel_window (window, x11_screen);
+ setup_toplevel_window (surface, x11_screen);
break;
case GDK_SURFACE_CHILD:
@@ -1011,12 +1011,12 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
}
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_SURFACE_XID (window), event_mask,
+ GDK_SURFACE_XID (surface), event_mask,
StructureNotifyMask | PropertyChangeMask);
- connect_frame_clock (window);
+ connect_frame_clock (surface);
- gdk_surface_freeze_toplevel_updates (window);
+ gdk_surface_freeze_toplevel_updates (surface);
}
static GdkEventMask
@@ -1092,7 +1092,7 @@ gdk_x11_surface_foreign_new_for_display (GdkDisplay *display,
if (screen == NULL)
return NULL;
- win = _gdk_display_create_window (display);
+ win = _gdk_display_create_surface (display);
win->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL);
win->impl_surface = win;
@@ -1166,20 +1166,20 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display,
}
static void
-gdk_x11_surface_destroy (GdkSurface *window,
+gdk_x11_surface_destroy (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel)
- gdk_toplevel_x11_free_contents (GDK_SURFACE_DISPLAY (window), toplevel);
+ gdk_toplevel_x11_free_contents (GDK_SURFACE_DISPLAY (surface), toplevel);
- unhook_surface_changed (window);
+ unhook_surface_changed (surface);
if (impl->cairo_surface)
{
@@ -1189,53 +1189,53 @@ gdk_x11_surface_destroy (GdkSurface *window,
}
if (!recursing && !foreign_destroy)
- XDestroyWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window));
+ XDestroyWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface));
}
/* This function is called when the XWindow is really gone.
*/
static void
-gdk_x11_surface_destroy_notify (GdkSurface *window)
+gdk_x11_surface_destroy_notify (GdkSurface *surface)
{
GdkSurfaceImplX11 *surface_impl;
- surface_impl = GDK_SURFACE_IMPL_X11 ((window)->impl);
+ surface_impl = GDK_SURFACE_IMPL_X11 ((surface)->impl);
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- if (GDK_SURFACE_TYPE(window) != GDK_SURFACE_FOREIGN)
- g_warning ("GdkSurface %#lx unexpectedly destroyed", GDK_SURFACE_XID (window));
+ if (GDK_SURFACE_TYPE(surface) != GDK_SURFACE_FOREIGN)
+ g_warning ("GdkSurface %#lx unexpectedly destroyed", GDK_SURFACE_XID (surface));
- _gdk_surface_destroy (window, TRUE);
+ _gdk_surface_destroy (surface, TRUE);
}
- _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), GDK_SURFACE_XID (window));
+ _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (surface), GDK_SURFACE_XID (surface));
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_display_remove_window (GDK_SURFACE_DISPLAY (surface), surface_impl->toplevel->focus_window);
- _gdk_x11_surface_grab_check_destroy (window);
+ _gdk_x11_surface_grab_check_destroy (surface);
- g_object_unref (window);
+ g_object_unref (surface);
}
static void
-update_wm_hints (GdkSurface *window,
+update_wm_hints (GdkSurface *surface,
gboolean force)
{
- GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
XWMHints wm_hints;
if (!force &&
!toplevel->is_leader &&
- window->state & GDK_SURFACE_STATE_WITHDRAWN)
+ surface->state & GDK_SURFACE_STATE_WITHDRAWN)
return;
wm_hints.flags = StateHint | InputHint;
- wm_hints.input = window->accept_focus ? True : False;
+ wm_hints.input = surface->accept_focus ? True : False;
wm_hints.initial_state = NormalState;
- if (window->state & GDK_SURFACE_STATE_ICONIFIED)
+ if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
{
wm_hints.flags |= StateHint;
wm_hints.initial_state = IconicState;
@@ -1265,27 +1265,27 @@ update_wm_hints (GdkSurface *window,
if (toplevel->urgency_hint)
wm_hints.flags |= XUrgencyHint;
- XSetWMHints (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XSetWMHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&wm_hints);
}
static void
-set_initial_hints (GdkSurface *window)
+set_initial_hints (GdkSurface *surface)
{
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
- Window xwindow = GDK_SURFACE_XID (window);
+ Window xwindow = GDK_SURFACE_XID (surface);
GdkToplevelX11 *toplevel;
Atom atoms[9];
gint i;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (!toplevel)
return;
- update_wm_hints (window, TRUE);
+ update_wm_hints (surface, TRUE);
/* We set the spec hints regardless of whether the spec is supported,
* since it can't hurt and it's kind of expensive to check whether
@@ -1294,7 +1294,7 @@ set_initial_hints (GdkSurface *window)
i = 0;
- if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
+ if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_MAXIMIZED_VERT");
@@ -1305,21 +1305,21 @@ set_initial_hints (GdkSurface *window)
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
}
- if (window->state & GDK_SURFACE_STATE_ABOVE)
+ if (surface->state & GDK_SURFACE_STATE_ABOVE)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_ABOVE");
++i;
}
- if (window->state & GDK_SURFACE_STATE_BELOW)
+ if (surface->state & GDK_SURFACE_STATE_BELOW)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_BELOW");
++i;
}
- if (window->state & GDK_SURFACE_STATE_STICKY)
+ if (surface->state & GDK_SURFACE_STATE_STICKY)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_STICKY");
@@ -1327,7 +1327,7 @@ set_initial_hints (GdkSurface *window)
toplevel->have_sticky = TRUE;
}
- if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
+ if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_FULLSCREEN");
@@ -1335,7 +1335,7 @@ set_initial_hints (GdkSurface *window)
toplevel->have_fullscreen = TRUE;
}
- if (window->modal_hint)
+ if (surface->modal_hint)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_MODAL");
@@ -1356,7 +1356,7 @@ set_initial_hints (GdkSurface *window)
++i;
}
- if (window->state & GDK_SURFACE_STATE_ICONIFIED)
+ if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_HIDDEN");
@@ -1379,7 +1379,7 @@ set_initial_hints (GdkSurface *window)
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
}
- if (window->state & GDK_SURFACE_STATE_STICKY)
+ if (surface->state & GDK_SURFACE_STATE_STICKY)
{
atoms[0] = 0xFFFFFFFF;
XChangeProperty (xdisplay,
@@ -1400,27 +1400,27 @@ set_initial_hints (GdkSurface *window)
}
static void
-gdk_surface_x11_show (GdkSurface *window, gboolean already_mapped)
+gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped)
{
GdkDisplay *display;
GdkX11Display *display_x11;
GdkToplevelX11 *toplevel;
- Display *xdisplay = GDK_SURFACE_XDISPLAY (window);
- Window xwindow = GDK_SURFACE_XID (window);
+ Display *xdisplay = GDK_SURFACE_XDISPLAY (surface);
+ Window xwindow = GDK_SURFACE_XID (surface);
if (!already_mapped)
- set_initial_hints (window);
+ set_initial_hints (surface);
- if (SURFACE_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (surface))
{
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
display_x11 = GDK_X11_DISPLAY (display);
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel->user_time != 0 &&
display_x11->user_time != 0 &&
XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
- gdk_x11_surface_set_user_time (window, display_x11->user_time);
+ gdk_x11_surface_set_user_time (surface, display_x11->user_time);
}
XMapWindow (xdisplay, xwindow);
@@ -1429,26 +1429,26 @@ gdk_surface_x11_show (GdkSurface *window, gboolean already_mapped)
* when mapping a window. This also ensures that the default behavior remains
* consistent with pre-fullscreen mode implementation.
*/
- if (window->fullscreen_mode != GDK_FULLSCREEN_ON_CURRENT_MONITOR)
- gdk_x11_surface_apply_fullscreen_mode (window);
+ if (surface->fullscreen_mode != GDK_FULLSCREEN_ON_CURRENT_MONITOR)
+ gdk_x11_surface_apply_fullscreen_mode (surface);
}
static void
-gdk_surface_x11_hide (GdkSurface *window)
+gdk_surface_x11_hide (GdkSurface *surface)
{
/* We'll get the unmap notify eventually, and handle it then,
* but checking here makes things more consistent if we are
* just doing stuff ourself.
*/
- _gdk_x11_surface_grab_check_unmap (window,
- NextRequest (GDK_SURFACE_XDISPLAY (window)));
+ _gdk_x11_surface_grab_check_unmap (surface,
+ NextRequest (GDK_SURFACE_XDISPLAY (surface)));
- /* You can't simply unmap toplevel windows. */
- switch (window->surface_type)
+ /* You can't simply unmap toplevel surfaces. */
+ switch (surface->surface_type)
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP: /* ? */
- gdk_surface_withdraw (window);
+ gdk_surface_withdraw (surface);
return;
case GDK_SURFACE_FOREIGN:
@@ -1457,53 +1457,53 @@ gdk_surface_x11_hide (GdkSurface *window)
break;
}
- _gdk_surface_clear_update_area (window);
+ _gdk_surface_clear_update_area (surface);
- XUnmapWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window));
+ XUnmapWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface));
}
static void
-gdk_surface_x11_withdraw (GdkSurface *window)
+gdk_surface_x11_withdraw (GdkSurface *surface)
{
- if (!window->destroyed)
+ if (!surface->destroyed)
{
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_synthesize_surface_state (window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_WITHDRAWN);
- g_assert (!GDK_SURFACE_IS_MAPPED (window));
+ g_assert (!GDK_SURFACE_IS_MAPPED (surface));
- XWithdrawWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window), 0);
+ XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface), 0);
}
}
static inline void
-window_x11_move (GdkSurface *window,
+surface_x11_move (GdkSurface *surface,
gint x,
gint y)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- XMoveWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XMoveWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
x * impl->surface_scale, y * impl->surface_scale);
if (impl->override_redirect)
{
- window->x = x;
- window->y = y;
+ surface->x = x;
+ surface->y = y;
}
}
static inline void
-window_x11_resize (GdkSurface *window,
+surface_x11_resize (GdkSurface *surface,
gint width,
gint height)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (width < 1)
width = 1;
@@ -1511,35 +1511,35 @@ window_x11_resize (GdkSurface *window,
if (height < 1)
height = 1;
- window_pre_damage (window);
+ surface_pre_damage (surface);
- XResizeWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XResizeWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
width * impl->surface_scale, height * impl->surface_scale);
if (impl->override_redirect)
{
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));
+ surface->width = width;
+ surface->height = height;
+ _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl));
}
else
{
if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
- window->resize_count += 1;
+ surface->resize_count += 1;
}
}
static inline void
-window_x11_move_resize (GdkSurface *window,
+surface_x11_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (width < 1)
width = 1;
@@ -1547,34 +1547,34 @@ window_x11_move_resize (GdkSurface *window,
if (height < 1)
height = 1;
- window_pre_damage (window);
+ surface_pre_damage (surface);
- XMoveResizeWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XMoveResizeWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
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;
+ surface->x = x;
+ surface->y = y;
impl->unscaled_width = width * impl->surface_scale;
impl->unscaled_height = height * impl->surface_scale;
- window->width = width;
- window->height = height;
+ surface->width = width;
+ surface->height = height;
- _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (window->impl));
+ _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl));
}
else
{
if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
- window->resize_count += 1;
+ surface->resize_count += 1;
}
}
static void
-gdk_surface_x11_move_resize (GdkSurface *window,
+gdk_surface_x11_move_resize (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
@@ -1582,73 +1582,73 @@ gdk_surface_x11_move_resize (GdkSurface *window,
gint height)
{
if (with_move && (width < 0 && height < 0))
- window_x11_move (window, x, y);
+ surface_x11_move (surface, x, y);
else
{
if (with_move)
- window_x11_move_resize (window, x, y, width, height);
+ surface_x11_move_resize (surface, x, y, width, height);
else
- window_x11_resize (window, width, height);
+ surface_x11_resize (surface, width, height);
}
}
void
-_gdk_x11_surface_set_surface_scale (GdkSurface *window,
+_gdk_x11_surface_set_surface_scale (GdkSurface *surface,
int scale)
{
GdkSurfaceImplX11 *impl;
GdkToplevelX11 *toplevel;
GdkSurfaceHints geom_mask;
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
impl->surface_scale = scale;
if (impl->cairo_surface)
cairo_surface_set_device_scale (impl->cairo_surface, impl->surface_scale, impl->surface_scale);
- _gdk_surface_update_size (window);
+ _gdk_surface_update_size (surface);
- toplevel = _gdk_x11_surface_get_toplevel (window);
- if (toplevel && window->surface_type != GDK_SURFACE_FOREIGN)
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
+ if (toplevel && surface->surface_type != GDK_SURFACE_FOREIGN)
{
- /* These are affected by window scale: */
+ /* These are affected by surface scale: */
geom_mask = toplevel->last_geometry_hints_mask &
(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC);
if (geom_mask)
- gdk_surface_set_geometry_hints (window,
+ gdk_surface_set_geometry_hints (surface,
&toplevel->last_geometry_hints,
geom_mask);
}
- if (window->surface_type == GDK_SURFACE_FOREIGN)
- XMoveWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- window->x * impl->surface_scale,
- window->y * impl->surface_scale);
+ if (surface->surface_type == GDK_SURFACE_FOREIGN)
+ XMoveWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ surface->x * impl->surface_scale,
+ surface->y * impl->surface_scale);
else
{
if (impl->override_redirect)
{
- impl->unscaled_width = window->width * impl->surface_scale;
- impl->unscaled_height = window->height * impl->surface_scale;
+ impl->unscaled_width = surface->width * impl->surface_scale;
+ impl->unscaled_height = surface->height * impl->surface_scale;
}
- XResizeWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- window->width * impl->surface_scale,
- window->height * impl->surface_scale);
+ XResizeWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ surface->width * impl->surface_scale,
+ surface->height * impl->surface_scale);
}
- gdk_surface_invalidate_rect (window, NULL, TRUE);
+ gdk_surface_invalidate_rect (surface, NULL, TRUE);
}
static void
-gdk_surface_x11_raise (GdkSurface *window)
+gdk_surface_x11_raise (GdkSurface *surface)
{
- XRaiseWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window));
+ XRaiseWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface));
}
static void
-gdk_surface_x11_restack_toplevel (GdkSurface *window,
+gdk_surface_x11_restack_toplevel (GdkSurface *surface,
GdkSurface *sibling,
gboolean above)
{
@@ -1656,57 +1656,57 @@ gdk_surface_x11_restack_toplevel (GdkSurface *window,
changes.sibling = GDK_SURFACE_XID (sibling);
changes.stack_mode = above ? Above : Below;
- XReconfigureWMWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (window)),
+ XReconfigureWMWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (surface)),
CWStackMode | CWSibling, &changes);
}
static void
-gdk_surface_x11_lower (GdkSurface *window)
+gdk_surface_x11_lower (GdkSurface *surface)
{
- XLowerWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window));
+ XLowerWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface));
}
/**
* gdk_x11_surface_move_to_current_desktop:
- * @window: (type GdkX11Surface): a #GdkSurface
+ * @surface: (type GdkX11Surface): a #GdkSurface
*
- * Moves the window to the correct workspace when running under a
+ * Moves the surface to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
- * Will not do anything if the window is already on all workspaces.
+ * Will not do anything if the surface is already on all workspaces.
*/
void
-gdk_x11_surface_move_to_current_desktop (GdkSurface *window)
+gdk_x11_surface_move_to_current_desktop (GdkSurface *surface)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel->on_all_desktops)
return;
- move_to_current_desktop (window);
+ move_to_current_desktop (surface);
}
static void
-move_to_current_desktop (GdkSurface *window)
+move_to_current_desktop (GdkSurface *surface)
{
guint32 desktop;
- desktop = gdk_x11_screen_get_current_desktop (GDK_SURFACE_SCREEN (window));
- gdk_x11_surface_move_to_desktop (window, desktop);
+ desktop = gdk_x11_screen_get_current_desktop (GDK_SURFACE_SCREEN (surface));
+ gdk_x11_surface_move_to_desktop (surface, desktop);
}
static guint32
-get_netwm_cardinal_property (GdkSurface *window,
+get_netwm_cardinal_property (GdkSurface *surface,
const gchar *name)
{
- GdkX11Screen *x11_screen = GDK_SURFACE_SCREEN (window);
+ GdkX11Screen *x11_screen = GDK_SURFACE_SCREEN (surface);
GdkAtom atom;
guint32 prop = 0;
Atom type;
@@ -1721,8 +1721,8 @@ get_netwm_cardinal_property (GdkSurface *window,
return 0;
XGetWindowProperty (x11_screen->xdisplay,
- GDK_SURFACE_XID (window),
- gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), name),
+ GDK_SURFACE_XID (surface),
+ gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface), name),
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, &data);
@@ -1737,48 +1737,48 @@ get_netwm_cardinal_property (GdkSurface *window,
/**
* gdk_x11_surface_get_desktop:
- * @window: (type GdkX11Surface): a #GdkSurface
+ * @surface: (type GdkX11Surface): a #GdkSurface
*
- * Gets the number of the workspace @window is on.
+ * Gets the number of the workspace @surface is on.
*
- * Returns: the current workspace of @window
+ * Returns: the current workspace of @surface
*/
guint32
-gdk_x11_surface_get_desktop (GdkSurface *window)
+gdk_x11_surface_get_desktop (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
- return get_netwm_cardinal_property (window, "_NET_WM_DESKTOP");
+ return get_netwm_cardinal_property (surface, "_NET_WM_DESKTOP");
}
/**
* gdk_x11_surface_move_to_desktop:
- * @window: (type GdkX11Surface): a #GdkSurface
- * @desktop: the number of the workspace to move the window to
+ * @surface: (type GdkX11Surface): a #GdkSurface
+ * @desktop: the number of the workspace to move the surface to
*
- * Moves the window to the given workspace when running unde a
+ * Moves the surface to the given workspace when running unde a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
*/
void
-gdk_x11_surface_move_to_desktop (GdkSurface *window,
+gdk_x11_surface_move_to_desktop (GdkSurface *surface,
guint32 desktop)
{
GdkAtom atom;
XClientMessageEvent xclient;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
atom = g_intern_static_string ("_NET_WM_DESKTOP");
- if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), atom))
+ if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface), atom))
return;
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.serial = 0;
xclient.send_event = True;
- xclient.window = GDK_SURFACE_XID (window);
- xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_SURFACE_DISPLAY (window), atom);
+ xclient.window = GDK_SURFACE_XID (surface);
+ xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_SURFACE_DISPLAY (surface), atom);
xclient.format = 32;
xclient.data.l[0] = desktop;
@@ -1787,35 +1787,35 @@ gdk_x11_surface_move_to_desktop (GdkSurface *window,
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XROOTWIN (window),
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XROOTWIN (surface),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
static void
-gdk_x11_surface_focus (GdkSurface *window,
+gdk_x11_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = GDK_SURFACE_DISPLAY (window);
+ display = GDK_SURFACE_DISPLAY (surface);
- if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_ACTIVE_WINDOW")))
{
XClientMessageEvent xclient;
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
+ xclient.window = GDK_SURFACE_XID (surface);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_ACTIVE_WINDOW");
xclient.format = 32;
@@ -1825,20 +1825,20 @@ gdk_x11_surface_focus (GdkSurface *window,
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
else
{
- XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window));
+ XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface));
/* There is no way of knowing reliably whether we are viewable;
* so trap errors asynchronously around the XSetInputFocus call
*/
gdk_x11_display_error_trap_push (display);
XSetInputFocus (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
RevertToParent,
timestamp);
gdk_x11_display_error_trap_pop_ignored (display);
@@ -1846,17 +1846,17 @@ gdk_x11_surface_focus (GdkSurface *window,
}
static void
-gdk_x11_surface_set_type_hint (GdkSurface *window,
+gdk_x11_surface_set_type_hint (GdkSurface *surface,
GdkSurfaceTypeHint hint)
{
GdkDisplay *display;
Atom atom;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
switch (hint)
{
@@ -1907,14 +1907,14 @@ gdk_x11_surface_set_type_hint (GdkSurface *window,
break;
}
- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"),
XA_ATOM, 32, PropModeReplace,
(guchar *)&atom, 1);
}
static GdkSurfaceTypeHint
-gdk_x11_surface_get_type_hint (GdkSurface *window)
+gdk_x11_surface_get_type_hint (GdkSurface *surface)
{
GdkDisplay *display;
GdkSurfaceTypeHint type;
@@ -1924,17 +1924,17 @@ gdk_x11_surface_get_type_hint (GdkSurface *window)
gulong bytes_after_return;
guchar *data = NULL;
- g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_SURFACE_TYPE_HINT_NORMAL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_SURFACE_TYPE_HINT_NORMAL);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return GDK_SURFACE_TYPE_HINT_NORMAL;
type = GDK_SURFACE_TYPE_HINT_NORMAL;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"),
0, G_MAXLONG, False, XA_ATOM, &type_return,
&format_return, &nitems_return, &bytes_after_return,
@@ -1982,11 +1982,11 @@ gdk_x11_surface_get_type_hint (GdkSurface *window)
static void
gdk_wmspec_change_state (gboolean add,
- GdkSurface *window,
+ GdkSurface *surface,
GdkAtom state1,
GdkAtom state2)
{
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
XClientMessageEvent xclient;
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
@@ -1995,7 +1995,7 @@ gdk_wmspec_change_state (gboolean add,
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
+ xclient.window = GDK_SURFACE_XID (surface);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE");
xclient.format = 32;
xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
@@ -2004,101 +2004,101 @@ gdk_wmspec_change_state (gboolean add,
xclient.data.l[3] = 1; /* source indication */
xclient.data.l[4] = 0;
- XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
static void
-gdk_x11_surface_set_modal_hint (GdkSurface *window,
+gdk_x11_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- window->modal_hint = modal;
+ surface->modal_hint = modal;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (modal, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (modal, surface,
g_intern_static_string ("_NET_WM_STATE_MODAL"),
NULL);
}
static void
-gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *window,
+gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
toplevel->skip_taskbar_hint = skips_taskbar;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (skips_taskbar, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (skips_taskbar, surface,
g_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
NULL);
}
static void
-gdk_x11_surface_set_skip_pager_hint (GdkSurface *window,
+gdk_x11_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
toplevel->skip_pager_hint = skips_pager;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (skips_pager, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (skips_pager, surface,
g_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"),
NULL);
}
static void
-gdk_x11_surface_set_urgency_hint (GdkSurface *window,
+gdk_x11_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
toplevel->urgency_hint = urgent;
- update_wm_hints (window, FALSE);
+ update_wm_hints (surface, FALSE);
}
static void
-gdk_x11_surface_set_geometry_hints (GdkSurface *window,
+gdk_x11_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
XSizeHints size_hints;
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel)
{
if (geometry)
@@ -2197,13 +2197,13 @@ gdk_x11_surface_set_geometry_hints (GdkSurface *window,
/* FIXME: Would it be better to delete this property if
* geom_mask == 0? It would save space on the server
*/
- XSetWMNormalHints (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XSetWMNormalHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&size_hints);
}
static void
-gdk_surface_get_geometry_hints (GdkSurface *window,
+gdk_surface_get_geometry_hints (GdkSurface *surface,
GdkGeometry *geometry,
GdkSurfaceHints *geom_mask)
{
@@ -2211,24 +2211,24 @@ gdk_surface_get_geometry_hints (GdkSurface *window,
XSizeHints *size_hints;
glong junk_supplied_mask = 0;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (geometry != NULL);
g_return_if_fail (geom_mask != NULL);
*geom_mask = 0;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
size_hints = XAllocSizeHints ();
if (!size_hints)
return;
- if (!XGetWMNormalHints (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ if (!XGetWMNormalHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
size_hints,
&junk_supplied_mask))
size_hints->flags = 0;
@@ -2357,7 +2357,7 @@ set_wm_name (GdkDisplay *display,
}
static void
-gdk_x11_surface_set_title (GdkSurface *window,
+gdk_x11_surface_set_title (GdkSurface *surface,
const gchar *title)
{
GdkDisplay *display;
@@ -2366,17 +2366,17 @@ gdk_x11_surface_set_title (GdkSurface *window,
g_return_if_fail (title != NULL);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
- xwindow = GDK_SURFACE_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
set_wm_name (display, xwindow, title);
- if (!gdk_surface_icon_name_set (window))
+ if (!gdk_surface_icon_name_set (surface))
{
XChangeProperty (xdisplay, xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"),
@@ -2390,83 +2390,83 @@ gdk_x11_surface_set_title (GdkSurface *window,
}
static void
-gdk_x11_surface_set_role (GdkSurface *window,
+gdk_x11_surface_set_role (GdkSurface *surface,
const gchar *role)
{
GdkDisplay *display;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
if (role)
- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE"),
XA_STRING, 8, PropModeReplace, (guchar *)role, strlen (role));
else
- XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE"));
}
static void
-gdk_x11_surface_set_startup_id (GdkSurface *window,
+gdk_x11_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
if (startup_id)
- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (unsigned char *)startup_id, strlen (startup_id));
else
- XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"));
}
static void
-gdk_x11_surface_set_transient_for (GdkSurface *window,
+gdk_x11_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
/* XSetTransientForHint() doesn't allow unsetting, so do it manually */
if (parent && !GDK_SURFACE_DESTROYED (parent))
- XSetTransientForHint (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XSetTransientForHint (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
GDK_SURFACE_XID (parent));
else
- XDeleteProperty (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), "WM_TRANSIENT_FOR"));
+ XDeleteProperty (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface), "WM_TRANSIENT_FOR"));
}
GdkCursor *
-_gdk_x11_surface_get_cursor (GdkSurface *window)
+_gdk_x11_surface_get_cursor (GdkSurface *surface)
{
GdkSurfaceImplX11 *impl;
- g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
return impl->cursor;
}
static void
-gdk_surface_x11_get_geometry (GdkSurface *window,
+gdk_surface_x11_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
@@ -2481,12 +2481,12 @@ gdk_surface_x11_get_geometry (GdkSurface *window,
guint tborder_width;
guint tdepth;
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- XGetGeometry (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XGetGeometry (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
@@ -2501,20 +2501,20 @@ gdk_surface_x11_get_geometry (GdkSurface *window,
}
static void
-gdk_surface_x11_get_root_coords (GdkSurface *window,
+gdk_surface_x11_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
Window child;
gint tx;
gint ty;
- XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- GDK_SURFACE_XROOTWIN (window),
+ XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ GDK_SURFACE_XROOTWIN (surface),
x * impl->surface_scale, y * impl->surface_scale, &tx, &ty,
&child);
@@ -2525,7 +2525,7 @@ gdk_surface_x11_get_root_coords (GdkSurface *window,
}
static void
-gdk_x11_surface_get_frame_extents (GdkSurface *window,
+gdk_x11_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
{
GdkDisplay *display;
@@ -2555,31 +2555,31 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window,
rect->width = 1;
rect->height = 1;
- while (window->parent && (window->parent)->parent)
- window = window->parent;
+ while (surface->parent && (surface->parent)->parent)
+ surface = surface->parent;
- impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
/* Refine our fallback answer a bit using local information */
- 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;
+ rect->x = surface->x * impl->surface_scale;
+ rect->y = surface->y * impl->surface_scale;
+ rect->width = surface->width * impl->surface_scale;
+ rect->height = surface->height * impl->surface_scale;
- if (GDK_SURFACE_DESTROYED (window) || impl->override_redirect)
+ if (GDK_SURFACE_DESTROYED (surface) || impl->override_redirect)
return;
nvroots = 0;
vroots = NULL;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
gdk_x11_display_error_trap_push (display);
- xwindow = GDK_SURFACE_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
/* first try: use _NET_FRAME_EXTENTS */
- if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_FRAME_EXTENTS")) &&
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
gdk_x11_get_xatom_by_name_for_display (display,
@@ -2626,9 +2626,9 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window,
tree to get our window's parent which hopefully is the window frame */
/* use NETWM_VIRTUAL_ROOTS if available */
- root = GDK_SURFACE_XROOTWIN (window);
+ root = GDK_SURFACE_XROOTWIN (surface);
- if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_VIRTUAL_ROOTS")) &&
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
gdk_x11_get_xatom_by_name_for_display (display,
@@ -2645,7 +2645,7 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window,
}
}
- xparent = GDK_SURFACE_XID (window);
+ xparent = GDK_SURFACE_XID (surface);
do
{
@@ -2696,7 +2696,7 @@ gdk_x11_surface_get_frame_extents (GdkSurface *window,
}
static gboolean
-gdk_surface_x11_get_device_state (GdkSurface *window,
+gdk_surface_x11_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
@@ -2704,11 +2704,11 @@ gdk_surface_x11_get_device_state (GdkSurface *window,
{
GdkSurface *child;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return FALSE;
/*HIDPI: handle coords here?*/
- GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
+ GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
&child,
NULL, NULL,
x, y, mask);
@@ -2716,68 +2716,68 @@ gdk_surface_x11_get_device_state (GdkSurface *window,
}
static GdkEventMask
-gdk_surface_x11_get_events (GdkSurface *window)
+gdk_surface_x11_get_events (GdkSurface *surface)
{
XWindowAttributes attrs;
GdkEventMask event_mask;
GdkEventMask filtered;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 0;
else
{
- XGetWindowAttributes (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XGetWindowAttributes (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&attrs);
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
/* if property change was filtered out before, keep it filtered out */
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
- window->event_mask = event_mask & ((window->event_mask & filtered) | ~filtered);
+ surface->event_mask = event_mask & ((surface->event_mask & filtered) | ~filtered);
return event_mask;
}
}
static void
-gdk_surface_x11_set_events (GdkSurface *window,
+gdk_surface_x11_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
long xevent_mask = 0;
- if (!GDK_SURFACE_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
GdkX11Display *display_x11;
- if (GDK_SURFACE_XID (window) != GDK_SURFACE_XROOTWIN (window))
+ if (GDK_SURFACE_XID (surface) != GDK_SURFACE_XROOTWIN (surface))
xevent_mask = StructureNotifyMask | PropertyChangeMask;
- display_x11 = GDK_X11_DISPLAY (gdk_surface_get_display (window));
+ display_x11 = GDK_X11_DISPLAY (gdk_surface_get_display (surface));
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_SURFACE_XID (window), event_mask,
+ GDK_SURFACE_XID (surface), event_mask,
xevent_mask);
}
}
static inline void
-do_shape_combine_region (GdkSurface *window,
+do_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y,
gint shape)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (shape_region == NULL)
{
/* Use NULL mask to unset the shape */
if (shape == ShapeBounding
- ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (window))
- : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (window)))
+ ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (surface))
+ : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
{
- XShapeCombineMask (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XShapeCombineMask (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
shape,
0, 0,
None,
@@ -2787,8 +2787,8 @@ do_shape_combine_region (GdkSurface *window,
}
if (shape == ShapeBounding
- ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (window))
- : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (window)))
+ ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (surface))
+ : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
{
gint n_rects = 0;
XRectangle *xrects = NULL;
@@ -2797,8 +2797,8 @@ do_shape_combine_region (GdkSurface *window,
0, 0, impl->surface_scale,
&xrects, &n_rects);
- XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
shape,
offset_x * impl->surface_scale,
offset_y * impl->surface_scale,
@@ -2811,70 +2811,70 @@ do_shape_combine_region (GdkSurface *window,
}
static void
-gdk_surface_x11_shape_combine_region (GdkSurface *window,
+gdk_surface_x11_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
- do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeBounding);
+ do_shape_combine_region (surface, shape_region, offset_x, offset_y, ShapeBounding);
}
static void
-gdk_surface_x11_input_shape_combine_region (GdkSurface *window,
+gdk_surface_x11_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
#ifdef ShapeInput
- do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeInput);
+ do_shape_combine_region (surface, shape_region, offset_x, offset_y, ShapeInput);
#endif
}
static void
-gdk_x11_surface_set_accept_focus (GdkSurface *window,
+gdk_x11_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
{
accept_focus = accept_focus != FALSE;
- if (window->accept_focus != accept_focus)
+ if (surface->accept_focus != accept_focus)
{
- window->accept_focus = accept_focus;
+ surface->accept_focus = accept_focus;
- if (!GDK_SURFACE_DESTROYED (window) &&
- SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
- update_wm_hints (window, FALSE);
+ if (!GDK_SURFACE_DESTROYED (surface) &&
+ SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
+ update_wm_hints (surface, FALSE);
}
}
static void
-gdk_x11_surface_set_focus_on_map (GdkSurface *window,
+gdk_x11_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
{
focus_on_map = focus_on_map != FALSE;
- if (window->focus_on_map != focus_on_map)
+ if (surface->focus_on_map != focus_on_map)
{
- window->focus_on_map = focus_on_map;
+ surface->focus_on_map = focus_on_map;
- if ((!GDK_SURFACE_DESTROYED (window)) &&
- (!window->focus_on_map) &&
- SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
- gdk_x11_surface_set_user_time (window, 0);
+ if ((!GDK_SURFACE_DESTROYED (surface)) &&
+ (!surface->focus_on_map) &&
+ SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
+ gdk_x11_surface_set_user_time (surface, 0);
}
}
/**
* gdk_x11_surface_set_user_time:
- * @window: (type GdkX11Surface): A toplevel #GdkSurface
+ * @surface: (type GdkX11Surface): A toplevel #GdkSurface
* @timestamp: An XServer timestamp to which the property should be set
*
* The application can use this call to update the _NET_WM_USER_TIME
- * property on a toplevel window. This property stores an Xserver
+ * property on a toplevel surface. This property stores an Xserver
* time which represents the time of the last user input event
- * received for this window. This property may be used by the window
+ * received for this surface. This property may be used by the window
* manager to alter the focus, stacking, and/or placement behavior of
- * windows when they are mapped depending on whether the new window
- * was created by a user action or is a "pop-up" window activated by a
+ * surfaces when they are mapped depending on whether the new surface
+ * was created by a user action or is a "pop-up" surface activated by a
* timer or some other event.
*
* Note that this property is automatically updated by GDK, so this
@@ -2882,7 +2882,7 @@ gdk_x11_surface_set_focus_on_map (GdkSurface *window,
* events bypassing GDK.
**/
void
-gdk_x11_surface_set_user_time (GdkSurface *window,
+gdk_x11_surface_set_user_time (GdkSurface *surface,
guint32 timestamp)
{
GdkDisplay *display;
@@ -2891,13 +2891,13 @@ gdk_x11_surface_set_user_time (GdkSurface *window,
glong timestamp_long = (glong)timestamp;
Window xid;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
display_x11 = GDK_X11_DISPLAY (display);
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (!toplevel)
{
@@ -2906,11 +2906,11 @@ gdk_x11_surface_set_user_time (GdkSurface *window,
}
if (toplevel->focus_window != None &&
- gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_WM_USER_TIME_WINDOW")))
xid = toplevel->focus_window;
else
- xid = GDK_SURFACE_XID (window);
+ xid = GDK_SURFACE_XID (surface);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xid,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
@@ -2928,30 +2928,30 @@ gdk_x11_surface_set_user_time (GdkSurface *window,
/**
* gdk_x11_surface_set_utf8_property:
- * @window: (type GdkX11Surface): a #GdkSurface
+ * @surface: (type GdkX11Surface): a #GdkSurface
* @name: Property name, will be interned as an X atom
* @value: (allow-none): Property value, or %NULL to delete
*
* This function modifies or removes an arbitrary X11 window
- * property of type UTF8_STRING. If the given @window is
- * not a toplevel window, it is ignored.
+ * property of type UTF8_STRING. If the given @surface is
+ * not a toplevel surface, it is ignored.
*/
void
-gdk_x11_surface_set_utf8_property (GdkSurface *window,
+gdk_x11_surface_set_utf8_property (GdkSurface *surface,
const gchar *name,
const gchar *value)
{
GdkDisplay *display;
- if (!SURFACE_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
if (value != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, name),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)value, strlen (value));
@@ -2959,19 +2959,19 @@ gdk_x11_surface_set_utf8_property (GdkSurface *window,
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, name));
}
}
static void
-gdk_x11_surface_set_shadow_width (GdkSurface *window,
+gdk_x11_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
Atom frame_extents;
gulong data[4] = {
left * impl->surface_scale,
@@ -2980,10 +2980,10 @@ gdk_x11_surface_set_shadow_width (GdkSurface *window,
bottom * impl->surface_scale
};
- frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_surface_get_display (window),
+ frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_surface_get_display (surface),
"_GTK_FRAME_EXTENTS");
- XChangeProperty (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
+ XChangeProperty (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
frame_extents, XA_CARDINAL,
32, PropModeReplace,
(guchar *) &data, 4);
@@ -2991,24 +2991,24 @@ gdk_x11_surface_set_shadow_width (GdkSurface *window,
/**
* gdk_x11_surface_set_theme_variant:
- * @window: (type GdkX11Surface): a #GdkSurface
+ * @surface: (type GdkX11Surface): a #GdkSurface
* @variant: the theme variant to export
*
* GTK+ applications can request a dark theme variant. In order to
* make other applications - namely window managers using GTK+ for
* themeing - aware of this choice, GTK+ uses this function to
* export the requested theme variant as _GTK_THEME_VARIANT property
- * on toplevel windows.
+ * on toplevel surfaces.
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
- * to create toplevel windows.
+ * to create toplevel surfaces.
*/
void
-gdk_x11_surface_set_theme_variant (GdkSurface *window,
+gdk_x11_surface_set_theme_variant (GdkSurface *surface,
const char *variant)
{
- gdk_x11_surface_set_utf8_property (window, "_GTK_THEME_VARIANT",
+ gdk_x11_surface_set_utf8_property (surface, "_GTK_THEME_VARIANT",
variant ? variant : "");
}
@@ -3019,7 +3019,7 @@ gdk_x11_surface_set_theme_variant (GdkSurface *window,
: XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100)
static void
-gdk_surface_update_icon (GdkSurface *window,
+gdk_surface_update_icon (GdkSurface *surface,
GList *icon_list)
{
GdkToplevelX11 *toplevel;
@@ -3027,7 +3027,7 @@ gdk_surface_update_icon (GdkSurface *window,
GList *tmp_list;
int best_size;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel->icon_pixmap != NULL)
{
@@ -3080,17 +3080,17 @@ gdk_surface_update_icon (GdkSurface *window,
{
int width = gdk_texture_get_width (best_icon);
int height = gdk_texture_get_height (best_icon);
- cairo_surface_t *surface;
+ cairo_surface_t *cairo_surface;
cairo_t *cr;
- toplevel->icon_pixmap = gdk_x11_surface_create_pixmap_surface (window, width, height);
+ toplevel->icon_pixmap = gdk_x11_surface_create_pixmap_surface (surface, width, height);
- surface = gdk_texture_download_surface (best_icon);
+ cairo_surface = gdk_texture_download_surface (best_icon);
cr = cairo_create (toplevel->icon_pixmap);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_set_source_surface (cr, surface, 0, 0);
- if (cairo_surface_get_content (surface) == CAIRO_CONTENT_COLOR_ALPHA)
+ cairo_set_source_surface (cr, cairo_surface, 0, 0);
+ if (cairo_surface_get_content (cairo_surface) == CAIRO_CONTENT_COLOR_ALPHA)
{
/* Saturate the image, so it has bilevel alpha */
cairo_push_group_with_content (cr, CAIRO_CONTENT_COLOR_ALPHA);
@@ -3102,27 +3102,27 @@ gdk_surface_update_icon (GdkSurface *window,
cairo_paint (cr);
cairo_destroy (cr);
- if (cairo_surface_get_content (surface) == CAIRO_CONTENT_COLOR_ALPHA)
+ if (cairo_surface_get_content (cairo_surface) == CAIRO_CONTENT_COLOR_ALPHA)
{
- GdkDisplay *display = gdk_surface_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
toplevel->icon_mask = _gdk_x11_display_create_bitmap_surface (display, width, height);
cr = cairo_create (toplevel->icon_mask);
- cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_set_source_surface (cr, cairo_surface, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
cairo_destroy (cr);
}
- cairo_surface_destroy (surface);
+ cairo_surface_destroy (cairo_surface);
}
- update_wm_hints (window, FALSE);
+ update_wm_hints (surface, FALSE);
}
static void
-gdk_x11_surface_set_icon_list (GdkSurface *window,
+gdk_x11_surface_set_icon_list (GdkSurface *surface,
GList *textures)
{
gulong *data;
@@ -3134,11 +3134,11 @@ gdk_x11_surface_set_icon_list (GdkSurface *window,
GdkDisplay *display;
gint i, n;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
size = 0;
n = 0;
@@ -3185,7 +3185,7 @@ gdk_x11_surface_set_icon_list (GdkSurface *window,
if (size > 0)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"),
XA_CARDINAL, 32,
PropModeReplace,
@@ -3194,119 +3194,119 @@ gdk_x11_surface_set_icon_list (GdkSurface *window,
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"));
}
g_free (data);
- gdk_surface_update_icon (window, textures);
+ gdk_surface_update_icon (surface, textures);
}
static gboolean
-gdk_surface_icon_name_set (GdkSurface *window)
+gdk_surface_icon_name_set (GdkSurface *surface)
{
- return GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (window),
+ return GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (surface),
g_quark_from_static_string ("gdk-icon-name-set")));
}
static void
-gdk_x11_surface_set_icon_name (GdkSurface *window,
+gdk_x11_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
GdkDisplay *display;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
- g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"),
+ g_object_set_qdata (G_OBJECT (surface), g_quark_from_static_string ("gdk-icon-name-set"),
GUINT_TO_POINTER (name != NULL));
if (name != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)name, strlen (name));
- set_text_property (display, GDK_SURFACE_XID (window),
+ set_text_property (display, GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"),
name);
}
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"));
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"));
}
}
static void
-gdk_x11_surface_iconify (GdkSurface *window)
+gdk_x11_surface_iconify (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
- XIconifyWindow (GDK_SURFACE_XDISPLAY (window),
- GDK_SURFACE_XID (window),
- gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (window)));
+ XIconifyWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (surface)));
}
else
{
/* Flip our client side flag, the real work happens on map. */
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_ICONIFIED);
- gdk_wmspec_change_state (TRUE, window,
+ gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL);
}
}
static void
-gdk_x11_surface_deiconify (GdkSurface *window)
+gdk_x11_surface_deiconify (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
- gdk_surface_show (window);
- gdk_wmspec_change_state (FALSE, window,
+ gdk_surface_show (surface);
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL);
}
else
{
/* Flip our client side flag, the real work happens on map. */
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_ICONIFIED,
0);
- gdk_wmspec_change_state (FALSE, window,
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL);
}
}
static void
-gdk_x11_surface_stick (GdkSurface *window)
+gdk_x11_surface_stick (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
/* "stick" means stick to all desktops _and_ do not scroll with the
* viewport. i.e. glue to the monitor glass in all cases.
@@ -3315,16 +3315,16 @@ gdk_x11_surface_stick (GdkSurface *window)
XClientMessageEvent xclient;
/* Request stick during viewport scroll */
- gdk_wmspec_change_state (TRUE, window,
+ gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_STICKY"),
NULL);
/* Request desktop 0xFFFFFFFF */
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
- xclient.display = GDK_SURFACE_XDISPLAY (window);
- xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window),
+ xclient.window = GDK_SURFACE_XID (surface);
+ xclient.display = GDK_SURFACE_XDISPLAY (surface);
+ xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"_NET_WM_DESKTOP");
xclient.format = 32;
@@ -3334,39 +3334,39 @@ gdk_x11_surface_stick (GdkSurface *window)
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
else
{
/* Flip our client side flag, the real work happens on map. */
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_STICKY);
}
}
static void
-gdk_x11_surface_unstick (GdkSurface *window)
+gdk_x11_surface_unstick (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
/* Request unstick from viewport */
- gdk_wmspec_change_state (FALSE, window,
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_STICKY"),
NULL);
- move_to_current_desktop (window);
+ move_to_current_desktop (surface);
}
else
{
/* Flip our client side flag, the real work happens on map. */
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_STICKY,
0);
@@ -3374,53 +3374,53 @@ gdk_x11_surface_unstick (GdkSurface *window)
}
static void
-gdk_x11_surface_maximize (GdkSurface *window)
+gdk_x11_surface_maximize (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (TRUE, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_MAXIMIZED);
}
static void
-gdk_x11_surface_unmaximize (GdkSurface *window)
+gdk_x11_surface_unmaximize (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (FALSE, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_MAXIMIZED,
0);
}
static void
-gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window)
+gdk_x11_surface_apply_fullscreen_mode (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
/* _NET_WM_FULLSCREEN_MONITORS gives an indication to the window manager as
- * to which monitors so span across when the window is fullscreen, but it's
- * not a state in itself so this would have no effect if the window is not
+ * to which monitors so span across when the surface is fullscreen, but it's
+ * not a state in itself so this would have no effect if the surface is not
* mapped.
*/
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
XClientMessageEvent xclient;
gint monitors[4];
@@ -3428,11 +3428,11 @@ gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window)
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
- xclient.display = GDK_SURFACE_XDISPLAY (window);
+ xclient.window = GDK_SURFACE_XID (surface);
+ xclient.display = GDK_SURFACE_XDISPLAY (surface);
xclient.format = 32;
- switch (window->fullscreen_mode)
+ switch (surface->fullscreen_mode)
{
case GDK_FULLSCREEN_ON_CURRENT_MONITOR:
@@ -3463,7 +3463,7 @@ gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window)
case GDK_FULLSCREEN_ON_ALL_MONITORS:
- _gdk_x11_screen_get_edge_monitors (GDK_SURFACE_SCREEN (window),
+ _gdk_x11_screen_get_edge_monitors (GDK_SURFACE_SCREEN (surface),
&monitors[0],
&monitors[1],
&monitors[2],
@@ -3485,163 +3485,163 @@ gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window)
default:
g_warning ("gdk_x11_surface_apply_fullscreen_mode: Unhandled fullscreen mode %d",
- window->fullscreen_mode);
+ surface->fullscreen_mode);
return;
}
/* Send fullscreen monitors client message */
xclient.data.l[4] = 1; /* source indication */
- xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window),
+ xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"_NET_WM_FULLSCREEN_MONITORS");
- XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
}
static void
-gdk_x11_surface_fullscreen (GdkSurface *window)
+gdk_x11_surface_fullscreen (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
- gdk_wmspec_change_state (TRUE, window,
+ gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
NULL);
/* Actual XRandR layout may have change since we computed the fullscreen
* monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode.
*/
- if (window->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS)
- gdk_x11_surface_apply_fullscreen_mode (window);
+ if (surface->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS)
+ gdk_x11_surface_apply_fullscreen_mode (surface);
}
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_FULLSCREEN);
}
static void
-gdk_x11_surface_fullscreen_on_monitor (GdkSurface *window,
+gdk_x11_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
GdkRectangle geom;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
gdk_monitor_get_geometry (monitor, &geom);
- gdk_surface_move (window, geom.x, geom.y);
+ gdk_surface_move (surface, geom.x, geom.y);
- gdk_surface_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
- gdk_x11_surface_fullscreen (window);
+ gdk_surface_set_fullscreen_mode (surface, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
+ gdk_x11_surface_fullscreen (surface);
}
static void
-gdk_x11_surface_unfullscreen (GdkSurface *window)
+gdk_x11_surface_unfullscreen (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
- gdk_wmspec_change_state (FALSE, window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
NULL);
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_FULLSCREEN,
0);
}
static void
-gdk_x11_surface_set_keep_above (GdkSurface *window,
+gdk_x11_surface_set_keep_above (GdkSurface *surface,
gboolean setting)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
if (setting)
- gdk_wmspec_change_state (FALSE, window,
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_BELOW"),
NULL);
- gdk_wmspec_change_state (setting, window,
+ gdk_wmspec_change_state (setting, surface,
g_intern_static_string ("_NET_WM_STATE_ABOVE"),
NULL);
}
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE,
setting ? GDK_SURFACE_STATE_ABOVE : 0);
}
static void
-gdk_x11_surface_set_keep_below (GdkSurface *window, gboolean setting)
+gdk_x11_surface_set_keep_below (GdkSurface *surface, gboolean setting)
{
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_SURFACE_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
if (setting)
- gdk_wmspec_change_state (FALSE, window,
+ gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_ABOVE"),
NULL);
- gdk_wmspec_change_state (setting, window,
+ gdk_wmspec_change_state (setting, surface,
g_intern_static_string ("_NET_WM_STATE_BELOW"),
NULL);
}
else
- gdk_synthesize_surface_state (window,
+ gdk_synthesize_surface_state (surface,
setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW,
setting ? GDK_SURFACE_STATE_BELOW : 0);
}
static GdkSurface *
-gdk_x11_surface_get_group (GdkSurface *window)
+gdk_x11_surface_get_group (GdkSurface *surface)
{
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return NULL;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
return toplevel->group_leader;
}
static void
-gdk_x11_surface_set_group (GdkSurface *window,
+gdk_x11_surface_set_group (GdkSurface *surface,
GdkSurface *leader)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_SURFACE (window));
- g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader));
- if (GDK_SURFACE_DESTROYED (window) ||
+ if (GDK_SURFACE_DESTROYED (surface) ||
(leader != NULL && GDK_SURFACE_DESTROYED (leader)) ||
- !SURFACE_IS_TOPLEVEL (window))
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- toplevel = _gdk_x11_surface_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (leader == NULL)
- leader = gdk_display_get_default_group (gdk_surface_get_display (window));
+ leader = gdk_display_get_default_group (gdk_surface_get_display (surface));
if (toplevel->group_leader != leader)
{
@@ -3651,11 +3651,11 @@ gdk_x11_surface_set_group (GdkSurface *window,
(_gdk_x11_surface_get_toplevel (leader))->is_leader = TRUE;
}
- update_wm_hints (window, FALSE);
+ update_wm_hints (surface, FALSE);
}
static MotifWmHints *
-gdk_surface_get_mwm_hints (GdkSurface *window)
+gdk_surface_get_mwm_hints (GdkSurface *surface)
{
GdkDisplay *display;
Atom hints_atom = None;
@@ -3665,14 +3665,14 @@ gdk_surface_get_mwm_hints (GdkSurface *window)
gulong nitems;
gulong bytes_after;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);
- XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
+ XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, &data);
@@ -3684,7 +3684,7 @@ gdk_surface_get_mwm_hints (GdkSurface *window)
}
static void
-gdk_surface_set_mwm_hints (GdkSurface *window,
+gdk_surface_set_mwm_hints (GdkSurface *surface,
MotifWmHints *new_hints)
{
GdkDisplay *display;
@@ -3696,14 +3696,14 @@ gdk_surface_set_mwm_hints (GdkSurface *window,
gulong nitems;
gulong bytes_after;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);
- XGetWindowProperty (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window),
+ XGetWindowProperty (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, &data);
@@ -3726,7 +3726,7 @@ gdk_surface_set_mwm_hints (GdkSurface *window,
}
}
- XChangeProperty (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window),
+ XChangeProperty (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface),
hints_atom, hints_atom, 32, PropModeReplace,
(guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
@@ -3735,13 +3735,13 @@ gdk_surface_set_mwm_hints (GdkSurface *window,
}
static void
-gdk_x11_surface_set_decorations (GdkSurface *window,
+gdk_x11_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
MotifWmHints hints;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
@@ -3749,21 +3749,21 @@ gdk_x11_surface_set_decorations (GdkSurface *window,
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = decorations;
- gdk_surface_set_mwm_hints (window, &hints);
+ gdk_surface_set_mwm_hints (surface, &hints);
}
static gboolean
-gdk_x11_surface_get_decorations(GdkSurface *window,
+gdk_x11_surface_get_decorations(GdkSurface *surface,
GdkWMDecoration *decorations)
{
MotifWmHints *hints;
gboolean result = FALSE;
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return FALSE;
- hints = gdk_surface_get_mwm_hints (window);
+ hints = gdk_surface_get_mwm_hints (surface);
if (hints)
{
@@ -3781,15 +3781,15 @@ gdk_x11_surface_get_decorations(GdkSurface *window,
}
static void
-gdk_x11_surface_set_functions (GdkSurface *window,
+gdk_x11_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
MotifWmHints hints;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
@@ -3797,7 +3797,7 @@ gdk_x11_surface_set_functions (GdkSurface *window,
hints.flags = MWM_HINTS_FUNCTIONS;
hints.functions = functions;
- gdk_surface_set_mwm_hints (window, &hints);
+ gdk_surface_set_mwm_hints (surface, &hints);
}
cairo_region_t *
@@ -3871,18 +3871,18 @@ _gdk_x11_xwindow_get_shape (Display *xdisplay,
static void
wmspec_send_message (GdkDisplay *display,
- GdkSurface *window,
+ GdkSurface *surface,
gint root_x,
gint root_y,
gint action,
gint button)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
XClientMessageEvent xclient;
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
+ xclient.window = GDK_SURFACE_XID (surface);
xclient.message_type =
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_MOVERESIZE");
xclient.format = 32;
@@ -3892,7 +3892,7 @@ wmspec_send_message (GdkDisplay *display,
xclient.data.l[3] = button;
xclient.data.l[4] = 1; /* source indication */
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
@@ -3902,19 +3902,19 @@ handle_wmspec_button_release (GdkDisplay *display,
const XEvent *xevent)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
- GdkSurface *window;
+ GdkSurface *surface;
#if defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2)
XIEvent *xiev = (XIEvent *) xevent->xcookie.data;
XIDeviceEvent *xidev = (XIDeviceEvent *) xiev;
if (xevent->xany.type == GenericEvent)
- window = gdk_x11_surface_lookup_for_display (display, xidev->event);
+ surface = gdk_x11_surface_lookup_for_display (display, xidev->event);
else
#endif
- window = gdk_x11_surface_lookup_for_display (display, xevent->xany.window);
+ surface = gdk_x11_surface_lookup_for_display (display, xevent->xany.window);
- if (display_x11->wm_moveresize_button != 0 && window != NULL)
+ if (display_x11->wm_moveresize_button != 0 && surface != NULL)
{
if ((xevent->xany.type == ButtonRelease &&
xevent->xbutton.button == display_x11->wm_moveresize_button)
@@ -3927,13 +3927,13 @@ handle_wmspec_button_release (GdkDisplay *display,
)
{
display_x11->wm_moveresize_button = 0;
- wmspec_send_message (display, window, 0, 0, _NET_WM_MOVERESIZE_CANCEL, 0);
+ wmspec_send_message (display, surface, 0, 0, _NET_WM_MOVERESIZE_CANCEL, 0);
}
}
}
static void
-wmspec_moveresize (GdkSurface *window,
+wmspec_moveresize (GdkSurface *surface,
gint direction,
GdkDevice *device,
gint button,
@@ -3941,17 +3941,17 @@ wmspec_moveresize (GdkSurface *window,
gint root_y,
guint32 timestamp)
{
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
if (button != 0)
gdk_seat_ungrab (gdk_device_get_seat (device)); /* Release passive grab */
GDK_X11_DISPLAY (display)->wm_moveresize_button = button;
- wmspec_send_message (display, window, root_x, root_y, direction, button);
+ wmspec_send_message (display, surface, root_x, root_y, direction, button);
}
static void
-wmspec_resize_drag (GdkSurface *window,
+wmspec_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -4007,7 +4007,7 @@ wmspec_resize_drag (GdkSurface *window,
return;
}
- wmspec_moveresize (window, direction, device, button, root_x, root_y, timestamp);
+ wmspec_moveresize (surface, direction, device, button, root_x, root_y, timestamp);
}
typedef struct _MoveResizeData MoveResizeData;
@@ -4016,8 +4016,8 @@ struct _MoveResizeData
{
GdkDisplay *display;
- GdkSurface *moveresize_window;
- GdkSurface *moveresize_emulation_window;
+ GdkSurface *moveresize_surface;
+ GdkSurface *moveresize_emulation_surface;
gboolean is_resize;
GdkSurfaceEdge resize_edge;
GdkDevice *device;
@@ -4068,7 +4068,7 @@ check_maximize (MoveResizeData *mv_resize,
if (mv_resize->is_resize)
return;
- state = gdk_surface_get_state (mv_resize->moveresize_window);
+ state = gdk_surface_get_state (mv_resize->moveresize_surface);
if (state & GDK_SURFACE_STATE_MAXIMIZED)
return;
@@ -4076,7 +4076,7 @@ check_maximize (MoveResizeData *mv_resize,
y = mv_resize->moveresize_orig_y + (y_root - mv_resize->moveresize_y);
if (y < 10)
- gdk_surface_maximize (mv_resize->moveresize_window);
+ gdk_surface_maximize (mv_resize->moveresize_surface);
}
static void
@@ -4090,7 +4090,7 @@ check_unmaximize (MoveResizeData *mv_resize,
if (mv_resize->is_resize)
return;
- state = gdk_surface_get_state (mv_resize->moveresize_window);
+ state = gdk_surface_get_state (mv_resize->moveresize_surface);
if ((state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_TILED)) == 0)
return;
@@ -4099,7 +4099,7 @@ check_unmaximize (MoveResizeData *mv_resize,
dy = y_root - mv_resize->moveresize_y;
if (ABS (dx) > 20 || ABS (dy) > 20)
- gdk_surface_unmaximize (mv_resize->moveresize_window);
+ gdk_surface_unmaximize (mv_resize->moveresize_surface);
}
static void
@@ -4175,7 +4175,7 @@ update_pos (MoveResizeData *mv_resize,
w, h, &w, &h);
}
- gdk_surface_move_resize (mv_resize->moveresize_window, x, y, w, h);
+ gdk_surface_move_resize (mv_resize->moveresize_surface, x, y, w, h);
}
else
{
@@ -4184,16 +4184,16 @@ update_pos (MoveResizeData *mv_resize,
x = mv_resize->moveresize_orig_x + dx;
y = mv_resize->moveresize_orig_y + dy;
- gdk_surface_move (mv_resize->moveresize_window, x, y);
+ gdk_surface_move (mv_resize->moveresize_surface, x, y);
}
}
static void
finish_drag (MoveResizeData *mv_resize)
{
- gdk_surface_destroy (mv_resize->moveresize_emulation_window);
- mv_resize->moveresize_emulation_window = NULL;
- g_clear_object (&mv_resize->moveresize_window);
+ gdk_surface_destroy (mv_resize->moveresize_emulation_surface);
+ mv_resize->moveresize_emulation_surface = NULL;
+ g_clear_object (&mv_resize->moveresize_surface);
g_clear_pointer (&mv_resize->moveresize_pending_event, g_free);
}
@@ -4256,13 +4256,13 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
GdkSurfaceImplX11 *impl;
- if (!mv_resize || !mv_resize->moveresize_window)
+ if (!mv_resize || !mv_resize->moveresize_surface)
{
handle_wmspec_button_release (display, event);
return FALSE;
}
- impl = GDK_SURFACE_IMPL_X11 (mv_resize->moveresize_window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (mv_resize->moveresize_surface->impl);
if (mv_resize->moveresize_button != 0)
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
@@ -4270,7 +4270,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
switch (event->xany.type)
{
case MotionNotify:
- if (mv_resize->moveresize_window->resize_count > 0)
+ if (mv_resize->moveresize_surface->resize_count > 0)
{
if (mv_resize->moveresize_pending_event)
*mv_resize->moveresize_pending_event = *event;
@@ -4363,12 +4363,12 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
gboolean
_gdk_x11_moveresize_configure_done (GdkDisplay *display,
- GdkSurface *window)
+ GdkSurface *surface)
{
XEvent *tmp_event;
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
- if (!mv_resize || window != mv_resize->moveresize_window)
+ if (!mv_resize || surface != mv_resize->moveresize_surface)
return FALSE;
if (mv_resize->moveresize_pending_event)
@@ -4383,24 +4383,24 @@ _gdk_x11_moveresize_configure_done (GdkDisplay *display,
}
static void
-create_moveresize_window (MoveResizeData *mv_resize,
+create_moveresize_surface (MoveResizeData *mv_resize,
guint32 timestamp)
{
GdkGrabStatus status;
- g_assert (mv_resize->moveresize_emulation_window == NULL);
+ g_assert (mv_resize->moveresize_emulation_surface == NULL);
- mv_resize->moveresize_emulation_window = gdk_surface_new_temp (mv_resize->display);
- gdk_surface_show (mv_resize->moveresize_emulation_window);
+ mv_resize->moveresize_emulation_surface = gdk_surface_new_temp (mv_resize->display);
+ gdk_surface_show (mv_resize->moveresize_emulation_surface);
status = gdk_seat_grab (gdk_device_get_seat (mv_resize->device),
- mv_resize->moveresize_emulation_window,
+ mv_resize->moveresize_emulation_surface,
GDK_SEAT_CAPABILITY_POINTER, FALSE,
NULL, NULL, NULL, NULL);
if (status != GDK_GRAB_SUCCESS)
{
- /* If this fails, some other client has grabbed the window
+ /* If this fails, some other client has grabbed the surface
* already.
*/
finish_drag (mv_resize);
@@ -4412,7 +4412,7 @@ create_moveresize_window (MoveResizeData *mv_resize,
/*
Calculate mv_resize->moveresize_orig_x and mv_resize->moveresize_orig_y
so that calling XMoveWindow with these coordinates will not move the
- window.
+ surface.
Note that this depends on the WM to implement ICCCM-compliant reference
point handling.
*/
@@ -4425,14 +4425,14 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)
{
- gdk_surface_get_origin (mv_resize->moveresize_window,
+ gdk_surface_get_origin (mv_resize->moveresize_surface,
&mv_resize->moveresize_orig_x,
&mv_resize->moveresize_orig_y);
}
else
{
- gdk_surface_get_frame_extents (mv_resize->moveresize_window, &rect);
- gdk_surface_get_geometry (mv_resize->moveresize_window,
+ gdk_surface_get_frame_extents (mv_resize->moveresize_surface, &rect);
+ gdk_surface_get_geometry (mv_resize->moveresize_surface,
NULL, NULL, &width, &height);
switch (mv_resize->moveresize_geometry.win_gravity)
@@ -4483,7 +4483,7 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
}
static void
-emulate_resize_drag (GdkSurface *window,
+emulate_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -4491,9 +4491,9 @@ emulate_resize_drag (GdkSurface *window,
gint root_y,
guint32 timestamp)
{
- MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (window), TRUE);
+ MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (surface), TRUE);
- if (mv_resize->moveresize_window != NULL)
+ if (mv_resize->moveresize_surface != NULL)
return; /* already a drag operation in progress */
mv_resize->is_resize = TRUE;
@@ -4502,32 +4502,32 @@ emulate_resize_drag (GdkSurface *window,
mv_resize->device = device;
mv_resize->moveresize_x = root_x;
mv_resize->moveresize_y = root_y;
- mv_resize->moveresize_window = g_object_ref (window);
+ mv_resize->moveresize_surface = g_object_ref (surface);
- mv_resize->moveresize_orig_width = gdk_surface_get_width (window);
- mv_resize->moveresize_orig_height = gdk_surface_get_height (window);
+ mv_resize->moveresize_orig_width = gdk_surface_get_width (surface);
+ mv_resize->moveresize_orig_height = gdk_surface_get_height (surface);
mv_resize->moveresize_geom_mask = 0;
- gdk_surface_get_geometry_hints (window,
+ gdk_surface_get_geometry_hints (surface,
&mv_resize->moveresize_geometry,
&mv_resize->moveresize_geom_mask);
calculate_unmoving_origin (mv_resize);
- create_moveresize_window (mv_resize, timestamp);
+ create_moveresize_surface (mv_resize, timestamp);
}
static void
-emulate_move_drag (GdkSurface *window,
+emulate_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (window), TRUE);
+ MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (surface), TRUE);
- if (mv_resize->moveresize_window != NULL)
+ if (mv_resize->moveresize_surface != NULL)
return; /* already a drag operation in progress */
mv_resize->is_resize = FALSE;
@@ -4536,25 +4536,25 @@ emulate_move_drag (GdkSurface *window,
mv_resize->moveresize_x = root_x;
mv_resize->moveresize_y = root_y;
- mv_resize->moveresize_window = g_object_ref (window);
+ mv_resize->moveresize_surface = g_object_ref (surface);
calculate_unmoving_origin (mv_resize);
- create_moveresize_window (mv_resize, timestamp);
+ create_moveresize_surface (mv_resize, timestamp);
}
static gboolean
-_should_perform_ewmh_drag (GdkSurface *window,
+_should_perform_ewmh_drag (GdkSurface *surface,
GdkDevice *device)
{
GdkPointerSurfaceInfo *info;
GdkDisplay *display;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
info = _gdk_display_get_pointer_info (display, device);
if ((!info->last_slave || gdk_device_get_source (info->last_slave) != GDK_SOURCE_TOUCHSCREEN) &&
- gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_WM_MOVERESIZE")))
return TRUE;
@@ -4562,7 +4562,7 @@ _should_perform_ewmh_drag (GdkSurface *window,
}
static void
-gdk_x11_surface_begin_resize_drag (GdkSurface *window,
+gdk_x11_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
@@ -4570,19 +4570,19 @@ gdk_x11_surface_begin_resize_drag (GdkSurface *window,
gint root_y,
guint32 timestamp)
{
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
/* Avoid EWMH for touch devices */
- if (_should_perform_ewmh_drag (window, device))
- wmspec_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
+ if (_should_perform_ewmh_drag (surface, device))
+ wmspec_resize_drag (surface, edge, device, button, root_x, root_y, timestamp);
else
- emulate_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
+ emulate_resize_drag (surface, edge, device, button, root_x, root_y, timestamp);
}
static void
-gdk_x11_surface_begin_move_drag (GdkSurface *window,
+gdk_x11_surface_begin_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
@@ -4591,7 +4591,7 @@ gdk_x11_surface_begin_move_drag (GdkSurface *window,
{
gint direction;
- if (GDK_SURFACE_DESTROYED (window) || !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) || !SURFACE_IS_TOPLEVEL (surface))
return;
if (button == 0)
@@ -4600,24 +4600,24 @@ gdk_x11_surface_begin_move_drag (GdkSurface *window,
direction = _NET_WM_MOVERESIZE_MOVE;
/* Avoid EWMH for touch devices */
- if (_should_perform_ewmh_drag (window, device))
- wmspec_moveresize (window, direction, device, button, root_x, root_y, timestamp);
+ if (_should_perform_ewmh_drag (surface, device))
+ wmspec_moveresize (surface, direction, device, button, root_x, root_y, timestamp);
else
- emulate_move_drag (window, device, button, root_x, root_y, timestamp);
+ emulate_move_drag (surface, device, button, root_x, root_y, timestamp);
}
static gboolean
-gdk_x11_surface_beep (GdkSurface *window)
+gdk_x11_surface_beep (GdkSurface *surface)
{
GdkDisplay *display;
- display = GDK_SURFACE_DISPLAY (window);
+ display = GDK_SURFACE_DISPLAY (surface);
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{
XkbBell (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
0,
None);
return TRUE;
@@ -4628,19 +4628,19 @@ gdk_x11_surface_beep (GdkSurface *window)
}
static void
-gdk_x11_surface_set_opacity (GdkSurface *window,
+gdk_x11_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
{
GdkDisplay *display;
gulong cardinal;
- g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (window) ||
- !SURFACE_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
if (opacity < 0)
opacity = 0;
@@ -4651,11 +4651,11 @@ gdk_x11_surface_set_opacity (GdkSurface *window,
if (cardinal == 0xffffffff)
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY"));
else
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY"),
XA_CARDINAL, 32,
PropModeReplace,
@@ -4681,8 +4681,8 @@ timestamp_predicate (Display *display,
/**
* gdk_x11_get_server_time:
- * @window: (type GdkX11Surface): a #GdkSurface, used for communication
- * with the server. The window must have
+ * @surface: (type GdkX11Surface): a #GdkSurface, used for communication
+ * with the server. The surface must have
* GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will
* result.
*
@@ -4691,7 +4691,7 @@ timestamp_predicate (Display *display,
* Returns: the time stamp.
**/
guint32
-gdk_x11_get_server_time (GdkSurface *window)
+gdk_x11_get_server_time (GdkSurface *surface)
{
Display *xdisplay;
Window xwindow;
@@ -4699,13 +4699,13 @@ gdk_x11_get_server_time (GdkSurface *window)
XEvent xevent;
Atom timestamp_prop_atom;
- g_return_val_if_fail (GDK_IS_SURFACE (window), 0);
- g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+ g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), 0);
- xdisplay = GDK_SURFACE_XDISPLAY (window);
- xwindow = GDK_SURFACE_XID (window);
+ xdisplay = GDK_SURFACE_XDISPLAY (surface);
+ xwindow = GDK_SURFACE_XID (surface);
timestamp_prop_atom =
- gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window),
+ gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"GDK_TIMESTAMP_PROP");
XChangeProperty (xdisplay, xwindow, timestamp_prop_atom,
@@ -4720,31 +4720,31 @@ gdk_x11_get_server_time (GdkSurface *window)
/**
* gdk_x11_surface_get_xid:
- * @window: (type GdkX11Surface): a native #GdkSurface.
+ * @surface: (type GdkX11Surface): a native #GdkSurface.
*
- * Returns the X resource (window) belonging to a #GdkSurface.
+ * Returns the X resource (surface) belonging to a #GdkSurface.
*
* Returns: the ID of @drawable’s X resource.
**/
XID
-gdk_x11_surface_get_xid (GdkSurface *window)
+gdk_x11_surface_get_xid (GdkSurface *surface)
{
- if (!GDK_SURFACE_IS_X11 (window) ||
- !_gdk_surface_has_impl (window))
+ if (!GDK_SURFACE_IS_X11 (surface) ||
+ !_gdk_surface_has_impl (surface))
{
g_warning (G_STRLOC " drawable is not a native X11 window");
return None;
}
- return GDK_SURFACE_IMPL_X11 (window->impl)->xid;
+ return GDK_SURFACE_IMPL_X11 (surface->impl)->xid;
}
static gint
-gdk_x11_surface_get_scale_factor (GdkSurface *window)
+gdk_x11_surface_get_scale_factor (GdkSurface *surface)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 1;
return impl->surface_scale;
@@ -4752,40 +4752,40 @@ gdk_x11_surface_get_scale_factor (GdkSurface *window)
/**
* gdk_x11_surface_set_frame_sync_enabled:
- * @window: (type GdkX11Surface): a native #GdkSurface
+ * @surface: (type GdkX11Surface): a native #GdkSurface
* @frame_sync_enabled: whether frame-synchronization should be enabled
*
- * This function can be used to disable frame synchronization for a window.
+ * This function can be used to disable frame synchronization for a surface.
* Normally frame synchronziation will be enabled or disabled based on whether
* the system has a compositor that supports frame synchronization, but if
- * the window is not directly managed by the window manager, then frame
- * synchronziation may need to be disabled. This is the case for a window
+ * the surface is not directly managed by the window manager, then frame
+ * synchronziation may need to be disabled. This is the case for a surface
* embedded via the XEMBED protocol.
*/
void
-gdk_x11_surface_set_frame_sync_enabled (GdkSurface *window,
+gdk_x11_surface_set_frame_sync_enabled (GdkSurface *surface,
gboolean frame_sync_enabled)
{
- if (!GDK_SURFACE_IS_X11 (window) ||
- !_gdk_surface_has_impl (window))
+ if (!GDK_SURFACE_IS_X11 (surface) ||
+ !_gdk_surface_has_impl (surface))
{
g_warning (G_STRLOC " drawable is not a native X11 window");
return;
}
- GDK_SURFACE_IMPL_X11 (window->impl)->frame_sync_enabled = FALSE;
+ GDK_SURFACE_IMPL_X11 (surface->impl)->frame_sync_enabled = FALSE;
}
static void
-gdk_x11_surface_set_opaque_region (GdkSurface *window,
+gdk_x11_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkDisplay *display;
int nitems;
gulong *data;
- if (GDK_SURFACE_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (region != NULL)
@@ -4812,10 +4812,10 @@ gdk_x11_surface_set_opaque_region (GdkSurface *window,
data = NULL;
}
- display = gdk_surface_get_display (window);
+ display = gdk_surface_get_display (surface);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_SURFACE_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_OPAQUE_REGION"),
XA_CARDINAL, 32, PropModeReplace,
(guchar *) data, nitems);
@@ -4824,11 +4824,11 @@ gdk_x11_surface_set_opaque_region (GdkSurface *window,
}
static gboolean
-gdk_x11_surface_show_window_menu (GdkSurface *window,
+gdk_x11_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
- GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl);
- GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
GdkDevice *device;
int device_id;
double x_root, y_root;
@@ -4843,7 +4843,7 @@ gdk_x11_surface_show_window_menu (GdkSurface *window,
return FALSE;
}
- if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window),
+ if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_GTK_SHOW_WINDOW_MENU")))
return FALSE;
@@ -4857,14 +4857,14 @@ gdk_x11_surface_show_window_menu (GdkSurface *window,
gdk_seat_ungrab (gdk_device_get_seat (device));
xclient.type = ClientMessage;
- xclient.window = GDK_SURFACE_XID (window);
+ xclient.window = GDK_SURFACE_XID (surface);
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->surface_scale;
xclient.data.l[2] = y_root * impl->surface_scale;
xclient.format = 32;
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False,
+ XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
diff --git a/gdk/x11/gdkx11surface.h b/gdk/x11/gdkx11surface.h
index d2fc1e4a60..85f46c120e 100644
--- a/gdk/x11/gdkx11surface.h
+++ b/gdk/x11/gdkx11surface.h
@@ -54,28 +54,28 @@ GDK_AVAILABLE_IN_ALL
GType gdk_x11_surface_get_type (void);
GDK_AVAILABLE_IN_ALL
-Window gdk_x11_surface_get_xid (GdkSurface *window);
+Window gdk_x11_surface_get_xid (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_set_user_time (GdkSurface *window,
+void gdk_x11_surface_set_user_time (GdkSurface *surface,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_set_utf8_property (GdkSurface *window,
+void gdk_x11_surface_set_utf8_property (GdkSurface *surface,
const gchar *name,
const gchar *value);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_set_theme_variant (GdkSurface *window,
+void gdk_x11_surface_set_theme_variant (GdkSurface *surface,
const char *variant);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_move_to_current_desktop (GdkSurface *window);
+void gdk_x11_surface_move_to_current_desktop (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-guint32 gdk_x11_surface_get_desktop (GdkSurface *window);
+guint32 gdk_x11_surface_get_desktop (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_move_to_desktop (GdkSurface *window,
+void gdk_x11_surface_move_to_desktop (GdkSurface *surface,
guint32 desktop);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *window,
+void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *surface,
gboolean frame_sync_enabled);
/**
@@ -99,7 +99,7 @@ void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *window,
#define GDK_SURFACE_XID(win) (gdk_x11_surface_get_xid (win))
GDK_AVAILABLE_IN_ALL
-guint32 gdk_x11_get_server_time (GdkSurface *window);
+guint32 gdk_x11_get_server_time (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GdkSurface *gdk_x11_surface_foreign_new_for_display (GdkDisplay *display,
diff --git a/gdk/x11/gdkxid.c b/gdk/x11/gdkxid.c
index ec8bf6ab4e..93ca3c12a3 100644
--- a/gdk/x11/gdkxid.c
+++ b/gdk/x11/gdkxid.c
@@ -71,7 +71,7 @@ _gdk_x11_display_remove_window (GdkDisplay *display,
XID xid)
{
GdkX11Display *display_x11;
- GdkSurface *window;
+ GdkSurface *surface;
g_return_if_fail (GDK_IS_DISPLAY (display));
@@ -80,9 +80,9 @@ _gdk_x11_display_remove_window (GdkDisplay *display,
if (!display_x11->xid_ht)
return;
- window = g_hash_table_lookup (display_x11->xid_ht, &xid);
- if (window && gdk_surface_get_parent (window) == NULL)
- display_x11->toplevels = g_list_remove (display_x11->toplevels, window);
+ surface = g_hash_table_lookup (display_x11->xid_ht, &xid);
+ if (surface && gdk_surface_get_parent (surface) == NULL)
+ display_x11->toplevels = g_list_remove (display_x11->toplevels, surface);
g_hash_table_remove (display_x11->xid_ht, &xid);
}