summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkdisplay-x11.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2018-03-20 11:40:08 +0100
committerAlexander Larsson <alexl@redhat.com>2018-03-20 11:40:08 +0100
commit391727bd0dff0f1d2d937f125bb08a541da02348 (patch)
treed7bac00df572f7efde9c8a9ffde46accb971ad20 /gdk/x11/gdkdisplay-x11.c
parentf7326ff828ad133a7884906ad4cd03e2d9980535 (diff)
downloadgtk+-391727bd0dff0f1d2d937f125bb08a541da02348.tar.gz
GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend subclasses) to surface. Additionally it renames related types: GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType, GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge This is an automatic conversion using the below commands: git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass git sed -f g GdkWindow GdkSurface git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2" git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE" git sed -f g "broadway_window" "broadway_surface" git sed -f g "BroadwayWindow" "BroadwaySurface" git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE" git sed -f g "wayland_window" "wayland_surface" git sed -f g "WaylandWindow" "WaylandSurface" git sed -f g "X11_WINDOW" "X11_SURFACE" git sed -f g "x11_window" "x11_surface" git sed -f g "X11Window" "X11Surface" git sed -f g "WIN32_WINDOW" "WIN32_SURFACE" git sed -f g "win32_window" "win32_surface" git sed -f g "Win32Window" "Win32Surface" git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE" git sed -f g "quartz_window" "quartz_surface" git sed -f g "QuartzWindow" "QuartzSurface" git checkout NEWS* po-properties
Diffstat (limited to 'gdk/x11/gdkdisplay-x11.c')
-rw-r--r--gdk/x11/gdkdisplay-x11.c294
1 files changed, 147 insertions, 147 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 28a5344c24..0a2bfbff53 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -199,19 +199,19 @@ gdk_x11_display_event_translator_init (GdkEventTranslatorIface *iface)
iface->translate_event = gdk_x11_display_translate_event;
}
-#define ANY_EDGE_TILED (GDK_WINDOW_STATE_LEFT_TILED | \
- GDK_WINDOW_STATE_RIGHT_TILED | \
- GDK_WINDOW_STATE_TOP_TILED | \
- GDK_WINDOW_STATE_BOTTOM_TILED)
+#define ANY_EDGE_TILED (GDK_SURFACE_STATE_LEFT_TILED | \
+ GDK_SURFACE_STATE_RIGHT_TILED | \
+ GDK_SURFACE_STATE_TOP_TILED | \
+ GDK_SURFACE_STATE_BOTTOM_TILED)
static void
-do_edge_constraint_state_check (GdkWindow *window,
- GdkWindowState old_state,
- GdkWindowState *set,
- GdkWindowState *unset)
+do_edge_constraint_state_check (GdkSurface *window,
+ GdkSurfaceState old_state,
+ GdkSurfaceState *set,
+ GdkSurfaceState *unset)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowState local_set, local_unset;
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkSurfaceState local_set, local_unset;
guint edge_constraints;
local_set = *set;
@@ -220,130 +220,130 @@ do_edge_constraint_state_check (GdkWindow *window,
/* If the WM doesn't support _GTK_EDGE_CONSTRAINTS, rely on the fallback
* implementation. If it supports _GTK_EDGE_CONSTRAINTS, arrange for
- * GDK_WINDOW_STATE_TILED to be set if any edge is tiled, and cleared
+ * GDK_SURFACE_STATE_TILED to be set if any edge is tiled, and cleared
* if no edge is tiled.
*/
- if (!gdk_window_supports_edge_constraints (window))
+ if (!gdk_surface_supports_edge_constraints (window))
{
/* FIXME: we rely on implementation details of mutter here:
* mutter only tiles horizontally, and sets maxvert when it does
* and if it tiles, it always affects all edges
*/
- if (old_state & GDK_WINDOW_STATE_TILED)
+ if (old_state & GDK_SURFACE_STATE_TILED)
{
if (!toplevel->have_maxvert)
- local_unset |= GDK_WINDOW_STATE_TILED;
+ local_unset |= GDK_SURFACE_STATE_TILED;
}
else
{
if (toplevel->have_maxvert && !toplevel->have_maxhorz)
- local_set |= GDK_WINDOW_STATE_TILED;
+ local_set |= GDK_SURFACE_STATE_TILED;
}
}
else
{
- if (old_state & GDK_WINDOW_STATE_TILED)
+ if (old_state & GDK_SURFACE_STATE_TILED)
{
if (!(edge_constraints & ANY_EDGE_TILED))
- local_unset |= GDK_WINDOW_STATE_TILED;
+ local_unset |= GDK_SURFACE_STATE_TILED;
}
else
{
if (edge_constraints & ANY_EDGE_TILED)
- local_set |= GDK_WINDOW_STATE_TILED;
+ local_set |= GDK_SURFACE_STATE_TILED;
}
}
/* Top edge */
- if (old_state & GDK_WINDOW_STATE_TOP_TILED)
+ if (old_state & GDK_SURFACE_STATE_TOP_TILED)
{
- if ((edge_constraints & GDK_WINDOW_STATE_TOP_TILED) == 0)
- local_unset |= GDK_WINDOW_STATE_TOP_TILED;
+ if ((edge_constraints & GDK_SURFACE_STATE_TOP_TILED) == 0)
+ local_unset |= GDK_SURFACE_STATE_TOP_TILED;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_TOP_TILED)
- local_set |= GDK_WINDOW_STATE_TOP_TILED;
+ if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED)
+ local_set |= GDK_SURFACE_STATE_TOP_TILED;
}
- if (old_state & GDK_WINDOW_STATE_TOP_RESIZABLE)
+ if (old_state & GDK_SURFACE_STATE_TOP_RESIZABLE)
{
- if ((edge_constraints & GDK_WINDOW_STATE_TOP_RESIZABLE) == 0)
- local_unset |= GDK_WINDOW_STATE_TOP_RESIZABLE;
+ if ((edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE) == 0)
+ local_unset |= GDK_SURFACE_STATE_TOP_RESIZABLE;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_TOP_RESIZABLE)
- local_set |= GDK_WINDOW_STATE_TOP_RESIZABLE;
+ if (edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE)
+ local_set |= GDK_SURFACE_STATE_TOP_RESIZABLE;
}
/* Right edge */
- if (old_state & GDK_WINDOW_STATE_RIGHT_TILED)
+ if (old_state & GDK_SURFACE_STATE_RIGHT_TILED)
{
- if ((edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED) == 0)
- local_unset |= GDK_WINDOW_STATE_RIGHT_TILED;
+ if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED) == 0)
+ local_unset |= GDK_SURFACE_STATE_RIGHT_TILED;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED)
- local_set |= GDK_WINDOW_STATE_RIGHT_TILED;
+ if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED)
+ local_set |= GDK_SURFACE_STATE_RIGHT_TILED;
}
- if (old_state & GDK_WINDOW_STATE_RIGHT_RESIZABLE)
+ if (old_state & GDK_SURFACE_STATE_RIGHT_RESIZABLE)
{
- if ((edge_constraints & GDK_WINDOW_STATE_RIGHT_RESIZABLE) == 0)
- local_unset |= GDK_WINDOW_STATE_RIGHT_RESIZABLE;
+ if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE) == 0)
+ local_unset |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_RIGHT_RESIZABLE)
- local_set |= GDK_WINDOW_STATE_RIGHT_RESIZABLE;
+ if (edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE)
+ local_set |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
}
/* Bottom edge */
- if (old_state & GDK_WINDOW_STATE_BOTTOM_TILED)
+ if (old_state & GDK_SURFACE_STATE_BOTTOM_TILED)
{
- if ((edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED) == 0)
- local_unset |= GDK_WINDOW_STATE_BOTTOM_TILED;
+ if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED) == 0)
+ local_unset |= GDK_SURFACE_STATE_BOTTOM_TILED;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED)
- local_set |= GDK_WINDOW_STATE_BOTTOM_TILED;
+ if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED)
+ local_set |= GDK_SURFACE_STATE_BOTTOM_TILED;
}
- if (old_state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE)
+ if (old_state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE)
{
- if ((edge_constraints & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) == 0)
- local_unset |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
+ if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) == 0)
+ local_unset |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_RESIZABLE)
- local_set |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
+ if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE)
+ local_set |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
}
/* Left edge */
- if (old_state & GDK_WINDOW_STATE_LEFT_TILED)
+ if (old_state & GDK_SURFACE_STATE_LEFT_TILED)
{
- if ((edge_constraints & GDK_WINDOW_STATE_LEFT_TILED) == 0)
- local_unset |= GDK_WINDOW_STATE_LEFT_TILED;
+ if ((edge_constraints & GDK_SURFACE_STATE_LEFT_TILED) == 0)
+ local_unset |= GDK_SURFACE_STATE_LEFT_TILED;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_LEFT_TILED)
- local_set |= GDK_WINDOW_STATE_LEFT_TILED;
+ if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED)
+ local_set |= GDK_SURFACE_STATE_LEFT_TILED;
}
- if (old_state & GDK_WINDOW_STATE_LEFT_RESIZABLE)
+ if (old_state & GDK_SURFACE_STATE_LEFT_RESIZABLE)
{
- if ((edge_constraints & GDK_WINDOW_STATE_LEFT_RESIZABLE) == 0)
- local_unset |= GDK_WINDOW_STATE_LEFT_RESIZABLE;
+ if ((edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE) == 0)
+ local_unset |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_LEFT_RESIZABLE)
- local_set |= GDK_WINDOW_STATE_LEFT_RESIZABLE;
+ if (edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE)
+ local_set |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
}
*set = local_set;
@@ -351,78 +351,78 @@ do_edge_constraint_state_check (GdkWindow *window,
}
static void
-do_net_wm_state_changes (GdkWindow *window)
+do_net_wm_state_changes (GdkSurface *window)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowState old_state, set, unset;
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkSurfaceState old_state, set, unset;
- if (GDK_WINDOW_DESTROYED (window) ||
- gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL)
+ if (GDK_SURFACE_DESTROYED (window) ||
+ gdk_surface_get_window_type (window) != GDK_SURFACE_TOPLEVEL)
return;
- old_state = gdk_window_get_state (window);
+ old_state = gdk_surface_get_state (window);
set = unset = 0;
/* For found_sticky to remain TRUE, we have to also be on desktop
* 0xFFFFFFFF
*/
- if (old_state & GDK_WINDOW_STATE_STICKY)
+ if (old_state & GDK_SURFACE_STATE_STICKY)
{
if (!(toplevel->have_sticky && toplevel->on_all_desktops))
- unset |= GDK_WINDOW_STATE_STICKY;
+ unset |= GDK_SURFACE_STATE_STICKY;
}
else
{
if (toplevel->have_sticky && toplevel->on_all_desktops)
- set |= GDK_WINDOW_STATE_STICKY;
+ set |= GDK_SURFACE_STATE_STICKY;
}
- if (old_state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (old_state & GDK_SURFACE_STATE_FULLSCREEN)
{
if (!toplevel->have_fullscreen)
- unset |= GDK_WINDOW_STATE_FULLSCREEN;
+ unset |= GDK_SURFACE_STATE_FULLSCREEN;
}
else
{
if (toplevel->have_fullscreen)
- set |= GDK_WINDOW_STATE_FULLSCREEN;
+ set |= GDK_SURFACE_STATE_FULLSCREEN;
}
/* Our "maximized" means both vertical and horizontal; if only one,
* we don't expose that via GDK
*/
- if (old_state & GDK_WINDOW_STATE_MAXIMIZED)
+ if (old_state & GDK_SURFACE_STATE_MAXIMIZED)
{
if (!(toplevel->have_maxvert && toplevel->have_maxhorz))
- unset |= GDK_WINDOW_STATE_MAXIMIZED;
+ unset |= GDK_SURFACE_STATE_MAXIMIZED;
}
else
{
if (toplevel->have_maxvert && toplevel->have_maxhorz)
- set |= GDK_WINDOW_STATE_MAXIMIZED;
+ set |= GDK_SURFACE_STATE_MAXIMIZED;
}
- if (old_state & GDK_WINDOW_STATE_FOCUSED)
+ if (old_state & GDK_SURFACE_STATE_FOCUSED)
{
if (!toplevel->have_focused)
- unset |= GDK_WINDOW_STATE_FOCUSED;
+ unset |= GDK_SURFACE_STATE_FOCUSED;
}
else
{
if (toplevel->have_focused)
- set |= GDK_WINDOW_STATE_FOCUSED;
+ set |= GDK_SURFACE_STATE_FOCUSED;
}
- if (old_state & GDK_WINDOW_STATE_ICONIFIED)
+ if (old_state & GDK_SURFACE_STATE_ICONIFIED)
{
if (!toplevel->have_hidden)
- unset |= GDK_WINDOW_STATE_ICONIFIED;
+ unset |= GDK_SURFACE_STATE_ICONIFIED;
}
else
{
if (toplevel->have_hidden)
- set |= GDK_WINDOW_STATE_ICONIFIED;
+ set |= GDK_SURFACE_STATE_ICONIFIED;
}
/* Update edge constraints and tiling */
@@ -432,10 +432,10 @@ do_net_wm_state_changes (GdkWindow *window)
}
static void
-gdk_check_wm_desktop_changed (GdkWindow *window)
+gdk_check_wm_desktop_changed (GdkSurface *window)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
Atom type;
gint format;
@@ -447,7 +447,7 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
@@ -467,11 +467,11 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
}
static void
-gdk_check_wm_state_changed (GdkWindow *window)
+gdk_check_wm_state_changed (GdkSurface *window)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
- GdkX11Screen *screen = GDK_WINDOW_SCREEN (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
+ GdkX11Screen *screen = GDK_SURFACE_SCREEN (window);
Atom type;
gint format;
@@ -492,7 +492,7 @@ gdk_check_wm_state_changed (GdkWindow *window)
type = None;
gdk_x11_display_error_trap_push (display);
- XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
+ XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
&bytes_after, &data);
@@ -545,10 +545,10 @@ gdk_check_wm_state_changed (GdkWindow *window)
}
static void
-gdk_check_edge_constraints_changed (GdkWindow *window)
+gdk_check_edge_constraints_changed (GdkSurface *window)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (window);
Atom type;
gint format;
@@ -560,7 +560,7 @@ gdk_check_edge_constraints_changed (GdkWindow *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_GTK_EDGE_CONSTRAINTS"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
@@ -635,15 +635,15 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
const XEvent *xevent)
{
Window xwindow;
- GdkWindow *window;
+ GdkSurface *window;
gboolean is_substructure;
- GdkWindowImplX11 *window_impl = NULL;
+ GdkSurfaceImplX11 *window_impl = NULL;
GdkX11Screen *x11_screen = NULL;
GdkToplevelX11 *toplevel = NULL;
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
gboolean return_val;
- /* Find the GdkWindow that this event relates to. If that's
+ /* Find the GdkSurface that this event relates to. If that's
* not the same as the window that the event was sent to,
* we are getting an event from SubstructureNotifyMask.
* We ignore such events for internal operation, but we
@@ -656,18 +656,18 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xwindow = get_event_xwindow (xevent);
is_substructure = xwindow != xevent->xany.window;
- window = gdk_x11_window_lookup_for_display (display, xwindow);
+ window = gdk_x11_surface_lookup_for_display (display, xwindow);
if (window)
{
/* We may receive events such as NoExpose/GraphicsExpose
* and ShmCompletion for pixmaps
*/
- if (!GDK_IS_WINDOW (window))
+ if (!GDK_IS_SURFACE (window))
return FALSE;
- x11_screen = GDK_WINDOW_SCREEN (window);
- toplevel = _gdk_x11_window_get_toplevel (window);
- window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ x11_screen = GDK_SURFACE_SCREEN (window);
+ toplevel = _gdk_x11_surface_get_toplevel (window);
+ window_impl = GDK_SURFACE_IMPL_X11 (window->impl);
g_object_ref (window);
}
@@ -675,7 +675,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
event->any.window = window;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
- if (window && GDK_WINDOW_DESTROYED (window))
+ if (window && GDK_SURFACE_DESTROYED (window))
{
if (xevent->type != DestroyNotify)
{
@@ -748,7 +748,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
y2 = (xevent->xexpose.y + xevent->xexpose.height + window_impl->window_scale -1) / window_impl->window_scale;
expose_rect.height = y2 - expose_rect.y;
- _gdk_x11_window_process_expose (window, xevent->xexpose.serial, &expose_rect);
+ _gdk_x11_surface_process_expose (window, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
@@ -778,7 +778,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + window_impl->window_scale -1) / window_impl->window_scale;
expose_rect.height = y2 - expose_rect.y;
- _gdk_x11_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect);
+ _gdk_x11_surface_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect);
return_val = FALSE;
}
break;
@@ -832,10 +832,10 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
event->any.type = GDK_DESTROY;
event->any.window = window;
- return_val = window && !GDK_WINDOW_DESTROYED (window);
+ return_val = window && !GDK_SURFACE_DESTROYED (window);
- if (window && GDK_WINDOW_XID (window) != x11_screen->xroot_window)
- gdk_window_destroy_notify (window);
+ if (window && GDK_SURFACE_XID (window) != x11_screen->xroot_window)
+ gdk_surface_destroy_notify (window);
}
else
return_val = FALSE;
@@ -865,23 +865,23 @@ 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_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
gdk_synthesize_window_state (window,
0,
- GDK_WINDOW_STATE_ICONIFIED);
+ GDK_SURFACE_STATE_ICONIFIED);
}
if (window_impl->toplevel &&
window_impl->toplevel->frame_pending)
{
window_impl->toplevel->frame_pending = FALSE;
- _gdk_frame_clock_thaw (gdk_window_get_frame_clock (event->any.window));
+ _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.window));
}
if (toplevel)
- gdk_window_freeze_toplevel_updates (window);
+ gdk_surface_freeze_toplevel_updates (window);
- _gdk_x11_window_grab_check_unmap (window, xevent->xany.serial);
+ _gdk_x11_surface_grab_check_unmap (window, xevent->xany.serial);
}
break;
@@ -897,13 +897,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (window && !is_substructure)
{
/* Unset iconified if it was set */
- if (window->state & GDK_WINDOW_STATE_ICONIFIED)
+ if (window->state & GDK_SURFACE_STATE_ICONIFIED)
gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_ICONIFIED,
+ GDK_SURFACE_STATE_ICONIFIED,
0);
if (toplevel)
- gdk_window_thaw_toplevel_updates (window);
+ gdk_surface_thaw_toplevel_updates (window);
}
break;
@@ -934,7 +934,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
xevent->xconfigure.override_redirect,
!window
? " (discarding)"
- : window->window_type == GDK_WINDOW_CHILD
+ : window->window_type == GDK_SURFACE_CHILD
? " (discarding child)"
: xevent->xconfigure.event != xevent->xconfigure.window
? " (discarding substructure)"
@@ -955,7 +955,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (!window ||
xevent->xconfigure.event != xevent->xconfigure.window ||
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
+ GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD)
return_val = FALSE;
else
{
@@ -966,15 +966,15 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (!xevent->xconfigure.send_event &&
!xevent->xconfigure.override_redirect &&
- !GDK_WINDOW_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (window))
{
gint tx = 0;
gint ty = 0;
Window child_window = 0;
gdk_x11_display_error_trap_push (display);
- if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window),
+ GDK_SURFACE_XID (window),
x11_screen->xroot_window,
0, 0,
&tx, &ty,
@@ -1003,8 +1003,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
window->width = event->configure.width;
window->height = event->configure.height;
- _gdk_window_update_size (window);
- _gdk_x11_window_update_size (window_impl);
+ _gdk_surface_update_size (window);
+ _gdk_x11_surface_update_size (window_impl);
}
if (window->resize_count >= 1)
@@ -1172,7 +1172,7 @@ server_time_to_monotonic_time (GdkX11Display *display_x11,
(!display_x11->server_time_is_monotonic_time &&
server_time > display_x11->server_time_query_time + 10*1000*1000)) /* 10 seconds */
{
- gint64 current_server_time = gdk_x11_get_server_time (display_x11->leader_gdk_window);
+ gint64 current_server_time = gdk_x11_get_server_time (display_x11->leader_gdk_surface);
gint64 current_server_time_usec = (gint64)current_server_time * 1000;
gint64 current_monotonic_time = g_get_monotonic_time ();
display_x11->server_time_query_time = current_monotonic_time;
@@ -1201,24 +1201,24 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkWindow *win = event->any.window;
+ GdkSurface *win = event->any.window;
GdkDisplay *display;
Atom atom;
- if (!GDK_IS_X11_WINDOW (win) || GDK_WINDOW_DESTROYED (win))
+ if (!GDK_IS_X11_SURFACE (win) || GDK_SURFACE_DESTROYED (win))
return GDK_FILTER_CONTINUE;
if (xevent->type != ClientMessage)
return GDK_FILTER_CONTINUE;
- display = GDK_WINDOW_DISPLAY (win);
+ display = GDK_SURFACE_DISPLAY (win);
/* This isn't actually WM_PROTOCOLS because that wouldn't leave enough space
* in the message for everything that gets stuffed in */
if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_DRAWN"))
{
- GdkWindowImplX11 *window_impl;
- window_impl = GDK_WINDOW_IMPL_X11 (win->impl);
+ GdkSurfaceImplX11 *window_impl;
+ window_impl = GDK_SURFACE_IMPL_X11 (win->impl);
if (window_impl->toplevel)
{
guint32 d0 = xevent->xclient.data.l[0];
@@ -1230,7 +1230,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
gint64 frame_drawn_time = server_time_to_monotonic_time (GDK_X11_DISPLAY (display), ((guint64)d3 << 32) | d2);
gint64 refresh_interval, presentation_time;
- GdkFrameClock *clock = gdk_window_get_frame_clock (win);
+ GdkFrameClock *clock = gdk_surface_get_frame_clock (win);
GdkFrameTimings *timings = find_frame_timings (clock, serial);
if (timings)
@@ -1255,8 +1255,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_TIMINGS"))
{
- GdkWindowImplX11 *window_impl;
- window_impl = GDK_WINDOW_IMPL_X11 (win->impl);
+ GdkSurfaceImplX11 *window_impl;
+ window_impl = GDK_SURFACE_IMPL_X11 (win->impl);
if (window_impl->toplevel)
{
guint32 d0 = xevent->xclient.data.l[0];
@@ -1266,7 +1266,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
guint64 serial = ((guint64)d1 << 32) | d0;
- GdkFrameClock *clock = gdk_window_get_frame_clock (win);
+ GdkFrameClock *clock = gdk_surface_get_frame_clock (win);
GdkFrameTimings *timings = find_frame_timings (clock, serial);
if (timings)
@@ -1310,13 +1310,13 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
event->any.type = GDK_DELETE;
- gdk_x11_window_set_user_time (win, xevent->xclient.data.l[1]);
+ gdk_x11_surface_set_user_time (win, xevent->xclient.data.l[1]);
return GDK_FILTER_TRANSLATE;
}
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS"))
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (win);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (win);
/* There is no way of knowing reliably whether we are viewable;
* so trap errors asynchronously around the XSetInputFocus call
@@ -1338,8 +1338,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
{
XClientMessageEvent xclient = xevent->xclient;
- xclient.window = GDK_WINDOW_XROOTWIN (win);
- XSendEvent (GDK_WINDOW_XDISPLAY (win),
+ xclient.window = GDK_SURFACE_XROOTWIN (win);
+ XSendEvent (GDK_SURFACE_XDISPLAY (win),
xclient.window,
False,
SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient);
@@ -1349,7 +1349,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST") &&
GDK_X11_DISPLAY (display)->use_sync)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (win);
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (win);
if (toplevel)
{
#ifdef HAVE_XSYNC
@@ -1493,10 +1493,10 @@ gdk_x11_display_open (const gchar *display_name)
gdk_event_init (display);
- display_x11->leader_gdk_window = gdk_window_new_temp (display);
- (_gdk_x11_window_get_toplevel (display_x11->leader_gdk_window))->is_leader = TRUE;
+ display_x11->leader_gdk_surface = gdk_surface_new_temp (display);
+ (_gdk_x11_surface_get_toplevel (display_x11->leader_gdk_surface))->is_leader = TRUE;
- display_x11->leader_window = GDK_WINDOW_XID (display_x11->leader_gdk_window);
+ display_x11->leader_window = GDK_SURFACE_XID (display_x11->leader_gdk_surface);
display_x11->leader_window_title_set = FALSE;
@@ -1811,7 +1811,7 @@ device_grab_update_callback (GdkDisplay *display,
gpointer data,
gulong serial)
{
- GdkPointerWindowInfo *pointer_info;
+ GdkPointerSurfaceInfo *pointer_info;
GdkDevice *device = data;
pointer_info = _gdk_display_get_pointer_info (display, device);
@@ -1884,12 +1884,12 @@ gdk_x11_display_has_pending (GdkDisplay *display)
return XPending (GDK_DISPLAY_XDISPLAY (display));
}
-static GdkWindow *
+static GdkSurface *
gdk_x11_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- return GDK_X11_DISPLAY (display)->leader_gdk_window;
+ return GDK_X11_DISPLAY (display)->leader_gdk_surface;
}
/**
@@ -1982,7 +1982,7 @@ gdk_x11_display_finalize (GObject *object)
/* List of event window extraction functions */
g_slist_free_full (display_x11->event_types, g_free);
- /* input GdkWindow list */
+ /* input GdkSurface list */
g_list_free_full (display_x11->input_windows, g_free);
/* Free all GdkX11Screens */
@@ -2378,7 +2378,7 @@ gdk_x11_display_request_selection_notification (GdkDisplay *display,
* Returns the timestamp of the last user interaction on
* @display. The timestamp is taken from events caused
* by user interaction such as key presses or pointer
- * movements. See gdk_x11_window_set_user_time().
+ * movements. See gdk_x11_surface_set_user_time().
*
* Returns: the timestamp of the last user interaction
*/
@@ -3006,7 +3006,7 @@ gdk_x11_display_get_toplevel_windows (GdkDisplay *display)
static guint32
gdk_x11_display_get_last_seen_time (GdkDisplay *display)
{
- return gdk_x11_get_server_time (GDK_X11_DISPLAY (display)->leader_gdk_window);
+ return gdk_x11_get_server_time (GDK_X11_DISPLAY (display)->leader_gdk_surface);
}
static gboolean
@@ -3034,7 +3034,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
object_class->dispose = gdk_x11_display_dispose;
object_class->finalize = gdk_x11_display_finalize;
- display_class->window_type = GDK_TYPE_X11_WINDOW;
+ display_class->window_type = GDK_TYPE_X11_SURFACE;
#ifdef GDK_RENDERING_VULKAN
display_class->vk_context_type = GDK_TYPE_X11_VULKAN_CONTEXT;
display_class->vk_extension_name = VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
@@ -3105,5 +3105,5 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
_gdk_marshal_BOOLEAN__POINTER,
G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
- _gdk_x11_windowing_init ();
+ _gdk_x11_surfaceing_init ();
}