summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2018-03-20 16:16:57 +0000
committerAlexander Larsson <alexl@redhat.com>2018-03-20 16:16:57 +0000
commit695d141f32d8aed14b57cc065554974d541f8ba6 (patch)
treedeb13486e9441d4be37b882b13013ac98d936d42
parentb83ba41f2d129953572e3ad8d490b4d3e5a7ddf9 (diff)
parent4ac450b324bcae047d3fa53986133e18da0ec1bf (diff)
downloadgtk+-695d141f32d8aed14b57cc065554974d541f8ba6.tar.gz
Merge branch 'rename-window-to-surface' into 'master'
Rename window to surface See merge request GNOME/gtk!72
-rw-r--r--demos/gtk-demo/application.c18
-rw-r--r--demos/gtk-demo/changedisplay.c10
-rw-r--r--demos/gtk-demo/dnd.c2
-rw-r--r--demos/gtk-demo/drawingarea.c2
-rw-r--r--demos/gtk-demo/fontplane.c2
-rw-r--r--demos/gtk-demo/gtkfishbowl.c2
-rw-r--r--demos/gtk-demo/list_store.c2
-rw-r--r--demos/gtk-demo/main.c2
-rw-r--r--demos/widget-factory/widget-factory.c4
-rw-r--r--docs/developers.txt18
-rw-r--r--docs/dnd_internals.txt8
-rw-r--r--docs/reference/gdk/gdk4-sections.txt410
-rw-r--r--docs/reference/gdk/gdk4.types2
-rw-r--r--docs/reference/gsk/gsk4-sections.txt4
-rw-r--r--docs/reference/gtk/drawing-model.xml26
-rw-r--r--docs/reference/gtk/glossary.xml20
-rw-r--r--docs/reference/gtk/gtk4-sections.txt22
-rw-r--r--docs/reference/gtk/input-handling.xml18
-rw-r--r--docs/reference/gtk/migrating-3to4.xml24
-rw-r--r--docs/reference/gtk/question_index.sgml4
-rw-r--r--docs/tools/shooter.c10
-rw-r--r--docs/widget_system.txt24
-rw-r--r--examples/drawing.c4
-rw-r--r--gdk/broadway/gdkbroadway.h2
-rw-r--r--gdk/broadway/gdkbroadwaysurface.h (renamed from gdk/broadway/gdkbroadwaywindow.h)28
-rw-r--r--gdk/broadway/gdkdevice-broadway.c72
-rw-r--r--gdk/broadway/gdkdisplay-broadway.c10
-rw-r--r--gdk/broadway/gdkdisplay-broadway.h2
-rw-r--r--gdk/broadway/gdkdnd-broadway.c8
-rw-r--r--gdk/broadway/gdkeventsource.c22
-rw-r--r--gdk/broadway/gdkprivate-broadway.h32
-rw-r--r--gdk/broadway/gdksurface-broadway.c (renamed from gdk/broadway/gdkwindow-broadway.c)614
-rw-r--r--gdk/broadway/gdksurface-broadway.h (renamed from gdk/broadway/gdkwindow-broadway.h)40
-rw-r--r--gdk/broadway/meson.build4
-rw-r--r--gdk/gdk-autocleanup.h2
-rw-r--r--gdk/gdk-private.h12
-rw-r--r--gdk/gdk.h2
-rw-r--r--gdk/gdkcairo.c14
-rw-r--r--gdk/gdkcairo.h4
-rw-r--r--gdk/gdkcursor.c4
-rw-r--r--gdk/gdkdevice.c172
-rw-r--r--gdk/gdkdevice.h24
-rw-r--r--gdk/gdkdeviceprivate.h38
-rw-r--r--gdk/gdkdisplay.c176
-rw-r--r--gdk/gdkdisplay.h6
-rw-r--r--gdk/gdkdisplayprivate.h54
-rw-r--r--gdk/gdkdnd.c62
-rw-r--r--gdk/gdkdnd.h8
-rw-r--r--gdk/gdkdndprivate.h8
-rw-r--r--gdk/gdkdrawcontext.c52
-rw-r--r--gdk/gdkdrawcontext.h2
-rw-r--r--gdk/gdkdrawingcontext.c70
-rw-r--r--gdk/gdkdrawingcontext.h2
-rw-r--r--gdk/gdkevents.c72
-rw-r--r--gdk/gdkevents.h66
-rw-r--r--gdk/gdkeventsprivate.h90
-rw-r--r--gdk/gdkgl.c60
-rw-r--r--gdk/gdkglcontext.c38
-rw-r--r--gdk/gdkglcontext.h2
-rw-r--r--gdk/gdkgltexture.c12
-rw-r--r--gdk/gdkinternals.h120
-rw-r--r--gdk/gdkmonitor.c6
-rw-r--r--gdk/gdkpaintable.c2
-rw-r--r--gdk/gdkpango.c4
-rw-r--r--gdk/gdkpixbuf-drawable.c4
-rw-r--r--gdk/gdkseat.c22
-rw-r--r--gdk/gdkseat.h12
-rw-r--r--gdk/gdkseatdefault.c16
-rw-r--r--gdk/gdkseatprivate.h2
-rw-r--r--gdk/gdksurface.c6957
-rw-r--r--gdk/gdksurface.h (renamed from gdk/gdkwindow.h)570
-rw-r--r--gdk/gdksurfaceimpl.c (renamed from gdk/gdkwindowimpl.c)106
-rw-r--r--gdk/gdksurfaceimpl.h256
-rw-r--r--gdk/gdktypes.h88
-rw-r--r--gdk/gdkvulkancontext.c38
-rw-r--r--gdk/gdkwindow.c6957
-rw-r--r--gdk/gdkwindowimpl.h256
-rw-r--r--gdk/meson.build6
-rw-r--r--gdk/quartz/GdkQuartzNSWindow.c224
-rw-r--r--gdk/quartz/GdkQuartzNSWindow.h4
-rw-r--r--gdk/quartz/GdkQuartzView.c138
-rw-r--r--gdk/quartz/GdkQuartzView.h6
-rw-r--r--gdk/quartz/gdkdevice-core-quartz.c102
-rw-r--r--gdk/quartz/gdkdisplay-quartz.c10
-rw-r--r--gdk/quartz/gdkdisplay-quartz.h10
-rw-r--r--gdk/quartz/gdkdnd-quartz.c6
-rw-r--r--gdk/quartz/gdkevents-quartz.c136
-rw-r--r--gdk/quartz/gdkglcontext-quartz.c2
-rw-r--r--gdk/quartz/gdkglcontext-quartz.h4
-rw-r--r--gdk/quartz/gdkglobals-quartz.c2
-rw-r--r--gdk/quartz/gdkprivate-quartz.h52
-rw-r--r--gdk/quartz/gdkquartz.h2
-rw-r--r--gdk/quartz/gdkquartzsurface.h55
-rw-r--r--gdk/quartz/gdkquartzwindow.h55
-rw-r--r--gdk/quartz/gdkscreen-quartz.c8
-rw-r--r--gdk/quartz/gdksurface-quartz.c (renamed from gdk/quartz/gdkwindow-quartz.c)1190
-rw-r--r--gdk/quartz/gdksurface-quartz.h115
-rw-r--r--gdk/quartz/gdkwindow-quartz.h115
-rw-r--r--gdk/quartz/meson.build4
-rw-r--r--gdk/wayland/gdkdevice-wayland.c336
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c28
-rw-r--r--gdk/wayland/gdkdisplay-wayland.h2
-rw-r--r--gdk/wayland/gdkdnd-wayland.c92
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c54
-rw-r--r--gdk/wayland/gdkglcontext-wayland.h4
-rw-r--r--gdk/wayland/gdkprivate-wayland.h50
-rw-r--r--gdk/wayland/gdkselection-wayland.c10
-rw-r--r--gdk/wayland/gdksurface-wayland.c (renamed from gdk/wayland/gdkwindow-wayland.c)1846
-rw-r--r--gdk/wayland/gdkvulkancontext-wayland.c16
-rw-r--r--gdk/wayland/gdkwayland.h2
-rw-r--r--gdk/wayland/gdkwaylandsurface.h (renamed from gdk/wayland/gdkwaylandwindow.h)46
-rw-r--r--gdk/wayland/meson.build4
-rw-r--r--gdk/win32/gdkcursor-win32.c2
-rw-r--r--gdk/win32/gdkdevice-virtual.c34
-rw-r--r--gdk/win32/gdkdevice-win32.c52
-rw-r--r--gdk/win32/gdkdevice-win32.h2
-rw-r--r--gdk/win32/gdkdevice-wintab.c54
-rw-r--r--gdk/win32/gdkdevice-wintab.h2
-rw-r--r--gdk/win32/gdkdevicemanager-win32.c46
-rw-r--r--gdk/win32/gdkdevicemanager-win32.h2
-rw-r--r--gdk/win32/gdkdisplay-win32.c20
-rw-r--r--gdk/win32/gdkdisplay-win32.h2
-rw-r--r--gdk/win32/gdkdnd-win32.c260
-rw-r--r--gdk/win32/gdkevents-win32.c564
-rw-r--r--gdk/win32/gdkgeometry-win32.c96
-rw-r--r--gdk/win32/gdkglcontext-win32.c52
-rw-r--r--gdk/win32/gdkglcontext-win32.h4
-rw-r--r--gdk/win32/gdkmain-win32.c24
-rw-r--r--gdk/win32/gdkmonitor-win32.c2
-rw-r--r--gdk/win32/gdkprivate-win32.h88
-rw-r--r--gdk/win32/gdkscreen-win32.c8
-rw-r--r--gdk/win32/gdkselection-win32.c100
-rw-r--r--gdk/win32/gdkselection-win32.h2
-rw-r--r--gdk/win32/gdksurface-win32.c (renamed from gdk/win32/gdkwindow-win32.c)2116
-rw-r--r--gdk/win32/gdksurface-win32.h (renamed from gdk/win32/gdkwindow-win32.h)64
-rw-r--r--gdk/win32/gdkvulkancontext-win32.c4
-rw-r--r--gdk/win32/gdkwin32.h2
-rw-r--r--gdk/win32/gdkwin32dnd-private.h4
-rw-r--r--gdk/win32/gdkwin32misc.h16
-rw-r--r--gdk/win32/gdkwin32surface.h (renamed from gdk/win32/gdkwin32window.h)26
-rw-r--r--gdk/win32/meson.build4
-rw-r--r--gdk/x11/gdkdevice-core-x11.c162
-rw-r--r--gdk/x11/gdkdevice-xi2.c120
-rw-r--r--gdk/x11/gdkdevicemanager-core-x11.c132
-rw-r--r--gdk/x11/gdkdevicemanager-xi2.c130
-rw-r--r--gdk/x11/gdkdevicemanagerprivate-core.h2
-rw-r--r--gdk/x11/gdkdisplay-x11.c438
-rw-r--r--gdk/x11/gdkdisplay-x11.h8
-rw-r--r--gdk/x11/gdkdnd-x11.c560
-rw-r--r--gdk/x11/gdkeventsource.c60
-rw-r--r--gdk/x11/gdkeventtranslator.c20
-rw-r--r--gdk/x11/gdkeventtranslator.h8
-rw-r--r--gdk/x11/gdkgeometry-x11.c54
-rw-r--r--gdk/x11/gdkglcontext-x11.c88
-rw-r--r--gdk/x11/gdkglcontext-x11.h4
-rw-r--r--gdk/x11/gdkmain-x11.c32
-rw-r--r--gdk/x11/gdkmonitor-x11.c10
-rw-r--r--gdk/x11/gdkprivate-x11.h58
-rw-r--r--gdk/x11/gdkscreen-x11.c50
-rw-r--r--gdk/x11/gdkscreen-x11.h6
-rw-r--r--gdk/x11/gdkselectioninputstream-x11.c2
-rw-r--r--gdk/x11/gdkselectionoutputstream-x11.c2
-rw-r--r--gdk/x11/gdksurface-x11.c (renamed from gdk/x11/gdkwindow-x11.c)2160
-rw-r--r--gdk/x11/gdksurface-x11.h (renamed from gdk/x11/gdkwindow-x11.h)54
-rw-r--r--gdk/x11/gdkvulkancontext-x11.c6
-rw-r--r--gdk/x11/gdkx-autocleanups.h2
-rw-r--r--gdk/x11/gdkx.h2
-rw-r--r--gdk/x11/gdkx11display.h2
-rw-r--r--gdk/x11/gdkx11surface.h (renamed from gdk/x11/gdkx11window.h)64
-rw-r--r--gdk/x11/gdkxid.c24
-rw-r--r--gdk/x11/meson.build4
-rw-r--r--gdk/x11/xsettings-client.c8
-rw-r--r--gsk/gl/gskglrenderer.c28
-rw-r--r--gsk/gskbroadwayrenderer.c16
-rw-r--r--gsk/gskcairorenderer.c6
-rw-r--r--gsk/gskrenderer.c62
-rw-r--r--gsk/gskrenderer.h6
-rw-r--r--gsk/gskrendererprivate.h2
-rw-r--r--gsk/gskrendernode.c2
-rw-r--r--gsk/vulkan/gskvulkanrender.c8
-rw-r--r--gsk/vulkan/gskvulkanrenderer.c16
-rw-r--r--gtk/a11y/gtkentryaccessible.c22
-rw-r--r--gtk/a11y/gtklabelaccessible.c20
-rw-r--r--gtk/a11y/gtktextcellaccessible.c14
-rw-r--r--gtk/a11y/gtktextviewaccessible.c22
-rw-r--r--gtk/a11y/gtktreeviewaccessible.c14
-rw-r--r--gtk/a11y/gtkwidgetaccessible.c22
-rw-r--r--gtk/a11y/gtkwindowaccessible.c30
-rw-r--r--gtk/gtkaccellabel.c2
-rw-r--r--gtk/gtkactionbar.c2
-rw-r--r--gtk/gtkappchooserwidget.c2
-rw-r--r--gtk/gtkapplication-wayland.c8
-rw-r--r--gtk/gtkapplication-x11.c26
-rw-r--r--gtk/gtkbin.c2
-rw-r--r--gtk/gtkbox.c2
-rw-r--r--gtk/gtkbutton.c2
-rw-r--r--gtk/gtkcalendar.c2
-rw-r--r--gtk/gtkcellrendereraccel.c4
-rw-r--r--gtk/gtkcellview.c2
-rw-r--r--gtk/gtkcenterbox.c2
-rw-r--r--gtk/gtkcolorbutton.c2
-rw-r--r--gtk/gtkcolorplane.c4
-rw-r--r--gtk/gtkcolorswatch.c2
-rw-r--r--gtk/gtkcombobox.c2
-rw-r--r--gtk/gtkdebugupdates.c2
-rw-r--r--gtk/gtkdnd-quartz.c52
-rw-r--r--gtk/gtkdnd.c18
-rw-r--r--gtk/gtkdragdest.c6
-rw-r--r--gtk/gtkdrawingarea.c2
-rw-r--r--gtk/gtkentry.c2
-rw-r--r--gtk/gtkentrycompletion.c16
-rw-r--r--gtk/gtkexpander.c2
-rw-r--r--gtk/gtkfilechooserbutton.c2
-rw-r--r--gtk/gtkfilechoosernativequartz.c2
-rw-r--r--gtk/gtkfilechoosernativewin32.c2
-rw-r--r--gtk/gtkfilechooserwidget.c2
-rw-r--r--gtk/gtkfixed.c2
-rw-r--r--gtk/gtkflowbox.c2
-rw-r--r--gtk/gtkfontbutton.c2
-rw-r--r--gtk/gtkfontchooserwidget.c2
-rw-r--r--gtk/gtkgesture.c16
-rw-r--r--gtk/gtkgizmo.c2
-rw-r--r--gtk/gtkglarea.c4
-rw-r--r--gtk/gtkgrid.c2
-rw-r--r--gtk/gtkheaderbar.c36
-rw-r--r--gtk/gtkicon.c2
-rw-r--r--gtk/gtkicontheme.c4
-rw-r--r--gtk/gtkiconview.c4
-rw-r--r--gtk/gtkimage.c2
-rw-r--r--gtk/gtkimcontextime.c80
-rw-r--r--gtk/gtkimcontextime.h4
-rw-r--r--gtk/gtkimcontextquartz.c28
-rw-r--r--gtk/gtkimcontextsimple.c16
-rw-r--r--gtk/gtkimcontextxim.c48
-rw-r--r--gtk/gtkimmulticontext.c2
-rw-r--r--gtk/gtkinvisible.c10
-rw-r--r--gtk/gtklabel.c2
-rw-r--r--gtk/gtklayout.c2
-rw-r--r--gtk/gtklevelbar.c2
-rw-r--r--gtk/gtklistbox.c2
-rw-r--r--gtk/gtkmagnifier.c2
-rw-r--r--gtk/gtkmain.c76
-rw-r--r--gtk/gtkmediacontrols.c2
-rw-r--r--gtk/gtkmediastream.c18
-rw-r--r--gtk/gtkmediastream.h8
-rw-r--r--gtk/gtkmenu.c104
-rw-r--r--gtk/gtkmenu.h2
-rw-r--r--gtk/gtkmenubutton.c2
-rw-r--r--gtk/gtkmenuitem.c8
-rw-r--r--gtk/gtkmenuprivate.h4
-rw-r--r--gtk/gtkmenushell.c6
-rw-r--r--gtk/gtkmnemonichash.c6
-rw-r--r--gtk/gtknotebook.c38
-rw-r--r--gtk/gtkoverlay.c2
-rw-r--r--gtk/gtkpaned.c2
-rw-r--r--gtk/gtkpathbar.c2
-rw-r--r--gtk/gtkpopover.c44
-rw-r--r--gtk/gtkprintoperation-win32.c6
-rw-r--r--gtk/gtkprintunixdialog.c2
-rw-r--r--gtk/gtkprogressbar.c2
-rw-r--r--gtk/gtkrange.c2
-rw-r--r--gtk/gtkrevealer.c2
-rw-r--r--gtk/gtkscrollbar.c2
-rw-r--r--gtk/gtkscrolledwindow.c2
-rw-r--r--gtk/gtkseparator.c2
-rw-r--r--gtk/gtkseparatortoolitem.c2
-rw-r--r--gtk/gtksettings.c2
-rw-r--r--gtk/gtkshortcutsshortcut.c2
-rw-r--r--gtk/gtkshortcutswindow.c2
-rw-r--r--gtk/gtkspinbutton.c2
-rw-r--r--gtk/gtkspinner.c2
-rw-r--r--gtk/gtkstack.c2
-rw-r--r--gtk/gtkstackswitcher.c2
-rw-r--r--gtk/gtkstatusbar.c2
-rw-r--r--gtk/gtkswitch.c2
-rw-r--r--gtk/gtktextutil.c4
-rw-r--r--gtk/gtktextview.c46
-rw-r--r--gtk/gtktextview.h2
-rw-r--r--gtk/gtktoolbar.c4
-rw-r--r--gtk/gtktooltip.c56
-rw-r--r--gtk/gtktooltipprivate.h2
-rw-r--r--gtk/gtktreeview.c184
-rw-r--r--gtk/gtktreeview.h4
-rw-r--r--gtk/gtkvideo.c10
-rw-r--r--gtk/gtkviewport.c2
-rw-r--r--gtk/gtkwidget.c442
-rw-r--r--gtk/gtkwidget.h32
-rw-r--r--gtk/gtkwidgetfocus.c8
-rw-r--r--gtk/gtkwidgetprivate.h32
-rw-r--r--gtk/gtkwin32theme.c6
-rw-r--r--gtk/gtkwindow.c698
-rw-r--r--gtk/gtkwindow.h6
-rw-r--r--gtk/gtkwindowprivate.h2
-rw-r--r--gtk/inspector/general.c16
-rw-r--r--gtk/inspector/gtkstackcombo.c2
-rw-r--r--gtk/inspector/inspect-button.c24
-rw-r--r--gtk/inspector/recorder.c6
-rw-r--r--gtk/inspector/recorder.h2
-rw-r--r--gtk/inspector/rendernodeview.c2
-rw-r--r--gtk/inspector/visual.c2
-rw-r--r--gtk/inspector/window.c2
-rw-r--r--gtk/inspector/window.h2
-rw-r--r--tests/motion-compression.c2
-rw-r--r--tests/rendernode.c6
-rw-r--r--tests/showrendernode.c12
-rw-r--r--tests/testfullscreen.c14
-rw-r--r--tests/testgtk.c82
-rw-r--r--tests/testinput.c4
-rw-r--r--tests/testtooltips.c2
-rw-r--r--tests/testwidgetfocus.c2
-rw-r--r--tests/testxinerama.c4
-rw-r--r--testsuite/gsk/compare-render.c6
-rw-r--r--testsuite/gsk/test-render-nodes.c8
-rw-r--r--testsuite/gtk/defaultvalue.c8
-rw-r--r--testsuite/gtk/gestures.c12
-rw-r--r--testsuite/gtk/notify.c8
-rw-r--r--testsuite/gtk/object.c2
-rw-r--r--testsuite/gtk/objects-finalize.c2
-rw-r--r--testsuite/gtk/templates.c4
-rw-r--r--testsuite/reftests/reftest-snapshot.c24
320 files changed, 16753 insertions, 16753 deletions
diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c
index dec3ad2974..f6500fd0ce 100644
--- a/demos/gtk-demo/application.c
+++ b/demos/gtk-demo/application.c
@@ -470,14 +470,14 @@ demo_application_window_size_allocate (GtkWidget *widget,
}
static void
-window_state_changed (GtkWidget *widget)
+surface_state_changed (GtkWidget *widget)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
- GdkWindowState new_state;
+ GdkSurfaceState new_state;
- new_state = gdk_window_get_state (gtk_widget_get_window (widget));
- window->maximized = (new_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
- window->fullscreen = (new_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
+ new_state = gdk_surface_get_state (gtk_widget_get_surface (widget));
+ window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
+ window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
}
static void
@@ -485,15 +485,15 @@ demo_application_window_realize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (demo_application_window_parent_class)->realize (widget);
- g_signal_connect_swapped (gtk_widget_get_window (widget), "notify::state",
- G_CALLBACK (window_state_changed), widget);
+ g_signal_connect_swapped (gtk_widget_get_surface (widget), "notify::state",
+ G_CALLBACK (surface_state_changed), widget);
}
static void
demo_application_window_unrealize (GtkWidget *widget)
{
- g_signal_handlers_disconnect_by_func (gtk_widget_get_window (widget),
- window_state_changed, widget);
+ g_signal_handlers_disconnect_by_func (gtk_widget_get_surface (widget),
+ surface_state_changed, widget);
GTK_WIDGET_CLASS (demo_application_window_parent_class)->unrealize (widget);
}
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c
index 28cb194229..f9c273297d 100644
--- a/demos/gtk-demo/changedisplay.c
+++ b/demos/gtk-demo/changedisplay.c
@@ -68,19 +68,19 @@ enum
static GtkWidget *
find_toplevel_at_pointer (GdkDisplay *display)
{
- GdkWindow *pointer_window;
+ GdkSurface *pointer_window;
GtkWidget *widget = NULL;
- pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (),
+ pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (),
NULL, NULL);
- /* The user data field of a GdkWindow is used to store a pointer
+ /* The user data field of a GdkSurface is used to store a pointer
* to the widget that created it.
*/
if (pointer_window)
{
gpointer widget_ptr;
- gdk_window_get_user_data (pointer_window, &widget_ptr);
+ gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr;
}
@@ -128,7 +128,7 @@ query_for_toplevel (GdkDisplay *display,
device = gtk_get_current_event_device ();
if (gdk_seat_grab (gdk_device_get_seat (device),
- gtk_widget_get_window (popup),
+ gtk_widget_get_surface (popup),
GDK_SEAT_CAPABILITY_ALL_POINTING,
FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
{
diff --git a/demos/gtk-demo/dnd.c b/demos/gtk-demo/dnd.c
index 77f207c6eb..e31c392cee 100644
--- a/demos/gtk-demo/dnd.c
+++ b/demos/gtk-demo/dnd.c
@@ -299,7 +299,7 @@ pressed_cb (GtkGesture *gesture,
rect.height = 0;
gtk_menu_popup_at_rect (GTK_MENU (menu),
- gtk_widget_get_window (widget),
+ gtk_widget_get_surface (widget),
&rect,
GDK_GRAVITY_NORTH_WEST,
GDK_GRAVITY_NORTH_WEST,
diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c
index 985345de8a..387754bc25 100644
--- a/demos/gtk-demo/drawingarea.c
+++ b/demos/gtk-demo/drawingarea.c
@@ -137,7 +137,7 @@ checkerboard_draw (GtkDrawingArea *da,
/* At the start of a draw handler, a clip region has been set on
* the Cairo context, and the contents have been cleared to the
* widget's background color. The docs for
- * gdk_window_begin_paint_region() give more details on how this
+ * gdk_surface_begin_paint_region() give more details on how this
* works.
*/
diff --git a/demos/gtk-demo/fontplane.c b/demos/gtk-demo/fontplane.c
index 0e7e2d0b7d..6df1bfe7f7 100644
--- a/demos/gtk-demo/fontplane.c
+++ b/demos/gtk-demo/fontplane.c
@@ -208,7 +208,7 @@ plane_drag_gesture_end (GtkGestureDrag *gesture,
static void
gtk_font_plane_init (GtkFontPlane *plane)
{
- gtk_widget_set_has_window (GTK_WIDGET (plane), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (plane), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
plane->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (plane));
diff --git a/demos/gtk-demo/gtkfishbowl.c b/demos/gtk-demo/gtkfishbowl.c
index f75ff0c409..4e1b42acec 100644
--- a/demos/gtk-demo/gtkfishbowl.c
+++ b/demos/gtk-demo/gtkfishbowl.c
@@ -56,7 +56,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkFishbowl, gtk_fishbowl, GTK_TYPE_CONTAINER)
static void
gtk_fishbowl_init (GtkFishbowl *fishbowl)
{
- gtk_widget_set_has_window (GTK_WIDGET (fishbowl), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (fishbowl), FALSE);
}
/**
diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c
index 3055eb24c9..53c30a2b72 100644
--- a/demos/gtk-demo/list_store.c
+++ b/demos/gtk-demo/list_store.c
@@ -37,7 +37,7 @@ enum
static Bug data[] =
{
{ FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" },
- { FALSE, 60620, "Critical", "gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe" },
+ { FALSE, 60620, "Critical", "gdk_surface_clear_area (gdksurface-win32.c) is not thread-safe" },
{ FALSE, 50214, "Major", "Xft support does not clean up correctly" },
{ TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " },
{ FALSE, 56070, "Normal", "Can't click button after setting in sensitive" },
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index bf009ab46f..27669c2831 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -250,7 +250,7 @@ static gchar *types[] =
"GtkTreeSelection ",
"GdkDisplay ",
"GdkScreen ",
- "GdkWindow ",
+ "GdkSurface ",
"GdkEventButton ",
"GdkCursor ",
"GtkTreeIter ",
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 64224d0136..60dbd07ceb 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -64,7 +64,7 @@ get_idle (gpointer data)
GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window));
gtk_widget_set_sensitive (window, TRUE);
- gdk_window_set_cursor (gtk_widget_get_window (window), NULL);
+ gdk_surface_set_cursor (gtk_widget_get_surface (window), NULL);
g_application_unmark_busy (G_APPLICATION (app));
return G_SOURCE_REMOVE;
@@ -81,7 +81,7 @@ get_busy (GSimpleAction *action,
g_application_mark_busy (G_APPLICATION (app));
cursor = gdk_cursor_new_from_name ("wait", NULL);
- gdk_window_set_cursor (gtk_widget_get_window (window), cursor);
+ gdk_surface_set_cursor (gtk_widget_get_surface (window), cursor);
g_object_unref (cursor);
g_timeout_add (5000, get_idle, window);
diff --git a/docs/developers.txt b/docs/developers.txt
index 66e1d9309b..be81ec1a41 100644
--- a/docs/developers.txt
+++ b/docs/developers.txt
@@ -26,13 +26,13 @@ Refer to the file widget_system.txt which covers widget flags and the
resulting invariants in a detailed way.
-GdkWindow pointers may be NULL in GdkEvents
+GdkSurface pointers may be NULL in GdkEvents
-------------------------------------------
The notification nature of the signal mechanism might cause events to
-be emitted that have their GdkWindow pointer set to NULL.
+be emitted that have their GdkSurface pointer set to NULL.
This is due to the fact that certain events need to be emitted after the
-real GdkWindow of a widget is not any longer pertinent.
+real GdkSurface of a widget is not any longer pertinent.
It's up to the signal handling function (application) to check for the
window field of the event structure to be != NULL, if it is going to
perform any operations through Gdk calls on it.
@@ -43,7 +43,7 @@ GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
GtkWidget::focus_out_event
-Events that are assured to have a valid GdkEvent.any.window field are
+Events that are assured to have a valid GdkEvent.any.surface field are
GDK_EXPOSE GtkWidget::expose_event
@@ -51,10 +51,10 @@ GDK_EXPOSE GtkWidget::expose_event
Writing Gdk functions
---------------------
-When writing Gdk functions that operate on GdkWindow structures in any
-meaningful sense, that is casting to a GdkWindowPrivate structure for
-access to fields other then GdkWindow.user_data, the programmer is
-recommended to check for the GdkWindowPrivate.destroyed field to be ==
-FALSE, especially if the GdkWindowPrivate.xwindow field is used.
+When writing Gdk functions that operate on GdkSurface structures in any
+meaningful sense, that is casting to a GdkSurfacePrivate structure for
+access to fields other then GdkSurface.user_data, the programmer is
+recommended to check for the GdkSurfacePrivate.destroyed field to be ==
+FALSE, especially if the GdkSurfacePrivate.xwindow field is used.
Silent abortion of the Gdk function is the correct behaviour if this
condition isn't met.
diff --git a/docs/dnd_internals.txt b/docs/dnd_internals.txt
index fc5afcecc0..56266ecb97 100644
--- a/docs/dnd_internals.txt
+++ b/docs/dnd_internals.txt
@@ -81,19 +81,19 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* Source side */
-GdkDragContext * gdk_drag_begin (GdkWindow *window,
+GdkDragContext * gdk_drag_begin (GdkSurface *window,
GList *targets,
GdkDragAction actions);
gboolean gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
+ GdkSurface *drag_surface,
gint x_root,
gint y_root,
- GdkWindow **dest_window,
+ GdkSurface **dest_surface,
GdkDragProtocol *protocol);
gboolean gdk_drag_motion (GdkDragContext *context,
- GdkWindow *dest_window,
+ GdkSurface *dest_surface,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index c63a170560..28eee08e85 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -47,12 +47,12 @@ gdk_scroll_direction_get_type
gdk_setting_action_get_type
gdk_status_get_type
gdk_visibility_state_get_type
-gdk_window_attributes_type_get_type
-gdk_window_edge_get_type
-gdk_window_hints_get_type
-gdk_window_state_get_type
-gdk_window_type_get_type
-gdk_window_type_hint_get_type
+gdk_surface_attributes_type_get_type
+gdk_surface_edge_get_type
+gdk_surface_hints_get_type
+gdk_surface_state_get_type
+gdk_surface_type_get_type
+gdk_surface_type_hint_get_type
gdk_wm_decoration_get_type
gdk_wm_function_get_type
GDK_AVAILABLE_IN_4_0
@@ -96,7 +96,7 @@ gdk_display_get_n_monitors
gdk_display_get_monitor
gdk_display_get_primary_monitor
gdk_display_get_monitor_at_point
-gdk_display_get_monitor_at_window
+gdk_display_get_monitor_at_surface
gdk_display_get_clipboard
gdk_display_get_primary_clipboard
gdk_display_get_setting
@@ -169,186 +169,186 @@ gdk_rgba_get_type
<SECTION>
<TITLE>Windows</TITLE>
<FILE>windows</FILE>
-GdkWindow
-GdkWindowType
-GdkWindowClass
-GdkWindowHints
+GdkSurface
+GdkSurfaceType
+GdkSurfaceClass
+GdkSurfaceHints
GdkGeometry
GdkGravity
GdkAnchorHints
-GdkWindowEdge
-GdkWindowTypeHint
-GdkWindowState
-gdk_window_new_toplevel
-gdk_window_new_popup
-gdk_window_new_temp
-gdk_window_new_child
-gdk_window_destroy
-gdk_window_get_window_type
-gdk_window_get_display
-gdk_window_show
-gdk_window_show_unraised
-gdk_window_hide
-gdk_window_is_destroyed
-gdk_window_is_visible
-gdk_window_is_viewable
-gdk_window_is_input_only
-gdk_window_is_shaped
-gdk_window_get_state
-gdk_window_withdraw
-gdk_window_iconify
-gdk_window_deiconify
-gdk_window_stick
-gdk_window_unstick
-gdk_window_maximize
-gdk_window_unmaximize
-gdk_window_fullscreen
-gdk_window_fullscreen_on_monitor
-gdk_window_unfullscreen
+GdkSurfaceEdge
+GdkSurfaceTypeHint
+GdkSurfaceState
+gdk_surface_new_toplevel
+gdk_surface_new_popup
+gdk_surface_new_temp
+gdk_surface_new_child
+gdk_surface_destroy
+gdk_surface_get_surface_type
+gdk_surface_get_display
+gdk_surface_show
+gdk_surface_show_unraised
+gdk_surface_hide
+gdk_surface_is_destroyed
+gdk_surface_is_visible
+gdk_surface_is_viewable
+gdk_surface_is_input_only
+gdk_surface_is_shaped
+gdk_surface_get_state
+gdk_surface_withdraw
+gdk_surface_iconify
+gdk_surface_deiconify
+gdk_surface_stick
+gdk_surface_unstick
+gdk_surface_maximize
+gdk_surface_unmaximize
+gdk_surface_fullscreen
+gdk_surface_fullscreen_on_monitor
+gdk_surface_unfullscreen
GdkFullscreenMode
-gdk_window_get_fullscreen_mode
-gdk_window_set_fullscreen_mode
-gdk_window_set_keep_above
-gdk_window_set_keep_below
-gdk_window_set_opacity
-gdk_window_set_pass_through
-gdk_window_get_pass_through
-gdk_window_move
-gdk_window_resize
-gdk_window_move_resize
-gdk_window_scroll
-gdk_window_move_region
-gdk_window_has_native
-gdk_window_raise
-gdk_window_lower
-gdk_window_restack
-gdk_window_focus
-gdk_window_register_dnd
-gdk_window_begin_resize_drag
-gdk_window_begin_resize_drag_for_device
-gdk_window_begin_move_drag
-gdk_window_begin_move_drag_for_device
-gdk_window_show_window_menu
-gdk_window_constrain_size
-gdk_window_beep
-gdk_window_get_scale_factor
-gdk_window_set_opaque_region
-gdk_window_create_gl_context
-gdk_window_create_vulkan_context
+gdk_surface_get_fullscreen_mode
+gdk_surface_set_fullscreen_mode
+gdk_surface_set_keep_above
+gdk_surface_set_keep_below
+gdk_surface_set_opacity
+gdk_surface_set_pass_through
+gdk_surface_get_pass_through
+gdk_surface_move
+gdk_surface_resize
+gdk_surface_move_resize
+gdk_surface_scroll
+gdk_surface_move_region
+gdk_surface_has_native
+gdk_surface_raise
+gdk_surface_lower
+gdk_surface_restack
+gdk_surface_focus
+gdk_surface_register_dnd
+gdk_surface_begin_resize_drag
+gdk_surface_begin_resize_drag_for_device
+gdk_surface_begin_move_drag
+gdk_surface_begin_move_drag_for_device
+gdk_surface_show_window_menu
+gdk_surface_constrain_size
+gdk_surface_beep
+gdk_surface_get_scale_factor
+gdk_surface_set_opaque_region
+gdk_surface_create_gl_context
+gdk_surface_create_vulkan_context
<SUBSECTION>
-gdk_window_get_clip_region
-gdk_window_begin_draw_frame
-gdk_window_end_draw_frame
-gdk_window_get_visible_region
+gdk_surface_get_clip_region
+gdk_surface_begin_draw_frame
+gdk_surface_end_draw_frame
+gdk_surface_get_visible_region
<SUBSECTION>
-gdk_window_invalidate_rect
-gdk_window_invalidate_region
-GdkWindowChildFunc
-gdk_window_invalidate_maybe_recurse
-gdk_window_get_update_area
-gdk_window_freeze_updates
-gdk_window_thaw_updates
-gdk_window_get_frame_clock
+gdk_surface_invalidate_rect
+gdk_surface_invalidate_region
+GdkSurfaceChildFunc
+gdk_surface_invalidate_maybe_recurse
+gdk_surface_get_update_area
+gdk_surface_freeze_updates
+gdk_surface_thaw_updates
+gdk_surface_get_frame_clock
<SUBSECTION>
-gdk_window_set_user_data
-gdk_window_set_accept_focus
-gdk_window_get_accept_focus
-gdk_window_set_focus_on_map
-gdk_window_get_focus_on_map
-gdk_window_shape_combine_region
-gdk_window_set_child_shapes
-gdk_window_merge_child_shapes
-gdk_window_input_shape_combine_region
-gdk_window_set_child_input_shapes
-gdk_window_merge_child_input_shapes
-gdk_window_set_title
+gdk_surface_set_user_data
+gdk_surface_set_accept_focus
+gdk_surface_get_accept_focus
+gdk_surface_set_focus_on_map
+gdk_surface_get_focus_on_map
+gdk_surface_shape_combine_region
+gdk_surface_set_child_shapes
+gdk_surface_merge_child_shapes
+gdk_surface_input_shape_combine_region
+gdk_surface_set_child_input_shapes
+gdk_surface_merge_child_input_shapes
+gdk_surface_set_title
GDK_PARENT_RELATIVE
-gdk_window_set_cursor
-gdk_window_get_cursor
-gdk_window_get_user_data
-gdk_window_get_geometry
-gdk_window_set_geometry_hints
-gdk_window_get_width
-gdk_window_get_height
-gdk_window_set_icon_list
-gdk_window_set_modal_hint
-gdk_window_get_modal_hint
-gdk_window_set_type_hint
-gdk_window_get_type_hint
-gdk_window_set_shadow_width
-gdk_window_set_skip_taskbar_hint
-gdk_window_set_skip_pager_hint
-gdk_window_set_urgency_hint
-gdk_window_get_position
-gdk_window_get_root_origin
-gdk_window_get_frame_extents
-gdk_window_get_origin
-gdk_window_get_root_coords
-gdk_window_get_device_position
-gdk_window_get_device_position_double
+gdk_surface_set_cursor
+gdk_surface_get_cursor
+gdk_surface_get_user_data
+gdk_surface_get_geometry
+gdk_surface_set_geometry_hints
+gdk_surface_get_width
+gdk_surface_get_height
+gdk_surface_set_icon_list
+gdk_surface_set_modal_hint
+gdk_surface_get_modal_hint
+gdk_surface_set_type_hint
+gdk_surface_get_type_hint
+gdk_surface_set_shadow_width
+gdk_surface_set_skip_taskbar_hint
+gdk_surface_set_skip_pager_hint
+gdk_surface_set_urgency_hint
+gdk_surface_get_position
+gdk_surface_get_root_origin
+gdk_surface_get_frame_extents
+gdk_surface_get_origin
+gdk_surface_get_root_coords
+gdk_surface_get_device_position
+gdk_surface_get_device_position_double
GdkModifierType
GdkModifierIntent
-gdk_window_get_parent
-gdk_window_get_toplevel
-gdk_window_get_children
-gdk_window_get_children_with_user_data
-gdk_window_peek_children
-gdk_window_get_events
-gdk_window_set_events
-gdk_window_set_icon_name
-gdk_window_set_transient_for
-gdk_window_set_role
-gdk_window_set_startup_id
-gdk_window_set_group
-gdk_window_get_group
-gdk_window_set_decorations
-gdk_window_get_decorations
+gdk_surface_get_parent
+gdk_surface_get_toplevel
+gdk_surface_get_children
+gdk_surface_get_children_with_user_data
+gdk_surface_peek_children
+gdk_surface_get_events
+gdk_surface_set_events
+gdk_surface_set_icon_name
+gdk_surface_set_transient_for
+gdk_surface_set_role
+gdk_surface_set_startup_id
+gdk_surface_set_group
+gdk_surface_get_group
+gdk_surface_set_decorations
+gdk_surface_get_decorations
GdkWMDecoration
-gdk_window_set_functions
+gdk_surface_set_functions
GdkWMFunction
<SUBSECTION>
-gdk_window_get_support_multidevice
-gdk_window_set_support_multidevice
-gdk_window_get_device_cursor
-gdk_window_set_device_cursor
-gdk_window_get_device_events
-gdk_window_set_device_events
+gdk_surface_get_support_multidevice
+gdk_surface_set_support_multidevice
+gdk_surface_get_device_cursor
+gdk_surface_set_device_cursor
+gdk_surface_get_device_events
+gdk_surface_set_device_events
<SUBSECTION>
-gdk_window_coords_from_parent
-gdk_window_coords_to_parent
+gdk_surface_coords_from_parent
+gdk_surface_coords_to_parent
<SUBSECTION Standard>
-GDK_WINDOW
-GDK_WINDOW_GET_CLASS
-GDK_TYPE_WINDOW
-GDK_IS_WINDOW
-GDK_WINDOW_CLASS
-GDK_IS_WINDOW_CLASS
+GDK_SURFACE
+GDK_SURFACE_GET_CLASS
+GDK_TYPE_SURFACE
+GDK_IS_SURFACE
+GDK_SURFACE_CLASS
+GDK_IS_SURFACE_CLASS
GDK_TYPE_FILTER_RETURN
GDK_TYPE_GRAVITY
GDK_TYPE_MODIFIER_TYPE
-GDK_TYPE_WINDOW_ATTRIBUTES_TYPE
-GDK_TYPE_WINDOW_EDGE
-GDK_TYPE_WINDOW_HINTS
-GDK_TYPE_WINDOW_TYPE
-GDK_TYPE_WINDOW_TYPE_HINT
+GDK_TYPE_SURFACE_ATTRIBUTES_TYPE
+GDK_TYPE_SURFACE_EDGE
+GDK_TYPE_SURFACE_HINTS
+GDK_TYPE_SURFACE_TYPE
+GDK_TYPE_SURFACE_TYPE_HINT
GDK_TYPE_WM_DECORATION
GDK_TYPE_WM_FUNCTION
-GDK_TYPE_WINDOW_STATE
+GDK_TYPE_SURFACE_STATE
<SUBSECTION Private>
-gdk_window_get_type
-gdk_window_window_class_get_type
-GdkWindowClass
-GdkWindowImpl
-GdkWindowImplClass
-GdkWindowRedirect
-gdk_window_impl_get_type
+gdk_surface_get_type
+gdk_surface_window_class_get_type
+GdkSurfaceClass
+GdkSurfaceImpl
+GdkSurfaceImplClass
+GdkSurfaceRedirect
+gdk_surface_impl_get_type
gdk_fullscreen_mode_get_type
</SECTION>
@@ -417,8 +417,8 @@ gdk_pango_layout_line_get_clip_region
<SECTION>
<TITLE>Cairo Interaction</TITLE>
<FILE>cairo_interaction</FILE>
-gdk_window_create_similar_surface
-gdk_window_create_similar_image_surface
+gdk_surface_create_similar_surface
+gdk_surface_create_similar_image_surface
gdk_cairo_get_clip_rectangle
gdk_cairo_get_drawing_context
gdk_cairo_set_source_rgba
@@ -536,15 +536,15 @@ gdk_device_ungrab
gdk_device_get_state
gdk_device_get_position
gdk_device_get_position_double
-gdk_device_get_window_at_position
-gdk_device_get_window_at_position_double
+gdk_device_get_surface_at_position
+gdk_device_get_surface_at_position_double
gdk_device_get_history
gdk_device_free_history
GdkTimeCoord
gdk_device_get_axis
gdk_device_list_axes
gdk_device_get_axis_value
-gdk_device_get_last_event_window
+gdk_device_get_last_event_surface
<SUBSECTION>
gdk_device_tool_get_serial
@@ -657,7 +657,7 @@ gdk_event_get_scroll_deltas
gdk_event_is_scroll_stop_event
gdk_event_get_state
gdk_event_get_time
-gdk_event_get_window
+gdk_event_get_surface
gdk_event_get_event_type
GdkEventSequence
gdk_event_get_event_sequence
@@ -804,9 +804,9 @@ gdk_drag_context_get_suggested_action
gdk_drag_context_get_selected_action
gdk_drag_context_get_formats
gdk_drag_context_get_device
-gdk_drag_context_get_source_window
-gdk_drag_context_get_dest_window
-gdk_drag_context_get_drag_window
+gdk_drag_context_get_source_surface
+gdk_drag_context_get_dest_surface
+gdk_drag_context_get_drag_surface
gdk_drag_context_set_hotspot
<SUBSECTION Standard>
@@ -828,7 +828,7 @@ gdk_drag_context_get_type
<INCLUDE>gdk/gdkx.h</INCLUDE>
<TITLE>X Window System Interaction</TITLE>
<FILE>x_interaction</FILE>
-GDK_WINDOW_XID
+GDK_SURFACE_XID
GDK_DISPLAY_XDISPLAY
GDK_POINTER_TO_XID
GDK_XID_TO_POINTER
@@ -853,7 +853,7 @@ gdk_x11_display_error_trap_push
gdk_x11_display_error_trap_pop
gdk_x11_display_error_trap_pop_ignored
gdk_x11_display_set_cursor_theme
-gdk_x11_display_set_window_scale
+gdk_x11_display_set_surface_scale
gdk_x11_display_get_glx_version
gdk_x11_register_standard_event_type
gdk_x11_screen_get_screen_number
@@ -864,16 +864,16 @@ gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint
gdk_x11_screen_get_number_of_desktops
gdk_x11_screen_get_current_desktop
-gdk_x11_window_foreign_new_for_display
-gdk_x11_window_lookup_for_display
-gdk_x11_window_get_xid
-gdk_x11_window_set_theme_variant
-gdk_x11_window_set_user_time
-gdk_x11_window_move_to_current_desktop
-gdk_x11_window_move_to_desktop
-gdk_x11_window_get_desktop
-gdk_x11_window_set_utf8_property
-gdk_x11_window_set_frame_sync_enabled
+gdk_x11_surface_foreign_new_for_display
+gdk_x11_surface_lookup_for_display
+gdk_x11_surface_get_xid
+gdk_x11_surface_set_theme_variant
+gdk_x11_surface_set_user_time
+gdk_x11_surface_move_to_current_desktop
+gdk_x11_surface_move_to_desktop
+gdk_x11_surface_get_desktop
+gdk_x11_surface_set_utf8_property
+gdk_x11_surface_set_frame_sync_enabled
gdk_x11_keymap_get_group_for_state
gdk_x11_keymap_key_is_modifier
gdk_x11_visual_get_xvisual
@@ -966,12 +966,12 @@ GDK_X11_VISUAL_CLASS
GDK_IS_X11_VISUAL
GDK_IS_X11_VISUAL_CLASS
GDK_X11_VISUAL_GET_CLASS
-GDK_TYPE_X11_WINDOW
-GDK_X11_WINDOW
-GDK_X11_WINDOW_CLASS
-GDK_IS_X11_WINDOW
-GDK_IS_X11_WINDOW_CLASS
-GDK_X11_WINDOW_GET_CLASS
+GDK_TYPE_X11_SURFACE
+GDK_X11_SURFACE
+GDK_X11_SURFACE_CLASS
+GDK_IS_X11_SURFACE
+GDK_IS_X11_SURFACE_CLASS
+GDK_X11_SURFACE_GET_CLASS
<SUBSECTION Private>
gdk_x11_app_launch_context_get_type
@@ -988,8 +988,8 @@ gdk_x11_drag_context_get_type
gdk_x11_keymap_get_type
gdk_x11_screen_get_type
gdk_x11_visual_get_type
-gdk_x11_window_get_type
-gdk_window_impl_x11_get_type
+gdk_x11_surface_get_type
+gdk_surface_impl_x11_get_type
</SECTION>
<SECTION>
@@ -1003,13 +1003,13 @@ gdk_wayland_device_get_wl_seat
gdk_wayland_display_get_wl_compositor
gdk_wayland_display_get_wl_display
gdk_wayland_display_query_registry
-gdk_wayland_window_new_subsurface
-gdk_wayland_window_get_wl_surface
-gdk_wayland_window_set_use_custom_surface
-GdkWaylandWindowExported
-gdk_wayland_window_export_handle
-gdk_wayland_window_unexport_handle
-gdk_wayland_window_set_transient_for_exported
+gdk_wayland_surface_new_subsurface
+gdk_wayland_surface_get_wl_surface
+gdk_wayland_surface_set_use_custom_surface
+GdkWaylandSurfaceExported
+gdk_wayland_surface_export_handle
+gdk_wayland_surface_unexport_handle
+gdk_wayland_surface_set_transient_for_exported
<SUBSECTION Standard>
GDK_TYPE_WAYLAND_DEVICE
@@ -1030,18 +1030,18 @@ GDK_WAYLAND_DISPLAY_MANAGER_CLASS
GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS
GDK_IS_WAYLAND_DISPLAY_MANAGER
GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS
-GDK_TYPE_WAYLAND_WINDOW
-GDK_WAYLAND_WINDOW
-GDK_WAYLAND_WINDOW_CLASS
-GDK_WAYLAND_WINDOW_GET_CLASS
-GDK_IS_WAYLAND_WINDOW
-GDK_IS_WAYLAND_WINDOW_CLASS
+GDK_TYPE_WAYLAND_SURFACE
+GDK_WAYLAND_SURFACE
+GDK_WAYLAND_SURFACE_CLASS
+GDK_WAYLAND_SURFACE_GET_CLASS
+GDK_IS_WAYLAND_SURFACE
+GDK_IS_WAYLAND_SURFACE_CLASS
<SUBSECTION Private>
gdk_wayland_device_get_type
gdk_wayland_display_get_type
gdk_wayland_display_manager_get_type
-gdk_wayland_window_get_type
+gdk_wayland_surface_get_type
</SECTION>
@@ -1116,7 +1116,7 @@ gdk_frame_timings_get_type
<FILE>gdkdrawcontext</FILE>
GdkDrawContext
gdk_draw_context_get_display
-gdk_draw_context_get_window
+gdk_draw_context_get_surface
<SUBSECTION Standard>
GDK_DRAW_CONTEXT
@@ -1132,7 +1132,7 @@ gdk_draw_context_get_type
<FILE>gdkglcontext</FILE>
GdkGLContext
gdk_gl_context_get_display
-gdk_gl_context_get_window
+gdk_gl_context_get_surface
gdk_gl_context_get_shared_context
gdk_gl_context_get_version
@@ -1197,7 +1197,7 @@ GDK_IS_MONITOR
<SECTION>
<FILE>gdkdrawingcontext</FILE>
GdkDrawingContext
-gdk_drawing_context_get_window
+gdk_drawing_context_get_surface
gdk_drawing_context_get_clip
gdk_drawing_context_get_cairo_context
gdk_drawing_context_is_valid
diff --git a/docs/reference/gdk/gdk4.types b/docs/reference/gdk/gdk4.types
index 4367e448ba..1aba9be875 100644
--- a/docs/reference/gdk/gdk4.types
+++ b/docs/reference/gdk/gdk4.types
@@ -11,7 +11,7 @@ gdk_gl_context_get_type
gdk_keymap_get_type
gdk_monitor_get_type
gdk_seat_get_type
-gdk_window_get_type
+gdk_surface_get_type
gdk_content_serializer_get_type
gdk_content_deserializer_get_type
gdk_clipboard_get_type
diff --git a/docs/reference/gsk/gsk4-sections.txt b/docs/reference/gsk/gsk4-sections.txt
index 71ee47e0d4..0d4a80c55f 100644
--- a/docs/reference/gsk/gsk4-sections.txt
+++ b/docs/reference/gsk/gsk4-sections.txt
@@ -1,7 +1,7 @@
<SECTION>
<FILE>GskRenderer</FILE>
-gsk_renderer_new_for_window
-gsk_renderer_get_window
+gsk_renderer_new_for_surface
+gsk_renderer_get_surface
gsk_renderer_get_display
gsk_renderer_realize
gsk_renderer_unrealize
diff --git a/docs/reference/gtk/drawing-model.xml b/docs/reference/gtk/drawing-model.xml
index a608e75a09..c19fffc2b6 100644
--- a/docs/reference/gtk/drawing-model.xml
+++ b/docs/reference/gtk/drawing-model.xml
@@ -90,7 +90,7 @@
<link linkend="GdkEvent"><structname>GdkEvent</structname></link>
structures and sends them on to the GTK layer. In turn, the GTK layer
finds the widget that corresponds to a particular
- <classname>GdkWindow</classname> and emits the corresponding event
+ <classname>GdkSurface</classname> and emits the corresponding event
signals on that widget.
</para>
@@ -207,17 +207,17 @@
<para>
Normally, there is only a single cairo context which is used in
- the entire repaint, rather than one per GdkWindow. This means you
+ the entire repaint, rather than one per GdkSurface. This means you
have to respect (and not reset) existing clip and transformations
set on it.
</para>
<para>
- Most widgets, including those that create their own GdkWindows have
+ Most widgets, including those that create their own GdkSurfaces have
a transparent background, so they draw on top of whatever widgets
are below them. This was not the case in GTK+ 2 where the theme set
the background of most widgets to the default background color. (In
- fact, transparent GdkWindows used to be impossible.)
+ fact, transparent GdkSurfaces used to be impossible.)
</para>
<para>
@@ -263,10 +263,10 @@
<para>
Two basic functions in GDK form the core of the double-buffering
mechanism: <link
- linkend="gdk_window_begin_paint_region"><function>gdk_window_begin_paint_region()</function></link>
+ linkend="gdk_surface_begin_paint_region"><function>gdk_surface_begin_paint_region()</function></link>
and <link
- linkend="gdk_window_end_paint"><function>gdk_window_end_paint()</function></link>.
- The first function tells a <classname>GdkWindow</classname> to
+ linkend="gdk_surface_end_paint"><function>gdk_surface_end_paint()</function></link>.
+ The first function tells a <classname>GdkSurface</classname> to
create a temporary off-screen buffer for drawing. All
subsequent drawing operations to this window get automatically
redirected to that buffer. The second function actually paints
@@ -278,16 +278,16 @@
<para>
It would be inconvenient for all widgets to call
- <function>gdk_window_begin_paint_region()</function> and
- <function>gdk_window_end_paint()</function> at the beginning
+ <function>gdk_surface_begin_paint_region()</function> and
+ <function>gdk_surface_end_paint()</function> at the beginning
and end of their draw handlers.
</para>
<para>
To make this easier, GTK+ normally calls
- <function>gdk_window_begin_paint_region()</function>
+ <function>gdk_surface_begin_paint_region()</function>
before emitting the #GtkWidget::draw signal, and
- then it calls <function>gdk_window_end_paint()</function>
+ then it calls <function>gdk_surface_end_paint()</function>
after the signal has been emitted. This is convenient for
most widgets, as they do not need to worry about creating
their own temporary drawing buffers or about calling those
@@ -335,8 +335,8 @@ my_widget_init (MyWidget *widget)
<para>
Even if you turn off double buffering on a widget, you
can still call
- <function>gdk_window_begin_paint_region()</function> and
- <function>gdk_window_end_paint()</function> by hand to use
+ <function>gdk_surface_begin_paint_region()</function> and
+ <function>gdk_surface_end_paint()</function> by hand to use
temporary drawing buffers.
</para>
</refsect2>
diff --git a/docs/reference/gtk/glossary.xml b/docs/reference/gtk/glossary.xml
index 7c7488424e..5e4754755f 100644
--- a/docs/reference/gtk/glossary.xml
+++ b/docs/reference/gtk/glossary.xml
@@ -137,7 +137,7 @@
<para>
This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it
- actually shows the GdkWindows it created when it was
+ actually shows the GdkSurfaces it created when it was
<glossterm linkend="realization">realized</glossterm>. When a
widget is mapped, it must turn on its
%GTK_MAPPED <link linkend="GtkWidgetFlags">flag</link>.
@@ -146,7 +146,7 @@
<para>
Note that due to the asynchronous nature of the X window
system, a widget's window may not appear on the screen
- immediatly after one calls gdk_window_show():
+ immediatly after one calls gdk_surface_show():
you must wait for the corresponding map <glossterm
linkend="event">event</glossterm> to be received. You can do
this with the <link
@@ -193,10 +193,10 @@
<glossterm>no-window widget</glossterm>
<glossdef>
<para>
- A widget that does not have a GdkWindow of its own on which to
+ A widget that does not have a GdkSurface of its own on which to
draw its contents, but rather shares its <glossterm
linkend="parent">parent's</glossterm>. This can be tested with
- the gtk_widget_get_has_window() function.
+ the gtk_widget_get_has_surface() function.
</para>
</glossdef>
</glossentry>
@@ -218,20 +218,20 @@
<para>
This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it
- creates its own GdkWindow, or otherwise associates itself with
+ creates its own GdkSurface, or otherwise associates itself with
its <glossterm linkend="parent">parent's</glossterm>
- GdkWindow. If the widget has its own window, then it must
+ GdkSurface. If the widget has its own window, then it must
also attach a <glossterm linkend="style">style</glossterm> to
it. A widget becomes unrealized by destroying its associated
- GdkWindow. When a widget is realized, it must turn on its
+ GdkSurface. When a widget is realized, it must turn on its
%GTK_REALIZED <link linkend="GtkWidgetFlags">flag</link>.
</para>
<para>
- Widgets that don't own the GdkWindow on which they draw are
+ Widgets that don't own the GdkSurface on which they draw are
called <glossterm linkend="no-window">no-window widgets</glossterm>.
- This can be tested with the gtk_widget_get_has_window() function. Normally,
- these widgets draw on their parent's GdkWindow.
+ This can be tested with the gtk_widget_get_has_surface() function. Normally,
+ these widgets draw on their parent's GdkSurface.
</para>
<para>
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index e3a984d3c3..6d1c4b6225 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -2907,7 +2907,7 @@ gtk_text_view_get_line_at_y
gtk_text_view_get_line_yrange
gtk_text_view_get_iter_at_location
gtk_text_view_get_iter_at_position
-gtk_text_view_buffer_to_window_coords
+gtk_text_view_buffer_to_surface_coords
gtk_text_view_window_to_buffer_coords
gtk_text_view_set_border_window_size
gtk_text_view_get_border_window_size
@@ -3642,9 +3642,9 @@ gtk_tree_view_get_visible_rect
gtk_tree_view_get_visible_range
gtk_tree_view_convert_bin_window_to_tree_coords
gtk_tree_view_convert_bin_window_to_widget_coords
-gtk_tree_view_convert_tree_to_bin_window_coords
+gtk_tree_view_convert_tree_to_bin_surface_coords
gtk_tree_view_convert_tree_to_widget_coords
-gtk_tree_view_convert_widget_to_bin_window_coords
+gtk_tree_view_convert_widget_to_bin_surface_coords
gtk_tree_view_convert_widget_to_tree_coords
gtk_tree_view_enable_model_drag_dest
gtk_tree_view_enable_model_drag_source
@@ -4243,8 +4243,8 @@ gtk_widget_set_name
gtk_widget_get_name
gtk_widget_set_sensitive
gtk_widget_set_parent
-gtk_widget_set_parent_window
-gtk_widget_get_parent_window
+gtk_widget_set_parent_surface
+gtk_widget_get_parent_surface
gtk_widget_get_toplevel
gtk_widget_get_ancestor
gtk_widget_is_ancestor
@@ -4300,9 +4300,9 @@ gtk_widget_set_tooltip_window
gtk_widget_get_has_tooltip
gtk_widget_set_has_tooltip
gtk_widget_trigger_tooltip_query
-gtk_widget_get_window
-gtk_widget_register_window
-gtk_widget_unregister_window
+gtk_widget_get_surface
+gtk_widget_register_surface
+gtk_widget_unregister_surface
gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation
@@ -4319,8 +4319,8 @@ gtk_widget_get_can_focus
gtk_widget_set_can_focus
gtk_widget_get_focus_on_click
gtk_widget_set_focus_on_click
-gtk_widget_get_has_window
-gtk_widget_set_has_window
+gtk_widget_get_has_surface
+gtk_widget_set_has_surface
gtk_widget_get_sensitive
gtk_widget_is_sensitive
gtk_widget_get_visible
@@ -4335,7 +4335,7 @@ gtk_widget_has_visible_focus
gtk_widget_has_grab
gtk_widget_is_drawable
gtk_widget_is_toplevel
-gtk_widget_set_window
+gtk_widget_set_surface
gtk_widget_set_receives_default
gtk_widget_get_receives_default
gtk_widget_set_support_multidevice
diff --git a/docs/reference/gtk/input-handling.xml b/docs/reference/gtk/input-handling.xml
index f8e653a1f4..73599bc19d 100644
--- a/docs/reference/gtk/input-handling.xml
+++ b/docs/reference/gtk/input-handling.xml
@@ -91,7 +91,7 @@
<title>Event propagation</title>
<para>
- For widgets which have a #GdkWindow set, events are received from the
+ For widgets which have a #GdkSurface set, events are received from the
windowing system and passed to gtk_main_do_event(). See its documentation
for details of what it does: compression of enter/leave events,
identification of the widget receiving the event, pushing the event onto a
@@ -101,11 +101,11 @@
<para>
When a GDK backend produces an input event, it is tied to a #GdkDevice and
- a #GdkWindow, which in turn represents a windowing system surface in the
+ a #GdkSurface, which in turn represents a windowing system surface in the
backend. If a widget has grabbed the current input device, or all input
devices, the event is propagated to that #GtkWidget. Otherwise, it is
- propagated to the the #GtkWidget which called gtk_widget_register_window()
- on the #GdkWindow receiving the event.
+ propagated to the the #GtkWidget which called gtk_widget_register_surface()
+ on the #GdkSurface receiving the event.
</para>
<para>
@@ -113,7 +113,7 @@
specific input device (gtk_device_grab_add()), is sent events in
preference to a global grab (gtk_grab_add()). Input grabs only have effect
within the #GtkWindowGroup containing the #GtkWidget which registered the
- event’s #GdkWindow. If this #GtkWidget is a child of the grab widget, the
+ event’s #GdkSurface. If this #GtkWidget is a child of the grab widget, the
event is propagated to the child — this is the basis for propagating
events within modal dialogs.
</para>
@@ -186,15 +186,15 @@
Each widget instance has a basic event mask and another per input device,
which determine the types of input event it receives. Each event mask set
on a widget is added to the corresponding (basic or per-device) event mask
- for the widget’s #GdkWindow, and all child #GdkWindows.
+ for the widget’s #GdkSurface, and all child #GdkSurfaces.
</para>
<para>
- Filtering events against event masks happens inside #GdkWindow, which
+ Filtering events against event masks happens inside #GdkSurface, which
exposes event masks to the windowing system to reduce the number of events
GDK receives from it. On receiving an event, it is filtered against the
- #GdkWindow’s mask for the input device, if set. Otherwise, it is filtered
- against the #GdkWindow’s basic event mask.
+ #GdkSurface’s mask for the input device, if set. Otherwise, it is filtered
+ against the #GdkSurface’s basic event mask.
</para>
<para>
diff --git a/docs/reference/gtk/migrating-3to4.xml b/docs/reference/gtk/migrating-3to4.xml
index a162b5e5f0..8a0a4639e9 100644
--- a/docs/reference/gtk/migrating-3to4.xml
+++ b/docs/reference/gtk/migrating-3to4.xml
@@ -79,13 +79,13 @@
<title>Review your window creation flags</title>
<para>
GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use
- gdk_window_set_cursor() to set a cursor on the window after
+ gdk_surface_set_cursor() to set a cursor on the window after
creating it.
</para>
<para>
GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses
an RGBA visual for windows. To prepare your code for this,
- use gdk_window_set_visual (gdk_screen_get_rgba_visual ()) after
+ use gdk_surface_set_visual (gdk_screen_get_rgba_visual ()) after
creating your window.
</para>
<para>
@@ -150,7 +150,7 @@
</section>
<section>
- <title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_window()</title>
+ <title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface()</title>
<para>
These functions are not supported in GTK+ 4. Instead, either use backend-specific
APIs, or render your widgets using gtk_widget_render().
@@ -194,7 +194,7 @@
<title>Stop using the root window</title>
<para>
The root window is an X11-centric concept that is no longer exposed in the
- backend-neutral GDK API. gdk_window_get_parent() will return %NULL for toplevel
+ backend-neutral GDK API. gdk_surface_get_parent() will return %NULL for toplevel
windows. If you need to interact with the X11 root window, you can use
gdk_x11_display_get_xrootwindow() to get its XID.
</para>
@@ -217,12 +217,12 @@
</section>
<section>
- <title>Adapt to GdkWindow API changes</title>
+ <title>Adapt to GdkSurface API changes</title>
<para>
- The gdk_window_new() function has been replaced by a number of more
- specialized constructors: gdk_window_new_toplevel(), gdk_window_new_popup(),
- gdk_window_new_temp(), gdk_window_new_child(), gdk_window_new_input(),
- gdk_wayland_window_new_subsurface(). Use the appropriate ones to create
+ The gdk_surface_new() function has been replaced by a number of more
+ specialized constructors: gdk_surface_new_toplevel(), gdk_surface_new_popup(),
+ gdk_surface_new_temp(), gdk_surface_new_child(), gdk_surface_new_input(),
+ gdk_wayland_surface_new_subsurface(). Use the appropriate ones to create
your windows.
</para>
<para>
@@ -230,7 +230,7 @@
complicating the code and could not be supported across backends.
</para>
<para>
- gdk_window_reparent() is no longer available.
+ gdk_surface_reparent() is no longer available.
</para>
</section>
@@ -244,7 +244,7 @@
</section>
<section>
- <title>Stop using gdk_window_set_event_compression</title>
+ <title>Stop using gdk_surface_set_event_compression</title>
<para>
Event compression is now always enabled. If you need to see the uncoalesced
motion history, use gdk_event_get_motion_history().
@@ -367,7 +367,7 @@
</section>
<section>
- <title>Stop using APIs to query GdkWindows</title>
+ <title>Stop using APIs to query GdkSurfaces</title>
<para>
A number of APIs for querying special-purpose windows have been removed,
since these windows are no longer publically available:
diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml
index 4f1bf02e2d..28a470dd1c 100644
--- a/docs/reference/gtk/question_index.sgml
+++ b/docs/reference/gtk/question_index.sgml
@@ -391,14 +391,14 @@ This comes up when using bitfields; in C you can write the following
code:
<informalexample>
<programlisting>
- gdk_window_set_events (gdk_window,
+ gdk_surface_set_events (gdk_surface,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting>
</informalexample>
while in C++ you must write:
<informalexample>
<programlisting>
- gdk_window_set_events (gdk_window,
+ gdk_surface_set_events (gdk_surface,
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting>
</informalexample>
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c
index d61eb394c8..2269b3fddf 100644
--- a/docs/tools/shooter.c
+++ b/docs/tools/shooter.c
@@ -211,20 +211,20 @@ static GList *toplevels;
static guint shot_id;
static gboolean
-window_is_csd (GdkWindow *window)
+window_is_csd (GdkSurface *window)
{
gboolean set;
GdkWMDecoration decorations = 0;
/* FIXME: is this accurate? */
- set = gdk_window_get_decorations (window, &decorations);
+ set = gdk_surface_get_decorations (window, &decorations);
return (set && (decorations == 0));
}
static gboolean
shoot_one (WidgetInfo *info)
{
- GdkWindow *window;
+ GdkSurface *window;
XID id;
GdkPixbuf *screenshot = NULL;
DecorationType decor = DECOR_FRAME;
@@ -235,8 +235,8 @@ shoot_one (WidgetInfo *info)
gtk_main_quit ();
}
- window = gtk_widget_get_window (info->window);
- id = gdk_x11_window_get_xid (window);
+ window = gtk_widget_get_surface (info->window);
+ id = gdk_x11_surface_get_xid (window);
if (window_is_csd (window))
decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME;
screenshot = take_window_shot (id, decor);
diff --git a/docs/widget_system.txt b/docs/widget_system.txt
index 9463f10db9..1bd94b483a 100644
--- a/docs/widget_system.txt
+++ b/docs/widget_system.txt
@@ -62,23 +62,23 @@ GtkWidget, public flags:
GTK_TOPLEVEL:
Widgets without a real parent, as there are GtkWindows and
GtkMenus have this flag set throughout their lifetime.
- Toplevel widgets always contain their own GdkWindow.
+ Toplevel widgets always contain their own GdkSurface.
GTK_NO_WINDOW:
This flag is indicative for a widget that does not provide
- its own GdkWindow. Visible action (e.g. drawing) is performed
- on the parent's GdkWindow.
+ its own GdkSurface. Visible action (e.g. drawing) is performed
+ on the parent's GdkSurface.
GTK_REALIZED:
Set by gtk_widget_realize, unset by gtk_widget_unrealize.
Relies on ((widget->parent && widget->parent->window)
|| GTK_WIDGET_TOPLEVEL (widget));
- Means: widget has an associated GdkWindow (XWindow).
+ Means: widget has an associated GdkSurface (XWindow).
GTK_MAPPED:
Set by gtk_widget_map, unset by gtk_widget_unmap.
May only be set if GTK_WIDGET_REALIZED (widget).
- Means: gdk_window_show() has been called on the widgets window(s).
+ Means: gdk_surface_show() has been called on the widgets window(s).
GTK_VISIBLE:
Set by gtk_widget_show.
@@ -329,7 +329,7 @@ Adding to a container
When a widget is added to a container, the container:
- 1) calls gtk_widget_set_parent_window (widget, window) if
+ 1) calls gtk_widget_set_parent_surface (widget, window) if
the widget is being added to something other than container->window
2) calls gtk_widget_set_parent (widget, container)
@@ -364,7 +364,7 @@ When a widget receives the "realize" signal it should:
1) set the realized flag
2) set widget->window
- widget->window = gtk_widget_get_parent_window (widget);
+ widget->window = gtk_widget_get_parent_surface (widget);
g_object_ref (widget->window);
3) attach the widget's style
@@ -374,7 +374,7 @@ When a widget receives the "realize" signal it should:
1) set the REALIZED flag
2) create windows with the parent obtained from
- gtk_widget_get_parent_window (widget);
+ gtk_widget_get_parent_surface (widget);
3) attach the widget's style
4) set the background color for the new window based on the style
@@ -382,7 +382,7 @@ The Map signal
--------------
1) Set the MAPPED flag
- 2) If the widget has any windows, gdk_window_show those windows
+ 2) If the widget has any windows, gdk_surface_show those windows
3) call gtk_widget_map for all child widgets that are
VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only
be !CHILD_VISIBLE if the container set it that way, so
@@ -395,7 +395,7 @@ The Unmap signal
When a widget receives the unmap signal, it must:
- 1) If the widget has a window, gdk_window_hide that window,
+ 1) If the widget has a window, gdk_surface_hide that window,
2) If the widget does not have a window, unmap all child widgets
3) Do any other functions related to taking the widget offscreen
(for instance, removing popup windows...)
@@ -409,8 +409,8 @@ When a widget receives the unrealize signal, it must
1) For any windows other than widget->window do:
- gdk_window_set_user_data (window, NULL);
- gdk_window_destroy (window);
+ gdk_surface_set_user_data (window, NULL);
+ gdk_surface_destroy (window);
2) Call the parent's unrealize handler
diff --git a/examples/drawing.c b/examples/drawing.c
index 1eebb34ca4..9001515b43 100644
--- a/examples/drawing.c
+++ b/examples/drawing.c
@@ -30,9 +30,9 @@ size_allocate_cb (GtkWidget *widget,
surface = NULL;
}
- if (gtk_widget_get_window (widget))
+ if (gtk_widget_get_surface (widget))
{
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget));
diff --git a/gdk/broadway/gdkbroadway.h b/gdk/broadway/gdkbroadway.h
index 3e72be0f3b..33a7bff89d 100644
--- a/gdk/broadway/gdkbroadway.h
+++ b/gdk/broadway/gdkbroadway.h
@@ -30,7 +30,7 @@
#define __GDKBROADWAY_H_INSIDE__
#include <gdk/broadway/gdkbroadwaydisplay.h>
-#include <gdk/broadway/gdkbroadwaywindow.h>
+#include <gdk/broadway/gdkbroadwaysurface.h>
#include <gdk/broadway/gdkbroadwaycursor.h>
#include <gdk/broadway/gdkbroadwaymonitor.h>
diff --git a/gdk/broadway/gdkbroadwaywindow.h b/gdk/broadway/gdkbroadwaysurface.h
index 914ec278e6..12ce448c51 100644
--- a/gdk/broadway/gdkbroadwaywindow.h
+++ b/gdk/broadway/gdkbroadwaysurface.h
@@ -22,33 +22,33 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_BROADWAY_WINDOW_H__
-#define __GDK_BROADWAY_WINDOW_H__
+#ifndef __GDK_BROADWAY_SURFACE_H__
+#define __GDK_BROADWAY_SURFACE_H__
#include <gdk/gdk.h>
G_BEGIN_DECLS
-#define GDK_TYPE_BROADWAY_WINDOW (gdk_broadway_window_get_type ())
-#define GDK_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindow))
-#define GDK_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
-#define GDK_IS_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_WINDOW))
-#define GDK_IS_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_WINDOW))
-#define GDK_BROADWAY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
+#define GDK_TYPE_BROADWAY_SURFACE (gdk_broadway_surface_get_type ())
+#define GDK_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurface))
+#define GDK_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
+#define GDK_IS_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SURFACE))
+#define GDK_IS_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SURFACE))
+#define GDK_BROADWAY_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
#ifdef GDK_COMPILATION
-typedef struct _GdkBroadwayWindow GdkBroadwayWindow;
+typedef struct _GdkBroadwaySurface GdkBroadwaySurface;
#else
-typedef GdkWindow GdkBroadwayWindow;
+typedef GdkSurface GdkBroadwaySurface;
#endif
-typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass;
+typedef struct _GdkBroadwaySurfaceClass GdkBroadwaySurfaceClass;
GDK_AVAILABLE_IN_ALL
-GType gdk_broadway_window_get_type (void);
+GType gdk_broadway_surface_get_type (void);
GDK_AVAILABLE_IN_ALL
-guint32 gdk_broadway_get_last_seen_time (GdkWindow *window);
+guint32 gdk_broadway_get_last_seen_time (GdkSurface *window);
G_END_DECLS
-#endif /* __GDK_BROADWAY_WINDOW_H__ */
+#endif /* __GDK_BROADWAY_SURFACE_H__ */
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c
index 3a50d6ed75..baff0c0360 100644
--- a/gdk/broadway/gdkdevice-broadway.c
+++ b/gdk/broadway/gdkdevice-broadway.c
@@ -20,49 +20,49 @@
#include "gdkdevice-broadway.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkprivate-broadway.h"
static gboolean gdk_broadway_device_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_broadway_device_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask);
-static void gdk_broadway_device_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+static void gdk_broadway_device_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor);
static void gdk_broadway_device_warp (GdkDevice *device,
gdouble x,
gdouble y);
static void gdk_broadway_device_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_broadway_device_ungrab (GdkDevice *device,
guint32 time_);
-static GdkWindow * gdk_broadway_device_window_at_position (GdkDevice *device,
+static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
-static void gdk_broadway_device_select_window_events (GdkDevice *device,
- GdkWindow *window,
+static void gdk_broadway_device_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask);
@@ -75,13 +75,13 @@ gdk_broadway_device_class_init (GdkBroadwayDeviceClass *klass)
device_class->get_history = gdk_broadway_device_get_history;
device_class->get_state = gdk_broadway_device_get_state;
- device_class->set_window_cursor = gdk_broadway_device_set_window_cursor;
+ device_class->set_surface_cursor = gdk_broadway_device_set_surface_cursor;
device_class->warp = gdk_broadway_device_warp;
device_class->query_state = gdk_broadway_device_query_state;
device_class->grab = gdk_broadway_device_grab;
device_class->ungrab = gdk_broadway_device_ungrab;
- device_class->window_at_position = gdk_broadway_device_window_at_position;
- device_class->select_window_events = gdk_broadway_device_select_window_events;
+ device_class->surface_at_position = gdk_broadway_device_surface_at_position;
+ device_class->select_surface_events = gdk_broadway_device_select_surface_events;
}
static void
@@ -97,7 +97,7 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
static gboolean
gdk_broadway_device_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -108,13 +108,13 @@ gdk_broadway_device_get_history (GdkDevice *device,
static void
gdk_broadway_device_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x, y;
- gdk_window_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position_double (window, device, &x, &y, mask);
if (axes)
{
@@ -124,8 +124,8 @@ gdk_broadway_device_get_state (GdkDevice *device,
}
static void
-gdk_broadway_device_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_broadway_device_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor)
{
}
@@ -139,8 +139,8 @@ gdk_broadway_device_warp (GdkDevice *device,
static void
gdk_broadway_device_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -177,7 +177,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
*mask = mask32;
if (child_window)
{
- GdkWindow *mouse_toplevel;
+ GdkSurface *mouse_toplevel;
mouse_toplevel = g_hash_table_lookup (broadway_display->id_ht, GUINT_TO_POINTER (mouse_toplevel_id));
if (window == NULL)
@@ -190,10 +190,10 @@ gdk_broadway_device_query_state (GdkDevice *device,
}
void
-_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
+_gdk_broadway_surface_grab_check_unmap (GdkSurface *window,
gulong serial)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
GdkSeat *seat;
GList *devices, *d;
@@ -212,9 +212,9 @@ _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
void
-_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
+_gdk_broadway_surface_grab_check_destroy (GdkSurface *window)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
GdkSeat *seat;
GdkDeviceGrabInfo *grab;
GList *devices, *d;
@@ -230,7 +230,7 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
/* Make sure there is no lasting grab in this native window */
grab = _gdk_display_get_last_device_grab (display, d->data);
- if (grab && grab->native_window == window)
+ if (grab && grab->native_surface == window)
{
grab->serial_end = grab->serial_start;
grab->implicit_ungrab = TRUE;
@@ -244,10 +244,10 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
static GdkGrabStatus
gdk_broadway_device_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -266,7 +266,7 @@ gdk_broadway_device_grab (GdkDevice *device,
{
/* Device is a pointer */
return _gdk_broadway_server_grab_pointer (broadway_display->server,
- GDK_WINDOW_IMPL_BROADWAY (window->impl)->id,
+ GDK_SURFACE_IMPL_BROADWAY (window->impl)->id,
owner_events,
event_mask,
time_);
@@ -311,14 +311,14 @@ gdk_broadway_device_ungrab (GdkDevice *device,
}
}
-static GdkWindow *
-gdk_broadway_device_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- GdkWindow *window;
+ GdkSurface *window;
gdk_broadway_device_query_state (device, NULL, &window, NULL, NULL, win_x, win_y, mask);
@@ -326,8 +326,8 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
}
static void
-gdk_broadway_device_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_broadway_device_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask)
{
}
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index 1f5abd1c27..80c9975254 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -181,10 +181,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
toplevels = broadway_display->toplevels;
for (l = toplevels; l != NULL; l = l->next)
{
- GdkWindowImplBroadway *toplevel_impl = l->data;
+ GdkSurfaceImplBroadway *toplevel_impl = l->data;
if (toplevel_impl->maximized)
- gdk_window_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
+ gdk_surface_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
}
}
@@ -313,7 +313,7 @@ gdk_broadway_display_has_pending (GdkDisplay *display)
return FALSE;
}
-static GdkWindow *
+static GdkSurface *
gdk_broadway_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@@ -520,7 +520,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
object_class->dispose = gdk_broadway_display_dispose;
object_class->finalize = gdk_broadway_display_finalize;
- display_class->window_type = GDK_TYPE_BROADWAY_WINDOW;
+ display_class->surface_type = GDK_TYPE_BROADWAY_SURFACE;
display_class->get_name = gdk_broadway_display_get_name;
display_class->beep = gdk_broadway_display_beep;
@@ -534,7 +534,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
- display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
+ display_class->create_surface_impl = _gdk_broadway_display_create_surface_impl;
display_class->get_keymap = _gdk_broadway_display_get_keymap;
display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target;
diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h
index 51d59ae077..25a962ac66 100644
--- a/gdk/broadway/gdkdisplay-broadway.h
+++ b/gdk/broadway/gdkdisplay-broadway.h
@@ -26,7 +26,7 @@
#include "gdkdisplayprivate.h"
#include "gdkkeys.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
#include "gdkbroadway-server.h"
#include "gdkmonitorprivate.h"
diff --git a/gdk/broadway/gdkdnd-broadway.c b/gdk/broadway/gdkdnd-broadway.c
index cbbd63af38..91023fa8f2 100644
--- a/gdk/broadway/gdkdnd-broadway.c
+++ b/gdk/broadway/gdkdnd-broadway.c
@@ -84,7 +84,7 @@ gdk_broadway_drag_context_finalize (GObject *object)
/* Drag Contexts */
GdkDragContext *
-_gdk_broadway_window_drag_begin (GdkWindow *window,
+_gdk_broadway_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -94,10 +94,10 @@ _gdk_broadway_window_drag_begin (GdkWindow *window,
GdkDragContext *new_context;
g_return_val_if_fail (window != NULL, NULL);
- g_return_val_if_fail (GDK_WINDOW_IS_BROADWAY (window), NULL);
+ g_return_val_if_fail (GDK_SURFACE_IS_BROADWAY (window), NULL);
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
- "display", gdk_window_get_display (window),
+ "display", gdk_surface_get_display (window),
"content", content,
NULL);
@@ -145,7 +145,7 @@ gdk_broadway_drag_context_drop_finish (GdkDragContext *context,
}
void
-_gdk_broadway_window_register_dnd (GdkWindow *window)
+_gdk_broadway_surface_register_dnd (GdkSurface *window)
{
}
diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c
index f0d2e16cd6..4f2e67da98 100644
--- a/gdk/broadway/gdkeventsource.c
+++ b/gdk/broadway/gdkeventsource.c
@@ -88,7 +88,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
GdkDisplay *display;
GdkBroadwayDisplay *display_broadway;
GdkSeat *seat;
- GdkWindow *window;
+ GdkSurface *window;
GdkEvent *event = NULL;
GList *node;
GSList *list, *d;
@@ -117,7 +117,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_ENTER_NOTIFY);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->crossing.time = message->base.time;
event->crossing.x = message->pointer.win_x;
event->crossing.y = message->pointer.win_y;
@@ -137,7 +137,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_LEAVE_NOTIFY);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->crossing.time = message->base.time;
event->crossing.x = message->pointer.win_x;
event->crossing.y = message->pointer.win_y;
@@ -160,7 +160,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_MOTION_NOTIFY);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->motion.time = message->base.time;
event->motion.x = message->pointer.win_x;
event->motion.y = message->pointer.win_y;
@@ -184,7 +184,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (message->base.type == 'b' ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->button.time = message->base.time;
event->button.x = message->pointer.win_x;
event->button.y = message->pointer.win_y;
@@ -204,7 +204,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_SCROLL);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->scroll.time = message->base.time;
event->scroll.x = message->pointer.win_x;
event->scroll.y = message->pointer.win_y;
@@ -243,7 +243,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
break;
event = gdk_event_new (event_type);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->touch.sequence = GUINT_TO_POINTER(message->touch.sequence_id);
event->touch.emulating_pointer = message->touch.is_emulated;
event->touch.time = message->base.time;
@@ -279,7 +279,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (message->base.type == 'k' ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->key.time = message->base.time;
event->key.keyval = message->key.key;
event->key.state = message->key.state;
@@ -306,7 +306,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
window->y = message->configure_notify.y;
event = gdk_event_new (GDK_CONFIGURE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->configure.x = message->configure_notify.x;
event->configure.y = message->configure_notify.y;
event->configure.width = message->configure_notify.width;
@@ -340,7 +340,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->focus_change.in = FALSE;
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
node = _gdk_event_queue_append (display, event);
@@ -350,7 +350,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
if (window)
{
event = gdk_event_new (GDK_FOCUS_CHANGE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->focus_change.in = TRUE;
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
node = _gdk_event_queue_append (display, event);
diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h
index 161d03367d..b899517cd2 100644
--- a/gdk/broadway/gdkprivate-broadway.h
+++ b/gdk/broadway/gdkprivate-broadway.h
@@ -31,41 +31,41 @@
#include <gdk/gdkcursor.h>
#include <gdk/gdkinternals.h>
-#include "gdkwindow-broadway.h"
+#include "gdksurface-broadway.h"
#include "gdkdisplay-broadway.h"
#include "gdkbroadwaycursor.h"
-#include "gdkbroadwaywindow.h"
+#include "gdkbroadwaysurface.h"
void _gdk_broadway_resync_windows (void);
guint32 gdk_broadway_display_ensure_texture (GdkDisplay *display,
GdkTexture *texture);
-void gdk_broadway_window_set_nodes (GdkWindow *window,
+void gdk_broadway_surface_set_nodes (GdkSurface *window,
GArray *nodes,
GPtrArray *node_textures);
-void _gdk_broadway_window_register_dnd (GdkWindow *window);
-GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window,
+void _gdk_broadway_surface_register_dnd (GdkSurface *window);
+GdkDragContext * _gdk_broadway_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
gint dx,
gint dy);
-void _gdk_broadway_window_translate (GdkWindow *window,
+void _gdk_broadway_surface_translate (GdkSurface *window,
cairo_region_t *area,
gint dx,
gint dy);
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
BroadwayInputMsg *msg);
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
- GdkWindow *window);
-void _gdk_broadway_roundtrip_notify (GdkWindow *window,
+ GdkSurface *window);
+void _gdk_broadway_roundtrip_notify (GdkSurface *window,
guint32 tag,
gboolean local_reply);
-void _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
-void _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
+void _gdk_broadway_surface_grab_check_destroy (GdkSurface *window);
+void _gdk_broadway_surface_grab_check_unmap (GdkSurface *window,
gulong serial);
void _gdk_keymap_keys_changed (GdkDisplay *display);
@@ -99,11 +99,11 @@ void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
-void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_broadway_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding,
gint format,
@@ -120,11 +120,11 @@ BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display,
gboolean remove);
/* Window methods - testing */
-void _gdk_broadway_window_resize_surface (GdkWindow *window);
+void _gdk_broadway_surface_resize_surface (GdkSurface *window);
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
-#define GDK_WINDOW_IS_BROADWAY(win) (GDK_IS_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl))
+#define GDK_SURFACE_IS_BROADWAY(win) (GDK_IS_SURFACE_IMPL_BROADWAY (((GdkSurface *)win)->impl))
#endif /* __GDK_PRIVATE_BROADWAY_H__ */
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdksurface-broadway.c
index ebbd03e658..0d71b59e50 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -25,12 +25,12 @@
#include "config.h"
-#include "gdkwindow-broadway.h"
+#include "gdksurface-broadway.h"
#include "gdkbroadwaydisplay.h"
#include "gdkdisplay.h"
-#include "gdkwindow.h"
-#include "gdkwindowimpl.h"
+#include "gdksurface.h"
+#include "gdksurfaceimpl.h"
#include "gdkdisplay-broadway.h"
#include "gdkprivate-broadway.h"
#include "gdkinternals.h"
@@ -44,34 +44,34 @@
#include <string.h>
/* Forward declarations */
-static void gdk_window_impl_broadway_finalize (GObject *object);
+static void gdk_surface_impl_broadway_finalize (GObject *object);
-#define WINDOW_IS_TOPLEVEL(window) \
- (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
+#define SURFACE_IS_TOPLEVEL(window) \
+ (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
-struct _GdkBroadwayWindow {
- GdkWindow parent;
+struct _GdkBroadwaySurface {
+ GdkSurface parent;
};
-struct _GdkBroadwayWindowClass {
- GdkWindowClass parent_class;
+struct _GdkBroadwaySurfaceClass {
+ GdkSurfaceClass parent_class;
};
-G_DEFINE_TYPE (GdkBroadwayWindow, gdk_broadway_window, GDK_TYPE_WINDOW)
+G_DEFINE_TYPE (GdkBroadwaySurface, gdk_broadway_surface, GDK_TYPE_SURFACE)
static void
-gdk_broadway_window_class_init (GdkBroadwayWindowClass *broadway_window_class)
+gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *broadway_surface_class)
{
}
static void
-gdk_broadway_window_init (GdkBroadwayWindow *broadway_window)
+gdk_broadway_surface_init (GdkBroadwaySurface *broadway_surface)
{
}
-G_DEFINE_TYPE (GdkWindowImplBroadway,
- gdk_window_impl_broadway,
- GDK_TYPE_WINDOW_IMPL)
+G_DEFINE_TYPE (GdkSurfaceImplBroadway,
+ gdk_surface_impl_broadway,
+ GDK_TYPE_SURFACE_IMPL)
static GdkDisplay *
find_broadway_display (void)
@@ -111,7 +111,7 @@ flush_idle (gpointer data)
is frozen during e.g. window resizes so the paint will not happen
and the window resize request is never flushed. */
static void
-queue_flush (GdkWindow *window)
+queue_flush (GdkSurface *window)
{
if (flush_id == 0)
{
@@ -121,27 +121,27 @@ queue_flush (GdkWindow *window)
}
static void
-gdk_window_impl_broadway_init (GdkWindowImplBroadway *impl)
+gdk_surface_impl_broadway_init (GdkSurfaceImplBroadway *impl)
{
- impl->toplevel_window_type = -1;
+ impl->toplevel_surface_type = -1;
}
static void
-gdk_window_impl_broadway_finalize (GObject *object)
+gdk_surface_impl_broadway_finalize (GObject *object)
{
- GdkWindow *wrapper;
- GdkWindowImplBroadway *impl;
+ GdkSurface *wrapper;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- g_return_if_fail (GDK_IS_WINDOW_IMPL_BROADWAY (object));
+ g_return_if_fail (GDK_IS_SURFACE_IMPL_BROADWAY (object));
- impl = GDK_WINDOW_IMPL_BROADWAY (object);
+ impl = GDK_SURFACE_IMPL_BROADWAY (object);
wrapper = impl->wrapper;
- _gdk_broadway_window_grab_check_destroy (wrapper);
+ _gdk_broadway_surface_grab_check_destroy (wrapper);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper));
g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER(impl->id));
@@ -150,7 +150,7 @@ gdk_window_impl_broadway_finalize (GObject *object)
broadway_display->toplevels = g_list_remove (broadway_display->toplevels, impl);
- G_OBJECT_CLASS (gdk_window_impl_broadway_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gdk_surface_impl_broadway_parent_class)->finalize (object);
}
static gboolean
@@ -162,11 +162,11 @@ thaw_clock_cb (GdkFrameClock *clock)
}
void
-_gdk_broadway_roundtrip_notify (GdkWindow *window,
+_gdk_broadway_roundtrip_notify (GdkSurface *window,
guint32 tag,
gboolean local_reply)
{
- GdkFrameClock *clock = gdk_window_get_frame_clock (window);
+ GdkFrameClock *clock = gdk_surface_get_frame_clock (window);
/* If there is no remove web client, rate limit update to once a second */
if (local_reply)
@@ -177,13 +177,13 @@ _gdk_broadway_roundtrip_notify (GdkWindow *window,
static void
on_frame_clock_after_paint (GdkFrameClock *clock,
- GdkWindow *window)
+ GdkSurface *window)
{
- GdkDisplay *display = gdk_window_get_display (window);
- GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ GdkDisplay *display = gdk_surface_get_display (window);
+ GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
GdkBroadwayDisplay *broadway_display;
- _gdk_frame_clock_freeze (gdk_window_get_frame_clock (window));
+ _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window));
broadway_display = GDK_BROADWAY_DISPLAY (display);
@@ -193,11 +193,11 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
}
static void
-connect_frame_clock (GdkWindow *window)
+connect_frame_clock (GdkSurface *window)
{
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
{
- GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
+ GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window);
g_signal_connect (frame_clock, "after-paint",
G_CALLBACK (on_frame_clock_after_paint), window);
@@ -205,30 +205,30 @@ connect_frame_clock (GdkWindow *window)
}
void
-_gdk_broadway_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_broadway_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
broadway_display = GDK_BROADWAY_DISPLAY (display);
- impl = g_object_new (GDK_TYPE_WINDOW_IMPL_BROADWAY, NULL);
- window->impl = (GdkWindowImpl *)impl;
+ impl = g_object_new (GDK_TYPE_SURFACE_IMPL_BROADWAY, NULL);
+ window->impl = (GdkSurfaceImpl *)impl;
impl->id = _gdk_broadway_server_new_surface (broadway_display->server,
window->x,
window->y,
window->width,
window->height,
- window->window_type == GDK_WINDOW_TEMP);
+ window->surface_type == GDK_SURFACE_TEMP);
g_hash_table_insert (broadway_display->id_ht, GINT_TO_POINTER(impl->id), window);
impl->wrapper = window;
- g_assert (window->window_type == GDK_WINDOW_TOPLEVEL ||
- window->window_type == GDK_WINDOW_TEMP);
+ g_assert (window->surface_type == GDK_SURFACE_TOPLEVEL ||
+ window->surface_type == GDK_SURFACE_TEMP);
g_assert (window->parent == NULL);
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
@@ -237,37 +237,37 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
}
static cairo_surface_t *
-gdk_window_broadway_ref_cairo_surface (GdkWindow *window)
+gdk_surface_broadway_ref_cairo_surface (GdkSurface *window)
{
- GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
- if (GDK_IS_WINDOW_IMPL_BROADWAY (window) &&
- GDK_WINDOW_DESTROYED (impl->wrapper))
+ if (GDK_IS_SURFACE_IMPL_BROADWAY (window) &&
+ GDK_SURFACE_DESTROYED (impl->wrapper))
return NULL;
return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
}
static void
-_gdk_broadway_window_destroy (GdkWindow *window,
+_gdk_broadway_surface_destroy (GdkSurface *window,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
if (impl->node_data)
g_array_unref (impl->node_data);
if (impl->node_data_textures)
g_ptr_array_unref (impl->node_data_textures);
- _gdk_broadway_window_grab_check_destroy (window);
+ _gdk_broadway_surface_grab_check_destroy (window);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER (impl->id));
_gdk_broadway_server_destroy_surface (broadway_display->server, impl->id);
@@ -275,18 +275,18 @@ _gdk_broadway_window_destroy (GdkWindow *window,
}
void
-gdk_broadway_window_set_nodes (GdkWindow *window,
+gdk_broadway_surface_set_nodes (GdkSurface *window,
GArray *nodes,
GPtrArray *node_textures)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
if (nodes)
g_array_ref (nodes);
@@ -306,82 +306,82 @@ gdk_broadway_window_set_nodes (GdkWindow *window,
/* This function is called when the XWindow is really gone.
*/
static void
-gdk_broadway_window_destroy_notify (GdkWindow *window)
+gdk_broadway_surface_destroy_notify (GdkSurface *window)
{
- if (!GDK_WINDOW_DESTROYED (window))
- _gdk_window_destroy (window, TRUE);
+ if (!GDK_SURFACE_DESTROYED (window))
+ _gdk_surface_destroy (window, TRUE);
g_object_unref (window);
}
static void
-gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped)
+gdk_surface_broadway_show (GdkSurface *window, gboolean already_mapped)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
impl->visible = TRUE;
if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (window), GDK_MAP, NULL, FALSE);
+ _gdk_make_event (GDK_SURFACE (window), GDK_MAP, NULL, FALSE);
if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (window), GDK_MAP, NULL, FALSE);
+ _gdk_make_event (GDK_SURFACE (window), GDK_MAP, NULL, FALSE);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
if (_gdk_broadway_server_surface_show (broadway_display->server, impl->id))
queue_flush (window);
}
static void
-gdk_window_broadway_hide (GdkWindow *window)
+gdk_surface_broadway_hide (GdkSurface *window)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
impl->visible = FALSE;
if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
+ _gdk_make_event (GDK_SURFACE (window), GDK_UNMAP, NULL, FALSE);
if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
+ _gdk_make_event (GDK_SURFACE (window), GDK_UNMAP, NULL, FALSE);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
- _gdk_broadway_window_grab_check_unmap (window,
+ _gdk_broadway_surface_grab_check_unmap (window,
_gdk_broadway_server_get_next_serial (broadway_display->server));
if (_gdk_broadway_server_surface_hide (broadway_display->server, impl->id))
queue_flush (window);
- _gdk_window_clear_update_area (window);
+ _gdk_surface_clear_update_area (window);
}
static void
-gdk_window_broadway_withdraw (GdkWindow *window)
+gdk_surface_broadway_withdraw (GdkSurface *window)
{
- gdk_window_broadway_hide (window);
+ gdk_surface_broadway_hide (window);
}
static void
-gdk_window_broadway_move_resize (GdkWindow *window,
+gdk_surface_broadway_move_resize (GdkSurface *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
GdkBroadwayDisplay *broadway_display;
gboolean size_changed;
size_changed = FALSE;
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
if (width > 0 || height > 0)
{
@@ -416,141 +416,141 @@ gdk_window_broadway_move_resize (GdkWindow *window,
}
static void
-gdk_window_broadway_raise (GdkWindow *window)
+gdk_surface_broadway_raise (GdkSurface *window)
{
}
static void
-gdk_window_broadway_restack_toplevel (GdkWindow *window,
- GdkWindow *sibling,
+gdk_surface_broadway_restack_toplevel (GdkSurface *window,
+ GdkSurface *sibling,
gboolean above)
{
}
static void
-gdk_window_broadway_lower (GdkWindow *window)
+gdk_surface_broadway_lower (GdkSurface *window)
{
}
static void
-gdk_broadway_window_focus (GdkWindow *window,
+gdk_broadway_surface_focus (GdkSurface *window,
guint32 timestamp)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
+ if (GDK_SURFACE_DESTROYED (window) ||
!window->accept_focus)
return;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
- broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
+ broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window));
_gdk_broadway_server_surface_focus (broadway_display->server,
impl->id);
}
static void
-gdk_broadway_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
+gdk_broadway_surface_set_type_hint (GdkSurface *window,
+ GdkSurfaceTypeHint hint)
{
}
-static GdkWindowTypeHint
-gdk_broadway_window_get_type_hint (GdkWindow *window)
+static GdkSurfaceTypeHint
+gdk_broadway_surface_get_type_hint (GdkSurface *window)
{
- return GDK_WINDOW_TYPE_HINT_NORMAL;
+ return GDK_SURFACE_TYPE_HINT_NORMAL;
}
static void
-gdk_broadway_window_set_modal_hint (GdkWindow *window,
+gdk_broadway_surface_set_modal_hint (GdkSurface *window,
gboolean modal)
{
}
static void
-gdk_broadway_window_set_skip_taskbar_hint (GdkWindow *window,
+gdk_broadway_surface_set_skip_taskbar_hint (GdkSurface *window,
gboolean skips_taskbar)
{
}
static void
-gdk_broadway_window_set_skip_pager_hint (GdkWindow *window,
+gdk_broadway_surface_set_skip_pager_hint (GdkSurface *window,
gboolean skips_pager)
{
}
static void
-gdk_broadway_window_set_urgency_hint (GdkWindow *window,
+gdk_broadway_surface_set_urgency_hint (GdkSurface *window,
gboolean urgent)
{
}
static void
-gdk_broadway_window_set_geometry_hints (GdkWindow *window,
+gdk_broadway_surface_set_geometry_hints (GdkSurface *window,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
+ GdkSurfaceHints geom_mask)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
impl->geometry_hints = *geometry;
impl->geometry_hints_mask = geom_mask;
}
static void
-gdk_broadway_window_set_title (GdkWindow *window,
+gdk_broadway_surface_set_title (GdkSurface *window,
const gchar *title)
{
}
static void
-gdk_broadway_window_set_role (GdkWindow *window,
+gdk_broadway_surface_set_role (GdkSurface *window,
const gchar *role)
{
}
static void
-gdk_broadway_window_set_startup_id (GdkWindow *window,
+gdk_broadway_surface_set_startup_id (GdkSurface *window,
const gchar *startup_id)
{
}
static void
-gdk_broadway_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
+gdk_broadway_surface_set_transient_for (GdkSurface *window,
+ GdkSurface *parent)
{
GdkBroadwayDisplay *display;
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
int parent_id;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
parent_id = 0;
if (parent)
- parent_id = GDK_WINDOW_IMPL_BROADWAY (parent->impl)->id;
+ parent_id = GDK_SURFACE_IMPL_BROADWAY (parent->impl)->id;
impl->transient_for = parent_id;
- display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper));
+ display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper));
_gdk_broadway_server_surface_set_transient_for (display->server, impl->id, impl->transient_for);
}
static void
-gdk_window_broadway_get_geometry (GdkWindow *window,
+gdk_surface_broadway_get_geometry (GdkSurface *window,
gint *x,
gint *y,
gint *width,
gint *height)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
/* TODO: These should really roundtrip to the client to get the current data */
@@ -566,15 +566,15 @@ gdk_window_broadway_get_geometry (GdkWindow *window,
}
static void
-gdk_window_broadway_get_root_coords (GdkWindow *window,
+gdk_surface_broadway_get_root_coords (GdkSurface *window,
gint x,
gint y,
gint *root_x,
gint *root_y)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
if (root_x)
*root_x = x + impl->wrapper->x;
@@ -583,7 +583,7 @@ gdk_window_broadway_get_root_coords (GdkWindow *window,
}
static void
-gdk_broadway_window_get_frame_extents (GdkWindow *window,
+gdk_broadway_surface_get_frame_extents (GdkSurface *window,
GdkRectangle *rect)
{
g_return_if_fail (rect != NULL);
@@ -597,17 +597,17 @@ gdk_broadway_window_get_frame_extents (GdkWindow *window,
}
static gboolean
-gdk_window_broadway_get_device_state (GdkWindow *window,
+gdk_surface_broadway_get_device_state (GdkSurface *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
- GdkWindow *child;
+ GdkSurface *child;
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return FALSE;
GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
@@ -618,25 +618,25 @@ gdk_window_broadway_get_device_state (GdkWindow *window,
}
static GdkEventMask
-gdk_window_broadway_get_events (GdkWindow *window)
+gdk_surface_broadway_get_events (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return 0;
return 0;
}
static void
-gdk_window_broadway_set_events (GdkWindow *window,
+gdk_surface_broadway_set_events (GdkSurface *window,
GdkEventMask event_mask)
{
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (window))
{
}
}
static void
-gdk_window_broadway_shape_combine_region (GdkWindow *window,
+gdk_surface_broadway_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
@@ -644,7 +644,7 @@ gdk_window_broadway_shape_combine_region (GdkWindow *window,
}
static void
-gdk_window_broadway_input_shape_combine_region (GdkWindow *window,
+gdk_surface_broadway_input_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
@@ -652,7 +652,7 @@ gdk_window_broadway_input_shape_combine_region (GdkWindow *window,
}
static void
-gdk_broadway_window_set_accept_focus (GdkWindow *window,
+gdk_broadway_surface_set_accept_focus (GdkSurface *window,
gboolean accept_focus)
{
accept_focus = accept_focus != FALSE;
@@ -664,7 +664,7 @@ gdk_broadway_window_set_accept_focus (GdkWindow *window,
}
static void
-gdk_broadway_window_set_focus_on_map (GdkWindow *window,
+gdk_broadway_surface_set_focus_on_map (GdkSurface *window,
gboolean focus_on_map)
{
focus_on_map = focus_on_map != FALSE;
@@ -677,17 +677,17 @@ gdk_broadway_window_set_focus_on_map (GdkWindow *window,
static void
-gdk_broadway_window_set_icon_list (GdkWindow *window,
+gdk_broadway_surface_set_icon_list (GdkSurface *window,
GList *surfaces)
{
}
static void
-gdk_broadway_window_set_icon_name (GdkWindow *window,
+gdk_broadway_surface_set_icon_name (GdkSurface *window,
const gchar *name)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"),
@@ -695,93 +695,93 @@ gdk_broadway_window_set_icon_name (GdkWindow *window,
}
static void
-gdk_broadway_window_iconify (GdkWindow *window)
+gdk_broadway_surface_iconify (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_deiconify (GdkWindow *window)
+gdk_broadway_surface_deiconify (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_stick (GdkWindow *window)
+gdk_broadway_surface_stick (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_unstick (GdkWindow *window)
+gdk_broadway_surface_unstick (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_maximize (GdkWindow *window)
+gdk_broadway_surface_maximize (GdkSurface *window)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle geom;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
if (impl->maximized)
return;
impl->maximized = TRUE;
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED);
impl->pre_maximize_x = window->x;
impl->pre_maximize_y = window->y;
impl->pre_maximize_width = window->width;
impl->pre_maximize_height = window->height;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
monitor = gdk_display_get_primary_monitor (display);
gdk_monitor_get_geometry (monitor, &geom);
- gdk_window_move_resize (window,
+ gdk_surface_move_resize (window,
geom.x, geom.y,
geom.width, geom.height);
}
static void
-gdk_broadway_window_unmaximize (GdkWindow *window)
+gdk_broadway_surface_unmaximize (GdkSurface *window)
{
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
if (!impl->maximized)
return;
impl->maximized = FALSE;
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0);
- gdk_window_move_resize (window,
+ gdk_surface_move_resize (window,
impl->pre_maximize_x,
impl->pre_maximize_y,
impl->pre_maximize_width,
@@ -789,101 +789,101 @@ gdk_broadway_window_unmaximize (GdkWindow *window)
}
static void
-gdk_broadway_window_fullscreen (GdkWindow *window)
+gdk_broadway_surface_fullscreen (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_unfullscreen (GdkWindow *window)
+gdk_broadway_surface_unfullscreen (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_set_keep_above (GdkWindow *window,
+gdk_broadway_surface_set_keep_above (GdkSurface *window,
gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_set_keep_below (GdkWindow *window, gboolean setting)
+gdk_broadway_surface_set_keep_below (GdkSurface *window, gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
-static GdkWindow *
-gdk_broadway_window_get_group (GdkWindow *window)
+static GdkSurface *
+gdk_broadway_surface_get_group (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return NULL;
return window;
}
static void
-gdk_broadway_window_set_group (GdkWindow *window,
- GdkWindow *leader)
+gdk_broadway_surface_set_group (GdkSurface *window,
+ GdkSurface *leader)
{
}
static void
-gdk_broadway_window_set_decorations (GdkWindow *window,
+gdk_broadway_surface_set_decorations (GdkSurface *window,
GdkWMDecoration decorations)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static gboolean
-gdk_broadway_window_get_decorations (GdkWindow *window,
+gdk_broadway_surface_get_decorations (GdkSurface *window,
GdkWMDecoration *decorations)
{
gboolean result = FALSE;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return FALSE;
return result;
}
static void
-gdk_broadway_window_set_functions (GdkWindow *window,
+gdk_broadway_surface_set_functions (GdkSurface *window,
GdkWMFunction functions)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_broadway_window_end_paint (GdkWindow *window)
+gdk_broadway_surface_end_paint (GdkSurface *window)
{
- GdkWindowImplBroadway *impl;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ GdkSurfaceImplBroadway *impl;
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
impl->dirty = TRUE;
}
@@ -893,10 +893,10 @@ struct _MoveResizeData
{
GdkDisplay *display;
- GdkWindow *moveresize_window;
- GdkWindow *moveresize_emulation_window;
+ GdkSurface *moveresize_window;
+ GdkSurface *moveresize_emulation_window;
gboolean is_resize;
- GdkWindowEdge resize_edge;
+ GdkSurfaceEdge resize_edge;
gint moveresize_button;
gint moveresize_x;
gint moveresize_y;
@@ -905,7 +905,7 @@ struct _MoveResizeData
gint moveresize_orig_width;
gint moveresize_orig_height;
long moveresize_process_time;
- GdkWindowHints moveresize_geom_mask;
+ GdkSurfaceHints moveresize_geom_mask;
GdkGeometry moveresize_geometry;
BroadwayInputMsg *moveresize_pending_event;
};
@@ -954,37 +954,37 @@ update_pos (MoveResizeData *mv_resize,
switch (mv_resize->resize_edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
x += dx;
y += dy;
w -= dx;
h -= dy;
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
y += dy;
h -= dy;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
y += dy;
h -= dy;
w += dx;
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
h += dy;
x += dx;
w -= dx;
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
w += dx;
h += dy;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
h += dy;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
w += dx;
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
x += dx;
w -= dx;
break;
@@ -999,12 +999,12 @@ update_pos (MoveResizeData *mv_resize,
if (mv_resize->moveresize_geom_mask)
{
- gdk_window_constrain_size (&mv_resize->moveresize_geometry,
+ gdk_surface_constrain_size (&mv_resize->moveresize_geometry,
mv_resize->moveresize_geom_mask,
w, h, &w, &h);
}
- gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h);
+ gdk_surface_move_resize (mv_resize->moveresize_window, x, y, w, h);
}
else
{
@@ -1013,14 +1013,14 @@ update_pos (MoveResizeData *mv_resize,
x = mv_resize->moveresize_orig_x + dx;
y = mv_resize->moveresize_orig_y + dy;
- gdk_window_move (mv_resize->moveresize_window, x, y);
+ gdk_surface_move (mv_resize->moveresize_window, x, y);
}
}
static void
finish_drag (MoveResizeData *mv_resize)
{
- gdk_window_destroy (mv_resize->moveresize_emulation_window);
+ gdk_surface_destroy (mv_resize->moveresize_emulation_window);
mv_resize->moveresize_emulation_window = NULL;
g_object_unref (mv_resize->moveresize_window);
mv_resize->moveresize_window = NULL;
@@ -1125,7 +1125,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
gboolean
_gdk_broadway_moveresize_configure_done (GdkDisplay *display,
- GdkWindow *window)
+ GdkSurface *window)
{
BroadwayInputMsg *tmp_event;
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
@@ -1154,9 +1154,9 @@ create_moveresize_window (MoveResizeData *mv_resize,
g_assert (mv_resize->moveresize_emulation_window == NULL);
- mv_resize->moveresize_emulation_window = gdk_window_new_temp (mv_resize->display);
+ mv_resize->moveresize_emulation_window = gdk_surface_new_temp (mv_resize->display);
- gdk_window_show (mv_resize->moveresize_emulation_window);
+ gdk_surface_show (mv_resize->moveresize_emulation_window);
seat = gdk_display_get_default_seat (mv_resize->display);
pointer = gdk_seat_get_pointer (seat);
@@ -1192,14 +1192,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_window_get_origin (mv_resize->moveresize_window,
+ gdk_surface_get_origin (mv_resize->moveresize_window,
&mv_resize->moveresize_orig_x,
&mv_resize->moveresize_orig_y);
}
else
{
- gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect);
- gdk_window_get_geometry (mv_resize->moveresize_window,
+ gdk_surface_get_frame_extents (mv_resize->moveresize_window, &rect);
+ gdk_surface_get_geometry (mv_resize->moveresize_window,
NULL, NULL, &width, &height);
switch (mv_resize->moveresize_geometry.win_gravity)
@@ -1250,8 +1250,8 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
}
static void
-gdk_broadway_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+gdk_broadway_surface_begin_resize_drag (GdkSurface *window,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
@@ -1259,18 +1259,18 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
guint32 timestamp)
{
MoveResizeData *mv_resize;
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
if (impl->maximized)
return;
- mv_resize = get_move_resize_data (gdk_window_get_display (window), TRUE);
+ mv_resize = get_move_resize_data (gdk_surface_get_display (window), TRUE);
mv_resize->is_resize = TRUE;
mv_resize->moveresize_button = button;
@@ -1279,8 +1279,8 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
mv_resize->moveresize_y = root_y;
mv_resize->moveresize_window = g_object_ref (window);
- mv_resize->moveresize_orig_width = gdk_window_get_width (window);
- mv_resize->moveresize_orig_height = gdk_window_get_height (window);
+ mv_resize->moveresize_orig_width = gdk_surface_get_width (window);
+ mv_resize->moveresize_orig_height = gdk_surface_get_height (window);
mv_resize->moveresize_geom_mask = impl->geometry_hints_mask;
mv_resize->moveresize_geometry = impl->geometry_hints;
@@ -1291,7 +1291,7 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
}
static void
-gdk_broadway_window_begin_move_drag (GdkWindow *window,
+gdk_broadway_surface_begin_move_drag (GdkSurface *window,
GdkDevice *device,
gint button,
gint root_x,
@@ -1299,18 +1299,18 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window,
guint32 timestamp)
{
MoveResizeData *mv_resize;
- GdkWindowImplBroadway *impl;
+ GdkSurfaceImplBroadway *impl;
- impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+ impl = GDK_SURFACE_IMPL_BROADWAY (window->impl);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
if (impl->maximized)
return;
- mv_resize = get_move_resize_data (gdk_window_get_display (window), TRUE);
+ mv_resize = get_move_resize_data (gdk_surface_get_display (window), TRUE);
mv_resize->is_resize = FALSE;
mv_resize->moveresize_button = button;
@@ -1318,8 +1318,8 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window,
mv_resize->moveresize_y = root_y;
mv_resize->moveresize_window = g_object_ref (window);
- mv_resize->moveresize_orig_width = gdk_window_get_width (window);
- mv_resize->moveresize_orig_height = gdk_window_get_height (window);
+ mv_resize->moveresize_orig_width = gdk_surface_get_width (window);
+ mv_resize->moveresize_orig_height = gdk_surface_get_height (window);
mv_resize->moveresize_geom_mask = impl->geometry_hints_mask;
mv_resize->moveresize_geometry = impl->geometry_hints;
@@ -1330,19 +1330,19 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window,
}
static gboolean
-gdk_broadway_window_beep (GdkWindow *window)
+gdk_broadway_surface_beep (GdkSurface *window)
{
return FALSE;
}
static void
-gdk_broadway_window_set_opacity (GdkWindow *window,
+gdk_broadway_surface_set_opacity (GdkSurface *window,
gdouble opacity)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
if (opacity < 0)
@@ -1352,77 +1352,77 @@ gdk_broadway_window_set_opacity (GdkWindow *window,
}
guint32
-gdk_broadway_get_last_seen_time (GdkWindow *window)
+gdk_broadway_get_last_seen_time (GdkSurface *window)
{
GdkDisplay *display;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
return _gdk_broadway_server_get_last_seen_time (GDK_BROADWAY_DISPLAY (display)->server);
}
static void
-gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
+gdk_surface_impl_broadway_class_init (GdkSurfaceImplBroadwayClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
-
- object_class->finalize = gdk_window_impl_broadway_finalize;
-
- impl_class->ref_cairo_surface = gdk_window_broadway_ref_cairo_surface;
- impl_class->show = gdk_window_broadway_show;
- impl_class->hide = gdk_window_broadway_hide;
- impl_class->withdraw = gdk_window_broadway_withdraw;
- impl_class->set_events = gdk_window_broadway_set_events;
- impl_class->get_events = gdk_window_broadway_get_events;
- impl_class->raise = gdk_window_broadway_raise;
- impl_class->lower = gdk_window_broadway_lower;
- impl_class->restack_toplevel = gdk_window_broadway_restack_toplevel;
- impl_class->move_resize = gdk_window_broadway_move_resize;
- impl_class->get_geometry = gdk_window_broadway_get_geometry;
- impl_class->get_root_coords = gdk_window_broadway_get_root_coords;
- impl_class->get_device_state = gdk_window_broadway_get_device_state;
- impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
- impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
- impl_class->destroy = _gdk_broadway_window_destroy;
- impl_class->end_paint = gdk_broadway_window_end_paint;
- impl_class->beep = gdk_broadway_window_beep;
-
- impl_class->focus = gdk_broadway_window_focus;
- impl_class->set_type_hint = gdk_broadway_window_set_type_hint;
- impl_class->get_type_hint = gdk_broadway_window_get_type_hint;
- impl_class->set_modal_hint = gdk_broadway_window_set_modal_hint;
- impl_class->set_skip_taskbar_hint = gdk_broadway_window_set_skip_taskbar_hint;
- impl_class->set_skip_pager_hint = gdk_broadway_window_set_skip_pager_hint;
- impl_class->set_urgency_hint = gdk_broadway_window_set_urgency_hint;
- impl_class->set_geometry_hints = gdk_broadway_window_set_geometry_hints;
- impl_class->set_title = gdk_broadway_window_set_title;
- impl_class->set_role = gdk_broadway_window_set_role;
- impl_class->set_startup_id = gdk_broadway_window_set_startup_id;
- impl_class->set_transient_for = gdk_broadway_window_set_transient_for;
- impl_class->get_frame_extents = gdk_broadway_window_get_frame_extents;
- impl_class->set_accept_focus = gdk_broadway_window_set_accept_focus;
- impl_class->set_focus_on_map = gdk_broadway_window_set_focus_on_map;
- impl_class->set_icon_list = gdk_broadway_window_set_icon_list;
- impl_class->set_icon_name = gdk_broadway_window_set_icon_name;
- impl_class->iconify = gdk_broadway_window_iconify;
- impl_class->deiconify = gdk_broadway_window_deiconify;
- impl_class->stick = gdk_broadway_window_stick;
- impl_class->unstick = gdk_broadway_window_unstick;
- impl_class->maximize = gdk_broadway_window_maximize;
- impl_class->unmaximize = gdk_broadway_window_unmaximize;
- impl_class->fullscreen = gdk_broadway_window_fullscreen;
- impl_class->unfullscreen = gdk_broadway_window_unfullscreen;
- impl_class->set_keep_above = gdk_broadway_window_set_keep_above;
- impl_class->set_keep_below = gdk_broadway_window_set_keep_below;
- impl_class->get_group = gdk_broadway_window_get_group;
- impl_class->set_group = gdk_broadway_window_set_group;
- impl_class->set_decorations = gdk_broadway_window_set_decorations;
- impl_class->get_decorations = gdk_broadway_window_get_decorations;
- impl_class->set_functions = gdk_broadway_window_set_functions;
- impl_class->begin_resize_drag = gdk_broadway_window_begin_resize_drag;
- impl_class->begin_move_drag = gdk_broadway_window_begin_move_drag;
- impl_class->set_opacity = gdk_broadway_window_set_opacity;
- impl_class->destroy_notify = gdk_broadway_window_destroy_notify;
- impl_class->register_dnd = _gdk_broadway_window_register_dnd;
- impl_class->drag_begin = _gdk_broadway_window_drag_begin;
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
+
+ object_class->finalize = gdk_surface_impl_broadway_finalize;
+
+ impl_class->ref_cairo_surface = gdk_surface_broadway_ref_cairo_surface;
+ impl_class->show = gdk_surface_broadway_show;
+ impl_class->hide = gdk_surface_broadway_hide;
+ impl_class->withdraw = gdk_surface_broadway_withdraw;
+ impl_class->set_events = gdk_surface_broadway_set_events;
+ impl_class->get_events = gdk_surface_broadway_get_events;
+ impl_class->raise = gdk_surface_broadway_raise;
+ impl_class->lower = gdk_surface_broadway_lower;
+ impl_class->restack_toplevel = gdk_surface_broadway_restack_toplevel;
+ impl_class->move_resize = gdk_surface_broadway_move_resize;
+ impl_class->get_geometry = gdk_surface_broadway_get_geometry;
+ impl_class->get_root_coords = gdk_surface_broadway_get_root_coords;
+ impl_class->get_device_state = gdk_surface_broadway_get_device_state;
+ impl_class->shape_combine_region = gdk_surface_broadway_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_surface_broadway_input_shape_combine_region;
+ impl_class->destroy = _gdk_broadway_surface_destroy;
+ impl_class->end_paint = gdk_broadway_surface_end_paint;
+ impl_class->beep = gdk_broadway_surface_beep;
+
+ impl_class->focus = gdk_broadway_surface_focus;
+ impl_class->set_type_hint = gdk_broadway_surface_set_type_hint;
+ impl_class->get_type_hint = gdk_broadway_surface_get_type_hint;
+ impl_class->set_modal_hint = gdk_broadway_surface_set_modal_hint;
+ impl_class->set_skip_taskbar_hint = gdk_broadway_surface_set_skip_taskbar_hint;
+ impl_class->set_skip_pager_hint = gdk_broadway_surface_set_skip_pager_hint;
+ impl_class->set_urgency_hint = gdk_broadway_surface_set_urgency_hint;
+ impl_class->set_geometry_hints = gdk_broadway_surface_set_geometry_hints;
+ impl_class->set_title = gdk_broadway_surface_set_title;
+ impl_class->set_role = gdk_broadway_surface_set_role;
+ impl_class->set_startup_id = gdk_broadway_surface_set_startup_id;
+ impl_class->set_transient_for = gdk_broadway_surface_set_transient_for;
+ impl_class->get_frame_extents = gdk_broadway_surface_get_frame_extents;
+ impl_class->set_accept_focus = gdk_broadway_surface_set_accept_focus;
+ impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map;
+ impl_class->set_icon_list = gdk_broadway_surface_set_icon_list;
+ impl_class->set_icon_name = gdk_broadway_surface_set_icon_name;
+ impl_class->iconify = gdk_broadway_surface_iconify;
+ impl_class->deiconify = gdk_broadway_surface_deiconify;
+ impl_class->stick = gdk_broadway_surface_stick;
+ impl_class->unstick = gdk_broadway_surface_unstick;
+ impl_class->maximize = gdk_broadway_surface_maximize;
+ impl_class->unmaximize = gdk_broadway_surface_unmaximize;
+ impl_class->fullscreen = gdk_broadway_surface_fullscreen;
+ impl_class->unfullscreen = gdk_broadway_surface_unfullscreen;
+ impl_class->set_keep_above = gdk_broadway_surface_set_keep_above;
+ impl_class->set_keep_below = gdk_broadway_surface_set_keep_below;
+ impl_class->get_group = gdk_broadway_surface_get_group;
+ impl_class->set_group = gdk_broadway_surface_set_group;
+ impl_class->set_decorations = gdk_broadway_surface_set_decorations;
+ impl_class->get_decorations = gdk_broadway_surface_get_decorations;
+ impl_class->set_functions = gdk_broadway_surface_set_functions;
+ impl_class->begin_resize_drag = gdk_broadway_surface_begin_resize_drag;
+ impl_class->begin_move_drag = gdk_broadway_surface_begin_move_drag;
+ impl_class->set_opacity = gdk_broadway_surface_set_opacity;
+ impl_class->destroy_notify = gdk_broadway_surface_destroy_notify;
+ impl_class->register_dnd = _gdk_broadway_surface_register_dnd;
+ impl_class->drag_begin = _gdk_broadway_surface_drag_begin;
}
diff --git a/gdk/broadway/gdkwindow-broadway.h b/gdk/broadway/gdksurface-broadway.h
index bce4a7ddaa..b859ffc591 100644
--- a/gdk/broadway/gdkwindow-broadway.h
+++ b/gdk/broadway/gdksurface-broadway.h
@@ -22,31 +22,31 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_WINDOW_BROADWAY_H__
-#define __GDK_WINDOW_BROADWAY_H__
+#ifndef __GDK_SURFACE_BROADWAY_H__
+#define __GDK_SURFACE_BROADWAY_H__
-#include <gdk/gdkwindowimpl.h>
+#include <gdk/gdksurfaceimpl.h>
G_BEGIN_DECLS
-typedef struct _GdkWindowImplBroadway GdkWindowImplBroadway;
-typedef struct _GdkWindowImplBroadwayClass GdkWindowImplBroadwayClass;
+typedef struct _GdkSurfaceImplBroadway GdkSurfaceImplBroadway;
+typedef struct _GdkSurfaceImplBroadwayClass GdkSurfaceImplBroadwayClass;
/* Window implementation for Broadway
*/
-#define GDK_TYPE_WINDOW_IMPL_BROADWAY (gdk_window_impl_broadway_get_type ())
-#define GDK_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadway))
-#define GDK_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass))
-#define GDK_IS_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY))
-#define GDK_IS_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY))
-#define GDK_WINDOW_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass))
+#define GDK_TYPE_SURFACE_IMPL_BROADWAY (gdk_surface_impl_broadway_get_type ())
+#define GDK_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadway))
+#define GDK_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
+#define GDK_IS_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY))
+#define GDK_IS_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY))
+#define GDK_SURFACE_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
-struct _GdkWindowImplBroadway
+struct _GdkSurfaceImplBroadway
{
- GdkWindowImpl parent_instance;
+ GdkSurfaceImpl parent_instance;
- GdkWindow *wrapper;
+ GdkSurface *wrapper;
GdkCursor *cursor;
@@ -61,24 +61,24 @@ struct _GdkWindowImplBroadway
int pre_maximize_width;
int pre_maximize_height;
- gint8 toplevel_window_type;
+ gint8 toplevel_surface_type;
gboolean dirty;
gboolean last_synced;
GdkGeometry geometry_hints;
- GdkWindowHints geometry_hints_mask;
+ GdkSurfaceHints geometry_hints_mask;
GArray *node_data;
GPtrArray *node_data_textures;
};
-struct _GdkWindowImplBroadwayClass
+struct _GdkSurfaceImplBroadwayClass
{
- GdkWindowImplClass parent_class;
+ GdkSurfaceImplClass parent_class;
};
-GType gdk_window_impl_broadway_get_type (void);
+GType gdk_surface_impl_broadway_get_type (void);
G_END_DECLS
-#endif /* __GDK_WINDOW_BROADWAY_H__ */
+#endif /* __GDK_SURFACE_BROADWAY_H__ */
diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build
index 970b6c8e6c..81e29cc9c1 100644
--- a/gdk/broadway/meson.build
+++ b/gdk/broadway/meson.build
@@ -12,12 +12,12 @@ gdk_broadway_sources = files([
'gdkkeys-broadway.c',
'gdkmonitor-broadway.c',
'gdkselection-broadway.c',
- 'gdkwindow-broadway.c',
+ 'gdksurface-broadway.c',
])
gdk_broadway_public_headers = [
'gdkbroadwaydisplay.h',
- 'gdkbroadwaywindow.h',
+ 'gdkbroadwaysurface.h',
'gdkbroadwaycursor.h',
'gdkbroadwaymonitor.h',
]
diff --git a/gdk/gdk-autocleanup.h b/gdk/gdk-autocleanup.h
index 28a1f55211..b47e1c48c4 100644
--- a/gdk/gdk-autocleanup.h
+++ b/gdk/gdk-autocleanup.h
@@ -36,7 +36,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkWindow, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSurface, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)
diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h
index 7c4cd30d27..b037d66092 100644
--- a/gdk/gdk-private.h
+++ b/gdk/gdk-private.h
@@ -10,20 +10,20 @@ GdkDisplay * gdk_display_open_default (void);
gboolean gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device,
- GdkWindow **grab_window,
+ GdkSurface **grab_surface,
gboolean *owner_events);
void gdk_pre_parse (void);
-void gdk_window_freeze_toplevel_updates (GdkWindow *window);
-void gdk_window_thaw_toplevel_updates (GdkWindow *window);
+void gdk_surface_freeze_toplevel_updates (GdkSurface *surface);
+void gdk_surface_thaw_toplevel_updates (GdkSurface *surface);
-gboolean gdk_window_supports_edge_constraints (GdkWindow *window);
+gboolean gdk_surface_supports_edge_constraints (GdkSurface *surface);
-void gdk_window_move_to_rect (GdkWindow *window,
+void gdk_surface_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
- GdkGravity window_anchor,
+ GdkGravity surface_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy);
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 6bb48e004a..921e93690d 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -67,7 +67,7 @@
#include <gdk/gdktexture.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkvulkancontext.h>
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <gdk/gdk-autocleanup.h>
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index a53b01be9a..548e87bf80 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -33,9 +33,9 @@
* can be used with GDK. GTK+ does all of its drawing using cairo.
*
* GDK does not wrap the cairo API, instead it allows to create cairo
- * contexts which can be used to draw on #GdkWindows. Additional
+ * contexts which can be used to draw on #GdkSurfaces. Additional
* functions allow use #GdkRectangles with cairo and to use #GdkRGBAs,
- * #GdkPixbufs and #GdkWindows as sources for drawing operations.
+ * #GdkPixbufs and #GdkSurfaces as sources for drawing operations.
*/
@@ -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_window: (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.
@@ -251,14 +251,14 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
cairo_surface_t *
gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
int scale,
- GdkWindow *for_window)
+ GdkSurface *for_surface)
{
cairo_format_t format;
cairo_surface_t *surface;
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
g_return_val_if_fail (scale >= 0, NULL);
- g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL);
+ g_return_val_if_fail (for_surface == NULL || GDK_IS_SURFACE (for_surface), NULL);
if (gdk_pixbuf_get_n_channels (pixbuf) == 3)
format = CAIRO_FORMAT_RGB24;
@@ -266,7 +266,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
format = CAIRO_FORMAT_ARGB32;
surface =
- gdk_window_create_similar_image_surface (for_window,
+ gdk_surface_create_similar_image_surface (for_surface,
format,
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index 9417b0fd69..ebac127107 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -58,10 +58,10 @@ cairo_region_t *
GDK_AVAILABLE_IN_ALL
cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
int scale,
- GdkWindow *for_window);
+ GdkSurface *for_surface);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_draw_from_gl (cairo_t *cr,
- GdkWindow *window,
+ GdkSurface *surface,
int source,
int source_type,
int buffer_scale,
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c
index 2fb1f51838..1964d4fd59 100644
--- a/gdk/gdkcursor.c
+++ b/gdk/gdkcursor.c
@@ -48,7 +48,7 @@
*
* Cursors by themselves are not very interesting, they must be
* bound to a window for users to see them. This is done with
- * gdk_window_set_cursor() or gdk_window_set_device_cursor().
+ * gdk_surface_set_cursor() or gdk_surface_set_device_cursor().
* Applications will typically use higher-level GTK+ functions such
* as gtk_widget_set_cursor() instead.
*
@@ -69,7 +69,7 @@
* gdk_display_get_maximal_cursor_size() for the limitations that might apply.
*
* To ease work with unsupported cursors, a fallback cursor can be provided.
- * If a #GdkWindow cannot use a cursor because of the reasons mentioned above,
+ * If a #GdkSurface cannot use a cursor because of the reasons mentioned above,
* it will try the fallback cursor. Of course, fallback cursors can themselves
* have fallback cursors again, so it is possible to provide a chain of
* progressively easier to support cursors. If none of the provided cursors
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 30b7a5ed2e..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 #GdkWindow.
+ * @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,
- GdkWindow *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_WINDOW (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);
}
/**
@@ -594,43 +594,43 @@ gdk_device_get_position (GdkDevice *device,
/**
- * gdk_device_get_window_at_position_double:
+ * gdk_device_get_surface_at_position_double:
* @device: pointer #GdkDevice to query info to.
* @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * 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
* 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().
*
- * Returns: (nullable) (transfer none): the #GdkWindow under the
+ * Returns: (nullable) (transfer none): the #GdkSurface under the
* device position, or %NULL.
**/
-GdkWindow *
-gdk_device_get_window_at_position_double (GdkDevice *device,
+GdkSurface *
+gdk_device_get_surface_at_position_double (GdkDevice *device,
gdouble *win_x,
gdouble *win_y)
{
gdouble tmp_x, tmp_y;
- GdkWindow *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_window_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_window_find_descendant_at (window,
+ if (surface)
+ surface = _gdk_surface_find_descendant_at (surface,
tmp_x, tmp_y,
&tmp_x, &tmp_y);
@@ -639,50 +639,50 @@ gdk_device_get_window_at_position_double (GdkDevice *device,
if (win_y)
*win_y = tmp_y;
- return window;
+ return surface;
}
/**
- * gdk_device_get_window_at_position:
+ * gdk_device_get_surface_at_position:
* @device: pointer #GdkDevice to query info to.
* @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- * relative to the window origin, or %NULL.
+ * 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,
* unless there is an ongoing grab on them, see gdk_device_grab().
*
- * Returns: (nullable) (transfer none): the #GdkWindow under the
+ * Returns: (nullable) (transfer none): the #GdkSurface under the
* device position, or %NULL.
**/
-GdkWindow *
-gdk_device_get_window_at_position (GdkDevice *device,
+GdkSurface *
+gdk_device_get_surface_at_position (GdkDevice *device,
gint *win_x,
gint *win_y)
{
gdouble tmp_x, tmp_y;
- GdkWindow *window;
+ GdkSurface *surface;
- window =
- gdk_device_get_window_at_position_double (device, &tmp_x, &tmp_y);
+ surface =
+ gdk_device_get_surface_at_position_double (device, &tmp_x, &tmp_y);
if (win_x)
*win_x = round (tmp_x);
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):
@@ -698,7 +698,7 @@ gdk_device_get_window_at_position (GdkDevice *device,
* be returned. (This is not distinguishable from the case where
* motion history is supported and no events were found.)
*
- * Note that there is also gdk_window_set_event_compression() to get
+ * Note that there is also gdk_surface_set_event_compression() to get
* more motion events delivered directly, independent of the windowing
* system.
*
@@ -707,7 +707,7 @@ gdk_device_get_window_at_position (GdkDevice *device,
**/
gboolean
gdk_device_get_history (GdkDevice *device,
- GdkWindow *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_WINDOW (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_WINDOW_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 #GdkWindow 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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
@@ -1365,15 +1365,15 @@ gdk_device_grab (GdkDevice *device,
guint32 time_)
{
GdkGrabStatus res;
- GdkWindow *native;
+ GdkSurface *native;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
- g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
- g_return_val_if_fail (gdk_window_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_window_get_toplevel (window);
+ native = gdk_surface_get_toplevel (surface);
- if (native == NULL || GDK_WINDOW_DESTROYED (native))
+ if (native == NULL || GDK_SURFACE_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE;
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
@@ -1389,12 +1389,12 @@ gdk_device_grab (GdkDevice *device,
GdkDisplay *display;
gulong serial;
- display = gdk_window_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
@@ -1566,8 +1566,8 @@ find_axis_info (GArray *array,
}
gboolean
-_gdk_device_translate_window_coord (GdkDevice *device,
- GdkWindow *window,
+_gdk_device_translate_surface_coord (GdkDevice *device,
+ GdkSurface *surface,
guint index_,
gdouble value,
gdouble *axis_value)
@@ -1580,7 +1580,7 @@ _gdk_device_translate_window_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_window_coord (GdkDevice *device,
x_min = axis_info_x->min_value;
y_min = axis_info_y->min_value;
- window_width = gdk_window_get_width (window);
- window_height = gdk_window_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_window_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_window_coord (GdkDevice *device,
gboolean
_gdk_device_translate_screen_coord (GdkDevice *device,
- GdkWindow *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,
- GdkWindow *window,
- GdkWindow **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,
@@ -1764,14 +1764,14 @@ _gdk_device_query_state (GdkDevice *device,
mask);
}
-GdkWindow *
-_gdk_device_window_at_position (GdkDevice *device,
+GdkSurface *
+_gdk_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- return GDK_DEVICE_GET_CLASS (device)->window_at_position (device,
+ return GDK_DEVICE_GET_CLASS (device)->surface_at_position (device,
win_x,
win_y,
mask,
@@ -1779,22 +1779,22 @@ _gdk_device_window_at_position (GdkDevice *device,
}
/**
- * gdk_device_get_last_event_window:
+ * gdk_device_get_last_event_surface:
* @device: a #GdkDevice, with a source other than %GDK_SOURCE_KEYBOARD
*
- * Gets information about which window the given pointer device is in, based on events
+ * 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
*/
-GdkWindow *
-gdk_device_get_last_event_window (GdkDevice *device)
+GdkSurface *
+gdk_device_get_last_event_surface (GdkDevice *device)
{
GdkDisplay *display;
- GdkPointerWindowInfo *info;
+ GdkPointerSurfaceInfo *info;
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
@@ -1802,7 +1802,7 @@ gdk_device_get_last_event_window (GdkDevice *device)
display = gdk_device_get_display (device);
info = _gdk_display_get_pointer_info (display, device);
- return info->window_under_pointer;
+ return info->surface_under_pointer;
}
/**
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index bddaa71824..c52ddababa 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -73,10 +73,10 @@ typedef enum
* @GDK_MODE_DISABLED: the device is disabled and will not report any events.
* @GDK_MODE_SCREEN: the device is enabled. The device’s coordinate space
* maps to the entire screen.
- * @GDK_MODE_WINDOW: the device is enabled. The device’s coordinate space
- * is mapped to a single window. The manner in which this window
+ * @GDK_MODE_SURFACE: the device is enabled. The device’s coordinate space
+ * 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.
*/
@@ -84,7 +84,7 @@ typedef enum
{
GDK_MODE_DISABLED,
GDK_MODE_SCREEN,
- GDK_MODE_WINDOW
+ GDK_MODE_SURFACE
} GdkInputMode;
/**
@@ -163,7 +163,7 @@ void gdk_device_set_axis_use (GdkDevice *device,
GDK_AVAILABLE_IN_ALL
void gdk_device_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
@@ -171,8 +171,8 @@ void gdk_device_get_position (GdkDevice *device,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-GdkWindow *
- gdk_device_get_window_at_position
+GdkSurface *
+ gdk_device_get_surface_at_position
(GdkDevice *device,
gint *win_x,
gint *win_y);
@@ -181,14 +181,14 @@ void gdk_device_get_position_double (GdkDevice *device,
gdouble *x,
gdouble *y);
GDK_AVAILABLE_IN_ALL
-GdkWindow *
- gdk_device_get_window_at_position_double
+GdkSurface *
+ gdk_device_get_surface_at_position_double
(GdkDevice *device,
gdouble *win_x,
gdouble *win_y);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_history (GdkDevice *device,
- GdkWindow *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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
@@ -242,7 +242,7 @@ void gdk_device_warp (GdkDevice *device,
gint y);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_device_get_last_event_window (GdkDevice *device);
+GdkSurface *gdk_device_get_last_event_surface (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
const gchar *gdk_device_get_vendor_id (GdkDevice *device);
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index 1f6392f9dd..1614970834 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -71,49 +71,49 @@ struct _GdkDeviceClass
GObjectClass parent_class;
gboolean (* get_history) (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
void (* get_state) (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
- void (* set_window_cursor) (GdkDevice *device,
- GdkWindow *window,
+ void (* set_surface_cursor) (GdkDevice *device,
+ GdkSurface *surface,
GdkCursor *cursor);
void (* warp) (GdkDevice *device,
gdouble x,
gdouble y);
void (* query_state) (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **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,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
void (*ungrab) (GdkDevice *device,
guint32 time_);
- GdkWindow * (* window_at_position) (GdkDevice *device,
+ GdkSurface * (* surface_at_position) (GdkDevice *device,
double *win_x,
double *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
- void (* select_window_events) (GdkDevice *device,
- GdkWindow *window,
+ void (* select_surface_events) (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask);
};
@@ -138,16 +138,16 @@ void _gdk_device_get_axis_info (GdkDevice *device,
void _gdk_device_set_keys (GdkDevice *device,
guint num_keys);
-gboolean _gdk_device_translate_window_coord (GdkDevice *device,
- GdkWindow *window,
+gboolean _gdk_device_translate_surface_coord (GdkDevice *device,
+ GdkSurface *surface,
guint index,
gdouble value,
gdouble *axis_value);
gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
- GdkWindow *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,14 +167,14 @@ void _gdk_device_add_slave (GdkDevice *device,
void _gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
-GdkWindow * _gdk_device_window_at_position (GdkDevice *device,
+GdkSurface * _gdk_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index aa846da453..d8ca382e9e 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -31,7 +31,7 @@
#include "gdkdeviceprivate.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkevents.h"
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkinternals.h"
#include "gdkmonitorprivate.h"
@@ -171,7 +171,7 @@ gdk_display_class_init (GdkDisplayClass *class)
object_class->get_property = gdk_display_get_property;
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
- class->window_type = GDK_TYPE_WINDOW;
+ class->surface_type = GDK_TYPE_SURFACE;
class->opened = gdk_display_real_opened;
class->make_default = gdk_display_real_make_default;
@@ -326,17 +326,17 @@ gdk_display_class_init (GdkDisplayClass *class)
}
static void
-free_pointer_info (GdkPointerWindowInfo *info)
+free_pointer_info (GdkPointerSurfaceInfo *info)
{
- g_clear_object (&info->window_under_pointer);
- g_slice_free (GdkPointerWindowInfo, info);
+ g_clear_object (&info->surface_under_pointer);
+ g_slice_free (GdkPointerSurfaceInfo, info);
}
static void
free_device_grab (GdkDeviceGrabInfo *info)
{
- g_object_unref (info->window);
- g_object_unref (info->native_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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkDevice *device,
gboolean implicit,
- GdkWindow *grab_window)
+ GdkSurface *grab_surface)
{
- g_return_if_fail (window != NULL);
+ g_return_if_fail (surface != NULL);
- if (!GDK_WINDOW_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,8 +559,8 @@ _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDeviceGrabInfo *
_gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
- GdkWindow *window,
- GdkWindow *native_window,
+ GdkSurface *surface,
+ GdkSurface *native_surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
@@ -573,8 +573,8 @@ _gdk_display_add_device_grab (GdkDisplay *display,
info = g_new0 (GdkDeviceGrabInfo, 1);
- info->window = g_object_ref (window);
- info->native_window = g_object_ref (native_window);
+ info->surface = g_object_ref (surface);
+ info->native_surface = g_object_ref (native_surface);
info->serial_start = serial_start;
info->serial_end = G_MAXULONG;
info->owner_events = owner_events;
@@ -619,30 +619,30 @@ _gdk_display_add_device_grab (GdkDisplay *display,
return info;
}
-static GdkWindow *
+static GdkSurface *
get_current_toplevel (GdkDisplay *display,
GdkDevice *device,
int *x_out,
int *y_out,
GdkModifierType *state_out)
{
- GdkWindow *pointer_window;
+ GdkSurface *pointer_surface;
gdouble x, y;
GdkModifierType state;
- pointer_window = _gdk_device_window_at_position (device, &x, &y, &state, TRUE);
+ pointer_surface = _gdk_device_surface_at_position (device, &x, &y, &state, TRUE);
- if (pointer_window != NULL &&
- (GDK_WINDOW_DESTROYED (pointer_window) ||
- GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
- GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_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
@@ -654,8 +654,8 @@ switch_to_pointer_grab (GdkDisplay *display,
guint32 time,
gulong serial)
{
- GdkWindow *new_toplevel;
- GdkPointerWindowInfo *info;
+ GdkSurface *new_toplevel;
+ GdkPointerSurfaceInfo *info;
GList *old_grabs;
GdkModifierType state;
int x = 0, y = 0;
@@ -670,10 +670,10 @@ 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->window_under_pointer != grab->window)
- _gdk_display_set_window_under_pointer (display, device, NULL);
+ /* !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);
}
grab->activated = TRUE;
@@ -697,7 +697,7 @@ switch_to_pointer_grab (GdkDisplay *display,
if (new_toplevel)
{
/* w is now toplevel and x,y in toplevel coords */
- _gdk_display_set_window_under_pointer (display, device, new_toplevel);
+ _gdk_display_set_surface_under_pointer (display, device, new_toplevel);
info->toplevel_x = x;
info->toplevel_y = y;
info->state = state;
@@ -706,8 +706,8 @@ switch_to_pointer_grab (GdkDisplay *display,
if (grab == NULL) /* Ungrabbed, send events */
{
- /* We're now ungrabbed, update the window_under_pointer */
- _gdk_display_set_window_under_pointer (display, device, new_toplevel);
+ /* We're now ungrabbed, update the surface_under_pointer */
+ _gdk_display_set_surface_under_pointer (display, device, new_toplevel);
}
}
@@ -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_WINDOW (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,12 +832,12 @@ _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,
gulong serial,
- GdkWindow *if_child,
+ GdkSurface *if_child,
gboolean implicit)
{
GdkDeviceGrabInfo *grab;
@@ -851,7 +851,7 @@ _gdk_display_end_device_grab (GdkDisplay *display,
grab = l->data;
if (grab &&
(if_child == NULL ||
- _gdk_window_event_parent_of (if_child, grab->window)))
+ _gdk_surface_event_parent_of (if_child, grab->surface)))
{
grab->serial_end = serial;
grab->implicit_ungrab = implicit;
@@ -916,11 +916,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display,
return TRUE;
}
-GdkPointerWindowInfo *
+GdkPointerSurfaceInfo *
_gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device)
{
- GdkPointerWindowInfo *info;
+ GdkPointerSurfaceInfo *info;
if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
device = gdk_device_get_associated_device (device);
@@ -932,7 +932,7 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
if (G_UNLIKELY (!info))
{
- info = g_slice_new0 (GdkPointerWindowInfo);
+ info = g_slice_new0 (GdkPointerSurfaceInfo);
g_hash_table_insert (display->pointers_info, device, info);
}
@@ -951,7 +951,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
while (g_hash_table_iter_next (&iter, &key, &value))
{
- GdkPointerWindowInfo *info = value;
+ GdkPointerSurfaceInfo *info = value;
GdkDevice *device = key;
(func) (display, device, info, user_data);
@@ -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,
- GdkWindow **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,14 +1103,14 @@ 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.
- * See gdk_window_set_group().
+ * 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
**/
-GdkWindow *
+GdkSurface *
gdk_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@@ -1162,7 +1162,7 @@ gdk_display_get_primary_clipboard (GdkDisplay *display)
* gdk_display_supports_shapes:
* @display: a #GdkDisplay
*
- * Returns %TRUE if gdk_window_shape_combine_mask() can
+ * Returns %TRUE if gdk_surface_shape_combine_mask() can
* be used to create shaped windows on @display.
*
* Returns: %TRUE if shaped windows are supported
@@ -1179,10 +1179,10 @@ gdk_display_supports_shapes (GdkDisplay *display)
* gdk_display_supports_input_shapes:
* @display: a #GdkDisplay
*
- * Returns %TRUE if gdk_window_input_shape_combine_mask() can
- * be used to modify the input shape of windows on @display.
+ * Returns %TRUE if gdk_surface_input_shape_combine_mask() can
+ * 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)
@@ -1314,23 +1314,23 @@ _gdk_display_event_data_free (GdkDisplay *display,
}
void
-_gdk_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
- GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display,
- window,
+ GDK_DISPLAY_GET_CLASS (display)->create_surface_impl (display,
+ surface,
real_parent,
event_mask,
attributes);
}
-GdkWindow *
-_gdk_display_create_window (GdkDisplay *display)
+GdkSurface *
+_gdk_display_create_surface (GdkDisplay *display)
{
- return g_object_new (GDK_DISPLAY_GET_CLASS (display)->window_type,
+ return g_object_new (GDK_DISPLAY_GET_CLASS (display)->surface_type,
"display", display,
NULL);
}
@@ -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
- * gdk_window_set_opacity().
+ * 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
@@ -1673,19 +1673,19 @@ gdk_display_get_monitor_at_point (GdkDisplay *display,
}
/**
- * gdk_display_get_monitor_at_window:
+ * gdk_display_get_monitor_at_surface:
* @display: a #GdkDisplay
- * @window: a #GdkWindow
+ * @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_window (GdkDisplay *display,
- GdkWindow *window)
+gdk_display_get_monitor_at_surface (GdkDisplay *display,
+ GdkSurface *surface)
{
GdkRectangle win;
int n_monitors, i;
@@ -1696,16 +1696,16 @@ gdk_display_get_monitor_at_window (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
class = GDK_DISPLAY_GET_CLASS (display);
- if (class->get_monitor_at_window)
+ if (class->get_monitor_at_surface)
{
- best = class->get_monitor_at_window (display, window);
+ best = class->get_monitor_at_surface (display, surface);
if (best)
return best;
}
- gdk_window_get_geometry (window, &win.x, &win.y, &win.width, &win.height);
- gdk_window_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 9e46649795..b9f5d71fd8 100644
--- a/gdk/gdkdisplay.h
+++ b/gdk/gdkdisplay.h
@@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL
GdkDisplay *gdk_display_get_default (void);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_display_get_default_group (GdkDisplay *display);
+GdkSurface *gdk_display_get_default_group (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display);
@@ -116,8 +116,8 @@ GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display,
int x,
int y);
GDK_AVAILABLE_IN_ALL
-GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display,
- GdkWindow *window);
+GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display,
+ GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GdkKeymap * gdk_display_get_keymap (GdkDisplay *display);
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index ddb1c14f72..db2ec347d7 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -19,7 +19,7 @@
#define __GDK_DISPLAY_PRIVATE_H__
#include "gdkdisplay.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkcursor.h"
#include "gdkmonitor.h"
#include "gdkinternals.h"
@@ -40,8 +40,8 @@ typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the device grab on this display */
typedef struct
{
- GdkWindow *window;
- GdkWindow *native_window;
+ GdkSurface *surface;
+ GdkSurface *native_surface;
gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */
guint event_mask;
@@ -54,21 +54,21 @@ 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
{
- GdkWindow *window_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;
GdkDevice *last_slave;
-} GdkPointerWindowInfo;
+} GdkPointerSurfaceInfo;
struct _GdkDisplay
{
@@ -86,7 +86,7 @@ struct _GdkDisplay
GdkClipboard *clipboard;
GdkClipboard *primary_clipboard;
- GHashTable *pointers_info; /* GdkPointerWindowInfo for each device */
+ GHashTable *pointers_info; /* GdkPointerSurfaceInfo for each device */
guint32 last_event_time; /* Last reported event time from server */
guint double_click_time; /* Maximum time between clicks in msecs */
@@ -114,7 +114,7 @@ struct _GdkDisplayClass
{
GObjectClass parent_class;
- GType window_type; /* type for native windows for this display, set in class_init */
+ GType surface_type; /* type for native 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 */
@@ -125,7 +125,7 @@ struct _GdkDisplayClass
gboolean (*has_pending) (GdkDisplay *display);
void (*queue_events) (GdkDisplay *display);
void (*make_default) (GdkDisplay *display);
- GdkWindow * (*get_default_group) (GdkDisplay *display);
+ GdkSurface * (*get_default_group) (GdkDisplay *display);
gboolean (*supports_shapes) (GdkDisplay *display);
gboolean (*supports_input_shapes) (GdkDisplay *display);
@@ -140,11 +140,11 @@ struct _GdkDisplayClass
GdkEvent *new_event);
void (*event_data_free) (GdkDisplay *display,
GdkEvent *event);
- void (*create_window_impl) (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+ void (*create_surface_impl) (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
GdkKeymap * (*get_keymap) (GdkDisplay *display);
@@ -166,8 +166,8 @@ struct _GdkDisplayClass
GdkMonitor * (*get_monitor) (GdkDisplay *display,
int index);
GdkMonitor * (*get_primary_monitor) (GdkDisplay *display);
- GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display,
- GdkWindow *window);
+ GdkMonitor * (*get_monitor_at_surface) (GdkDisplay *display,
+ GdkSurface *surface);
gboolean (*get_setting) (GdkDisplay *display,
const char *name,
GValue *value);
@@ -185,7 +185,7 @@ struct _GdkDisplayClass
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkDevice *device,
- GdkPointerWindowInfo *device_info,
+ GdkPointerSurfaceInfo *device_info,
gpointer user_data);
void _gdk_display_update_last_event (GdkDisplay *display,
@@ -198,8 +198,8 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDevice *device);
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
- GdkWindow *window,
- GdkWindow *native_window,
+ GdkSurface *surface,
+ GdkSurface *native_surface,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
@@ -212,12 +212,12 @@ GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display
gboolean _gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device,
gulong serial,
- GdkWindow *if_child,
+ GdkSurface *if_child,
gboolean implicit);
gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
GdkDevice *device,
gulong serial);
-GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
+GdkPointerSurfaceInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device);
void _gdk_display_pointer_info_foreach (GdkDisplay *display,
GdkDisplayPointerInfoForeach func,
@@ -230,12 +230,12 @@ void _gdk_display_event_data_copy (GdkDisplay *display
GdkEvent *new_event);
void _gdk_display_event_data_free (GdkDisplay *display,
GdkEvent *event);
-void _gdk_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
-GdkWindow * _gdk_display_create_window (GdkDisplay *display);
+ GdkSurfaceAttr *attributes);
+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 a8aecbbb2e..8a7f16c355 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -26,7 +26,7 @@
#include "gdkdndprivate.h"
#include "gdkdisplay.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkintl.h"
#include "gdkcontentformats.h"
#include "gdkcontentprovider.h"
@@ -171,35 +171,35 @@ gdk_drag_context_get_selected_action (GdkDragContext *context)
}
/**
- * gdk_drag_context_get_source_window:
+ * gdk_drag_context_get_source_surface:
* @context: a #GdkDragContext
*
- * Returns the #GdkWindow where the DND operation started.
+ * Returns the #GdkSurface where the DND operation started.
*
- * Returns: (transfer none): a #GdkWindow
+ * Returns: (transfer none): a #GdkSurface
**/
-GdkWindow *
-gdk_drag_context_get_source_window (GdkDragContext *context)
+GdkSurface *
+gdk_drag_context_get_source_surface (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
- return context->source_window;
+ return context->source_surface;
}
/**
- * gdk_drag_context_get_dest_window:
+ * gdk_drag_context_get_dest_surface:
* @context: a #GdkDragContext
*
- * Returns the destination window for the DND operation.
+ * Returns the destination surface for the DND operation.
*
- * Returns: (transfer none): a #GdkWindow
+ * Returns: (transfer none): a #GdkSurface
**/
-GdkWindow *
-gdk_drag_context_get_dest_window (GdkDragContext *context)
+GdkSurface *
+gdk_drag_context_get_dest_surface (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
- return context->dest_window;
+ return context->dest_surface;
}
/**
@@ -315,11 +315,11 @@ gdk_drag_context_finalize (GObject *object)
g_clear_object (&context->content);
g_clear_pointer (&context->formats, gdk_content_formats_unref);
- if (context->source_window)
- g_object_unref (context->source_window);
+ if (context->source_surface)
+ g_object_unref (context->source_surface);
- if (context->dest_window)
- g_object_unref (context->dest_window);
+ if (context->dest_surface)
+ g_object_unref (context->dest_surface);
G_OBJECT_CLASS (gdk_drag_context_parent_class)->finalize (object);
}
@@ -782,25 +782,25 @@ gdk_drop_read_finish (GdkDragContext *context,
}
/**
- * gdk_drag_context_get_drag_window:
+ * gdk_drag_context_get_drag_surface:
* @context: a #GdkDragContext
*
- * Returns the window on which the drag icon should be rendered
- * 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
*/
-GdkWindow *
-gdk_drag_context_get_drag_window (GdkDragContext *context)
+GdkSurface *
+gdk_drag_context_get_drag_surface (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
- if (GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_window)
- return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_window (context);
+ if (GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_surface)
+ return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_drag_surface (context);
return NULL;
}
@@ -808,12 +808,12 @@ gdk_drag_context_get_drag_window (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 16442a5bb2..0cc1d33131 100644
--- a/gdk/gdkdnd.h
+++ b/gdk/gdkdnd.h
@@ -98,9 +98,9 @@ GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context);
+GdkSurface *gdk_drag_context_get_source_surface (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context);
+GdkSurface *gdk_drag_context_get_dest_surface (GdkDragContext *context);
/* Destination side */
GDK_AVAILABLE_IN_ALL
@@ -132,7 +132,7 @@ GInputStream * gdk_drop_read_finish (GdkDragContext *
/* Source side */
GDK_AVAILABLE_IN_ALL
-GdkDragContext * gdk_drag_begin (GdkWindow *window,
+GdkDragContext * gdk_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -147,7 +147,7 @@ void gdk_drag_drop_done (GdkDragContext *context,
gboolean success);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_drag_context_get_drag_window (GdkDragContext *context);
+GdkSurface *gdk_drag_context_get_drag_surface (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
void gdk_drag_context_set_hotspot (GdkDragContext *context,
diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h
index d4fb2b7feb..101ceed712 100644
--- a/gdk/gdkdndprivate.h
+++ b/gdk/gdkdndprivate.h
@@ -57,7 +57,7 @@ struct _GdkDragContextClass {
GAsyncResult *result,
GError **error);
gboolean (*drop_status) (GdkDragContext *context);
- GdkWindow* (*get_drag_window) (GdkDragContext *context);
+ GdkSurface* (*get_drag_surface) (GdkDragContext *context);
void (*set_hotspot) (GdkDragContext *context,
gint hot_x,
gint hot_y);
@@ -87,9 +87,9 @@ struct _GdkDragContext {
GdkDisplay *display;
gboolean is_source;
- GdkWindow *source_window;
- GdkWindow *dest_window;
- GdkWindow *drag_window;
+ GdkSurface *source_surface;
+ GdkSurface *dest_surface;
+ GdkSurface *drag_surface;
GdkContentProvider *content;
GdkContentFormats *formats;
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c
index 2566d01ca6..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 {
- GdkWindow *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,15 +146,15 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
G_PARAM_STATIC_STRINGS);
/**
- * GdkDrawContext:window:
+ * GdkDrawContext:surface:
*
- * The #GdkWindow the gl context is bound to.
+ * The #GdkSurface the gl context is bound to.
*/
- pspecs[PROP_WINDOW] =
- g_param_spec_object ("window",
- P_("Window"),
- P_("The GDK window bound to the context"),
- GDK_TYPE_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 |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
@@ -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,24 +257,24 @@ gdk_draw_context_get_display (GdkDrawContext *context)
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
- return priv->window ? gdk_window_get_display (priv->window) : NULL;
+ return priv->surface ? gdk_surface_get_display (priv->surface) : NULL;
}
/**
- * gdk_draw_context_get_window:
+ * gdk_draw_context_get_surface:
* @context: a #GdkDrawContext
*
- * Retrieves the #GdkWindow used by the @context.
+ * Retrieves the #GdkSurface used by the @context.
*
- * Returns: (nullable) (transfer none): a #GdkWindow or %NULL
+ * Returns: (nullable) (transfer none): a #GdkSurface or %NULL
*/
-GdkWindow *
-gdk_draw_context_get_window (GdkDrawContext *context)
+GdkSurface *
+gdk_draw_context_get_surface (GdkDrawContext *context)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
- return priv->window;
+ return priv->surface;
}
diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h
index 8c9c982926..70bc802c4a 100644
--- a/gdk/gdkdrawcontext.h
+++ b/gdk/gdkdrawcontext.h
@@ -40,7 +40,7 @@ GType gdk_draw_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_draw_context_get_window (GdkDrawContext *context);
+GdkSurface * gdk_draw_context_get_surface (GdkDrawContext *context);
G_END_DECLS
diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c
index 3c408a5f59..671da31930 100644
--- a/gdk/gdkdrawingcontext.c
+++ b/gdk/gdkdrawingcontext.c
@@ -18,16 +18,16 @@
/**
* SECTION:gdkdrawingcontext
* @Title: GdkDrawingContext
- * @Short_description: Drawing context for GDK windows
+ * @Short_description: Drawing context for GDK surfaces
*
* #GdkDrawingContext is an object that represents the current drawing
- * state of a #GdkWindow.
+ * state of a #GdkSurface.
*
- * It's possible to use a #GdkDrawingContext to draw on a #GdkWindow
+ * It's possible to use a #GdkDrawingContext to draw on a #GdkSurface
* via rendering API like Cairo or OpenGL.
*
- * A #GdkDrawingContext can only be created by calling gdk_window_begin_draw_frame()
- * and will be valid until a call to gdk_window_end_draw_frame().
+ * A #GdkDrawingContext can only be created by calling gdk_surface_begin_draw_frame()
+ * and will be valid until a call to gdk_surface_end_draw_frame().
*
* #GdkDrawingContext is available since GDK 3.22
*/
@@ -49,14 +49,14 @@
#include "gdkinternals.h"
#include "gdkintl.h"
#include "gdkframeclockidle.h"
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkglcontextprivate.h"
#include "gdk-private.h"
typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate;
struct _GdkDrawingContextPrivate {
- GdkWindow *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,13 +108,13 @@ 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_window_begin_draw_frame().",
+ "using gdk_surface_begin_draw_frame().",
G_OBJECT_TYPE_NAME (gobject));
return;
}
@@ -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,13 +171,13 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass)
gobject_class->dispose = gdk_drawing_context_dispose;
/**
- * GdkDrawingContext:window:
+ * GdkDrawingContext:surface:
*
- * The #GdkWindow that created the drawing context.
+ * The #GdkSurface that created the drawing context.
*/
- obj_property[PROP_WINDOW] =
- g_param_spec_object ("window", "Window", "The window that created the context",
- GDK_TYPE_WINDOW,
+ 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 |
G_PARAM_STATIC_STRINGS);
@@ -242,7 +242,7 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
* gdk_drawing_context_get_cairo_context:
* @context: a #GdkDrawingContext created with a %NULL paint context
*
- * Retrieves a Cairo context to be used to draw on the #GdkWindow
+ * Retrieves a Cairo context to be used to draw on the #GdkSurface
* that created the #GdkDrawingContext. The @context must have been
* created without a #GdkDrawContext for this function to work. If
* gdk_drawing_context_get_paint_context() does not return %NULL,
@@ -250,10 +250,10 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
*
* The returned context is guaranteed to be valid as long as the
* #GdkDrawingContext is valid, that is between a call to
- * gdk_window_begin_draw_frame() and gdk_window_end_draw_frame().
+ * gdk_surface_begin_draw_frame() and gdk_surface_end_draw_frame().
*
* Returns: (transfer none) (nullable): a Cairo context to be used to draw
- * the contents of the #GdkWindow. The context is owned by the
+ * the contents of the #GdkSurface. The context is owned by the
* #GdkDrawingContext and should not be destroyed. %NULL is
* returned when a paint context is in used.
*/
@@ -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_WINDOW (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_window_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_window_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);
@@ -291,21 +291,21 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
}
/**
- * gdk_drawing_context_get_window:
+ * gdk_drawing_context_get_surface:
* @context: a #GdkDrawingContext
*
- * Retrieves the window that created the drawing @context.
+ * Retrieves the surface that created the drawing @context.
*
- * Returns: (transfer none): a #GdkWindow
+ * Returns: (transfer none): a #GdkSurface
*/
-GdkWindow *
-gdk_drawing_context_get_window (GdkDrawingContext *context)
+GdkSurface *
+gdk_drawing_context_get_surface (GdkDrawingContext *context)
{
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (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_window_get_drawing_context (priv->window) != context)
+ if (gdk_surface_get_drawing_context (priv->surface) != context)
return FALSE;
return TRUE;
diff --git a/gdk/gdkdrawingcontext.h b/gdk/gdkdrawingcontext.h
index 4a6728136b..541e30bbe1 100644
--- a/gdk/gdkdrawingcontext.h
+++ b/gdk/gdkdrawingcontext.h
@@ -37,7 +37,7 @@ GDK_AVAILABLE_IN_ALL
GType gdk_drawing_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_drawing_context_get_window (GdkDrawingContext *context);
+GdkSurface * gdk_drawing_context_get_surface (GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL
GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 7f1b84a0e2..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;
- GdkWindow *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_window_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);
}
}
@@ -602,7 +602,7 @@ copy_time_coord (const GdkTimeCoord *coord)
* @event: a #GdkEvent
*
* Copies a #GdkEvent, copying or incrementing the reference count of the
- * resources associated with it (e.g. #GdkWindow’s and strings).
+ * resources associated with it (e.g. #GdkSurface’s and strings).
*
* Returns: (transfer full): a copy of @event. Free with g_object_unref()
*/
@@ -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,19 +776,19 @@ gdk_event_finalize (GObject *object)
}
/**
- * gdk_event_get_window:
+ * gdk_event_get_surface:
* @event: a #GdkEvent
*
- * Extracts the #GdkWindow associated with an event.
+ * Extracts the #GdkSurface associated with an event.
*
- * Returns: (transfer none): The #GdkWindow associated with the event
+ * Returns: (transfer none): The #GdkSurface associated with the event
*/
-GdkWindow *
-gdk_event_get_window (const GdkEvent *event)
+GdkSurface *
+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,
@@ -1626,7 +1626,7 @@ gdk_event_set_source_device (GdkEvent *event,
* triggered the event, falling back to the virtual (master) device
* (as in gdk_event_get_device()) if the event wasn’t caused by
* interaction with a hardware device. This may happen for example
- * in synthesized crossing events after a #GdkWindow updates its
+ * in synthesized crossing events after a #GdkSurface updates its
* geometry or a grab is acquired/released.
*
* If the event does not contain a device field, this function will
@@ -1673,13 +1673,13 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
GdkDisplay *display;
GdkModifierType modifier;
- g_return_val_if_fail (GDK_IS_WINDOW (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_window_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_window_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,
- GdkWindow **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 6203f9f368..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_WINDOW_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
-GdkWindow *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,
- GdkWindow **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 1daffc27b9..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;
- GdkWindow *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;
- GdkWindow *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;
- GdkWindow *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 5e9b9cc9a7..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,
- GdkWindow *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;
- GdkWindow *window = gdk_gl_context_get_window (paint_context);
- int window_scale = gdk_window_get_scale_factor (window);
- float w = gdk_window_get_width (window) * window_scale;
- float h = gdk_window_get_height (window) * window_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,
- GdkWindow *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_window_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,10 +458,10 @@ 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;
- GdkWindow *window;
- int unscaled_window_height;
+ GdkSurface *surface;
+ int unscaled_surface_height;
unsigned int texture_id;
- int window_scale;
+ int surface_scale;
double sx, sy;
float umax, vmax;
gboolean use_texture_rectangle;
@@ -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_window (paint_context);
- window_scale = gdk_window_get_scale_factor (window);
- gdk_window_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,14 +506,14 @@ 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++)
{
cairo_region_get_rectangle (region, i, &rect);
- glScissor (rect.x * window_scale, FLIP_Y ((rect.y + rect.height) * window_scale),
- rect.width * window_scale, rect.height * window_scale);
+ glScissor (rect.x * surface_scale, FLIP_Y ((rect.y + rect.height) * surface_scale),
+ rect.width * surface_scale, rect.height * surface_scale);
e = rect;
e.x *= sx;
@@ -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)
{
@@ -546,8 +546,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
{
GdkTexturedQuad quad = {
- rect.x * window_scale, FLIP_Y(rect.y * window_scale),
- (rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
+ rect.x * surface_scale, FLIP_Y(rect.y * surface_scale),
+ (rect.x + rect.width) * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale),
0, 0,
umax, vmax,
};
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index f82a240842..c31ad1e4c9 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -26,12 +26,12 @@
* #GdkGLContext is an object representing the platform-specific
* OpenGL draw context.
*
- * #GdkGLContexts are created for a #GdkWindow using
- * gdk_window_create_gl_context(), and the context will match the
- * the characteristics of the window.
+ * #GdkGLContexts are created for a #GdkSurface using
+ * gdk_surface_create_gl_context(), and the context will match the
+ * the characteristics of the surface.
*
* A #GdkGLContext is not tied to any particular normal framebuffer.
- * For instance, it cannot draw to the #GdkWindow back buffer. The GDK
+ * For instance, it cannot draw to the #GdkSurface back buffer. The GDK
* repaint system is in full control of the painting to that. Instead,
* you can create render buffers or textures and use gdk_cairo_draw_from_gl()
* in the draw function of your widget to draw them. Then GDK will handle
@@ -46,14 +46,14 @@
* ## Creating a new OpenGL context ##
*
* In order to create a new #GdkGLContext instance you need a
- * #GdkWindow, which you typically get during the realize call
+ * #GdkSurface, which you typically get during the realize call
* of a widget.
*
* A #GdkGLContext is not realized until either gdk_gl_context_make_current(),
* or until it is realized using gdk_gl_context_realize(). It is possible to
* specify details of the GL context like the OpenGL version to be used, or
* whether the GL context should have extra state validation enabled after
- * calling gdk_window_create_gl_context() by calling gdk_gl_context_realize().
+ * calling gdk_surface_create_gl_context() by calling gdk_gl_context_realize().
* If the realization fails you have the option to change the settings of the
* #GdkGLContext and try again.
*
@@ -265,12 +265,12 @@ gdk_gl_context_real_realize (GdkGLContext *self,
static cairo_region_t *
gdk_gl_context_real_get_damage (GdkGLContext *context)
{
- GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
return cairo_region_create_rectangle (&(GdkRectangle) {
0, 0,
- gdk_window_get_width (window),
- gdk_window_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);
- GdkWindow *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_window (draw_context);
- ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window);
- wh = gdk_window_get_height (window) * gdk_window_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);
@@ -886,19 +886,19 @@ gdk_gl_context_get_display (GdkGLContext *context)
}
/**
- * gdk_gl_context_get_window:
+ * gdk_gl_context_get_surface:
* @context: a #GdkGLContext
*
- * Retrieves the #GdkWindow used by the @context.
+ * Retrieves the #GdkSurface used by the @context.
*
- * Returns: (nullable) (transfer none): a #GdkWindow or %NULL
+ * Returns: (nullable) (transfer none): a #GdkSurface or %NULL
*/
-GdkWindow *
-gdk_gl_context_get_window (GdkGLContext *context)
+GdkSurface *
+gdk_gl_context_get_surface (GdkGLContext *context)
{
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
- return gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
+ return gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
}
/**
diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h
index f338a75cfb..45d4f3d58a 100644
--- a/gdk/gdkglcontext.h
+++ b/gdk/gdkglcontext.h
@@ -45,7 +45,7 @@ GType gdk_gl_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
+GdkSurface * gdk_gl_context_get_surface (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL
GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c
index 8d97c316a6..618aa45f4c 100644
--- a/gdk/gdkgltexture.c
+++ b/gdk/gdkgltexture.c
@@ -91,10 +91,10 @@ gdk_gl_texture_download (GdkTexture *texture,
}
else
{
- GdkWindow *window;
+ GdkSurface *surface;
- window = gdk_gl_context_get_window (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)
{
- GdkWindow *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_window (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 2438cf77cc..de55b8b4b4 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -28,7 +28,7 @@
#define __GDK_INTERNALS_H__
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkdisplay.h"
#include "gdkeventsprivate.h"
#include "gdkenumtypes.h"
@@ -42,7 +42,7 @@ G_BEGIN_DECLS
/* Debugging support */
-typedef struct _GdkWindowAttr GdkWindowAttr;
+typedef struct _GdkSurfaceAttr GdkSurfaceAttr;
typedef enum {
GDK_DEBUG_MISC = 1 << 0,
@@ -116,35 +116,35 @@ typedef enum
GDK_EVENT_FLUSHED = 1 << 2
} GdkEventFlags;
-typedef struct _GdkWindowPaint GdkWindowPaint;
+typedef struct _GdkSurfacePaint GdkSurfacePaint;
typedef enum
{
GDK_INPUT_OUTPUT,
GDK_INPUT_ONLY
-} GdkWindowWindowClass;
+} GdkSurfaceSurfaceClass;
-struct _GdkWindowAttr
+struct _GdkSurfaceAttr
{
gint x, y;
gint width;
gint height;
- GdkWindowWindowClass wclass;
- GdkWindowType window_type;
- GdkWindowTypeHint type_hint;
+ GdkSurfaceSurfaceClass wclass;
+ GdkSurfaceType surface_type;
+ GdkSurfaceTypeHint type_hint;
};
-struct _GdkWindow
+struct _GdkSurface
{
GObject parent_instance;
GdkDisplay *display;
- GdkWindowImpl *impl; /* window-system-specific delegate object */
+ GdkSurfaceImpl *impl; /* window-system-specific delegate object */
- GdkWindow *parent;
- GdkWindow *transient_for;
+ GdkSurface *parent;
+ GdkSurface *transient_for;
gpointer user_data;
@@ -152,18 +152,18 @@ struct _GdkWindow
gint y;
GdkEventMask event_mask;
- guint8 window_type;
+ guint8 surface_type;
guint8 resize_count;
- gint8 toplevel_window_type;
+ gint8 toplevel_surface_type;
GList *children;
GList children_list_node;
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;
@@ -182,8 +182,8 @@ struct _GdkWindow
/* We store the old expose areas to support buffer-age optimizations */
cairo_region_t *old_updated_area[2];
- GdkWindowState old_state;
- GdkWindowState state;
+ GdkSurfaceState old_state;
+ GdkSurfaceState state;
guint8 alpha;
guint8 fullscreen_mode;
@@ -202,17 +202,17 @@ struct _GdkWindow
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 GdkWindow that has the impl, ref:ed if another window.
- * This ref is required to keep the wrapper of the impl window alive
- * for as long as any GdkWindow references the impl. */
- GdkWindow *impl_window;
+ /* 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;
guint update_and_descendants_freeze_count;
@@ -223,9 +223,9 @@ struct _GdkWindow
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;
@@ -244,8 +244,8 @@ struct _GdkWindow
cairo_region_t *opaque_region;
};
-#define GDK_WINDOW_TYPE(d) ((((GdkWindow *)(d)))->window_type)
-#define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed)
+#define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->surface_type)
+#define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed)
extern gint _gdk_screen_number;
@@ -280,8 +280,8 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
void _gdk_windowing_event_data_free (GdkEvent *event);
-void gdk_window_set_state (GdkWindow *window,
- GdkWindowState new_state);
+void gdk_surface_set_state (GdkSurface *surface,
+ GdkSurfaceState new_state);
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
GdkRectangle *extents);
@@ -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,
- GdkWindow *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_window_ref_cairo_surface (GdkWindow *window);
+ _gdk_surface_ref_cairo_surface (GdkSurface *surface);
-GdkWindow* gdk_window_new (GdkDisplay *display,
- GdkWindow *parent,
- GdkWindowAttr *attributes);
-void _gdk_window_destroy (GdkWindow *window,
+GdkSurface* gdk_surface_new (GdkDisplay *display,
+ GdkSurface *parent,
+ GdkSurfaceAttr *attributes);
+void _gdk_surface_destroy (GdkSurface *surface,
gboolean foreign_destroy);
-void _gdk_window_clear_update_area (GdkWindow *window);
-void _gdk_window_update_size (GdkWindow *window);
-gboolean _gdk_window_update_viewable (GdkWindow *window);
-GdkGLContext * gdk_window_get_paint_gl_context (GdkWindow *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_window_get_unscaled_size (GdkWindow *window,
+void gdk_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height);
-GdkDrawingContext *gdk_window_get_drawing_context (GdkWindow *window);
+GdkDrawingContext *gdk_surface_get_drawing_context (GdkSurface *surface);
-cairo_region_t *gdk_window_get_current_paint_region (GdkWindow *window);
+cairo_region_t *gdk_surface_get_current_paint_region (GdkSurface *surface);
-void _gdk_window_process_updates_recurse (GdkWindow *window,
+void _gdk_surface_process_updates_recurse (GdkSurface *surface,
cairo_region_t *expose_region);
/*****************************************
@@ -352,28 +352,28 @@ void _gdk_windowing_got_event (GdkDisplay *display,
GdkEvent *event,
gulong serial);
-#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
+#define GDK_SURFACE_IS_MAPPED(surface) (((surface)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
-void _gdk_window_invalidate_for_expose (GdkWindow *window,
+void _gdk_surface_invalidate_for_expose (GdkSurface *surface,
cairo_region_t *region);
-GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
+GdkSurface * _gdk_surface_find_child_at (GdkSurface *surface,
double x, double y);
-GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
+GdkSurface * _gdk_surface_find_descendant_at (GdkSurface *toplevel,
double x, double y,
double *found_x,
double *found_y);
-GdkEvent * _gdk_make_event (GdkWindow *window,
+GdkEvent * _gdk_make_event (GdkSurface *surface,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
-gboolean _gdk_window_event_parent_of (GdkWindow *parent,
- GdkWindow *child);
+gboolean _gdk_surface_event_parent_of (GdkSurface *parent,
+ GdkSurface *child);
void _gdk_synthesize_crossing_events (GdkDisplay *display,
- GdkWindow *src,
- GdkWindow *dest,
+ GdkSurface *src,
+ GdkSurface *dest,
GdkDevice *device,
GdkDevice *source_device,
GdkCrossingMode mode,
@@ -384,18 +384,18 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display,
GdkEvent *event_in_queue,
gulong serial,
gboolean non_linear);
-void _gdk_display_set_window_under_pointer (GdkDisplay *display,
+void _gdk_display_set_surface_under_pointer (GdkDisplay *display,
GdkDevice *device,
- GdkWindow *window);
+ GdkSurface *surface);
-gboolean _gdk_window_has_impl (GdkWindow *window);
-GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
+gboolean _gdk_surface_has_impl (GdkSurface *surface);
+GdkSurface * _gdk_surface_get_impl_surface (GdkSurface *surface);
-void gdk_window_destroy_notify (GdkWindow *window);
+void gdk_surface_destroy_notify (GdkSurface *surface);
-void gdk_synthesize_window_state (GdkWindow *window,
- GdkWindowState unset_flags,
- GdkWindowState set_flags);
+void gdk_synthesize_surface_state (GdkSurface *surface,
+ GdkSurfaceState unset_flags,
+ GdkSurfaceState set_flags);
G_END_DECLS
diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c
index b1502e93eb..4b3358e2d7 100644
--- a/gdk/gdkmonitor.c
+++ b/gdk/gdkmonitor.c
@@ -34,7 +34,7 @@
* associated with a #GdkDisplay. GdkDisplay has APIs to enumerate
* monitors with gdk_display_get_n_monitors() and gdk_display_get_monitor(), and
* to find particular monitors with gdk_display_get_primary_monitor() or
- * gdk_display_get_monitor_at_window().
+ * gdk_display_get_monitor_at_surface().
*/
/**
@@ -410,8 +410,8 @@ 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
- * where it is better to use gdk_window_get_scale_factor() instead.
+ * 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 5c02d7371a..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_window_get_width (window);
- * height = gdk_window_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/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c
index 9aff8a2f69..fd4fa5a97a 100644
--- a/gdk/gdkpixbuf-drawable.c
+++ b/gdk/gdkpixbuf-drawable.c
@@ -24,7 +24,7 @@
#include "gdkpixbuf.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -38,7 +38,7 @@
* and manipulate pixbufs, see the #GdkPixbuf API documentation.
*
* The functions described here allow to obtain pixbufs from
- * #GdkWindows and cairo surfaces.
+ * #GdkSurfaces and cairo surfaces.
*/
static cairo_format_t
diff --git a/gdk/gdkseat.c b/gdk/gdkseat.c
index e193187c12..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 #GdkWindow 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,
@@ -267,10 +267,10 @@ gdk_seat_get_capabilities (GdkSeat *seat)
* events corresponding to the given capabilities. For example in GTK+ this
* is used for Drag and Drop operations, popup menus and such.
*
- * Note that if the event mask of a #GdkWindow has selected both button press
+ * 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,
- GdkWindow *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_WINDOW (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 3556323d29..bb0eb069f2 100644
--- a/gdk/gdkseat.h
+++ b/gdk/gdkseat.h
@@ -25,7 +25,7 @@
#endif
#include <glib-object.h>
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <gdk/gdkevents.h>
#include <gdk/gdktypes.h>
@@ -64,18 +64,18 @@ typedef enum {
/**
* GdkSeatGrabPrepareFunc:
* @seat: the #GdkSeat being grabbed
- * @window: the #GdkWindow 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,
- GdkWindow *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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
index 382cc042ba..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,
- GdkWindow *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_window_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_window_hide (window);
+ gdk_surface_hide (surface);
}
}
diff --git a/gdk/gdkseatprivate.h b/gdk/gdkseatprivate.h
index 22cdd08189..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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
new file mode 100644
index 0000000000..8f287d5199
--- /dev/null
+++ b/gdk/gdksurface.c
@@ -0,0 +1,6957 @@
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball,
+ * Josh MacDonald, Ryan Lortie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#include "config.h"
+
+#include <cairo-gobject.h>
+
+#include "gdksurface.h"
+
+#include "gdkrectangle.h"
+#include "gdkinternals.h"
+#include "gdkintl.h"
+#include "gdkdisplayprivate.h"
+#include "gdkdeviceprivate.h"
+#include "gdkmarshalers.h"
+#include "gdkframeclockidle.h"
+#include "gdksurfaceimpl.h"
+#include "gdkglcontextprivate.h"
+#include "gdkdrawingcontextprivate.h"
+#include "gdk-private.h"
+
+#include <math.h>
+
+#include <epoxy/gl.h>
+
+/* for the use of round() */
+#include "fallback-c89.c"
+
+#ifdef GDK_WINDOWING_WAYLAND
+#include "wayland/gdkwayland.h"
+#endif
+
+#undef DEBUG_SURFACE_PRINTING
+
+
+/**
+ * SECTION:surfaces
+ * @Short_description: Onscreen display areas in the target window system
+ * @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
+ * surface, the thing a user might think of as a “window” with a titlebar
+ * and so on; a #GtkWindow may contain many sub-GdkSurfaces.
+ */
+
+/**
+ * GdkSurface:
+ *
+ * The GdkSurface struct contains only private fields and
+ * should not be accessed directly.
+ */
+
+/* Historically a GdkSurface always matches a platform native window,
+ * 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 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 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 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 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 {
+ MOVED_TO_RECT,
+ LAST_SIGNAL
+};
+
+enum {
+ PROP_0,
+ PROP_CURSOR,
+ PROP_DISPLAY,
+ PROP_STATE,
+ LAST_PROP
+};
+
+/* Global info */
+
+static void gdk_surface_finalize (GObject *object);
+
+static void gdk_surface_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gdk_surface_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void gdk_surface_clear_backing_region (GdkSurface *surface);
+
+static void recompute_visible_regions (GdkSurface *private,
+ gboolean recalculate_children);
+static void gdk_surface_invalidate_in_parent (GdkSurface *private);
+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 *surface,
+ const cairo_region_t *region,
+ gboolean invalidate_children);
+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 *surface);
+
+static void gdk_surface_set_frame_clock (GdkSurface *surface,
+ GdkFrameClock *clock);
+
+
+static guint signals[LAST_SIGNAL] = { 0 };
+static GParamSpec *properties[LAST_PROP] = { NULL, };
+
+G_DEFINE_ABSTRACT_TYPE (GdkSurface, gdk_surface, G_TYPE_OBJECT)
+
+#ifdef DEBUG_SURFACE_PRINTING
+char *
+print_region (cairo_region_t *region)
+{
+ GString *s = g_string_new ("{");
+ if (cairo_region_is_empty (region))
+ {
+ g_string_append (s, "empty");
+ }
+ else
+ {
+ int num = cairo_region_num_rectangles (region);
+ cairo_rectangle_int_t r;
+
+ if (num == 1)
+ {
+ cairo_region_get_rectangle (region, 0, &r);
+ g_string_append_printf (s, "%dx%d @%d,%d", r.width, r.height, r.x, r.y);
+ }
+ else
+ {
+ int i;
+ cairo_region_get_extents (region, &r);
+ g_string_append_printf (s, "extent: %dx%d @%d,%d, details: ", r.width, r.height, r.x, r.y);
+ for (i = 0; i < num; i++)
+ {
+ cairo_region_get_rectangle (region, i, &r);
+ g_string_append_printf (s, "[%dx%d @%d,%d]", r.width, r.height, r.x, r.y);
+ if (i != num -1)
+ g_string_append (s, ", ");
+ }
+ }
+ }
+ g_string_append (s, "}");
+ return g_string_free (s, FALSE);
+}
+#endif
+
+static GList *
+list_insert_link_before (GList *list,
+ GList *sibling,
+ GList *link)
+{
+ if (list == NULL || sibling == list)
+ {
+ link->prev = NULL;
+ link->next = list;
+ if (list)
+ list->prev = link;
+ return link;
+ }
+ else if (sibling == NULL)
+ {
+ GList *last = g_list_last (list);
+
+ last->next = link;
+ link->prev = last;
+ link->next = NULL;
+
+ return list;
+ }
+ else
+ {
+ link->next = sibling;
+ link->prev = sibling->prev;
+ sibling->prev = link;
+
+ if (link->prev)
+ link->prev->next = link;
+
+ return list;
+ }
+}
+
+static void
+gdk_surface_init (GdkSurface *surface)
+{
+ /* 0-initialization is good for all other fields. */
+
+ surface->surface_type = GDK_SURFACE_CHILD;
+
+ 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;
+
+ surface->device_cursor = g_hash_table_new_full (NULL, NULL,
+ NULL, g_object_unref);
+}
+
+static void
+gdk_surface_class_init (GdkSurfaceClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gdk_surface_finalize;
+ object_class->set_property = gdk_surface_set_property;
+ object_class->get_property = gdk_surface_get_property;
+
+ /* Properties */
+
+ /**
+ * GdkSurface:cursor:
+ *
+ * The mouse pointer for a #GdkSurface. See gdk_surface_set_cursor() and
+ * gdk_surface_get_cursor() for details.
+ */
+ properties[PROP_CURSOR] =
+ g_param_spec_object ("cursor",
+ P_("Cursor"),
+ P_("Cursor"),
+ GDK_TYPE_CURSOR,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+ /**
+ * GdkSurface:display:
+ *
+ * The #GdkDisplay connection of the surface. See gdk_surface_get_display()
+ * for details.
+ */
+ properties[PROP_DISPLAY] =
+ g_param_spec_object ("display",
+ P_("Display"),
+ P_("Display"),
+ GDK_TYPE_DISPLAY,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ properties[PROP_STATE] =
+ g_param_spec_flags ("state",
+ P_("State"),
+ P_("State"),
+ GDK_TYPE_SURFACE_STATE, GDK_SURFACE_STATE_WITHDRAWN,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP, properties);
+
+ /**
+ * GdkSurface::moved-to-rect:
+ * @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 @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 @surface is finalized after being moved to a
+ * destination rectangle.
+ *
+ * @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 @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 @surface on-screen.
+ * Stability: Private
+ */
+ signals[MOVED_TO_RECT] =
+ g_signal_new (g_intern_static_string ("moved-to-rect"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL,
+ NULL,
+ _gdk_marshal_VOID__POINTER_POINTER_BOOLEAN_BOOLEAN,
+ G_TYPE_NONE,
+ 4,
+ G_TYPE_POINTER,
+ G_TYPE_POINTER,
+ G_TYPE_BOOLEAN,
+ G_TYPE_BOOLEAN);
+}
+
+static void
+seat_removed_cb (GdkDisplay *display,
+ GdkSeat *seat,
+ GdkSurface *surface)
+{
+ GdkDevice *device = gdk_seat_get_pointer (seat);
+
+ surface->devices_inside = g_list_remove (surface->devices_inside, device);
+ g_hash_table_remove (surface->device_cursor, device);
+
+ if (surface->device_events)
+ g_hash_table_remove (surface->device_events, device);
+}
+
+static void
+gdk_surface_finalize (GObject *object)
+{
+ GdkSurface *surface = GDK_SURFACE (object);
+
+ g_signal_handlers_disconnect_by_func (gdk_surface_get_display (surface),
+ seat_removed_cb, surface);
+
+ if (!GDK_SURFACE_DESTROYED (surface))
+ {
+ if (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_FOREIGN)
+ {
+ 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 (surface, TRUE);
+ }
+
+ if (surface->impl)
+ {
+ g_object_unref (surface->impl);
+ surface->impl = NULL;
+ }
+
+ if (surface->impl_surface != surface)
+ {
+ g_object_unref (surface->impl_surface);
+ surface->impl_surface = NULL;
+ }
+
+ if (surface->shape)
+ cairo_region_destroy (surface->shape);
+
+ if (surface->input_shape)
+ cairo_region_destroy (surface->input_shape);
+
+ if (surface->cursor)
+ g_object_unref (surface->cursor);
+
+ if (surface->device_cursor)
+ g_hash_table_destroy (surface->device_cursor);
+
+ if (surface->device_events)
+ g_hash_table_destroy (surface->device_events);
+
+ if (surface->devices_inside)
+ g_list_free (surface->devices_inside);
+
+ g_clear_object (&surface->display);
+
+ if (surface->opaque_region)
+ cairo_region_destroy (surface->opaque_region);
+
+ G_OBJECT_CLASS (gdk_surface_parent_class)->finalize (object);
+}
+
+static void
+gdk_surface_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GdkSurface *surface = GDK_SURFACE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CURSOR:
+ gdk_surface_set_cursor (surface, g_value_get_object (value));
+ break;
+
+ case PROP_DISPLAY:
+ surface->display = g_value_dup_object (value);
+ g_assert (surface->display != NULL);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gdk_surface_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GdkSurface *surface = GDK_SURFACE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CURSOR:
+ g_value_set_object (value, gdk_surface_get_cursor (surface));
+ break;
+
+ case PROP_DISPLAY:
+ g_value_set_object (value, surface->display);
+ break;
+
+ case PROP_STATE:
+ g_value_set_flags (value, surface->state);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static gboolean
+gdk_surface_is_subsurface (GdkSurface *surface)
+{
+ return surface->surface_type == GDK_SURFACE_SUBSURFACE;
+}
+
+static GdkSurface *
+gdk_surface_get_impl_surface (GdkSurface *surface)
+{
+ return surface->impl_surface;
+}
+
+GdkSurface *
+_gdk_surface_get_impl_surface (GdkSurface *surface)
+{
+ return gdk_surface_get_impl_surface (surface);
+}
+
+static gboolean
+gdk_surface_has_impl (GdkSurface *surface)
+{
+ return surface->impl_surface == surface;
+}
+
+static gboolean
+gdk_surface_is_toplevel (GdkSurface *surface)
+{
+ return
+ surface->parent == NULL ||
+ surface->parent->surface_type == GDK_SURFACE_ROOT;
+}
+
+gboolean
+_gdk_surface_has_impl (GdkSurface *surface)
+{
+ return gdk_surface_has_impl (surface);
+}
+
+static gboolean
+gdk_surface_has_no_impl (GdkSurface *surface)
+{
+ return surface->impl_surface != surface;
+}
+
+static void
+remove_sibling_overlapped_area (GdkSurface *surface,
+ cairo_region_t *region)
+{
+ GdkSurface *parent;
+ GdkSurface *sibling;
+ cairo_region_t *child_region;
+ GdkRectangle r;
+ GList *l;
+
+ parent = surface->parent;
+
+ if (gdk_surface_is_toplevel (surface))
+ return;
+
+ /* 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 == surface)
+ break;
+
+ if (!GDK_SURFACE_IS_MAPPED (sibling) || sibling->input_only)
+ continue;
+
+ r.x = sibling->x;
+ r.y = sibling->y;
+ r.width = sibling->width;
+ r.height = sibling->height;
+
+ child_region = cairo_region_create_rectangle (&r);
+
+ if (sibling->shape)
+ {
+ /* 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);
+ }
+
+ cairo_region_subtract (region, child_region);
+ cairo_region_destroy (child_region);
+ }
+
+ remove_sibling_overlapped_area (parent, region);
+
+ /* Convert back to surface coords */
+ cairo_region_translate (region, -surface->x, -surface->y);
+}
+
+static void
+remove_child_area (GdkSurface *surface,
+ gboolean for_input,
+ cairo_region_t *region)
+{
+ GdkSurface *child;
+ cairo_region_t *child_region;
+ GdkRectangle r;
+ GList *l;
+
+ for (l = surface->children; l; l = l->next)
+ {
+ child = l->data;
+
+ /* If region is empty already, no need to do
+ anything potentially costly */
+ if (cairo_region_is_empty (region))
+ break;
+
+ if (!GDK_SURFACE_IS_MAPPED (child) || child->input_only)
+ continue;
+
+ r.x = child->x;
+ r.y = child->y;
+ r.width = child->width;
+ r.height = child->height;
+
+ /* Bail early if child totally outside region */
+ if (cairo_region_contains_rectangle (region, &r) == CAIRO_REGION_OVERLAP_OUT)
+ continue;
+
+ child_region = cairo_region_create_rectangle (&r);
+
+ if (child->shape)
+ {
+ /* 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);
+ }
+
+ if (for_input)
+ {
+ if (child->input_shape)
+ cairo_region_intersect (child_region, child->input_shape);
+ }
+
+ cairo_region_subtract (region, child_region);
+ cairo_region_destroy (child_region);
+ }
+}
+
+static gboolean
+should_apply_clip_as_shape (GdkSurface *surface)
+{
+ return
+ gdk_surface_has_impl (surface) &&
+ /* Not for non-shaped toplevels */
+ (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 *surface,
+ cairo_region_t *region)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ /* 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
+ surfaces get resized */
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ if (region)
+ impl_class->shape_combine_region (surface,
+ region, 0, 0);
+ else if (surface->applied_shape)
+ impl_class->shape_combine_region (surface,
+ NULL, 0, 0);
+
+ surface->applied_shape = region != NULL;
+}
+
+static gboolean
+region_rect_equal (const cairo_region_t *region,
+ const GdkRectangle *rect)
+{
+ GdkRectangle extents;
+
+ if (cairo_region_num_rectangles (region) != 1)
+ return FALSE;
+
+ cairo_region_get_extents (region, &extents);
+
+ return extents.x == rect->x &&
+ extents.y == rect->y &&
+ extents.width == rect->width &&
+ extents.height == rect->height;
+}
+
+static void
+apply_clip_as_shape (GdkSurface *surface)
+{
+ GdkRectangle r;
+ cairo_region_t *region;
+
+ r.x = r.y = 0;
+ r.width = surface->width;
+ r.height = surface->height;
+
+ 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 surface. This is to avoid unneccessarily
+ adding meaningless shapes to all native subsurfaces */
+ if (!region_rect_equal (region, &r))
+ apply_shape (surface, region);
+ else
+ apply_shape (surface, NULL);
+
+ cairo_region_destroy (region);
+}
+
+static void
+recompute_visible_regions_internal (GdkSurface *private,
+ gboolean recalculate_clip,
+ gboolean recalculate_children)
+{
+ GdkRectangle r;
+ GList *l;
+ GdkSurface *child;
+ cairo_region_t *new_clip;
+ gboolean clip_region_changed;
+ gboolean abs_pos_changed;
+ int old_abs_x, old_abs_y;
+
+ old_abs_x = private->abs_x;
+ old_abs_y = private->abs_y;
+
+ /* Update absolute position */
+ if ((gdk_surface_has_impl (private) &&
+ private->surface_type != GDK_SURFACE_SUBSURFACE) ||
+ (gdk_surface_is_toplevel (private) &&
+ private->surface_type == GDK_SURFACE_SUBSURFACE))
+ {
+ /* Native surfaces and toplevel subsurfaces start here */
+ private->abs_x = 0;
+ private->abs_y = 0;
+ }
+ else
+ {
+ private->abs_x = private->parent->abs_x + private->x;
+ private->abs_y = private->parent->abs_y + private->y;
+ }
+
+ abs_pos_changed =
+ private->abs_x != old_abs_x ||
+ private->abs_y != old_abs_y;
+
+ /* Update clip region based on:
+ * parent clip
+ * surface size/position
+ */
+ clip_region_changed = FALSE;
+ if (recalculate_clip)
+ {
+ if (private->viewable)
+ {
+ /* Calculate visible region (sans children) in parent surface coords */
+ r.x = private->x;
+ r.y = private->y;
+ r.width = private->width;
+ r.height = private->height;
+ new_clip = cairo_region_create_rectangle (&r);
+
+ if (!gdk_surface_is_toplevel (private))
+ cairo_region_intersect (new_clip, private->parent->clip_region);
+
+ /* 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)
+ cairo_region_intersect (new_clip, private->shape);
+ }
+ else
+ new_clip = cairo_region_create ();
+
+ if (private->clip_region == NULL ||
+ !cairo_region_equal (private->clip_region, new_clip))
+ clip_region_changed = TRUE;
+
+ if (private->clip_region)
+ cairo_region_destroy (private->clip_region);
+ private->clip_region = new_clip;
+ }
+
+ /* Update all children, recursively (except for root, where children are not exact). */
+ if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
+ private->surface_type != GDK_SURFACE_ROOT)
+ {
+ for (l = private->children; l; l = l->next)
+ {
+ child = l->data;
+ /* Only recalculate clip if the the clip region changed, otherwise
+ * there is no way the child clip region could change (its has not e.g. moved)
+ * Except if recalculate_children is set to force child updates
+ */
+ recompute_visible_regions_internal (child,
+ recalculate_clip && (clip_region_changed || recalculate_children),
+ FALSE);
+ }
+ }
+}
+
+/* Call this when private has changed in one or more of these ways:
+ * size 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 surface didn’t change stacking order or size/pos, pass in TRUE
+ * for recalculate_siblings. (Mostly used internally for the recursion)
+ *
+ * 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
+recompute_visible_regions (GdkSurface *private,
+ gboolean recalculate_children)
+{
+ GdkSurface *toplevel;
+
+ toplevel = gdk_surface_get_toplevel (private);
+ toplevel->geometry_dirty = TRUE;
+
+ recompute_visible_regions_internal (private,
+ TRUE,
+ recalculate_children);
+}
+
+static void
+gdk_surface_clear_old_updated_area (GdkSurface *surface)
+{
+ int i;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (surface->old_updated_area[i])
+ {
+ cairo_region_destroy (surface->old_updated_area[i]);
+ surface->old_updated_area[i] = NULL;
+ }
+ }
+}
+
+static void
+gdk_surface_append_old_updated_area (GdkSurface *surface,
+ cairo_region_t *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 *surface)
+{
+ gdk_surface_clear_old_updated_area (surface);
+ recompute_visible_regions (surface, FALSE);
+}
+
+static GdkEventMask
+get_native_device_event_mask (GdkSurface *private,
+ GdkDevice *device)
+{
+ GdkEventMask event_mask;
+
+ if (device)
+ event_mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device));
+ else
+ event_mask = private->event_mask;
+
+ if (private->surface_type == GDK_SURFACE_ROOT ||
+ private->surface_type == GDK_SURFACE_FOREIGN)
+ return event_mask;
+ else
+ {
+ GdkEventMask mask;
+
+ mask = private->event_mask;
+
+ /* We need thse for all native surfaces so we can
+ emulate events on children: */
+ mask |=
+ GDK_EXPOSURE_MASK |
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_TOUCH_MASK |
+ GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_SCROLL_MASK;
+
+ return mask;
+ }
+}
+
+static GdkEventMask
+get_native_event_mask (GdkSurface *private)
+{
+ return get_native_device_event_mask (private, NULL);
+}
+
+GdkSurface*
+gdk_surface_new (GdkDisplay *display,
+ GdkSurface *parent,
+ GdkSurfaceAttr *attributes)
+{
+ GdkSurface *surface;
+ gboolean native;
+ GdkEventMask event_mask;
+
+ g_return_val_if_fail (attributes != NULL, NULL);
+
+ if (parent != NULL && GDK_SURFACE_DESTROYED (parent))
+ {
+ g_warning ("gdk_surface_new(): parent is destroyed");
+ return NULL;
+ }
+
+ surface = _gdk_display_create_surface (display);
+
+ surface->parent = parent;
+
+ surface->accept_focus = TRUE;
+ surface->focus_on_map = TRUE;
+
+ 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 surfaces
+ * before
+ */
+ if (parent == NULL)
+ surface->surface_type = GDK_SURFACE_TEMP;
+ else
+ surface->surface_type = GDK_SURFACE_CHILD;
+ }
+ else
+ surface->surface_type = attributes->surface_type;
+
+ /* Sanity checks */
+ 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 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 surfaces can only be used on Wayland");
+ return NULL;
+ }
+#endif
+ break;
+ case GDK_SURFACE_CHILD:
+ if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_ROOT ||
+ GDK_SURFACE_TYPE (parent) == 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 surfaces of type %d", surface->surface_type);
+ return NULL;
+ }
+
+ surface->event_mask = GDK_ALL_EVENTS_MASK;
+
+ if (attributes->wclass == GDK_INPUT_OUTPUT)
+ {
+ surface->input_only = FALSE;
+ }
+ else
+ {
+ surface->input_only = TRUE;
+ }
+
+ native = FALSE;
+
+ 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 (surface, frame_clock);
+ g_object_unref (frame_clock);
+
+ native = TRUE; /* Always use native surfaces for toplevels */
+ }
+
+#ifdef GDK_WINDOWING_WAYLAND
+ 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 (surface);
+
+ /* Create the impl */
+ _gdk_display_create_surface_impl (display, surface, parent, event_mask, attributes);
+ surface->impl_surface = surface;
+ }
+ else
+ {
+ surface->impl_surface = g_object_ref (surface->parent->impl_surface);
+ surface->impl = g_object_ref (surface->impl_surface->impl);
+ }
+
+ recompute_visible_regions (surface, FALSE);
+
+ g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), surface);
+
+ return surface;
+}
+
+/**
+ * gdk_surface_new_toplevel: (constructor)
+ * @display: the display to create the surface on
+ * @width: width of new surface
+ * @height: height of new surface
+ *
+ * Creates a new toplevel surface. The surface will be managed by the surface
+ * manager.
+ *
+ * Returns: (transfer full): the new #GdkSurface
+ **/
+GdkSurface *
+gdk_surface_new_toplevel (GdkDisplay *display,
+ gint width,
+ gint height)
+{
+ GdkSurfaceAttr attr;
+
+ g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
+ attr.wclass = GDK_INPUT_OUTPUT;
+ attr.x = 0;
+ attr.y = 0;
+ attr.width = width;
+ attr.height = height;
+ attr.surface_type = GDK_SURFACE_TOPLEVEL;
+
+ return gdk_surface_new (display, NULL, &attr);
+}
+
+/**
+ * gdk_surface_new_popup: (constructor)
+ * @display: the display to create the surface on
+ * @position: position of the surface on screen
+ *
+ * Creates a new toplevel popup surface. The surface will bypass surface
+ * management.
+ *
+ * Returns: (transfer full): the new #GdkSurface
+ **/
+GdkSurface *
+gdk_surface_new_popup (GdkDisplay *display,
+ const GdkRectangle *position)
+{
+ GdkSurfaceAttr attr;
+
+ g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+ g_return_val_if_fail (position != NULL, NULL);
+
+ attr.wclass = GDK_INPUT_OUTPUT;
+ attr.x = position->x;
+ attr.y = position->y;
+ attr.width = position->width;
+ attr.height = position->height;
+ attr.surface_type = GDK_SURFACE_TEMP;
+
+ return gdk_surface_new (display, NULL, &attr);
+}
+
+/**
+ * gdk_surface_new_temp: (constructor)
+ * @display: the display to create the surface on
+ *
+ * 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.
+ *
+ * Returns: (transfer full): the new #GdkSurface
+ **/
+GdkSurface *
+gdk_surface_new_temp (GdkDisplay *display)
+{
+ GdkSurfaceAttr attr;
+
+ g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
+ attr.wclass = GDK_INPUT_ONLY;
+ attr.x = -100;
+ attr.y = -100;
+ attr.width = 10;
+ attr.height = 10;
+ attr.surface_type = GDK_SURFACE_TEMP;
+
+ return gdk_surface_new (display, NULL, &attr);
+}
+
+/**
+ * gdk_surface_new_child: (constructor)
+ * @parent: the parent surface
+ * @position: placement of the surface inside @parent
+ *
+ * Creates a new client-side child surface.
+ *
+ * Returns: (transfer full): the new #GdkSurface
+ **/
+GdkSurface *
+gdk_surface_new_child (GdkSurface *parent,
+ const GdkRectangle *position)
+{
+ GdkSurfaceAttr attr;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
+
+ attr.wclass = GDK_INPUT_OUTPUT;
+ attr.x = position->x;
+ attr.y = position->y;
+ attr.width = position->width;
+ attr.height = position->height;
+ attr.surface_type = GDK_SURFACE_CHILD;
+
+ return gdk_surface_new (gdk_surface_get_display (parent), parent, &attr);
+}
+
+static void
+update_pointer_info_foreach (GdkDisplay *display,
+ GdkDevice *device,
+ GdkPointerSurfaceInfo *pointer_info,
+ gpointer user_data)
+{
+ GdkSurface *surface = user_data;
+
+ if (pointer_info->surface_under_pointer == surface)
+ {
+ g_object_unref (pointer_info->surface_under_pointer);
+ pointer_info->surface_under_pointer = NULL;
+ }
+}
+
+static void
+surface_remove_from_pointer_info (GdkSurface *surface,
+ GdkDisplay *display)
+{
+ _gdk_display_pointer_info_foreach (display,
+ update_pointer_info_foreach,
+ surface);
+}
+
+static void
+gdk_surface_free_current_paint (GdkSurface *surface)
+{
+ cairo_surface_destroy (surface->current_paint.surface);
+ surface->current_paint.surface = NULL;
+
+ cairo_region_destroy (surface->current_paint.region);
+ surface->current_paint.region = NULL;
+
+ surface->current_paint.surface_needs_composite = FALSE;
+}
+
+/**
+ * _gdk_surface_destroy_hierarchy:
+ * @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 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 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 surface. Like gdk_surface_destroy(),
+ * but does not drop the reference count created by gdk_surface_new().
+ **/
+static void
+_gdk_surface_destroy_hierarchy (GdkSurface *surface,
+ gboolean recursing,
+ gboolean recursing_native,
+ gboolean foreign_destroy)
+{
+ GdkSurfaceImplClass *impl_class;
+ GdkSurface *temp_surface;
+ GdkDisplay *display;
+ GList *tmp;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ display = gdk_surface_get_display (surface);
+
+ switch (surface->surface_type)
+ {
+ default:
+ g_assert_not_reached ();
+ break;
+
+ case GDK_SURFACE_ROOT:
+ if (!gdk_display_is_closed (display))
+ {
+ g_error ("attempted to destroy root window");
+ break;
+ }
+ /* else fall thru */
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_CHILD:
+ case GDK_SURFACE_TEMP:
+ case GDK_SURFACE_FOREIGN:
+ case GDK_SURFACE_SUBSURFACE:
+ if (surface->surface_type == GDK_SURFACE_FOREIGN && !foreign_destroy)
+ {
+ }
+ else
+ {
+ if (surface->parent)
+ {
+ if (surface->parent->children)
+ surface->parent->children = g_list_remove_link (surface->parent->children, &surface->children_list_node);
+
+ if (!recursing &&
+ GDK_SURFACE_IS_MAPPED (surface))
+ {
+ recompute_visible_regions (surface, FALSE);
+ gdk_surface_invalidate_in_parent (surface);
+ }
+ }
+
+ if (surface->gl_paint_context)
+ {
+ /* Make sure to destroy if current */
+ g_object_run_dispose (G_OBJECT (surface->gl_paint_context));
+ g_object_unref (surface->gl_paint_context);
+ surface->gl_paint_context = NULL;
+ }
+
+ if (surface->frame_clock)
+ {
+ g_object_run_dispose (G_OBJECT (surface->frame_clock));
+ gdk_surface_set_frame_clock (surface, NULL);
+ }
+
+ gdk_surface_free_current_paint (surface);
+
+ if (surface->surface_type == GDK_SURFACE_FOREIGN)
+ g_assert (surface->children == NULL);
+ else
+ {
+ tmp = surface->children;
+ surface->children = NULL;
+ /* No need to free children list, its all made up of in-struct nodes */
+
+ while (tmp)
+ {
+ temp_surface = tmp->data;
+ tmp = tmp->next;
+
+ if (temp_surface)
+ _gdk_surface_destroy_hierarchy (temp_surface,
+ TRUE,
+ recursing_native || gdk_surface_has_impl (surface),
+ foreign_destroy);
+ }
+ }
+
+ _gdk_surface_clear_update_area (surface);
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ 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 (surface);
+ }
+
+ surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
+ surface->parent = NULL;
+ surface->destroyed = TRUE;
+
+ surface_remove_from_pointer_info (surface, display);
+
+ if (surface->clip_region)
+ {
+ cairo_region_destroy (surface->clip_region);
+ surface->clip_region = NULL;
+ }
+
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
+ }
+ break;
+ }
+}
+
+/**
+ * _gdk_surface_destroy:
+ * @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 surface. Like gdk_surface_destroy(),
+ * but does not drop the reference count created by gdk_surface_new().
+ **/
+void
+_gdk_surface_destroy (GdkSurface *surface,
+ gboolean foreign_destroy)
+{
+ _gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, foreign_destroy);
+}
+
+/**
+ * gdk_surface_destroy:
+ * @surface: a #GdkSurface
+ *
+ * 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 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 *surface)
+{
+ _gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, FALSE);
+ g_object_unref (surface);
+}
+
+/**
+ * gdk_surface_set_user_data:
+ * @surface: a #GdkSurface
+ * @user_data: (allow-none) (type GObject.Object): user data
+ *
+ * For most purposes this function is deprecated in favor of
+ * g_object_set_data(). However, for historical reasons GTK+ stores
+ * 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 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 *surface,
+ gpointer user_data)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ surface->user_data = user_data;
+}
+
+/**
+ * gdk_surface_get_user_data:
+ * @surface: a #GdkSurface
+ * @data: (out): return location for 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 *surface,
+ gpointer *data)
+{
+ *data = surface->user_data;
+}
+
+/**
+ * gdk_surface_get_surface_type:
+ * @surface: a #GdkSurface
+ *
+ * Gets the type of the surface. See #GdkSurfaceType.
+ *
+ * Returns: type of surface
+ **/
+GdkSurfaceType
+gdk_surface_get_surface_type (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), (GdkSurfaceType) -1);
+
+ return GDK_SURFACE_TYPE (surface);
+}
+
+/**
+ * gdk_surface_get_display:
+ * @surface: a #GdkSurface
+ *
+ * Gets the #GdkDisplay associated with a #GdkSurface.
+ *
+ * Returns: (transfer none): the #GdkDisplay associated with @surface
+ **/
+GdkDisplay *
+gdk_surface_get_display (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ return surface->display;
+}
+/**
+ * gdk_surface_is_destroyed:
+ * @surface: a #GdkSurface
+ *
+ * Check to see if a surface is destroyed..
+ *
+ * Returns: %TRUE if the surface is destroyed
+ **/
+gboolean
+gdk_surface_is_destroyed (GdkSurface *surface)
+{
+ return GDK_SURFACE_DESTROYED (surface);
+}
+
+/**
+ * gdk_surface_has_native:
+ * @surface: a #GdkSurface
+ *
+ * Checks whether the surface has a native surface or not.
+ *
+ * Returns: %TRUE if the @surface has a native surface, %FALSE otherwise.
+ */
+gboolean
+gdk_surface_has_native (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->parent == NULL || surface->parent->impl != surface->impl;
+}
+
+/**
+ * gdk_surface_get_position:
+ * @surface: a #GdkSurface
+ * @x: (out) (allow-none): X coordinate of surface
+ * @y: (out) (allow-none): Y coordinate of surface
+ *
+ * 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 surface position, regardless of which events have been
+ * received or processed.
+ *
+ * The position coordinates are relative to the surface’s parent surface.
+ *
+ **/
+void
+gdk_surface_get_position (GdkSurface *surface,
+ gint *x,
+ gint *y)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (x)
+ *x = surface->x;
+ if (y)
+ *y = surface->y;
+}
+
+/**
+ * gdk_surface_get_parent:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface
+ **/
+GdkSurface*
+gdk_surface_get_parent (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ if (gdk_surface_is_subsurface (surface))
+ return surface->transient_for;
+ else
+ return surface->parent;
+}
+
+/**
+ * gdk_surface_get_toplevel:
+ * @surface: a #GdkSurface
+ *
+ * Gets the toplevel surface that’s an ancestor of @surface.
+ *
+ * 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 surface containing @surface
+ **/
+GdkSurface *
+gdk_surface_get_toplevel (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ while (surface->surface_type == GDK_SURFACE_CHILD ||
+ surface->surface_type == GDK_SURFACE_SUBSURFACE)
+ {
+ if (gdk_surface_is_toplevel (surface))
+ break;
+ surface = surface->parent;
+ }
+
+ return surface;
+}
+
+/**
+ * gdk_surface_get_children:
+ * @surface: a #GdkSurface
+ *
+ * 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 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 surfaces inside @surface
+ **/
+GList*
+gdk_surface_get_children (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return NULL;
+
+ return g_list_copy (surface->children);
+}
+
+/**
+ * gdk_surface_peek_children:
+ * @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 surfaces in @surface
+ **/
+GList *
+gdk_surface_peek_children (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return NULL;
+
+ return surface->children;
+}
+
+
+/**
+ * gdk_surface_get_children_with_user_data:
+ * @surface: a #GdkSurface
+ * @user_data: user data to look for
+ *
+ * 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 surface is first.
+ *
+ * Returns: (transfer container) (element-type GdkSurface):
+ * list of child surfaces inside @surface
+ **/
+GList *
+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 (surface), NULL);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return NULL;
+
+ res = NULL;
+ for (l = surface->children; l != NULL; l = l->next)
+ {
+ child = l->data;
+
+ if (child->user_data == user_data)
+ res = g_list_prepend (res, child);
+ }
+
+ return res;
+}
+
+
+/**
+ * gdk_surface_is_visible:
+ * @surface: a #GdkSurface
+ *
+ * Checks whether the surface has been mapped (with gdk_surface_show() or
+ * gdk_surface_show_unraised()).
+ *
+ * Returns: %TRUE if the surface is mapped
+ **/
+gboolean
+gdk_surface_is_visible (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return GDK_SURFACE_IS_MAPPED (surface);
+}
+
+/**
+ * gdk_surface_is_viewable:
+ * @surface: a #GdkSurface
+ *
+ * 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
+ * surface.)
+ *
+ * Returns: %TRUE if the surface is viewable
+ **/
+gboolean
+gdk_surface_is_viewable (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ if (surface->destroyed)
+ return FALSE;
+
+ return surface->viewable;
+}
+
+/**
+ * gdk_surface_get_state:
+ * @surface: a #GdkSurface
+ *
+ * Gets the bitwise OR of the currently active surface state flags,
+ * from the #GdkSurfaceState enumeration.
+ *
+ * Returns: surface state bitfield
+ **/
+GdkSurfaceState
+gdk_surface_get_state (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->state;
+}
+
+static cairo_content_t
+gdk_surface_get_content (GdkSurface *surface)
+{
+ cairo_surface_t *cairo_surface;
+ cairo_content_t content;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+
+ 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 *surface)
+{
+ 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 *surface,
+ GError **error)
+{
+ GError *internal_error = NULL;
+
+ if (GDK_DISPLAY_DEBUG_CHECK (surface->display, GL_DISABLE))
+ {
+ g_set_error_literal (error, GDK_GL_ERROR,
+ GDK_GL_ERROR_NOT_AVAILABLE,
+ _("GL support disabled via GDK_DEBUG"));
+ return NULL;
+ }
+
+ if (surface->impl_surface->gl_paint_context == NULL)
+ {
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ if (impl_class->create_gl_context == NULL)
+ {
+ g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
+ _("The current backend does not support OpenGL"));
+ return NULL;
+ }
+
+ surface->impl_surface->gl_paint_context =
+ impl_class->create_gl_context (surface->impl_surface,
+ TRUE,
+ NULL,
+ &internal_error);
+ }
+
+ if (internal_error != NULL)
+ {
+ g_propagate_error (error, internal_error);
+ g_clear_object (&(surface->impl_surface->gl_paint_context));
+ return NULL;
+ }
+
+ 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 (&(surface->impl_surface->gl_paint_context));
+ return NULL;
+ }
+
+ return surface->impl_surface->gl_paint_context;
+}
+
+/**
+ * gdk_surface_create_gl_context:
+ * @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 surface or surface.
+ *
+ * If the creation of the #GdkGLContext failed, @error will be set.
+ *
+ * Before using the returned #GdkGLContext, you will need to
+ * call gdk_gl_context_make_current() or gdk_gl_context_realize().
+ *
+ * Returns: (transfer full): the newly created #GdkGLContext, or
+ * %NULL on error
+ **/
+GdkGLContext *
+gdk_surface_create_gl_context (GdkSurface *surface,
+ GError **error)
+{
+ GdkGLContext *paint_context;
+
+ 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 (surface, error);
+ if (paint_context == NULL)
+ return NULL;
+
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_gl_context (surface->impl_surface,
+ FALSE,
+ paint_context,
+ error);
+}
+
+/**
+ * gdk_surface_create_vulkan_context:
+ * @surface: a #GdkSurface
+ * @error: return location for an error
+ *
+ * Creates a new #GdkVulkanContext for rendering on @surface.
+ *
+ * If the creation of the #GdkVulkanContext failed, @error will be set.
+ *
+ * Returns: (transfer full): the newly created #GdkVulkanContext, or
+ * %NULL on error
+ **/
+GdkVulkanContext *
+gdk_surface_create_vulkan_context (GdkSurface *surface,
+ GError **error)
+{
+ GdkDisplay *display;
+
+ 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 (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 (surface);
+
+ if (GDK_DISPLAY_GET_CLASS (display)->vk_extension_name == NULL)
+ {
+ g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
+ "The %s backend has no Vulkan support.", G_OBJECT_TYPE_NAME (display));
+ return FALSE;
+ }
+
+ return g_initable_new (GDK_DISPLAY_GET_CLASS (display)->vk_context_type,
+ NULL,
+ error,
+ "surface", surface,
+ NULL);
+}
+
+static void
+gdk_surface_begin_paint_internal (GdkSurface *surface,
+ const cairo_region_t *region)
+{
+ GdkRectangle clip_box;
+ GdkSurfaceImplClass *impl_class;
+ double sx, sy;
+ gboolean needs_surface;
+ cairo_content_t surface_content;
+
+ if (surface->current_paint.surface != NULL)
+ {
+ g_warning ("A paint operation on the surface is alredy in progress. "
+ "This is not allowed.");
+ return;
+ }
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ needs_surface = TRUE;
+ if (impl_class->begin_paint)
+ needs_surface = impl_class->begin_paint (surface);
+
+ 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 (surface);
+
+ if (needs_surface)
+ {
+ 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 (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);
+
+ surface->current_paint.surface_needs_composite = TRUE;
+ }
+ else
+ {
+ surface->current_paint.surface = gdk_surface_ref_impl_surface (surface);
+ surface->current_paint.surface_needs_composite = FALSE;
+ }
+
+ if (!cairo_region_is_empty (surface->current_paint.region))
+ gdk_surface_clear_backing_region (surface);
+}
+
+static void
+gdk_surface_end_paint_internal (GdkSurface *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+ cairo_t *cr;
+
+ 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 (surface->impl);
+
+ if (impl_class->end_paint)
+ impl_class->end_paint (surface);
+
+ if (surface->current_paint.surface_needs_composite)
+ {
+ cairo_surface_t *cairo_surface;
+
+ cairo_surface = gdk_surface_ref_impl_surface (surface);
+ cr = cairo_create (cairo_surface);
+
+ 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);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ cairo_surface_flush (cairo_surface);
+ cairo_surface_destroy (cairo_surface);
+ }
+
+ gdk_surface_free_current_paint (surface);
+}
+
+/**
+ * gdk_surface_begin_draw_frame:
+ * @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 @surface, and provides you with a #GdkDrawingContext.
+ *
+ * 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 @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 @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 @surface directly without
+ * calling gdk_surface_begin_draw_frame(), the user may see flicker
+ * as individual drawing operations are performed in sequence.
+ *
+ * When using GTK+, the widget system automatically places calls to
+ * gdk_surface_begin_draw_frame() and gdk_surface_end_draw_frame() around
+ * emissions of the `GtkWidget::draw` signal. That is, if you’re
+ * drawing the contents of the widget yourself, you can assume that the
+ * widget has a cleared background, is already set as the clip region,
+ * and already has a backing store. Therefore in most cases, application
+ * code in GTK does not need to call gdk_surface_begin_draw_frame()
+ * explicitly.
+ *
+ * Returns: (transfer none): a #GdkDrawingContext context that should be
+ * used to draw the contents of the surface; the returned context is owned
+ * by GDK.
+ */
+GdkDrawingContext *
+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 (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) == surface, NULL);
+ }
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return NULL;
+
+ if (surface->drawing_context != NULL)
+ {
+ 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.", surface);
+ return NULL;
+ }
+
+ real_region = cairo_region_copy (region);
+
+ if (draw_context)
+ gdk_draw_context_begin_frame (draw_context, real_region);
+ else
+ gdk_surface_begin_paint_internal (surface, real_region);
+
+ context = g_object_new (GDK_TYPE_DRAWING_CONTEXT,
+ "surface", surface,
+ "paint-context", draw_context,
+ "clip", real_region,
+ NULL);
+
+ /* Do not take a reference, to avoid creating cycles */
+ surface->drawing_context = context;
+
+ cairo_region_destroy (real_region);
+
+ return context;
+}
+
+/**
+ * gdk_surface_end_draw_frame:
+ * @surface: a #GdkSurface
+ * @context: the #GdkDrawingContext created by gdk_surface_begin_draw_frame()
+ *
+ * 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.
+ *
+ * It is an error to call this function without a matching
+ * gdk_surface_begin_frame() first.
+ */
+void
+gdk_surface_end_draw_frame (GdkSurface *surface,
+ GdkDrawingContext *context)
+{
+ GdkDrawContext *paint_context;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (GDK_IS_DRAWING_CONTEXT (context));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (surface->drawing_context == NULL)
+ {
+ g_critical ("The surface %p has no drawing context. You must call "
+ "gdk_surface_begin_draw_frame() before calling "
+ "gdk_surface_end_draw_frame().", surface);
+ return;
+ }
+ g_return_if_fail (surface->drawing_context == context);
+
+ paint_context = gdk_drawing_context_get_paint_context (context);
+ if (paint_context)
+ {
+ cairo_region_t *clip = gdk_drawing_context_get_clip (context);
+
+ gdk_draw_context_end_frame (paint_context,
+ clip,
+ surface->active_update_area);
+
+ cairo_region_destroy (clip);
+ }
+ else
+ {
+ gdk_surface_end_paint_internal (surface);
+ }
+
+ surface->drawing_context = NULL;
+
+ g_object_unref (context);
+}
+
+/*< private >
+ * gdk_surface_get_current_paint_region:
+ * @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 *surface)
+{
+ cairo_region_t *region;
+
+ if (surface->impl_surface->current_paint.region != NULL)
+ {
+ 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 (surface->clip_region);
+ }
+
+ return region;
+}
+
+/*< private >
+ * gdk_surface_get_drawing_context:
+ * @surface: a #GdkSurface
+ *
+ * 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 *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return NULL;
+
+ return surface->drawing_context;
+}
+
+/**
+ * gdk_surface_get_clip_region:
+ * @surface: a #GdkSurface
+ *
+ * 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 surface is obscured by other surfaces,
+ * but no area outside of this region will be affected by drawing
+ * primitives.
+ *
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
+ * when you are done.
+ **/
+cairo_region_t*
+gdk_surface_get_clip_region (GdkSurface *surface)
+{
+ cairo_region_t *result;
+
+ g_return_val_if_fail (GDK_SURFACE (surface), NULL);
+
+ result = cairo_region_copy (surface->clip_region);
+
+ if (surface->current_paint.region != NULL)
+ cairo_region_intersect (result, surface->current_paint.region);
+
+ return result;
+}
+
+/**
+ * gdk_surface_get_visible_region:
+ * @surface: a #GdkSurface
+ *
+ * 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 *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ return cairo_region_copy (surface->clip_region);
+}
+
+static void
+gdk_surface_clear_backing_region (GdkSurface *surface)
+{
+ cairo_t *cr;
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ cr = cairo_create (surface->current_paint.surface);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+ 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 surface. This should not be used
+ * from very many places: be careful! */
+static cairo_surface_t *
+ref_surface_surface (GdkSurface *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 (surface);
+}
+
+/* This is used in places like gdk_cairo_set_source_surface and
+ * 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 *surface)
+{
+ cairo_surface_t *cairo_surface;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ cairo_surface = ref_surface_surface (surface);
+
+ if (gdk_surface_has_impl (surface))
+ {
+ return cairo_surface;
+ }
+ else
+ {
+ cairo_surface_t *subsurface;
+ 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_surfaces = NULL;
+
+static inline gboolean
+gdk_surface_is_ancestor (GdkSurface *surface,
+ GdkSurface *ancestor)
+{
+ while (surface)
+ {
+ GdkSurface *parent = surface->parent;
+
+ if (parent == ancestor)
+ return TRUE;
+
+ surface = parent;
+ }
+
+ return FALSE;
+}
+
+static void
+gdk_surface_add_update_surface (GdkSurface *surface)
+{
+ GSList *tmp;
+ GSList *prev = NULL;
+ gboolean has_ancestor_in_list = FALSE;
+
+ /* 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_surfaces, surface);
+ if (tmp != NULL)
+ return;
+
+ for (tmp = update_surfaces; tmp; tmp = tmp->next)
+ {
+ GdkSurface *parent = surface->parent;
+
+ /* 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 (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 surfaces
+ */
+ if (parent == GDK_SURFACE (tmp->data)->parent)
+ {
+ if (parent != NULL)
+ {
+ 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);
+ if (index > sibling_index)
+ break;
+ prev = tmp;
+ }
+ }
+ /* here, tmp got advanced past all lower stacked siblings */
+ tmp = g_slist_prepend (tmp, g_object_ref (surface));
+ if (prev)
+ prev->next = tmp;
+ else
+ update_surfaces = tmp;
+ return;
+ }
+
+ /* 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, surface))
+ {
+ tmp = g_slist_prepend (tmp, g_object_ref (surface));
+
+ if (prev)
+ prev->next = tmp;
+ else
+ update_surfaces = tmp;
+ return;
+ }
+
+ /* if we're at the end of the list and had an ancestor it it,
+ * append to the list
+ */
+ if (! tmp->next && has_ancestor_in_list)
+ {
+ tmp = g_slist_append (tmp, g_object_ref (surface));
+ return;
+ }
+
+ prev = tmp;
+ }
+
+ /* 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_surfaces = g_slist_prepend (update_surfaces, g_object_ref (surface));
+}
+
+static void
+gdk_surface_remove_update_surface (GdkSurface *surface)
+{
+ GSList *link;
+
+ link = g_slist_find (update_surfaces, surface);
+ if (link != NULL)
+ {
+ update_surfaces = g_slist_delete_link (update_surfaces, link);
+ g_object_unref (surface);
+ }
+}
+
+static gboolean
+gdk_surface_is_toplevel_frozen (GdkSurface *surface)
+{
+ GdkSurface *toplevel;
+
+ toplevel = gdk_surface_get_toplevel (surface);
+
+ return toplevel->update_and_descendants_freeze_count > 0;
+}
+
+static void
+gdk_surface_schedule_update (GdkSurface *surface)
+{
+ GdkFrameClock *frame_clock;
+
+ if (surface &&
+ (surface->update_freeze_count ||
+ gdk_surface_is_toplevel_frozen (surface)))
+ return;
+
+ /* 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 (surface);
+ if (frame_clock)
+ gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (surface),
+ GDK_FRAME_CLOCK_PHASE_PAINT);
+}
+
+void
+_gdk_surface_process_updates_recurse (GdkSurface *surface,
+ cairo_region_t *expose_region)
+{
+ cairo_region_t *clipped_expose_region;
+ GdkEvent *event;
+
+ if (surface->destroyed)
+ return;
+
+ clipped_expose_region = cairo_region_copy (expose_region);
+
+ cairo_region_intersect (clipped_expose_region, surface->clip_region);
+
+ if (cairo_region_is_empty (clipped_expose_region))
+ goto out;
+
+ /* Paint the surface before the children, clipped to the surface region */
+
+ event = gdk_event_new (GDK_EXPOSE);
+ 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);
+ cairo_region_get_extents (clipped_expose_region, &event->expose.area);
+
+ _gdk_event_emit (event);
+ gdk_event_free (event);
+
+ out:
+ cairo_region_destroy (clipped_expose_region);
+}
+
+
+static void
+gdk_surface_update_native_shapes (GdkSurface *surface)
+{
+ if (should_apply_clip_as_shape (surface))
+ apply_clip_as_shape (surface);
+}
+
+/* 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 *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+ GdkSurface *toplevel;
+
+ toplevel = gdk_surface_get_toplevel (surface);
+ if (toplevel->geometry_dirty)
+ {
+ gdk_surface_update_native_shapes (toplevel);
+ toplevel->geometry_dirty = FALSE;
+ }
+
+ /* Ensure the surface lives while updating it */
+ g_object_ref (surface);
+
+ surface->in_update = TRUE;
+
+ /* If an update got queued during update processing, we can get a
+ * surface in the update queue that has an empty update_area.
+ * just ignore it.
+ */
+ if (surface->update_area)
+ {
+ g_assert (surface->active_update_area == NULL); /* No reentrancy */
+
+ surface->active_update_area = surface->update_area;
+ surface->update_area = NULL;
+
+ if (gdk_surface_is_viewable (surface))
+ {
+ cairo_region_t *expose_region;
+
+ expose_region = cairo_region_copy (surface->active_update_area);
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ /* Clip to part visible in impl surface */
+ cairo_region_intersect (expose_region, surface->clip_region);
+
+ if (impl_class->queue_antiexpose)
+ impl_class->queue_antiexpose (surface, expose_region);
+
+ impl_class->process_updates_recurse (surface, expose_region);
+
+ gdk_surface_append_old_updated_area (surface, surface->active_update_area);
+
+ cairo_region_destroy (expose_region);
+ }
+
+ cairo_region_destroy (surface->active_update_area);
+ surface->active_update_area = NULL;
+ }
+
+ surface->in_update = FALSE;
+
+ g_object_unref (surface);
+}
+
+static void
+gdk_surface_paint_on_clock (GdkFrameClock *clock,
+ void *data)
+{
+ GdkSurface *surface;
+
+ surface = GDK_SURFACE (data);
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->impl_surface == surface);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ g_object_ref (surface);
+
+ 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. */
+ !surface->in_update)
+ {
+ gdk_surface_process_updates_internal (surface);
+ gdk_surface_remove_update_surface (surface);
+ }
+
+ g_object_unref (surface);
+}
+
+static void
+gdk_surface_invalidate_rect_full (GdkSurface *surface,
+ const GdkRectangle *rect,
+ gboolean invalidate_children)
+{
+ GdkRectangle surface_rect;
+ cairo_region_t *region;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (surface->input_only || !surface->viewable)
+ return;
+
+ if (!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 (surface, region, invalidate_children);
+ cairo_region_destroy (region);
+}
+
+/**
+ * gdk_surface_invalidate_rect:
+ * @surface: a #GdkSurface
+ * @rect: (allow-none): rectangle to invalidate or %NULL to invalidate the whole
+ * 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 *surface,
+ const GdkRectangle *rect,
+ gboolean invalidate_children)
+{
+ gdk_surface_invalidate_rect_full (surface, rect, invalidate_children);
+}
+
+static void
+impl_surface_add_update_area (GdkSurface *impl_surface,
+ cairo_region_t *region)
+{
+ if (impl_surface->update_area)
+ cairo_region_union (impl_surface->update_area, region);
+ else
+ {
+ 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 *surface,
+ const cairo_region_t *region,
+ GdkSurfaceChildFunc child_func,
+ gpointer user_data)
+{
+ cairo_region_t *visible_region;
+ cairo_rectangle_int_t r;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (surface->input_only ||
+ !surface->viewable ||
+ cairo_region_is_empty (region) ||
+ surface->surface_type == GDK_SURFACE_ROOT)
+ return;
+
+ r.x = 0;
+ r.y = 0;
+
+ visible_region = cairo_region_copy (region);
+
+ while (surface != NULL &&
+ !cairo_region_is_empty (visible_region))
+ {
+ r.width = surface->width;
+ r.height = surface->height;
+ cairo_region_intersect_rectangle (visible_region, &r);
+
+ if (gdk_surface_has_impl (surface))
+ {
+ impl_surface_add_update_area (surface, visible_region);
+ break;
+ }
+ else
+ {
+ cairo_region_translate (visible_region,
+ surface->x, surface->y);
+ surface = surface->parent;
+ }
+ }
+
+ cairo_region_destroy (visible_region);
+}
+
+/**
+ * gdk_surface_invalidate_maybe_recurse:
+ * @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 @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,
+ * so there’s no need to do forces redraws manually, you just need to
+ * invalidate regions that you know should be redrawn.
+ *
+ * The @child_func parameter controls whether the region of
+ * 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 *surface,
+ const cairo_region_t *region,
+ GdkSurfaceChildFunc child_func,
+ gpointer user_data)
+{
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
+ child_func, user_data);
+}
+
+static gboolean
+true_predicate (GdkSurface *surface,
+ gpointer user_data)
+{
+ return TRUE;
+}
+
+static void
+gdk_surface_invalidate_region_full (GdkSurface *surface,
+ const cairo_region_t *region,
+ gboolean invalidate_children)
+{
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
+ invalidate_children ?
+ true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
+ NULL);
+}
+
+/**
+ * gdk_surface_invalidate_region:
+ * @surface: a #GdkSurface
+ * @region: a #cairo_region_t
+ * @invalidate_children: %TRUE to also invalidate child surfaces
+ *
+ * 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,
+ * so there’s no need to do forces redraws manually, you just need to
+ * invalidate regions that you know should be redrawn.
+ *
+ * The @invalidate_children parameter controls whether the region of
+ * 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 *surface,
+ const cairo_region_t *region,
+ gboolean invalidate_children)
+{
+ gdk_surface_invalidate_maybe_recurse (surface, region,
+ invalidate_children ?
+ true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
+ NULL);
+}
+
+/**
+ * _gdk_surface_invalidate_for_expose:
+ * @surface: a #GdkSurface
+ * @region: a #cairo_region_t
+ *
+ * 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 surface system. It exposes the native surface, plus
+ * any non-native child surfaces.
+ **/
+void
+_gdk_surface_invalidate_for_expose (GdkSurface *surface,
+ cairo_region_t *region)
+{
+ gdk_surface_invalidate_maybe_recurse_full (surface, region,
+ (gboolean (*) (GdkSurface *, gpointer))gdk_surface_has_no_impl,
+ NULL);
+}
+
+
+/**
+ * gdk_surface_get_update_area:
+ * @surface: a #GdkSurface
+ *
+ * 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 @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 @surface
+ **/
+cairo_region_t *
+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 (surface), NULL);
+
+ impl_surface = gdk_surface_get_impl_surface (surface);
+
+ if (impl_surface->update_area)
+ {
+ tmp_region = cairo_region_copy (surface->clip_region);
+ /* Convert to impl coords */
+ 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))
+ {
+ cairo_region_destroy (tmp_region);
+ return NULL;
+ }
+ else
+ {
+ /* Convert from impl coords */
+ cairo_region_translate (tmp_region, -surface->abs_x, -surface->abs_y);
+
+ /* 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 (surface, FALSE, to_remove);
+ remove_sibling_overlapped_area (surface, to_remove);
+
+ /* Remove from update_area */
+ 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);
+
+ if (cairo_region_is_empty (impl_surface->update_area))
+ {
+ cairo_region_destroy (impl_surface->update_area);
+ impl_surface->update_area = NULL;
+
+ gdk_surface_remove_update_surface ((GdkSurface *)impl_surface);
+ }
+
+ return tmp_region;
+ }
+ }
+ else
+ return NULL;
+}
+
+/**
+ * _gdk_surface_clear_update_area:
+ * @surface: a #GdkSurface.
+ *
+ * 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 *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->update_area)
+ {
+ gdk_surface_remove_update_surface (surface);
+
+ cairo_region_destroy (surface->update_area);
+ surface->update_area = NULL;
+ }
+}
+
+/**
+ * gdk_surface_freeze_updates:
+ * @surface: a #GdkSurface
+ *
+ * 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 *surface)
+{
+ GdkSurface *impl_surface;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ impl_surface = gdk_surface_get_impl_surface (surface);
+ impl_surface->update_freeze_count++;
+}
+
+/**
+ * gdk_surface_thaw_updates:
+ * @surface: a #GdkSurface
+ *
+ * Thaws a surface frozen with gdk_surface_freeze_updates().
+ **/
+void
+gdk_surface_thaw_updates (GdkSurface *surface)
+{
+ GdkSurface *impl_surface;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ impl_surface = gdk_surface_get_impl_surface (surface);
+
+ g_return_if_fail (impl_surface->update_freeze_count > 0);
+
+ if (--impl_surface->update_freeze_count == 0)
+ gdk_surface_schedule_update (GDK_SURFACE (impl_surface));
+}
+
+void
+gdk_surface_freeze_toplevel_updates (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
+
+ surface->update_and_descendants_freeze_count++;
+ _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (surface));
+}
+
+void
+gdk_surface_thaw_toplevel_updates (GdkSurface *surface)
+{
+ 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);
+
+ surface->update_and_descendants_freeze_count--;
+ _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (surface));
+
+ 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 surface
+ * @height: desired height of the surface
+ * @new_width: (out): location to store resulting width
+ * @new_height: (out): location to store resulting height
+ *
+ * Constrains a desired width and height according to a
+ * set of geometry hints (such as minimum and maximum size).
+ */
+void
+gdk_surface_constrain_size (GdkGeometry *geometry,
+ GdkSurfaceHints flags,
+ gint width,
+ gint height,
+ gint *new_width,
+ gint *new_height)
+{
+ /* This routine is partially borrowed from fvwm.
+ *
+ * Copyright 1993, Robert Nation
+ * You may use this code for any purpose, as long as the original
+ * copyright remains in the source code and all documentation
+ *
+ * which in turn borrows parts of the algorithm from uwm
+ */
+ gint min_width = 0;
+ gint min_height = 0;
+ gint base_width = 0;
+ gint base_height = 0;
+ gint xinc = 1;
+ gint yinc = 1;
+ gint max_width = G_MAXINT;
+ gint max_height = G_MAXINT;
+
+#define FLOOR(value, base) ( ((gint) ((value) / (base))) * (base) )
+
+ if ((flags & GDK_HINT_BASE_SIZE) && (flags & GDK_HINT_MIN_SIZE))
+ {
+ base_width = geometry->base_width;
+ base_height = geometry->base_height;
+ min_width = geometry->min_width;
+ min_height = geometry->min_height;
+ }
+ else if (flags & GDK_HINT_BASE_SIZE)
+ {
+ base_width = geometry->base_width;
+ base_height = geometry->base_height;
+ min_width = geometry->base_width;
+ min_height = geometry->base_height;
+ }
+ else if (flags & GDK_HINT_MIN_SIZE)
+ {
+ base_width = geometry->min_width;
+ base_height = geometry->min_height;
+ min_width = geometry->min_width;
+ min_height = geometry->min_height;
+ }
+
+ if (flags & GDK_HINT_MAX_SIZE)
+ {
+ max_width = geometry->max_width ;
+ max_height = geometry->max_height;
+ }
+
+ if (flags & GDK_HINT_RESIZE_INC)
+ {
+ xinc = MAX (xinc, geometry->width_inc);
+ yinc = MAX (yinc, geometry->height_inc);
+ }
+
+ /* clamp width and height to min and max values
+ */
+ width = CLAMP (width, min_width, max_width);
+ height = CLAMP (height, min_height, max_height);
+
+ /* shrink to base + N * inc
+ */
+ width = base_width + FLOOR (width - base_width, xinc);
+ height = base_height + FLOOR (height - base_height, yinc);
+
+ /* constrain aspect ratio, according to:
+ *
+ * width
+ * min_aspect <= -------- <= max_aspect
+ * height
+ */
+
+ if (flags & GDK_HINT_ASPECT &&
+ geometry->min_aspect > 0 &&
+ geometry->max_aspect > 0)
+ {
+ gint delta;
+
+ if (geometry->min_aspect * height > width)
+ {
+ delta = FLOOR (height - width / geometry->min_aspect, yinc);
+ if (height - delta >= min_height)
+ height -= delta;
+ else
+ {
+ delta = FLOOR (height * geometry->min_aspect - width, xinc);
+ if (width + delta <= max_width)
+ width += delta;
+ }
+ }
+
+ if (geometry->max_aspect * height < width)
+ {
+ delta = FLOOR (width - height * geometry->max_aspect, xinc);
+ if (width - delta >= min_width)
+ width -= delta;
+ else
+ {
+ delta = FLOOR (width / geometry->max_aspect - height, yinc);
+ if (height + delta <= max_height)
+ height += delta;
+ }
+ }
+ }
+
+#undef FLOOR
+
+ *new_width = width;
+ *new_height = height;
+}
+
+/**
+ * gdk_surface_get_device_position_double:
+ * @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.
+ * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
+ *
+ * Obtains the current device position in doubles and modifier state.
+ * The position is given in coordinates relative to the upper left
+ * corner of @surface.
+ *
+ * Returns: (nullable) (transfer none): The surface underneath @device
+ * (as with gdk_device_get_surface_at_position()), or %NULL if the
+ * surface is not known to GDK.
+ **/
+GdkSurface *
+gdk_surface_get_device_position_double (GdkSurface *surface,
+ GdkDevice *device,
+ double *x,
+ double *y,
+ GdkModifierType *mask)
+{
+ gdouble tmp_x, tmp_y;
+ GdkModifierType tmp_mask;
+ gboolean normal_child;
+
+ 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 (surface->impl)->get_device_state (surface,
+ device,
+ &tmp_x, &tmp_y,
+ &tmp_mask);
+ /* 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;
+ if (y)
+ *y = tmp_y;
+ if (mask)
+ *mask = tmp_mask;
+
+ if (normal_child)
+ return _gdk_surface_find_child_at (surface, tmp_x, tmp_y);
+ return NULL;
+}
+
+/**
+ * gdk_surface_get_device_position:
+ * @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.
+ * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
+ *
+ * Obtains the current device position and modifier state.
+ * The position is given in coordinates relative to the upper left
+ * corner of @surface.
+ *
+ * Use gdk_surface_get_device_position_double() if you need subpixel precision.
+ *
+ * Returns: (nullable) (transfer none): The surface underneath @device
+ * (as with gdk_device_get_surface_at_position()), or %NULL if the
+ * surface is not known to GDK.
+ **/
+GdkSurface *
+gdk_surface_get_device_position (GdkSurface *surface,
+ GdkDevice *device,
+ gint *x,
+ gint *y,
+ GdkModifierType *mask)
+{
+ gdouble tmp_x, tmp_y;
+
+ 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 surface;
+}
+
+static gboolean
+gdk_surface_raise_internal (GdkSurface *surface)
+{
+ GdkSurface *parent = surface->parent;
+ GdkSurfaceImplClass *impl_class;
+ gboolean did_raise = FALSE;
+
+ if (parent && parent->children->data != surface)
+ {
+ 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 (surface->impl);
+
+ /* Just do native raise for toplevels */
+ if (gdk_surface_has_impl (surface))
+ impl_class->raise (surface);
+
+ return did_raise;
+}
+
+/* Returns TRUE If the native surface was mapped or unmapped */
+static gboolean
+set_viewable (GdkSurface *w,
+ gboolean val)
+{
+ GdkSurface *child;
+ GList *l;
+
+ if (w->viewable == val)
+ return FALSE;
+
+ w->viewable = val;
+
+ if (val)
+ recompute_visible_regions (w, FALSE);
+
+ for (l = w->children; l != NULL; l = l->next)
+ {
+ child = l->data;
+
+ if (GDK_SURFACE_IS_MAPPED (child))
+ set_viewable (child, val);
+ }
+
+ return FALSE;
+}
+
+/* Returns TRUE If the native surface was mapped or unmapped */
+gboolean
+_gdk_surface_update_viewable (GdkSurface *surface)
+{
+ gboolean viewable;
+
+ if (surface->surface_type == GDK_SURFACE_FOREIGN ||
+ surface->surface_type == GDK_SURFACE_ROOT)
+ viewable = TRUE;
+ else if (gdk_surface_is_toplevel (surface) ||
+ surface->parent->viewable)
+ viewable = GDK_SURFACE_IS_MAPPED (surface);
+ else
+ viewable = FALSE;
+
+ return set_viewable (surface, viewable);
+}
+
+static void
+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 (surface));
+
+ if (surface->destroyed)
+ return;
+
+ 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 (surface);
+ }
+
+ if (gdk_surface_has_impl (surface))
+ {
+ if (!was_mapped)
+ gdk_synthesize_surface_state (surface,
+ GDK_SURFACE_STATE_WITHDRAWN,
+ 0);
+ }
+ else
+ {
+ surface->state = 0;
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
+ }
+
+ 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 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 (surface) && (was_viewable || !did_show))
+ {
+ 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 (surface))
+ {
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, 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 (surface, FALSE);
+
+ if (gdk_surface_is_viewable (surface))
+ gdk_surface_invalidate_rect_full (surface, NULL, TRUE);
+ }
+}
+
+/**
+ * gdk_surface_show_unraised:
+ * @surface: a #GdkSurface
+ *
+ * Shows a #GdkSurface onscreen, but does not modify its stacking
+ * 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 *surface)
+{
+ gdk_surface_show_internal (surface, FALSE);
+}
+
+/**
+ * gdk_surface_raise:
+ * @surface: a #GdkSurface
+ *
+ * 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 @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 *surface)
+{
+ gboolean did_raise;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ /* Keep children in (reverse) stacking order */
+ did_raise = gdk_surface_raise_internal (surface);
+
+ if (did_raise &&
+ !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 *surface)
+{
+ GdkSurface *parent = surface->parent;
+ GdkSurfaceImplClass *impl_class;
+
+ if (parent)
+ {
+ 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 (surface->impl);
+
+ /* Just do native lower for toplevels */
+ if (gdk_surface_has_impl (surface))
+ impl_class->lower (surface);
+}
+
+static void
+gdk_surface_invalidate_in_parent (GdkSurface *private)
+{
+ GdkRectangle r, child;
+
+ if (gdk_surface_is_toplevel (private))
+ return;
+
+ /* get the visible rectangle of the parent */
+ r.x = r.y = 0;
+ r.width = private->parent->width;
+ r.height = private->parent->height;
+
+ child.x = private->x;
+ child.y = private->y;
+ child.width = private->width;
+ child.height = private->height;
+ gdk_rectangle_intersect (&r, &child, &r);
+
+ gdk_surface_invalidate_rect_full (private->parent, &r, TRUE);
+}
+
+
+/**
+ * gdk_surface_lower:
+ * @surface: a #GdkSurface
+ *
+ * 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 @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 surface again, so don’t call this
+ * function before gdk_surface_show(). (Try gdk_surface_show_unraised().)
+ */
+void
+gdk_surface_lower (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ /* Keep children in (reverse) stacking order */
+ gdk_surface_lower_internal (surface);
+
+ gdk_surface_invalidate_in_parent (surface);
+}
+
+/**
+ * gdk_surface_restack:
+ * @surface: a #GdkSurface
+ * @sibling: (allow-none): a #GdkSurface that is a sibling of @surface, or %NULL
+ * @above: a boolean
+ *
+ * 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 surface.
+ *
+ * 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 *surface,
+ GdkSurface *sibling,
+ gboolean above)
+{
+ GdkSurfaceImplClass *impl_class;
+ GdkSurface *parent;
+ GList *sibling_link;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (sibling == NULL || GDK_IS_SURFACE (sibling));
+
+ if (surface->destroyed)
+ return;
+
+ if (sibling == NULL)
+ {
+ if (above)
+ gdk_surface_raise (surface);
+ else
+ gdk_surface_lower (surface);
+ return;
+ }
+
+ if (gdk_surface_is_toplevel (surface))
+ {
+ g_return_if_fail (gdk_surface_is_toplevel (sibling));
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->restack_toplevel (surface, sibling, above);
+ return;
+ }
+
+ parent = surface->parent;
+ if (parent)
+ {
+ sibling_link = g_list_find (parent->children, sibling);
+ g_return_if_fail (sibling_link != NULL);
+ if (sibling_link == NULL)
+ return;
+
+ parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
+ if (above)
+ parent->children = list_insert_link_before (parent->children,
+ sibling_link,
+ &surface->children_list_node);
+ else
+ parent->children = list_insert_link_before (parent->children,
+ sibling_link->next,
+ &surface->children_list_node);
+ }
+
+ gdk_surface_invalidate_in_parent (surface);
+}
+
+
+/**
+ * gdk_surface_show:
+ * @surface: a #GdkSurface
+ *
+ * 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 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 *surface)
+{
+ gdk_surface_show_internal (surface, TRUE);
+}
+
+/**
+ * gdk_surface_hide:
+ * @surface: a #GdkSurface
+ *
+ * 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 *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+ gboolean was_mapped, did_hide;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ was_mapped = GDK_SURFACE_IS_MAPPED (surface);
+
+ if (gdk_surface_has_impl (surface))
+ {
+
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
+ 0,
+ GDK_SURFACE_STATE_WITHDRAWN);
+ }
+ else if (was_mapped)
+ {
+ surface->state = GDK_SURFACE_STATE_WITHDRAWN;
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
+ }
+
+ if (was_mapped)
+ {
+ GdkDisplay *display;
+ GdkSeat *seat;
+ GList *devices, *d;
+
+ /* May need to break grabs on children */
+ display = gdk_surface_get_display (surface);
+ seat = gdk_display_get_default_seat (display);
+
+ devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
+ devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
+
+ for (d = devices; d; d = d->next)
+ {
+ GdkDevice *device = d->data;
+
+ if (_gdk_display_end_device_grab (display,
+ device,
+ _gdk_display_get_next_serial (display),
+ surface,
+ TRUE))
+ {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ gdk_device_ungrab (device, GDK_CURRENT_TIME);
+G_GNUC_END_IGNORE_DEPRECATIONS
+ }
+ }
+
+ g_list_free (devices);
+ }
+
+ did_hide = _gdk_surface_update_viewable (surface);
+
+ /* 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 (surface->impl);
+ impl_class->hide (surface);
+ }
+
+ gdk_surface_clear_old_updated_area (surface);
+ recompute_visible_regions (surface, FALSE);
+
+ if (was_mapped && !gdk_surface_has_impl (surface))
+ {
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, 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 (surface);
+}
+
+/**
+ * gdk_surface_withdraw:
+ * @surface: a toplevel #GdkSurface
+ *
+ * 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 surfaces before hiding them.
+ **/
+void
+gdk_surface_withdraw (GdkSurface *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+ gboolean was_mapped;
+ GdkGLContext *current_context;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ was_mapped = GDK_SURFACE_IS_MAPPED (surface);
+
+ if (gdk_surface_has_impl (surface))
+ {
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->withdraw (surface);
+
+ if (was_mapped)
+ {
+ if (surface->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (surface, 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) == surface)
+ gdk_gl_context_clear_current ();
+
+ recompute_visible_regions (surface, FALSE);
+ gdk_surface_clear_old_updated_area (surface);
+ }
+}
+
+/**
+ * gdk_surface_set_events:
+ * @surface: a #GdkSurface
+ * @event_mask: event mask for @surface
+ *
+ * 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 *surface,
+ GdkEventMask event_mask)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ surface->event_mask = event_mask;
+
+ if (gdk_surface_has_impl (surface))
+ {
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ impl_class->set_events (surface,
+ get_native_event_mask (surface));
+ }
+
+}
+
+/**
+ * gdk_surface_get_events:
+ * @surface: a #GdkSurface
+ *
+ * Gets the event mask for @surface for all master input devices. See
+ * gdk_surface_set_events().
+ *
+ * Returns: event mask for @surface
+ **/
+GdkEventMask
+gdk_surface_get_events (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+
+ if (surface->destroyed)
+ return 0;
+
+ return surface->event_mask;
+}
+
+/**
+ * gdk_surface_set_device_events:
+ * @surface: a #GdkSurface
+ * @device: #GdkDevice to enable events for.
+ * @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 @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 *surface,
+ GdkDevice *device,
+ GdkEventMask event_mask)
+{
+ GdkEventMask device_mask;
+ GdkSurface *native;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (GDK_IS_DEVICE (device));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ 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 surface->event_mask
+ */
+ g_hash_table_remove (surface->device_events, device);
+ }
+ else
+ g_hash_table_insert (surface->device_events, device,
+ GINT_TO_POINTER (event_mask));
+
+ native = gdk_surface_get_toplevel (surface);
+
+ 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:
+ * @surface: a #GdkSurface.
+ * @device: a #GdkDevice.
+ *
+ * Returns the event mask for @surface corresponding to an specific device.
+ *
+ * Returns: device event mask for @surface
+ **/
+GdkEventMask
+gdk_surface_get_device_events (GdkSurface *surface,
+ GdkDevice *device)
+{
+ GdkEventMask mask;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+ g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return 0;
+
+ if (!surface->device_events)
+ return 0;
+
+ mask = GPOINTER_TO_INT (g_hash_table_lookup (surface->device_events, device));
+
+ /* FIXME: device could be controlled by surface->event_mask */
+
+ return mask;
+}
+
+static void
+gdk_surface_move_resize_toplevel (GdkSurface *surface,
+ gboolean with_move,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ cairo_region_t *old_region, *new_region;
+ GdkSurfaceImplClass *impl_class;
+ gboolean expose;
+ gboolean is_resize;
+
+ expose = FALSE;
+ old_region = NULL;
+
+ is_resize = (width != -1) || (height != -1);
+
+ if (gdk_surface_is_viewable (surface) &&
+ !surface->input_only)
+ {
+ expose = TRUE;
+ old_region = cairo_region_copy (surface->clip_region);
+ }
+
+ 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 (surface, FALSE);
+
+ if (expose)
+ {
+ 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 (surface, new_region, TRUE);
+
+ cairo_region_destroy (old_region);
+ cairo_region_destroy (new_region);
+ }
+}
+
+
+static void
+gdk_surface_move_resize_internal (GdkSurface *surface,
+ gboolean with_move,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ cairo_region_t *old_region, *new_region;
+ gboolean expose;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->destroyed)
+ return;
+
+ if (gdk_surface_is_toplevel (surface))
+ {
+ gdk_surface_move_resize_toplevel (surface, with_move, x, y, width, height);
+ return;
+ }
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ /* Bail early if no change */
+ if (surface->width == width &&
+ surface->height == height &&
+ (!with_move ||
+ (surface->x == x &&
+ surface->y == y)))
+ return;
+
+ /* Handle child surfaces */
+
+ expose = FALSE;
+ old_region = NULL;
+
+ if (gdk_surface_is_viewable (surface) &&
+ !surface->input_only)
+ {
+ GdkRectangle r;
+
+ expose = TRUE;
+
+ r.x = surface->x;
+ r.y = surface->y;
+ r.width = surface->width;
+ r.height = surface->height;
+
+ old_region = cairo_region_create_rectangle (&r);
+ }
+
+ /* Set the new position and size */
+ if (with_move)
+ {
+ surface->x = x;
+ surface->y = y;
+ }
+ if (!(width < 0 && height < 0))
+ {
+ surface->width = width;
+ surface->height = height;
+ }
+
+ recompute_visible_regions (surface, FALSE);
+
+ if (expose)
+ {
+ GdkRectangle r;
+
+ 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 (surface->parent, new_region, TRUE);
+
+ cairo_region_destroy (old_region);
+ cairo_region_destroy (new_region);
+ }
+}
+
+
+
+/**
+ * gdk_surface_move:
+ * @surface: a #GdkSurface
+ * @x: X coordinate relative to surface’s parent
+ * @y: Y coordinate relative to surface’s parent
+ *
+ * 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 surfaces,
+ * the move will reliably succeed.
+ *
+ * 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 *surface,
+ gint x,
+ gint y)
+{
+ gdk_surface_move_resize_internal (surface, TRUE, x, y, -1, -1);
+}
+
+/**
+ * gdk_surface_resize:
+ * @surface: a #GdkSurface
+ * @width: new width of the surface
+ * @height: new height of the surface
+ *
+ * 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.
+ *
+ * Surfaces may not be resized below 1x1.
+ *
+ * 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 *surface,
+ gint width,
+ gint height)
+{
+ gdk_surface_move_resize_internal (surface, FALSE, 0, 0, width, height);
+}
+
+
+/**
+ * gdk_surface_move_resize:
+ * @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 surface first
+ * move, then resize, if you don’t use gdk_surface_move_resize().)
+ **/
+void
+gdk_surface_move_resize (GdkSurface *surface,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ gdk_surface_move_resize_internal (surface, TRUE, x, y, width, height);
+}
+
+/**
+ * gdk_surface_move_to_rect:
+ * @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 @surface, i.e. @rect's anchor
+ * point
+ * @rect_anchor_dy: vertical offset to shift @surface, i.e. @rect's anchor point
+ *
+ * Moves @surface to @rect, aligning their anchor points.
+ *
+ * @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 @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 @surface.
+ *
+ * @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
+ * @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.
+ *
+ * Stability: Private
+ */
+void
+gdk_surface_move_to_rect (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ 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 (surface->impl);
+ impl_class->move_to_rect (surface,
+ rect,
+ rect_anchor,
+ surface_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy);
+}
+
+/**
+ * gdk_surface_scroll:
+ * @surface: a #GdkSurface
+ * @dx: Amount to scroll in the X direction
+ * @dy: Amount to scroll in the Y direction
+ *
+ * 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 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 *surface,
+ gint dx,
+ gint dy)
+{
+ GList *tmp_list;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (dx == 0 && dy == 0)
+ return;
+
+ if (surface->destroyed)
+ return;
+
+ /* First move all child surfaces, without causing invalidation */
+
+ tmp_list = surface->children;
+ while (tmp_list)
+ {
+ GdkSurface *child = GDK_SURFACE (tmp_list->data);
+
+ /* Just update the positions, the bits will move with the copy */
+ child->x += dx;
+ child->y += dy;
+
+ tmp_list = tmp_list->next;
+ }
+
+ recompute_visible_regions (surface, TRUE);
+
+ gdk_surface_invalidate_rect_full (surface, NULL, TRUE);
+}
+
+/**
+ * gdk_surface_move_region:
+ * @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 @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 surfaces are not moved.
+ */
+void
+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 (surface));
+ g_return_if_fail (region != NULL);
+
+ if (dx == 0 && dy == 0)
+ return;
+
+ 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 (surface, expose_area, FALSE);
+ cairo_region_destroy (expose_area);
+}
+
+static void
+gdk_surface_set_cursor_internal (GdkSurface *surface,
+ GdkDevice *device,
+ GdkCursor *cursor)
+{
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ g_assert (gdk_surface_get_display (surface) == gdk_device_get_display (device));
+
+ 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 (surface);
+ pointer_info = _gdk_display_get_pointer_info (display, device);
+
+ if (_gdk_surface_event_parent_of (surface, pointer_info->surface_under_pointer))
+ update_cursor (display, device);
+ }
+}
+
+/**
+ * gdk_surface_get_cursor:
+ * @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 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 surface
+ */
+GdkCursor *
+gdk_surface_get_cursor (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ return surface->cursor;
+}
+
+/**
+ * gdk_surface_set_cursor:
+ * @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 @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 @surface will use the cursor of its parent surface. Most surfaces
+ * should use this default.
+ */
+void
+gdk_surface_set_cursor (GdkSurface *surface,
+ GdkCursor *cursor)
+{
+ GdkDisplay *display;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ display = gdk_surface_get_display (surface);
+
+ if (surface->cursor)
+ {
+ g_object_unref (surface->cursor);
+ surface->cursor = NULL;
+ }
+
+ if (!GDK_SURFACE_DESTROYED (surface))
+ {
+ GdkDevice *device;
+ GList *seats, *s;
+
+ if (cursor)
+ surface->cursor = g_object_ref (cursor);
+
+ seats = gdk_display_list_seats (display);
+
+ for (s = seats; s; s = s->next)
+ {
+ GList *devices, *d;
+
+ device = gdk_seat_get_pointer (s->data);
+ 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 (surface, device, surface->cursor);
+ }
+ g_list_free (devices);
+ }
+
+ g_list_free (seats);
+ g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_CURSOR]);
+ }
+}
+
+/**
+ * gdk_surface_get_device_cursor:
+ * @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 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 surface
+ **/
+GdkCursor *
+gdk_surface_get_device_cursor (GdkSurface *surface,
+ GdkDevice *device)
+{
+ 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 (surface->device_cursor, device);
+}
+
+/**
+ * gdk_surface_set_device_cursor:
+ * @surface: a #GdkSurface
+ * @device: a master, pointer #GdkDevice
+ * @cursor: a #GdkCursor
+ *
+ * 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
+ * @surface will use the cursor of its parent surface. Most surfaces should
+ * use this default.
+ **/
+void
+gdk_surface_set_device_cursor (GdkSurface *surface,
+ GdkDevice *device,
+ GdkCursor *cursor)
+{
+ 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 (surface->device_cursor, device);
+ else
+ g_hash_table_replace (surface->device_cursor, device, g_object_ref (cursor));
+
+ gdk_surface_set_cursor_internal (surface, device, cursor);
+}
+
+/**
+ * gdk_surface_get_geometry:
+ * @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 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 @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 @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
+ * coordinate space, whereas gdk_surface_get_geometry() is restricted to
+ * the 16-bit coordinates of X11.
+ */
+void
+gdk_surface_get_geometry (GdkSurface *surface,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height)
+{
+ GdkSurface *parent;
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (!GDK_SURFACE_DESTROYED (surface))
+ {
+ if (gdk_surface_has_impl (surface))
+ {
+ 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 = surface->parent;
+ if (parent && !gdk_surface_has_impl (parent))
+ {
+ if (x)
+ *x -= parent->abs_x;
+ if (y)
+ *y -= parent->abs_y;
+ }
+ }
+ else
+ {
+ if (x)
+ *x = surface->x;
+ if (y)
+ *y = surface->y;
+ if (width)
+ *width = surface->width;
+ if (height)
+ *height = surface->height;
+ }
+ }
+}
+
+/**
+ * gdk_surface_get_width:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface
+ */
+int
+gdk_surface_get_width (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+
+ return surface->width;
+}
+
+/**
+ * gdk_surface_get_height:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface
+ */
+int
+gdk_surface_get_height (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+
+ return surface->height;
+}
+
+/**
+ * gdk_surface_get_origin:
+ * @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 surface in root window coordinates.
+ * (Compare with gdk_surface_get_position() and
+ * 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 *surface,
+ gint *x,
+ gint *y)
+{
+ gint dummy_x, dummy_y;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
+
+ gdk_surface_get_root_coords (surface,
+ 0, 0,
+ x ? x : &dummy_x,
+ y ? y : &dummy_y);
+
+ return TRUE;
+}
+
+/**
+ * gdk_surface_get_root_coords:
+ * @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 surface position in root
+ * window coordinates. This is similar to
+ * gdk_surface_get_origin() but allows you to pass
+ * in any position in the surface, not just the origin.
+ */
+void
+gdk_surface_get_root_coords (GdkSurface *surface,
+ gint x,
+ gint y,
+ gint *root_x,
+ gint *root_y)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ {
+ *root_x = 0;
+ *root_y = 0;
+ return;
+ }
+
+ 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:
+ * @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
+ * in parent’s coordinate system, or %NULL
+ * @parent_y: (out) (allow-none): return location for Y coordinate
+ * in parent’s coordinate system, or %NULL
+ *
+ * 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 *surface,
+ gdouble x,
+ gdouble y,
+ gdouble *parent_x,
+ gdouble *parent_y)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (parent_x)
+ *parent_x = x + surface->x;
+
+ if (parent_y)
+ *parent_y = y + surface->y;
+}
+
+/**
+ * gdk_surface_coords_from_parent:
+ * @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 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.
+ *
+ * See also: gdk_surface_coords_to_parent()
+ **/
+void
+gdk_surface_coords_from_parent (GdkSurface *surface,
+ gdouble parent_x,
+ gdouble parent_y,
+ gdouble *x,
+ gdouble *y)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (x)
+ *x = parent_x - surface->x;
+
+ if (y)
+ *y = parent_y - surface->y;
+}
+
+/**
+ * gdk_surface_shape_combine_region:
+ * @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 @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
+ * 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
+ * widely available on most common platforms, but not available on
+ * very old X servers, and occasionally the implementation will be
+ * buggy. On servers without the shape extension, this function
+ * will do nothing.
+ *
+ * This function works on both toplevel and child surfaces.
+ */
+void
+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 (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (!surface->shape && shape_region == NULL)
+ return;
+
+ surface->shaped = (shape_region != NULL);
+
+ if (surface->shape)
+ cairo_region_destroy (surface->shape);
+
+ old_region = NULL;
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ old_region = cairo_region_copy (surface->clip_region);
+
+ if (shape_region)
+ {
+ surface->shape = cairo_region_copy (shape_region);
+ cairo_region_translate (surface->shape, offset_x, offset_y);
+ }
+ else
+ surface->shape = NULL;
+
+ recompute_visible_regions (surface, FALSE);
+
+ if (old_region)
+ {
+ new_region = cairo_region_copy (surface->clip_region);
+
+ /* New area in the surface, needs invalidation */
+ diff = cairo_region_copy (new_region);
+ cairo_region_subtract (diff, old_region);
+
+ gdk_surface_invalidate_region_full (surface, diff, TRUE);
+
+ cairo_region_destroy (diff);
+
+ if (!gdk_surface_is_toplevel (surface))
+ {
+ /* 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 surface coords */
+ cairo_region_translate (diff, surface->x, surface->y);
+
+ gdk_surface_invalidate_region_full (surface->parent, diff, TRUE);
+
+ cairo_region_destroy (diff);
+ }
+
+ cairo_region_destroy (new_region);
+ cairo_region_destroy (old_region);
+ }
+}
+
+static void
+do_child_shapes (GdkSurface *surface,
+ gboolean merge)
+{
+ GdkRectangle r;
+ cairo_region_t *region;
+
+ r.x = 0;
+ r.y = 0;
+ r.width = surface->width;
+ r.height = surface->height;
+
+ region = cairo_region_create_rectangle (&r);
+ remove_child_area (surface, FALSE, region);
+
+ if (merge && surface->shape)
+ cairo_region_subtract (region, surface->shape);
+
+ cairo_region_xor_rectangle (region, &r);
+
+ gdk_surface_shape_combine_region (surface, region, 0, 0);
+
+ cairo_region_destroy (region);
+}
+
+/**
+ * gdk_surface_set_child_shapes:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface in the masks to be merged.
+ **/
+void
+gdk_surface_set_child_shapes (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ do_child_shapes (surface, FALSE);
+}
+
+/**
+ * gdk_surface_merge_child_shapes:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface’s shape mask in the set of shapes to
+ * be merged.
+ */
+void
+gdk_surface_merge_child_shapes (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ do_child_shapes (surface, TRUE);
+}
+
+/**
+ * gdk_surface_input_shape_combine_region:
+ * @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 surface below @surface.
+ *
+ * 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 surface is
+ * “clickable”.
+ *
+ * On the X11 platform, this requires version 1.1 of the
+ * shape extension.
+ *
+ * On the Win32 platform, this functionality is not present and the
+ * function does nothing.
+ */
+void
+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 (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (surface->input_shape)
+ cairo_region_destroy (surface->input_shape);
+
+ if (shape_region)
+ {
+ surface->input_shape = cairo_region_copy (shape_region);
+ cairo_region_translate (surface->input_shape, offset_x, offset_y);
+ }
+ else
+ surface->input_shape = NULL;
+
+ if (gdk_surface_has_impl (surface))
+ {
+ 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 *surface,
+ gboolean merge)
+{
+ GdkRectangle r;
+ cairo_region_t *region;
+
+ r.x = 0;
+ r.y = 0;
+ r.width = surface->width;
+ r.height = surface->height;
+
+ region = cairo_region_create_rectangle (&r);
+ remove_child_area (surface, TRUE, region);
+
+ 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 (surface, region, 0, 0);
+}
+
+
+/**
+ * gdk_surface_set_child_input_shapes:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface in the masks to be merged.
+ **/
+void
+gdk_surface_set_child_input_shapes (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ do_child_input_shapes (surface, FALSE);
+}
+
+/**
+ * gdk_surface_set_pass_through:
+ * @surface: a #GdkSurface
+ * @pass_through: a boolean
+ *
+ * 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 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 surface, and so on up the hierarchy.
+ *
+ * If @pass_through is %TRUE then such pointer events happen as if the
+ * 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 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 surface.
+ **/
+void
+gdk_surface_set_pass_through (GdkSurface *surface,
+ gboolean pass_through)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ surface->pass_through = !!pass_through;
+}
+
+/**
+ * gdk_surface_get_pass_through:
+ * @surface: a #GdkSurface
+ *
+ * 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 *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->pass_through;
+}
+
+/**
+ * gdk_surface_merge_child_input_shapes:
+ * @surface: a #GdkSurface
+ *
+ * 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 @surface’s input shape mask in the set of
+ * shapes to be merged.
+ **/
+void
+gdk_surface_merge_child_input_shapes (GdkSurface *surface)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ do_child_input_shapes (surface, TRUE);
+}
+
+
+/**
+ * gdk_surface_get_modal_hint:
+ * @surface: A toplevel #GdkSurface.
+ *
+ * Determines whether or not the surface manager is hinted that @surface
+ * has modal behaviour.
+ *
+ * Returns: whether or not the surface has the modal hint set.
+ */
+gboolean
+gdk_surface_get_modal_hint (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->modal_hint;
+}
+
+/**
+ * gdk_surface_get_accept_focus:
+ * @surface: a toplevel #GdkSurface.
+ *
+ * Determines whether or not the desktop environment shuld be hinted that
+ * the surface does not want to receive input focus.
+ *
+ * Returns: whether or not the surface should receive input focus.
+ */
+gboolean
+gdk_surface_get_accept_focus (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->accept_focus;
+}
+
+/**
+ * gdk_surface_get_focus_on_map:
+ * @surface: a toplevel #GdkSurface.
+ *
+ * Determines whether or not the desktop environment should be hinted that the
+ * surface does not want to receive input focus when it is mapped.
+ *
+ * Returns: whether or not the surface wants to receive input focus when
+ * it is mapped.
+ */
+gboolean
+gdk_surface_get_focus_on_map (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->focus_on_map;
+}
+
+/**
+ * gdk_surface_is_input_only:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Determines whether or not the surface is an input only surface.
+ *
+ * Returns: %TRUE if @surface is input only
+ */
+gboolean
+gdk_surface_is_input_only (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->input_only;
+}
+
+/**
+ * gdk_surface_is_shaped:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Determines whether or not the surface is shaped.
+ *
+ * Returns: %TRUE if @surface is shaped
+ */
+gboolean
+gdk_surface_is_shaped (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ return surface->shaped;
+}
+
+/* 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 *surface)
+{
+ GdkSurface *parent;
+
+ while ((parent = surface->parent) != NULL &&
+ (parent->surface_type != GDK_SURFACE_ROOT))
+ surface = parent;
+
+ return surface;
+}
+
+gboolean
+_gdk_surface_event_parent_of (GdkSurface *parent,
+ GdkSurface *child)
+{
+ GdkSurface *w;
+
+ w = child;
+ while (w != NULL)
+ {
+ if (w == parent)
+ return TRUE;
+
+ w = w->parent;
+ }
+
+ return FALSE;
+}
+
+static void
+update_cursor (GdkDisplay *display,
+ GdkDevice *device)
+{
+ 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_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 surface */
+ !_gdk_surface_event_parent_of (grab->surface, pointer_surface))
+ {
+ /* use the cursor from the grab surface */
+ cursor_surface = grab->surface;
+ }
+ else
+ {
+ /* otherwise use the cursor from the pointer surface */
+ cursor_surface = pointer_surface;
+ }
+
+ /* Find the first surface with the cursor actually set, as
+ the cursor is inherited from the parent */
+ 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_surface = parent;
+
+ cursor = g_hash_table_lookup (cursor_surface->device_cursor, device);
+
+ if (!cursor)
+ cursor = cursor_surface->cursor;
+
+ /* Set all cursors on toplevel, otherwise its tricky to keep track of
+ * 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_surface (GdkSurface *surface,
+ gdouble x,
+ gdouble y)
+{
+ return
+ x >= 0 && x < surface->width &&
+ y >= 0 && y < surface->height &&
+ (surface->shape == NULL ||
+ cairo_region_contains_point (surface->shape,
+ x, y)) &&
+ (surface->input_shape == NULL ||
+ cairo_region_contains_point (surface->input_shape,
+ x, y));
+}
+
+/* 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 *surface,
+ gdouble x,
+ gdouble y,
+ GdkSurface **input_surface,
+ gdouble *input_surface_x,
+ gdouble *input_surface_y)
+{
+ GdkSurface *sub;
+ double child_x, child_y;
+ GList *l;
+
+ if (!point_in_surface (surface, x, y))
+ return FALSE;
+
+ if (!surface->pass_through)
+ {
+ if (input_surface)
+ {
+ *input_surface = surface;
+ *input_surface_x = x;
+ *input_surface_y = y;
+ }
+ return TRUE;
+ }
+
+ /* For pass-through, must be over a child input surface */
+
+ /* Children is ordered in reverse stack order, i.e. first is topmost */
+ for (l = surface->children; l != NULL; l = l->next)
+ {
+ sub = l->data;
+
+ if (!GDK_SURFACE_IS_MAPPED (sub))
+ continue;
+
+ gdk_surface_coords_from_parent ((GdkSurface *)sub,
+ x, y,
+ &child_x, &child_y);
+ if (point_in_input_surface (sub, child_x, child_y,
+ input_surface, input_surface_x, input_surface_y))
+ {
+ if (input_surface)
+ gdk_surface_coords_to_parent (sub,
+ *input_surface_x,
+ *input_surface_y,
+ input_surface_x,
+ input_surface_y);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+GdkSurface *
+_gdk_surface_find_child_at (GdkSurface *surface,
+ double x,
+ double y)
+{
+ GdkSurface *sub;
+ double child_x, child_y;
+ GList *l;
+
+ if (point_in_surface (surface, x, y))
+ {
+ /* Children is ordered in reverse stack order, i.e. first is topmost */
+ for (l = surface->children; l != NULL; l = l->next)
+ {
+ sub = l->data;
+
+ if (!GDK_SURFACE_IS_MAPPED (sub))
+ continue;
+
+ gdk_surface_coords_from_parent ((GdkSurface *)sub,
+ x, y,
+ &child_x, &child_y);
+ if (point_in_input_surface (sub, child_x, child_y,
+ NULL, NULL, NULL))
+ return (GdkSurface *)sub;
+ }
+ }
+
+ return NULL;
+}
+
+GdkSurface *
+_gdk_surface_find_descendant_at (GdkSurface *surface,
+ gdouble x,
+ gdouble y,
+ gdouble *found_x,
+ gdouble *found_y)
+{
+ GdkSurface *sub, *input_surface;
+ gdouble child_x, child_y;
+ GList *l;
+ gboolean found;
+
+ if (point_in_surface (surface, x, y))
+ {
+ do
+ {
+ found = FALSE;
+ /* Children is ordered in reverse stack order, i.e. first is topmost */
+ for (l = surface->children; l != NULL; l = l->next)
+ {
+ sub = l->data;
+
+ if (!GDK_SURFACE_IS_MAPPED (sub))
+ continue;
+
+ gdk_surface_coords_from_parent ((GdkSurface *)sub,
+ x, y,
+ &child_x, &child_y);
+ if (point_in_input_surface (sub, child_x, child_y,
+ &input_surface, &child_x, &child_y))
+ {
+ x = child_x;
+ y = child_y;
+ surface = input_surface;
+ found = TRUE;
+ break;
+ }
+ }
+ }
+ while (found);
+ }
+ else
+ {
+ /* Not in surface at all */
+ surface = NULL;
+ }
+
+ if (found_x)
+ *found_x = x;
+ if (found_y)
+ *found_y = y;
+
+ return surface;
+}
+
+/**
+ * gdk_surface_beep:
+ * @surface: a toplevel #GdkSurface
+ *
+ * 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 *surface)
+{
+ GdkDisplay *display;
+ GdkSurface *toplevel;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ toplevel = get_event_toplevel (surface);
+ display = gdk_surface_get_display (surface);
+
+ if (toplevel)
+ {
+ if (GDK_SURFACE_IMPL_GET_CLASS (toplevel->impl)->beep (toplevel))
+ return;
+ }
+
+ /* If surfaces fail to beep, we beep the display. */
+ gdk_display_beep (display);
+}
+
+/**
+ * gdk_surface_set_support_multidevice:
+ * @surface: a #GdkSurface.
+ * @support_multidevice: %TRUE to enable multidevice support in @surface.
+ *
+ * This function will enable multidevice features in @surface.
+ *
+ * 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 *surface,
+ gboolean support_multidevice)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return;
+
+ if (surface->support_multidevice == support_multidevice)
+ return;
+
+ surface->support_multidevice = support_multidevice;
+
+ /* FIXME: What to do if called when some pointers are inside the surface ? */
+}
+
+/**
+ * gdk_surface_get_support_multidevice:
+ * @surface: a #GdkSurface.
+ *
+ * Returns %TRUE if the surface is aware of the existence of multiple
+ * devices.
+ *
+ * Returns: %TRUE if the surface handles multidevice features.
+ **/
+gboolean
+gdk_surface_get_support_multidevice (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return FALSE;
+
+ return surface->support_multidevice;
+}
+
+/* send motion events if the right buttons are down */
+
+GdkEvent *
+_gdk_make_event (GdkSurface *surface,
+ GdkEventType type,
+ GdkEvent *event_in_queue,
+ gboolean before_event)
+{
+ GdkEvent *event = gdk_event_new (type);
+ guint32 the_time;
+ GdkModifierType the_state;
+
+ the_time = gdk_event_get_time (event_in_queue);
+ gdk_event_get_state (event_in_queue, &the_state);
+
+ 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;
+
+ switch ((guint) type)
+ {
+ case GDK_MOTION_NOTIFY:
+ event->motion.time = the_time;
+ event->motion.axes = NULL;
+ event->motion.state = the_state;
+ break;
+
+ case GDK_BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ event->button.time = the_time;
+ event->button.axes = NULL;
+ event->button.state = the_state;
+ break;
+
+ case GDK_TOUCH_BEGIN:
+ case GDK_TOUCH_UPDATE:
+ case GDK_TOUCH_END:
+ case GDK_TOUCH_CANCEL:
+ event->touch.time = the_time;
+ event->touch.axes = NULL;
+ event->touch.state = the_state;
+ break;
+
+ case GDK_SCROLL:
+ event->scroll.time = the_time;
+ event->scroll.state = the_state;
+ break;
+
+ case GDK_KEY_PRESS:
+ case GDK_KEY_RELEASE:
+ event->key.time = the_time;
+ event->key.state = the_state;
+ break;
+
+ case GDK_ENTER_NOTIFY:
+ case GDK_LEAVE_NOTIFY:
+ event->crossing.time = the_time;
+ event->crossing.state = the_state;
+ break;
+
+ case GDK_PROXIMITY_IN:
+ case GDK_PROXIMITY_OUT:
+ event->proximity.time = the_time;
+ break;
+
+ case GDK_DRAG_ENTER:
+ case GDK_DRAG_LEAVE:
+ case GDK_DRAG_MOTION:
+ case GDK_DROP_START:
+ event->dnd.time = the_time;
+ break;
+
+ case GDK_TOUCHPAD_SWIPE:
+ event->touchpad_swipe.time = the_time;
+ event->touchpad_swipe.state = the_state;
+ break;
+
+ case GDK_TOUCHPAD_PINCH:
+ event->touchpad_pinch.time = the_time;
+ event->touchpad_pinch.state = the_state;
+ break;
+
+ case GDK_FOCUS_CHANGE:
+ case GDK_CONFIGURE:
+ case GDK_MAP:
+ case GDK_UNMAP:
+ case GDK_DELETE:
+ case GDK_DESTROY:
+ case GDK_EXPOSE:
+ default:
+ break;
+ }
+
+ if (event_in_queue)
+ {
+ if (before_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 (surface), event_in_queue, event);
+ }
+ else
+ _gdk_event_queue_append (gdk_surface_get_display (surface), event);
+
+ return event;
+}
+
+void
+_gdk_display_set_surface_under_pointer (GdkDisplay *display,
+ GdkDevice *device,
+ GdkSurface *surface)
+{
+ GdkPointerSurfaceInfo *device_info;
+
+ device_info = _gdk_display_get_pointer_info (display, device);
+
+ if (device_info->surface_under_pointer)
+ g_object_unref (device_info->surface_under_pointer);
+ device_info->surface_under_pointer = surface;
+
+ if (surface)
+ {
+ g_object_ref (surface);
+ update_cursor (display, device);
+ }
+}
+
+#define GDK_ANY_BUTTON_MASK (GDK_BUTTON1_MASK | \
+ GDK_BUTTON2_MASK | \
+ GDK_BUTTON3_MASK | \
+ GDK_BUTTON4_MASK | \
+ GDK_BUTTON5_MASK)
+
+#ifdef DEBUG_SURFACE_PRINTING
+
+#ifdef GDK_WINDOWING_X11
+#include "x11/gdkx.h"
+#endif
+
+static void
+gdk_surface_print (GdkSurface *surface,
+ int indent)
+{
+ char *s;
+ const char *surface_types[] = {
+ "root",
+ "toplevel",
+ "child",
+ "dialog",
+ "temp",
+ "foreign",
+ "subsurface"
+ };
+
+ 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 (surface))
+ {
+#ifdef GDK_WINDOWING_X11
+ g_print (" impl(0x%lx)", gdk_x11_surface_get_xid (window));
+#endif
+ }
+
+ if (surface->surface_type != GDK_SURFACE_CHILD)
+ g_print (" %s", surface_types[surface->surface_type]);
+
+ if (surface->input_only)
+ g_print (" input-only");
+
+ if (surface->shaped)
+ g_print (" shaped");
+
+ if (!gdk_surface_is_visible ((GdkSurface *)surface))
+ g_print (" hidden");
+
+ g_print (" abs[%d,%d]",
+ surface->abs_x, surface->abs_y);
+
+ if (surface->alpha != 255)
+ g_print (" alpha[%d]",
+ surface->alpha);
+
+ s = print_region (surface->clip_region);
+ g_print (" clipbox[%s]", s);
+
+ g_print ("\n");
+}
+
+
+static void
+gdk_surface_print_tree (GdkSurface *surface,
+ int indent,
+ gboolean include_input_only)
+{
+ GList *l;
+
+ if (surface->input_only && !include_input_only)
+ return;
+
+ gdk_surface_print (surface, indent);
+
+ for (l = surface->children; l != NULL; l = l->next)
+ gdk_surface_print_tree (l->data, indent + 4, include_input_only);
+}
+
+#endif /* DEBUG_SURFACE_PRINTING */
+
+void
+_gdk_windowing_got_event (GdkDisplay *display,
+ GList *event_link,
+ GdkEvent *event,
+ gulong serial)
+{
+ GdkSurface *event_surface;
+ gboolean unlink_event = FALSE;
+ GdkDeviceGrabInfo *button_release_grab;
+ GdkPointerSurfaceInfo *pointer_info = NULL;
+ GdkDevice *device, *source_device;
+
+ _gdk_display_update_last_event (display, event);
+
+ device = gdk_event_get_device (event);
+ source_device = gdk_event_get_source_device (event);
+
+ if (device)
+ {
+ if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD &&
+ gdk_device_get_source (device) != GDK_SOURCE_TABLET_PAD)
+ {
+ pointer_info = _gdk_display_get_pointer_info (display, device);
+
+ if (source_device != pointer_info->last_slave &&
+ gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
+ pointer_info->last_slave = source_device;
+ else if (pointer_info->last_slave)
+ source_device = pointer_info->last_slave;
+ }
+
+ _gdk_display_device_grab_update (display, device, source_device, serial);
+
+ if (gdk_device_get_input_mode (device) == GDK_MODE_DISABLED ||
+ !_gdk_display_check_grab_ownership (display, device, serial))
+ {
+ /* Device events are blocked by another
+ * device grab, or the device is disabled
+ */
+ unlink_event = TRUE;
+ goto out;
+ }
+ }
+
+ event_surface = event->any.surface;
+ if (!event_surface)
+ goto out;
+
+#ifdef DEBUG_SURFACE_PRINTING
+ if (event->any.type == GDK_KEY_PRESS &&
+ (event->key.keyval == 0xa7 ||
+ event->key.keyval == 0xbd))
+ {
+ gdk_surface_print_tree (event_surface, 0, event->key.keyval == 0xbd);
+ }
+#endif
+
+ if (event_surface->surface_type == GDK_SURFACE_ROOT)
+ goto out;
+
+ if (event->any.type == GDK_ENTER_NOTIFY)
+ _gdk_display_set_surface_under_pointer (display, device, event_surface);
+ else if (event->any.type == GDK_LEAVE_NOTIFY)
+ _gdk_display_set_surface_under_pointer (display, device, NULL);
+
+ if ((event->any.type == GDK_BUTTON_RELEASE ||
+ event->any.type == GDK_TOUCH_CANCEL ||
+ event->any.type == GDK_TOUCH_END) &&
+ !event->any.send_event)
+ {
+ if (event->any.type == GDK_BUTTON_RELEASE ||
+ gdk_event_get_pointer_emulated (event))
+ {
+ button_release_grab =
+ _gdk_display_has_device_grab (display, device, serial);
+
+ if (button_release_grab &&
+ button_release_grab->implicit &&
+ (event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0)
+ {
+ button_release_grab->serial_end = serial;
+ button_release_grab->implicit_ungrab = FALSE;
+ _gdk_display_device_grab_update (display, device, source_device, serial);
+ }
+ }
+ }
+
+ out:
+ if (unlink_event)
+ {
+ _gdk_event_queue_remove_link (display, event_link);
+ g_list_free_1 (event_link);
+ gdk_event_free (event);
+ }
+
+ /* This does two things - first it sees if there are motions at the
+ * end of the queue that can be compressed. Second, if there is just
+ * a single motion that won't be dispatched because it is a compression
+ * candidate it queues up flushing the event queue.
+ */
+ _gdk_event_queue_handle_motion_compression (display);
+}
+
+/**
+ * gdk_surface_create_similar_surface:
+ * @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 @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().
+ *
+ * Initially the surface contents are all 0 (transparent if contents
+ * have transparency, black otherwise.)
+ *
+ * Returns: a pointer to the newly allocated surface. The caller
+ * owns the surface and should call cairo_surface_destroy() when done
+ * with it.
+ *
+ * This function always returns a valid pointer, but it will return a
+ * pointer to a “nil” surface if @other is already in an error state
+ * or any other error occurs.
+ **/
+cairo_surface_t *
+gdk_surface_create_similar_surface (GdkSurface * surface,
+ cairo_content_t content,
+ int width,
+ int height)
+{
+ cairo_surface_t *surface_surface, *similar_surface;
+ double sx, sy;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ surface_surface = gdk_surface_ref_impl_surface (surface);
+ sx = sy = 1;
+ cairo_surface_get_device_scale (surface_surface, &sx, &sy);
+
+ if (GDK_DISPLAY_DEBUG_CHECK (surface->display, CAIRO_IMAGE))
+ {
+ 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
+ {
+ similar_surface = cairo_surface_create_similar (surface_surface,
+ content,
+ width, height);
+ }
+
+ cairo_surface_destroy (surface_surface);
+
+ return similar_surface;
+}
+
+
+/**
+ * gdk_surface_create_similar_image_surface:
+ * @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 @surface
+ *
+ * Create a new image surface that is efficient to draw on the
+ * 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 @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 @surface you can
+ * use:
+ *
+ * |[<!-- language="C" -->
+ * 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 (surface,
+ * format,
+ * width, height,
+ * scale);
+ * ]|
+ *
+ * Note that unlike cairo_surface_create_similar_image(), the new
+ * surface's device scale is set to @scale, or to the scale factor of
+ * @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
+ * with it.
+ *
+ * This function always returns a valid pointer, but it will return a
+ * pointer to a “nil” surface if @other is already in an error state
+ * or any other error occurs.
+ **/
+cairo_surface_t *
+gdk_surface_create_similar_image_surface (GdkSurface * surface,
+ cairo_format_t format,
+ int width,
+ int height,
+ int scale)
+{
+ cairo_surface_t *cairo_surface;
+
+ g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), NULL);
+
+ if (surface == NULL)
+ {
+ cairo_surface = cairo_image_surface_create (format, width, height);
+ }
+ else if (GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_similar_image_surface)
+ {
+ 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 (surface);
+ cairo_surface =
+ cairo_surface_create_similar_image (window_surface,
+ format,
+ width,
+ height);
+ cairo_surface_destroy (window_surface);
+ }
+
+ if (scale == 0)
+ scale = gdk_surface_get_scale_factor (surface);
+
+ cairo_surface_set_device_scale (cairo_surface, scale, scale);
+
+ return cairo_surface;
+}
+
+
+/**
+ * gdk_surface_focus:
+ * @surface: a #GdkSurface
+ * @timestamp: timestamp of the event triggering the surface focus
+ *
+ * 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 *surface,
+ guint32 timestamp)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->focus (surface, timestamp);
+}
+
+/**
+ * gdk_surface_set_type_hint:
+ * @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 surface
+ * manager about the functionality of a surface. The window manager
+ * can use this information when determining the decoration and behaviour
+ * of the surface.
+ *
+ * The hint must be set before the surface is mapped.
+ **/
+void
+gdk_surface_set_type_hint (GdkSurface *surface,
+ GdkSurfaceTypeHint hint)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_type_hint (surface, hint);
+}
+
+/**
+ * gdk_surface_get_type_hint:
+ * @surface: A toplevel #GdkSurface
+ *
+ * This function returns the type hint set for a surface.
+ *
+ * Returns: The type hint set for @surface
+ **/
+GdkSurfaceTypeHint
+gdk_surface_get_type_hint (GdkSurface *surface)
+{
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_type_hint (surface);
+}
+
+/**
+ * gdk_surface_set_modal_hint:
+ * @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 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 surfaces for which you have
+ * previously called gdk_surface_set_transient_for()
+ **/
+void
+gdk_surface_set_modal_hint (GdkSurface *surface,
+ gboolean modal)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_modal_hint (surface, modal);
+}
+
+/**
+ * gdk_surface_set_skip_taskbar_hint:
+ * @surface: a toplevel #GdkSurface
+ * @skips_taskbar: %TRUE to skip the taskbar
+ *
+ * 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 surface to be treated according to
+ * standard policy for its semantic type.
+ **/
+void
+gdk_surface_set_skip_taskbar_hint (GdkSurface *surface,
+ gboolean skips_taskbar)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_taskbar_hint (surface, skips_taskbar);
+}
+
+/**
+ * gdk_surface_set_skip_pager_hint:
+ * @surface: a toplevel #GdkSurface
+ * @skips_pager: %TRUE to skip the pager
+ *
+ * Toggles whether a surface should appear in a pager (workspace
+ * switcher, or other desktop utility program that displays a small
+ * 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 surface to be treated according to standard policy for
+ * its semantic type.
+ **/
+void
+gdk_surface_set_skip_pager_hint (GdkSurface *surface,
+ gboolean skips_pager)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_pager_hint (surface, skips_pager);
+}
+
+/**
+ * gdk_surface_set_urgency_hint:
+ * @surface: a toplevel #GdkSurface
+ * @urgent: %TRUE if the surface is urgent
+ *
+ * Toggles whether a surface needs the user's
+ * urgent attention.
+ **/
+void
+gdk_surface_set_urgency_hint (GdkSurface *surface,
+ gboolean urgent)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_urgency_hint (surface, urgent);
+}
+
+/**
+ * gdk_surface_set_geometry_hints:
+ * @surface: a toplevel #GdkSurface
+ * @geometry: geometry hints
+ * @geom_mask: bitmask indicating fields of @geometry to pay attention to
+ *
+ * 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 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 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 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
+ * constraints for programmatic resizes, you should generally
+ * call gdk_surface_constrain_size() yourself to determine
+ * appropriate sizes.
+ *
+ **/
+void
+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 (surface->impl)->set_geometry_hints (surface, geometry, geom_mask);
+}
+
+/**
+ * gdk_surface_set_title:
+ * @surface: a toplevel #GdkSurface
+ * @title: title of @surface
+ *
+ * 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 *surface,
+ const gchar *title)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_title (surface, title);
+}
+
+/**
+ * gdk_surface_set_role:
+ * @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 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 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 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 surface.
+ *
+ **/
+void
+gdk_surface_set_role (GdkSurface *surface,
+ const gchar *role)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_role (surface, role);
+}
+
+/**
+ * gdk_surface_set_startup_id:
+ * @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 *surface,
+ const gchar *startup_id)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_startup_id (surface, startup_id);
+}
+
+/**
+ * gdk_surface_set_transient_for:
+ * @surface: a toplevel #GdkSurface
+ * @parent: another toplevel #GdkSurface
+ *
+ * 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 *surface,
+ GdkSurface *parent)
+{
+ surface->transient_for = parent;
+
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_transient_for (surface, parent);
+}
+
+/**
+ * gdk_surface_get_root_origin:
+ * @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 surface manager frame in root
+ * surface coordinates.
+ *
+ **/
+void
+gdk_surface_get_root_origin (GdkSurface *surface,
+ gint *x,
+ gint *y)
+{
+ GdkRectangle rect;
+
+ gdk_surface_get_frame_extents (surface, &rect);
+
+ if (x)
+ *x = rect.x;
+
+ if (y)
+ *y = rect.y;
+}
+
+/**
+ * gdk_surface_get_frame_extents:
+ * @surface: a toplevel #GdkSurface
+ * @rect: (out): rectangle to fill with bounding box of the surface frame
+ *
+ * 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 surface itself (rather than
+ * the frame) in root window coordinates, use gdk_surface_get_origin().
+ *
+ **/
+void
+gdk_surface_get_frame_extents (GdkSurface *surface,
+ GdkRectangle *rect)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_frame_extents (surface, rect);
+}
+
+/**
+ * gdk_surface_set_accept_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
+ * 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 *surface,
+ gboolean accept_focus)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_accept_focus (surface, accept_focus);
+}
+
+/**
+ * gdk_surface_set_focus_on_map:
+ * @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
+ * 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
+ * this hint. Window managers following the freedesktop.org window
+ * manager extension specification should respect it.
+ **/
+void
+gdk_surface_set_focus_on_map (GdkSurface *surface,
+ gboolean focus_on_map)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_focus_on_map (surface, focus_on_map);
+}
+
+/**
+ * gdk_surface_set_icon_list:
+ * @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 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 surface icons.
+ */
+void
+gdk_surface_set_icon_list (GdkSurface *surface,
+ GList *textures)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_list (surface, textures);
+}
+
+/**
+ * gdk_surface_set_icon_name:
+ * @surface: a toplevel #GdkSurface
+ * @name: (allow-none): name of surface while iconified (minimized)
+ *
+ * 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.
+ *
+ * After calling this with a non-%NULL @name, calls to gdk_surface_set_title()
+ * will not update the icon title.
+ *
+ * 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 surface icons.
+ **/
+void
+gdk_surface_set_icon_name (GdkSurface *surface,
+ const gchar *name)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_name (surface, name);
+}
+
+/**
+ * gdk_surface_iconify:
+ * @surface: a toplevel #GdkSurface
+ *
+ * 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 @surface is a toplevel surface.
+ *
+ **/
+void
+gdk_surface_iconify (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->iconify (surface);
+}
+
+/**
+ * gdk_surface_deiconify:
+ * @surface: a toplevel #GdkSurface
+ *
+ * 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 surface, focuses it,
+ * unminimizes it, and puts it on the current desktop.
+ *
+ **/
+void
+gdk_surface_deiconify (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->deiconify (surface);
+}
+
+/**
+ * gdk_surface_stick:
+ * @surface: a toplevel #GdkSurface
+ *
+ * “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 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 *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->stick (surface);
+}
+
+/**
+ * gdk_surface_unstick:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Reverse operation for gdk_surface_stick(); see gdk_surface_stick(),
+ * and gtk_window_unstick().
+ *
+ **/
+void
+gdk_surface_unstick (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unstick (surface);
+}
+
+/**
+ * gdk_surface_maximize:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Maximizes the surface. If the surface was already maximized, then
+ * this function does nothing.
+ *
+ * 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 surface.
+ *
+ **/
+void
+gdk_surface_maximize (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->maximize (surface);
+}
+
+/**
+ * gdk_surface_unmaximize:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Unmaximizes the surface. If the surface wasn’t maximized, then this
+ * function does nothing.
+ *
+ * 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 surface.
+ *
+ **/
+void
+gdk_surface_unmaximize (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unmaximize (surface);
+}
+
+/**
+ * gdk_surface_fullscreen:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Moves the surface into fullscreen mode. This means the
+ * surface covers the entire screen and is above any panels
+ * or task bars.
+ *
+ * If the surface was already fullscreen, then this function does nothing.
+ *
+ * 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
+ * fullscreenification actually happening. But it will happen with
+ * most standard window managers, and GDK makes a best effort to get
+ * it to happen.
+ **/
+void
+gdk_surface_fullscreen (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen (surface);
+}
+
+/**
+ * gdk_surface_fullscreen_on_monitor:
+ * @surface: a toplevel #GdkSurface
+ * @monitor: Which monitor to display fullscreen on.
+ *
+ * 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 surface was already fullscreen, then this function does nothing.
+ **/
+void
+gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
+ GdkMonitor *monitor)
+{
+ 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 (surface));
+ g_return_if_fail (gdk_monitor_is_valid (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 (surface->impl)->fullscreen (surface);
+}
+
+/**
+ * gdk_surface_set_fullscreen_mode:
+ * @surface: a toplevel #GdkSurface
+ * @mode: fullscreen mode
+ *
+ * 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 @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 @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
+ * surface to span over the multiple monitors when #GDK_FULLSCREEN_ON_ALL_MONITORS
+ * is specified.
+ **/
+void
+gdk_surface_set_fullscreen_mode (GdkSurface *surface,
+ GdkFullscreenMode mode)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->fullscreen_mode != mode)
+ {
+ surface->fullscreen_mode = mode;
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+ if (impl_class->apply_fullscreen_mode != NULL)
+ impl_class->apply_fullscreen_mode (surface);
+ }
+}
+
+/**
+ * gdk_surface_get_fullscreen_mode:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Obtains the #GdkFullscreenMode of the @surface.
+ *
+ * Returns: The #GdkFullscreenMode applied to the surface when fullscreen.
+ **/
+GdkFullscreenMode
+gdk_surface_get_fullscreen_mode (GdkSurface *surface)
+{
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
+
+ return surface->fullscreen_mode;
+}
+
+/**
+ * gdk_surface_unfullscreen:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Moves the surface out of fullscreen mode. If the surface was not
+ * fullscreen, does nothing.
+ *
+ * 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
+ * unfullscreenification actually happening. But it will happen with
+ * most standard window managers, and GDK makes a best effort to get
+ * it to happen.
+ **/
+void
+gdk_surface_unfullscreen (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unfullscreen (surface);
+}
+
+/**
+ * gdk_surface_set_keep_above:
+ * @surface: a toplevel #GdkSurface
+ * @setting: whether to keep @surface above other surfaces
+ *
+ * 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 @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 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 *surface,
+ gboolean setting)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_above (surface, setting);
+}
+
+/**
+ * gdk_surface_set_keep_below:
+ * @surface: a toplevel #GdkSurface
+ * @setting: whether to keep @surface below other surfaces
+ *
+ * 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 @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 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 *surface, gboolean setting)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_below (surface, setting);
+}
+
+/**
+ * gdk_surface_get_group:
+ * @surface: a toplevel #GdkSurface
+ *
+ * Returns the group leader surface for @surface. See gdk_surface_set_group().
+ *
+ * Returns: (transfer none): the group leader surface for @surface
+ **/
+GdkSurface *
+gdk_surface_get_group (GdkSurface *surface)
+{
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_group (surface);
+}
+
+/**
+ * gdk_surface_set_group:
+ * @surface: a toplevel #GdkSurface
+ * @leader: (allow-none): group leader surface, or %NULL to restore the default group leader surface
+ *
+ * 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 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 *surface,
+ GdkSurface *leader)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_group (surface, leader);
+}
+
+/**
+ * gdk_surface_set_decorations:
+ * @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 surface to have.
+ * Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
+ * using the GDK function directly.
+ *
+ * The @decorations argument is the logical OR of the fields in
+ * the #GdkWMDecoration enumeration. If #GDK_DECOR_ALL is included in the
+ * mask, the other bits indicate which decorations should be turned off.
+ * If #GDK_DECOR_ALL is not included, then the other bits indicate
+ * which decorations should be turned on.
+ *
+ * Most window managers honor a decorations hint of 0 to disable all decorations,
+ * but very few honor all possible combinations of bits.
+ *
+ **/
+void
+gdk_surface_set_decorations (GdkSurface *surface,
+ GdkWMDecoration decorations)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_decorations (surface, decorations);
+}
+
+/**
+ * gdk_surface_get_decorations:
+ * @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 surface has decorations set, %FALSE otherwise.
+ **/
+gboolean
+gdk_surface_get_decorations(GdkSurface *surface,
+ GdkWMDecoration *decorations)
+{
+ return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_decorations (surface, decorations);
+}
+
+/**
+ * gdk_surface_set_functions:
+ * @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.
+ *
+ * On the X backend, this function sets the traditional Motif window
+ * manager hint for this purpose. However, few window managers do
+ * anything reliable or interesting with this hint. Many ignore it
+ * entirely.
+ *
+ * The @functions argument is the logical OR of values from the
+ * #GdkWMFunction enumeration. If the bitmask includes #GDK_FUNC_ALL,
+ * then the other bits indicate which functions to disable; if
+ * it doesn’t include #GDK_FUNC_ALL, it indicates which functions to
+ * enable.
+ *
+ **/
+void
+gdk_surface_set_functions (GdkSurface *surface,
+ GdkWMFunction functions)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_functions (surface, functions);
+}
+
+/**
+ * gdk_surface_begin_resize_drag_for_device:
+ * @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
+ * @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 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
+ * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
+ * but has a fallback implementation for other window managers.
+ */
+void
+gdk_surface_begin_resize_drag_for_device (GdkSurface *surface,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 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:
+ * @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 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 *surface,
+ GdkSurfaceEdge edge,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp)
+{
+ GdkDisplay *display;
+ GdkDevice *device;
+
+ display = gdk_surface_get_display (surface);
+ device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ gdk_surface_begin_resize_drag_for_device (surface, edge,
+ device, button, root_x, root_y, timestamp);
+}
+
+/**
+ * gdk_surface_begin_move_drag_for_device:
+ * @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 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 *surface,
+ GdkDevice *device,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_move_drag (surface,
+ device, button, root_x, root_y, timestamp);
+}
+
+/**
+ * gdk_surface_begin_move_drag:
+ * @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 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 *surface,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp)
+{
+ GdkDisplay *display;
+ GdkDevice *device;
+
+ display = gdk_surface_get_display (surface);
+ device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ gdk_surface_begin_move_drag_for_device (surface, device, button, root_x, root_y, timestamp);
+}
+
+/**
+ * gdk_surface_set_opacity:
+ * @surface: a top-level or non-native #GdkSurface
+ * @opacity: opacity
+ *
+ * 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 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-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 surfaces was added in 3.8.
+ */
+void
+gdk_surface_set_opacity (GdkSurface *surface,
+ gdouble opacity)
+{
+ if (opacity < 0)
+ opacity = 0;
+ else if (opacity > 1)
+ opacity = 1;
+
+ surface->alpha = round (opacity * 255);
+
+ if (surface->destroyed)
+ return;
+
+ if (gdk_surface_has_impl (surface))
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_opacity (surface, opacity);
+ else
+ {
+ 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 *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->destroy_notify (surface);
+}
+
+/**
+ * gdk_surface_register_dnd:
+ * @surface: a #GdkSurface.
+ *
+ * Registers a surface as a potential drop destination.
+ */
+void
+gdk_surface_register_dnd (GdkSurface *surface)
+{
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->register_dnd (surface);
+}
+
+/**
+ * gdk_drag_begin:
+ * @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
+ * @dx: the x offset to @device's position where the drag nominally started
+ * @dy: the y offset to @device's position where the drag nominally started
+ *
+ * Starts a drag and creates a new drag context for it.
+ *
+ * This function is called by the drag source.
+ *
+ * Returns: (transfer full) (nullable): a newly created #GdkDragContext or
+ * %NULL on error.
+ */
+GdkDragContext *
+gdk_drag_begin (GdkSurface *surface,
+ GdkDevice *device,
+ GdkContentProvider *content,
+ GdkDragAction actions,
+ gint dx,
+ gint dy)
+{
+ 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 (surface) == gdk_device_get_display (device), NULL);
+ g_return_val_if_fail (GDK_IS_CONTENT_PROVIDER (content), NULL);
+
+ 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 *surface;
+ GdkDisplay *display;
+
+ surface = GDK_SURFACE (data);
+
+ 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);
+
+ surface->frame_clock_events_paused = TRUE;
+}
+
+static void
+gdk_surface_resume_events (GdkFrameClock *clock,
+ void *data)
+{
+ GdkSurface *surface;
+ GdkDisplay *display;
+
+ surface = GDK_SURFACE (data);
+
+ display = gdk_surface_get_display (surface);
+ _gdk_display_unpause_events (display);
+
+ surface->frame_clock_events_paused = FALSE;
+}
+
+static void
+gdk_surface_set_frame_clock (GdkSurface *surface,
+ GdkFrameClock *clock)
+{
+ 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 (surface));
+
+ if (clock == surface->frame_clock)
+ return;
+
+ if (clock)
+ {
+ g_object_ref (clock);
+ g_signal_connect (G_OBJECT (clock),
+ "flush-events",
+ G_CALLBACK (gdk_surface_flush_events),
+ surface);
+ g_signal_connect (G_OBJECT (clock),
+ "paint",
+ G_CALLBACK (gdk_surface_paint_on_clock),
+ surface);
+ g_signal_connect (G_OBJECT (clock),
+ "resume-events",
+ G_CALLBACK (gdk_surface_resume_events),
+ surface);
+ }
+
+ if (surface->frame_clock)
+ {
+ if (surface->frame_clock_events_paused)
+ gdk_surface_resume_events (surface->frame_clock, G_OBJECT (surface));
+
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
+ G_CALLBACK (gdk_surface_flush_events),
+ surface);
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
+ G_CALLBACK (gdk_surface_paint_on_clock),
+ surface);
+ g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
+ G_CALLBACK (gdk_surface_resume_events),
+ surface);
+ g_object_unref (surface->frame_clock);
+ }
+
+ surface->frame_clock = clock;
+}
+
+/**
+ * gdk_surface_get_frame_clock:
+ * @surface: surface to get frame clock for
+ *
+ * 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 *surface)
+{
+ GdkSurface *toplevel;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+
+ toplevel = gdk_surface_get_toplevel (surface);
+
+ return toplevel->frame_clock;
+}
+
+/**
+ * gdk_surface_get_scale_factor:
+ * @surface: surface to get scale factor for
+ *
+ * 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).
+ *
+ * A higher value means that drawing is automatically scaled up to
+ * a higher resolution, so any code doing drawing will automatically look
+ * nicer. However, if you are supplying pixel-based data the scale
+ * value can be used to determine whether to use a pixel resource
+ * with higher resolution data.
+ *
+ * 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 *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), 1);
+
+ if (GDK_SURFACE_DESTROYED (surface))
+ return 1;
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ if (impl_class->get_scale_factor)
+ return impl_class->get_scale_factor (surface);
+
+ return 1;
+}
+
+/* Returns the *real* unscaled size, which may be a fractional size
+ 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 *surface,
+ int *unscaled_width,
+ int *unscaled_height)
+{
+ GdkSurfaceImplClass *impl_class;
+ gint scale;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ if (surface->impl_surface == surface)
+ {
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ if (impl_class->get_unscaled_size)
+ {
+ impl_class->get_unscaled_size (surface, unscaled_width, unscaled_height);
+ return;
+ }
+ }
+
+ scale = gdk_surface_get_scale_factor (surface);
+
+ if (unscaled_width)
+ *unscaled_width = surface->width * scale;
+
+ if (unscaled_height)
+ *unscaled_height = surface->height * scale;
+}
+
+
+/**
+ * gdk_surface_set_opaque_region:
+ * @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 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 surfaces.
+ *
+ * GTK+ will update this property automatically if
+ * 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 *surface,
+ cairo_region_t *region)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (!GDK_SURFACE_DESTROYED (surface));
+
+ if (cairo_region_equal (surface->opaque_region, region))
+ return;
+
+ g_clear_pointer (&surface->opaque_region, cairo_region_destroy);
+
+ if (region != NULL)
+ surface->opaque_region = cairo_region_reference (region);
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ if (impl_class->set_opaque_region)
+ impl_class->set_opaque_region (surface, region);
+}
+
+/**
+ * gdk_surface_set_shadow_width:
+ * @surface: a #GdkSurface
+ * @left: The left extent
+ * @right: The right extent
+ * @top: The top extent
+ * @bottom: The bottom extent
+ *
+ * Newer GTK+ windows using client-side decorations use extra geometry
+ * around their frames for effects like shadows and invisible borders.
+ * Window managers that want to maximize windows or snap to edges need
+ * to know where the extents of the actual frame lie, so that users
+ * don’t feel like windows are snapping against random invisible edges.
+ *
+ * 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 surfaces.
+ */
+void
+gdk_surface_set_shadow_width (GdkSurface *surface,
+ gint left,
+ gint right,
+ gint top,
+ gint bottom)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ 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);
+
+ surface->shadow_top = top;
+ surface->shadow_left = left;
+ surface->shadow_right = right;
+ surface->shadow_bottom = bottom;
+
+ impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
+
+ if (impl_class->set_shadow_width)
+ impl_class->set_shadow_width (surface, left, right, top, bottom);
+}
+
+/**
+ * gdk_surface_show_window_menu:
+ * @surface: a #GdkSurface
+ * @event: a #GdkEvent to show the menu for
+ *
+ * Asks the windowing system to show the window menu. The window menu
+ * is the menu shown when right-clicking the titlebar on traditional
+ * windows managed by the window manager. This is useful for windows
+ * using client-side decorations, activating it with a right-click
+ * on the window decorations.
+ *
+ * Returns: %TRUE if the window menu was shown and %FALSE otherwise.
+ */
+gboolean
+gdk_surface_show_window_menu (GdkSurface *surface,
+ GdkEvent *event)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ 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 (surface->impl);
+
+ if (impl_class->show_window_menu)
+ return impl_class->show_window_menu (surface, event);
+ else
+ return FALSE;
+}
+
+gboolean
+gdk_surface_supports_edge_constraints (GdkSurface *surface)
+{
+ GdkSurfaceImplClass *impl_class;
+
+ 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 (surface->impl);
+
+ if (impl_class->supports_edge_constraints)
+ return impl_class->supports_edge_constraints (surface);
+ else
+ return FALSE;
+}
+
+void
+gdk_surface_set_state (GdkSurface *surface,
+ GdkSurfaceState new_state)
+{
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+
+ 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
+ * place to do it, but seems like the safest since it ensures we expose no
+ * inconsistent state to the user.
+ */
+
+ surface->state = new_state;
+
+ _gdk_surface_update_viewable (surface);
+
+ /* We only really send the event to toplevels, since
+ * 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 surface->state.
+ */
+ switch (surface->surface_type)
+ {
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP: /* ? */
+ g_object_notify (G_OBJECT (surface), "state");
+ break;
+ case GDK_SURFACE_FOREIGN:
+ case GDK_SURFACE_ROOT:
+ case GDK_SURFACE_CHILD:
+ default:
+ break;
+ }
+}
+
+void
+gdk_synthesize_surface_state (GdkSurface *surface,
+ GdkSurfaceState unset_flags,
+ GdkSurfaceState set_flags)
+{
+ gdk_surface_set_state (surface, (surface->state | set_flags) & ~unset_flags);
+}
diff --git a/gdk/gdkwindow.h b/gdk/gdksurface.h
index 281033dd75..33d3591e65 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdksurface.h
@@ -22,8 +22,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_WINDOW_H__
-#define __GDK_WINDOW_H__
+#ifndef __GDK_SURFACE_H__
+#define __GDK_SURFACE_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
@@ -41,44 +41,44 @@ G_BEGIN_DECLS
typedef struct _GdkGeometry GdkGeometry;
/**
- * GdkWindowType:
- * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire
+ * GdkSurfaceType:
+ * @GDK_SURFACE_ROOT: root window; this surface has no parent, covers the entire
* screen, and is created by the window system
- * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
- * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry)
- * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement
+ * @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow)
+ * @GDK_SURFACE_CHILD: child surface (used to implement e.g. #GtkEntry)
+ * @GDK_SURFACE_TEMP: override redirect temporary surface (used to implement
* #GtkMenu)
- * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
- * @GDK_WINDOW_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
{
- GDK_WINDOW_ROOT,
- GDK_WINDOW_TOPLEVEL,
- GDK_WINDOW_CHILD,
- GDK_WINDOW_TEMP,
- GDK_WINDOW_FOREIGN,
- GDK_WINDOW_SUBSURFACE
-} GdkWindowType;
+ GDK_SURFACE_ROOT,
+ GDK_SURFACE_TOPLEVEL,
+ GDK_SURFACE_CHILD,
+ GDK_SURFACE_TEMP,
+ GDK_SURFACE_FOREIGN,
+ GDK_SURFACE_SUBSURFACE
+} GdkSurfaceType;
/* Size restriction enumeration.
*/
/**
- * GdkWindowHints:
- * @GDK_HINT_POS: indicates that the program has positioned the window
+ * GdkSurfaceHints:
+ * @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
@@ -101,26 +101,26 @@ typedef enum
GDK_HINT_WIN_GRAVITY = 1 << 6,
GDK_HINT_USER_POS = 1 << 7,
GDK_HINT_USER_SIZE = 1 << 8
-} GdkWindowHints;
+} GdkSurfaceHints;
/* The next two enumeration values current match the
* Motif constants. If this is changed, the implementation
- * of gdk_window_set_decorations/gdk_window_set_functions
+ * of gdk_surface_set_decorations/gdk_surface_set_functions
* will need to change as well.
*/
/**
* 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
{
@@ -157,7 +157,7 @@ typedef enum
} GdkWMFunction;
/* Currently, these are the same values numerically as in the
- * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints()
+ * X protocol. If you change that, gdksurface-x11.c/gdk_surface_set_geometry_hints()
* will need fixing.
*/
/**
@@ -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
@@ -239,36 +239,36 @@ typedef enum
} GdkAnchorHints;
/**
- * GdkWindowEdge:
- * @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner.
- * @GDK_WINDOW_EDGE_NORTH: the top edge.
- * @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner.
- * @GDK_WINDOW_EDGE_WEST: the left edge.
- * @GDK_WINDOW_EDGE_EAST: the right edge.
- * @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner.
- * @GDK_WINDOW_EDGE_SOUTH: the lower edge.
- * @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner.
+ * GdkSurfaceEdge:
+ * @GDK_SURFACE_EDGE_NORTH_WEST: the top left corner.
+ * @GDK_SURFACE_EDGE_NORTH: the top edge.
+ * @GDK_SURFACE_EDGE_NORTH_EAST: the top right corner.
+ * @GDK_SURFACE_EDGE_WEST: the left edge.
+ * @GDK_SURFACE_EDGE_EAST: the right edge.
+ * @GDK_SURFACE_EDGE_SOUTH_WEST: the lower left corner.
+ * @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
{
- GDK_WINDOW_EDGE_NORTH_WEST,
- GDK_WINDOW_EDGE_NORTH,
- GDK_WINDOW_EDGE_NORTH_EAST,
- GDK_WINDOW_EDGE_WEST,
- GDK_WINDOW_EDGE_EAST,
- GDK_WINDOW_EDGE_SOUTH_WEST,
- GDK_WINDOW_EDGE_SOUTH,
- GDK_WINDOW_EDGE_SOUTH_EAST
-} GdkWindowEdge;
+ GDK_SURFACE_EDGE_NORTH_WEST,
+ GDK_SURFACE_EDGE_NORTH,
+ GDK_SURFACE_EDGE_NORTH_EAST,
+ GDK_SURFACE_EDGE_WEST,
+ GDK_SURFACE_EDGE_EAST,
+ GDK_SURFACE_EDGE_SOUTH_WEST,
+ GDK_SURFACE_EDGE_SOUTH,
+ GDK_SURFACE_EDGE_SOUTH_EAST
+} GdkSurfaceEdge;
/**
* GdkFullscreenMode:
* @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,40 +281,40 @@ 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 #GdkWindow it creates.
+ * then sets the hints on the #GdkSurface it creates.
*
- * gdk_window_set_geometry_hints() expects the hints to be fully valid already
+ * gdk_surface_set_geometry_hints() expects the hints to be fully valid already
* and simply passes them to the window manager; in contrast,
* gtk_window_set_geometry_hints() performs some interpretation. For example,
* #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
@@ -371,62 +371,62 @@ struct _GdkGeometry
};
/**
- * GdkWindowState:
- * @GDK_WINDOW_STATE_WITHDRAWN: the window is not shown.
- * @GDK_WINDOW_STATE_ICONIFIED: the window is minimized.
- * @GDK_WINDOW_STATE_MAXIMIZED: the window is maximized.
- * @GDK_WINDOW_STATE_STICKY: the window is sticky.
- * @GDK_WINDOW_STATE_FULLSCREEN: the window is maximized without
+ * GdkSurfaceState:
+ * @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_WINDOW_STATE_ABOVE: the window is kept above other windows.
- * @GDK_WINDOW_STATE_BELOW: the window is kept below other windows.
- * @GDK_WINDOW_STATE_FOCUSED: the window is presented as focused (with active decorations).
- * @GDK_WINDOW_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_WINDOW_STATE_TOP_TILED: whether the top edge is tiled, Since 3.91.2
- * @GDK_WINDOW_STATE_TOP_RESIZABLE: whether the top edge is resizable, Since 3.91.2
- * @GDK_WINDOW_STATE_RIGHT_TILED: whether the right edge is tiled, Since 3.91.2
- * @GDK_WINDOW_STATE_RIGHT_RESIZABLE: whether the right edge is resizable, Since 3.91.2
- * @GDK_WINDOW_STATE_BOTTOM_TILED: whether the bottom edge is tiled, Since 3.91.2
- * @GDK_WINDOW_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable, Since 3.91.2
- * @GDK_WINDOW_STATE_LEFT_TILED: whether the left edge is tiled, Since 3.91.2
- * @GDK_WINDOW_STATE_LEFT_RESIZABLE: whether the left edge is resizable, Since 3.91.2
+ * @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
+ * @GDK_SURFACE_STATE_RIGHT_TILED: whether the right edge is tiled, Since 3.91.2
+ * @GDK_SURFACE_STATE_RIGHT_RESIZABLE: whether the right edge is resizable, Since 3.91.2
+ * @GDK_SURFACE_STATE_BOTTOM_TILED: whether the bottom edge is tiled, Since 3.91.2
+ * @GDK_SURFACE_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable, Since 3.91.2
+ * @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
{
- GDK_WINDOW_STATE_WITHDRAWN = 1 << 0,
- GDK_WINDOW_STATE_ICONIFIED = 1 << 1,
- GDK_WINDOW_STATE_MAXIMIZED = 1 << 2,
- GDK_WINDOW_STATE_STICKY = 1 << 3,
- GDK_WINDOW_STATE_FULLSCREEN = 1 << 4,
- GDK_WINDOW_STATE_ABOVE = 1 << 5,
- GDK_WINDOW_STATE_BELOW = 1 << 6,
- GDK_WINDOW_STATE_FOCUSED = 1 << 7,
- GDK_WINDOW_STATE_TILED = 1 << 8,
- GDK_WINDOW_STATE_TOP_TILED = 1 << 9,
- GDK_WINDOW_STATE_TOP_RESIZABLE = 1 << 10,
- GDK_WINDOW_STATE_RIGHT_TILED = 1 << 11,
- GDK_WINDOW_STATE_RIGHT_RESIZABLE = 1 << 12,
- GDK_WINDOW_STATE_BOTTOM_TILED = 1 << 13,
- GDK_WINDOW_STATE_BOTTOM_RESIZABLE = 1 << 14,
- GDK_WINDOW_STATE_LEFT_TILED = 1 << 15,
- GDK_WINDOW_STATE_LEFT_RESIZABLE = 1 << 16
-} GdkWindowState;
-
-
-typedef struct _GdkWindowClass GdkWindowClass;
-
-#define GDK_TYPE_WINDOW (gdk_window_get_type ())
-#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
-#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
-#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
-#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
-#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
-
-
-struct _GdkWindowClass
+ GDK_SURFACE_STATE_WITHDRAWN = 1 << 0,
+ GDK_SURFACE_STATE_ICONIFIED = 1 << 1,
+ GDK_SURFACE_STATE_MAXIMIZED = 1 << 2,
+ GDK_SURFACE_STATE_STICKY = 1 << 3,
+ GDK_SURFACE_STATE_FULLSCREEN = 1 << 4,
+ GDK_SURFACE_STATE_ABOVE = 1 << 5,
+ GDK_SURFACE_STATE_BELOW = 1 << 6,
+ GDK_SURFACE_STATE_FOCUSED = 1 << 7,
+ GDK_SURFACE_STATE_TILED = 1 << 8,
+ GDK_SURFACE_STATE_TOP_TILED = 1 << 9,
+ GDK_SURFACE_STATE_TOP_RESIZABLE = 1 << 10,
+ GDK_SURFACE_STATE_RIGHT_TILED = 1 << 11,
+ GDK_SURFACE_STATE_RIGHT_RESIZABLE = 1 << 12,
+ GDK_SURFACE_STATE_BOTTOM_TILED = 1 << 13,
+ GDK_SURFACE_STATE_BOTTOM_RESIZABLE = 1 << 14,
+ GDK_SURFACE_STATE_LEFT_TILED = 1 << 15,
+ GDK_SURFACE_STATE_LEFT_RESIZABLE = 1 << 16
+} GdkSurfaceState;
+
+
+typedef struct _GdkSurfaceClass GdkSurfaceClass;
+
+#define GDK_TYPE_SURFACE (gdk_surface_get_type ())
+#define GDK_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE, GdkSurface))
+#define GDK_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE, GdkSurfaceClass))
+#define GDK_IS_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE))
+#define GDK_IS_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE))
+#define GDK_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE, GdkSurfaceClass))
+
+
+struct _GdkSurfaceClass
{
GObjectClass parent_class;
@@ -441,409 +441,409 @@ struct _GdkWindowClass
void (*_gdk_reserved8) (void);
};
-/* Windows
+/* Surfaces
*/
GDK_AVAILABLE_IN_ALL
-GType gdk_window_get_type (void) G_GNUC_CONST;
+GType gdk_surface_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_new_toplevel (GdkDisplay *display,
+GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display,
int width,
int height);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_new_popup (GdkDisplay *display,
+GdkSurface * gdk_surface_new_popup (GdkDisplay *display,
const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_new_temp (GdkDisplay *display);
+GdkSurface * gdk_surface_new_temp (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_new_child (GdkWindow *parent,
+GdkSurface * gdk_surface_new_child (GdkSurface *parent,
const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL
-void gdk_window_destroy (GdkWindow *window);
+void gdk_surface_destroy (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindowType gdk_window_get_window_type (GdkWindow *window);
+GdkSurfaceType gdk_surface_get_surface_type (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_is_destroyed (GdkWindow *window);
+gboolean gdk_surface_is_destroyed (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkDisplay * gdk_window_get_display (GdkWindow *window);
+GdkDisplay * gdk_surface_get_display (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_show (GdkWindow *window);
+void gdk_surface_show (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_hide (GdkWindow *window);
+void gdk_surface_hide (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_withdraw (GdkWindow *window);
+void gdk_surface_withdraw (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_show_unraised (GdkWindow *window);
+void gdk_surface_show_unraised (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_move (GdkWindow *window,
+void gdk_surface_move (GdkSurface *surface,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
-void gdk_window_resize (GdkWindow *window,
+void gdk_surface_resize (GdkSurface *surface,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
-void gdk_window_move_resize (GdkWindow *window,
+void gdk_surface_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
-void gdk_window_raise (GdkWindow *window);
+void gdk_surface_raise (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_lower (GdkWindow *window);
+void gdk_surface_lower (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_restack (GdkWindow *window,
- GdkWindow *sibling,
+void gdk_surface_restack (GdkSurface *surface,
+ GdkSurface *sibling,
gboolean above);
GDK_AVAILABLE_IN_ALL
-void gdk_window_focus (GdkWindow *window,
+void gdk_surface_focus (GdkSurface *surface,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_user_data (GdkWindow *window,
+void gdk_surface_set_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_accept_focus (GdkWindow *window);
+gboolean gdk_surface_get_accept_focus (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_accept_focus (GdkWindow *window,
+void gdk_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_focus_on_map (GdkWindow *window);
+gboolean gdk_surface_get_focus_on_map (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_focus_on_map (GdkWindow *window,
+void gdk_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL
-void gdk_window_scroll (GdkWindow *window,
+void gdk_surface_scroll (GdkSurface *surface,
gint dx,
gint dy);
GDK_AVAILABLE_IN_ALL
-void gdk_window_move_region (GdkWindow *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_window_shape_combine_region (GdkWindow *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_window_set_child_shapes (GdkWindow *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_window_merge_child_shapes (GdkWindow *window);
+void gdk_surface_merge_child_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_input_shape_combine_region (GdkWindow *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_window_set_child_input_shapes (GdkWindow *window);
+void gdk_surface_set_child_input_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_merge_child_input_shapes (GdkWindow *window);
+void gdk_surface_merge_child_input_shapes (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_pass_through (GdkWindow *window,
+void gdk_surface_set_pass_through (GdkSurface *surface,
gboolean pass_through);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_pass_through (GdkWindow *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_window_is_visible (GdkWindow *window);
+gboolean gdk_surface_is_visible (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_is_viewable (GdkWindow *window);
+gboolean gdk_surface_is_viewable (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_is_input_only (GdkWindow *window);
+gboolean gdk_surface_is_input_only (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_is_shaped (GdkWindow *window);
+gboolean gdk_surface_is_shaped (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindowState gdk_window_get_state (GdkWindow *window);
+GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
-/* GdkWindow */
+/* GdkSurface */
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_has_native (GdkWindow *window);
+gboolean gdk_surface_has_native (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint);
+void gdk_surface_set_type_hint (GdkSurface *surface,
+ GdkSurfaceTypeHint hint);
GDK_AVAILABLE_IN_ALL
-GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window);
+GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_modal_hint (GdkWindow *window);
+gboolean gdk_surface_get_modal_hint (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_modal_hint (GdkWindow *window,
+void gdk_surface_set_modal_hint (GdkSurface *surface,
gboolean modal);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
+void gdk_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_skip_pager_hint (GdkWindow *window,
+void gdk_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_urgency_hint (GdkWindow *window,
+void gdk_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_geometry_hints (GdkWindow *window,
+void gdk_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask);
+ GdkSurfaceHints geom_mask);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
+cairo_region_t *gdk_surface_get_clip_region (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
+cairo_region_t *gdk_surface_get_visible_region(GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkDrawingContext *gdk_window_begin_draw_frame (GdkWindow *window,
+GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *surface,
GdkDrawContext *context,
const cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
-void gdk_window_end_draw_frame (GdkWindow *window,
+void gdk_surface_end_draw_frame (GdkSurface *surface,
GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_title (GdkWindow *window,
+void gdk_surface_set_title (GdkSurface *surface,
const gchar *title);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_role (GdkWindow *window,
+void gdk_surface_set_role (GdkSurface *surface,
const gchar *role);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_startup_id (GdkWindow *window,
+void gdk_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent);
+void gdk_surface_set_transient_for (GdkSurface *surface,
+ GdkSurface *parent);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_cursor (GdkWindow *window,
+void gdk_surface_set_cursor (GdkSurface *surface,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
-GdkCursor *gdk_window_get_cursor (GdkWindow *window);
+GdkCursor *gdk_surface_get_cursor (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_device_cursor (GdkWindow *window,
+void gdk_surface_set_device_cursor (GdkSurface *surface,
GdkDevice *device,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
-GdkCursor *gdk_window_get_device_cursor (GdkWindow *window,
+GdkCursor *gdk_surface_get_device_cursor (GdkSurface *surface,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
-void gdk_window_get_user_data (GdkWindow *window,
+void gdk_surface_get_user_data (GdkSurface *surface,
gpointer *data);
GDK_AVAILABLE_IN_ALL
-void gdk_window_get_geometry (GdkWindow *window,
+void gdk_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height);
GDK_AVAILABLE_IN_ALL
-int gdk_window_get_width (GdkWindow *window);
+int gdk_surface_get_width (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-int gdk_window_get_height (GdkWindow *window);
+int gdk_surface_get_height (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_get_position (GdkWindow *window,
+void gdk_surface_get_position (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-gint gdk_window_get_origin (GdkWindow *window,
+gint gdk_surface_get_origin (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-void gdk_window_get_root_coords (GdkWindow *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_window_coords_to_parent (GdkWindow *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_window_coords_from_parent (GdkWindow *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_window_get_root_origin (GdkWindow *window,
+void gdk_surface_get_root_origin (GdkSurface *surface,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
-void gdk_window_get_frame_extents (GdkWindow *window,
+void gdk_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL
-gint gdk_window_get_scale_factor (GdkWindow *window);
+gint gdk_surface_get_scale_factor (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_get_device_position (GdkWindow *window,
+GdkSurface * gdk_surface_get_device_position (GdkSurface *surface,
GdkDevice *device,
gint *x,
gint *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_get_device_position_double (GdkWindow *window,
+GdkSurface * gdk_surface_get_device_position_double (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_get_parent (GdkWindow *window);
+GdkSurface * gdk_surface_get_parent (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
+GdkSurface * gdk_surface_get_toplevel (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_window_get_children (GdkWindow *window);
+GList * gdk_surface_get_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_window_peek_children (GdkWindow *window);
+GList * gdk_surface_peek_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GList * gdk_window_get_children_with_user_data (GdkWindow *window,
+GList * gdk_surface_get_children_with_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-GdkEventMask gdk_window_get_events (GdkWindow *window);
+GdkEventMask gdk_surface_get_events (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_events (GdkWindow *window,
+void gdk_surface_set_events (GdkSurface *surface,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_device_events (GdkWindow *window,
+void gdk_surface_set_device_events (GdkSurface *surface,
GdkDevice *device,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
-GdkEventMask gdk_window_get_device_events (GdkWindow *window,
+GdkEventMask gdk_surface_get_device_events (GdkSurface *surface,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_icon_list (GdkWindow *window,
+void gdk_surface_set_icon_list (GdkSurface *surface,
GList *surfaces);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_icon_name (GdkWindow *window,
+void gdk_surface_set_icon_name (GdkSurface *surface,
const gchar *name);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_group (GdkWindow *window,
- GdkWindow *leader);
+void gdk_surface_set_group (GdkSurface *surface,
+ GdkSurface *leader);
GDK_AVAILABLE_IN_ALL
-GdkWindow* gdk_window_get_group (GdkWindow *window);
+GdkSurface* gdk_surface_get_group (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_decorations (GdkWindow *window,
+void gdk_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_decorations (GdkWindow *window,
+gboolean gdk_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_functions (GdkWindow *window,
+void gdk_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
- gdk_window_create_similar_surface (GdkWindow *window,
+ gdk_surface_create_similar_surface (GdkSurface *surface,
cairo_content_t content,
int width,
int height);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
- gdk_window_create_similar_image_surface (GdkWindow *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_window_beep (GdkWindow *window);
+void gdk_surface_beep (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_iconify (GdkWindow *window);
+void gdk_surface_iconify (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_deiconify (GdkWindow *window);
+void gdk_surface_deiconify (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_stick (GdkWindow *window);
+void gdk_surface_stick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_unstick (GdkWindow *window);
+void gdk_surface_unstick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_maximize (GdkWindow *window);
+void gdk_surface_maximize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_unmaximize (GdkWindow *window);
+void gdk_surface_unmaximize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_fullscreen (GdkWindow *window);
+void gdk_surface_fullscreen (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_fullscreen_on_monitor (GdkWindow *window,
+void gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_fullscreen_mode (GdkWindow *window,
+void gdk_surface_set_fullscreen_mode (GdkSurface *surface,
GdkFullscreenMode mode);
GDK_AVAILABLE_IN_ALL
GdkFullscreenMode
- gdk_window_get_fullscreen_mode (GdkWindow *window);
+ gdk_surface_get_fullscreen_mode (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_unfullscreen (GdkWindow *window);
+void gdk_surface_unfullscreen (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_keep_above (GdkWindow *window,
+void gdk_surface_set_keep_above (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_keep_below (GdkWindow *window,
+void gdk_surface_set_keep_below (GdkSurface *surface,
gboolean setting);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_opacity (GdkWindow *window,
+void gdk_surface_set_opacity (GdkSurface *surface,
gdouble opacity);
GDK_AVAILABLE_IN_ALL
-void gdk_window_register_dnd (GdkWindow *window);
+void gdk_surface_register_dnd (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+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_window_begin_resize_drag_for_device (GdkWindow *window,
- GdkWindowEdge edge,
+void gdk_surface_begin_resize_drag_for_device (GdkSurface *surface,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_window_begin_move_drag (GdkWindow *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_window_begin_move_drag_for_device (GdkWindow *window,
+void gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
@@ -852,44 +852,44 @@ void gdk_window_begin_move_drag_for_device (GdkWindow *window,
/* Interface for dirty-region queueing */
GDK_AVAILABLE_IN_ALL
-void gdk_window_invalidate_rect (GdkWindow *window,
+void gdk_surface_invalidate_rect (GdkSurface *surface,
const GdkRectangle *rect,
gboolean invalidate_children);
GDK_AVAILABLE_IN_ALL
-void gdk_window_invalidate_region (GdkWindow *window,
+void gdk_surface_invalidate_region (GdkSurface *surface,
const cairo_region_t *region,
gboolean invalidate_children);
/**
- * GdkWindowChildFunc:
- * @window: a #GdkWindow
+ * GdkSurfaceChildFunc:
+ * @surface: a #GdkSurface
* @user_data: user data
*
- * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
- * It gets called for each child of the window to determine whether to
+ * A function of this type is passed to gdk_surface_invalidate_maybe_recurse().
+ * 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 (*GdkWindowChildFunc) (GdkWindow *window,
+typedef gboolean (*GdkSurfaceChildFunc) (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
+void gdk_surface_invalidate_maybe_recurse (GdkSurface *surface,
const cairo_region_t *region,
- GdkWindowChildFunc child_func,
+ GdkSurfaceChildFunc child_func,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
+cairo_region_t *gdk_surface_get_update_area (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_freeze_updates (GdkWindow *window);
+void gdk_surface_freeze_updates (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_thaw_updates (GdkWindow *window);
+void gdk_surface_thaw_updates (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_constrain_size (GdkGeometry *geometry,
- GdkWindowHints flags,
+void gdk_surface_constrain_size (GdkGeometry *geometry,
+ GdkSurfaceHints flags,
gint width,
gint height,
gint *new_width,
@@ -897,37 +897,37 @@ void gdk_window_constrain_size (GdkGeometry *geometry,
/* Multidevice support */
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_support_multidevice (GdkWindow *window,
+void gdk_surface_set_support_multidevice (GdkSurface *surface,
gboolean support_multidevice);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_get_support_multidevice (GdkWindow *window);
+gboolean gdk_surface_get_support_multidevice (GdkSurface *surface);
/* Frame clock */
GDK_AVAILABLE_IN_ALL
-GdkFrameClock* gdk_window_get_frame_clock (GdkWindow *window);
+GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_opaque_region (GdkWindow *window,
+void gdk_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
-void gdk_window_set_shadow_width (GdkWindow *window,
+void gdk_surface_set_shadow_width (GdkSurface *surface,
gint left,
gint right,
gint top,
gint bottom);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_window_show_window_menu (GdkWindow *window,
+gboolean gdk_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event);
GDK_AVAILABLE_IN_ALL
-GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
+GdkGLContext * gdk_surface_create_gl_context (GdkSurface *surface,
GError **error);
GDK_AVAILABLE_IN_ALL
GdkVulkanContext *
- gdk_window_create_vulkan_context(GdkWindow *window,
+ gdk_surface_create_vulkan_context(GdkSurface *surface,
GError **error);
G_END_DECLS
-#endif /* __GDK_WINDOW_H__ */
+#endif /* __GDK_SURFACE_H__ */
diff --git a/gdk/gdkwindowimpl.c b/gdk/gdksurfaceimpl.c
index af445e3bd6..e73d11748a 100644
--- a/gdk/gdkwindowimpl.c
+++ b/gdk/gdksurfaceimpl.c
@@ -24,36 +24,36 @@
#include "config.h"
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkinternals.h"
-G_DEFINE_TYPE (GdkWindowImpl, gdk_window_impl, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GdkSurfaceImpl, gdk_surface_impl, G_TYPE_OBJECT);
static gboolean
-gdk_window_impl_beep (GdkWindow *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;
}
static GdkDisplay *
-get_display_for_window (GdkWindow *primary,
- GdkWindow *secondary)
+get_display_for_surface (GdkSurface *primary,
+ GdkSurface *secondary)
{
- GdkDisplay *display = gdk_window_get_display (primary);
+ GdkDisplay *display = gdk_surface_get_display (primary);
if (display)
return display;
- display = gdk_window_get_display (secondary);
+ display = gdk_surface_get_display (secondary);
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,54 +158,54 @@ 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;
return primary;
}
-static GdkWindow *
-traverse_to_toplevel (GdkWindow *window,
+static GdkSurface *
+traverse_to_toplevel (GdkSurface *surface,
gint x,
gint y,
gint *toplevel_x,
gint *toplevel_y)
{
- GdkWindow *parent;
+ GdkSurface *parent;
gdouble xf = x;
gdouble yf = y;
- while ((parent = window->parent) != NULL &&
- (gdk_window_get_window_type (parent) != GDK_WINDOW_ROOT))
+ while ((parent = surface->parent) != NULL &&
+ (gdk_surface_get_surface_type (parent) != GDK_SURFACE_ROOT))
{
- gdk_window_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_window_impl_move_to_rect (GdkWindow *window,
+gdk_surface_impl_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
- GdkGravity window_anchor,
+ GdkGravity surface_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy)
{
- GdkWindow *transient_for_toplevel;
+ GdkSurface *transient_for_toplevel;
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle bounds;
@@ -218,33 +218,33 @@ gdk_window_impl_move_to_rect (GdkWindow *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,
&root_rect.y);
- gdk_window_get_root_coords (transient_for_toplevel,
+ gdk_surface_get_root_coords (transient_for_toplevel,
root_rect.x,
root_rect.y,
&root_rect.x,
&root_rect.y);
- display = get_display_for_window (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,
root_rect.width,
flipped_rect.width,
get_anchor_x_sign (rect_anchor),
- get_anchor_x_sign (window_anchor),
+ get_anchor_x_sign (surface_anchor),
rect_anchor_dx,
anchor_hints & GDK_ANCHOR_FLIP_X,
&flipped_x);
@@ -254,7 +254,7 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
root_rect.height,
flipped_rect.height,
get_anchor_y_sign (rect_anchor),
- get_anchor_y_sign (window_anchor),
+ get_anchor_y_sign (surface_anchor),
rect_anchor_dy,
anchor_hints & GDK_ANCHOR_FLIP_Y,
&flipped_y);
@@ -303,22 +303,22 @@ gdk_window_impl_move_to_rect (GdkWindow *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_window_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_window_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,21 +327,21 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
}
static void
-gdk_window_impl_process_updates_recurse (GdkWindow *window,
+gdk_surface_impl_process_updates_recurse (GdkSurface *surface,
cairo_region_t *region)
{
- _gdk_window_process_updates_recurse (window, region);
+ _gdk_surface_process_updates_recurse (surface, region);
}
static void
-gdk_window_impl_class_init (GdkWindowImplClass *impl_class)
+gdk_surface_impl_class_init (GdkSurfaceImplClass *impl_class)
{
- impl_class->beep = gdk_window_impl_beep;
- impl_class->move_to_rect = gdk_window_impl_move_to_rect;
- impl_class->process_updates_recurse = gdk_window_impl_process_updates_recurse;
+ impl_class->beep = gdk_surface_impl_beep;
+ impl_class->move_to_rect = gdk_surface_impl_move_to_rect;
+ impl_class->process_updates_recurse = gdk_surface_impl_process_updates_recurse;
}
static void
-gdk_window_impl_init (GdkWindowImpl *impl)
+gdk_surface_impl_init (GdkSurfaceImpl *impl)
{
}
diff --git a/gdk/gdksurfaceimpl.h b/gdk/gdksurfaceimpl.h
new file mode 100644
index 0000000000..4617a7d2fb
--- /dev/null
+++ b/gdk/gdksurfaceimpl.h
@@ -0,0 +1,256 @@
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GDK_SURFACE_IMPL_H__
+#define __GDK_SURFACE_IMPL_H__
+
+#include <gdk/gdksurface.h>
+#include <gdk/gdkproperty.h>
+
+G_BEGIN_DECLS
+
+#define GDK_TYPE_SURFACE_IMPL (gdk_surface_impl_get_type ())
+#define GDK_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImpl))
+#define GDK_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
+#define GDK_IS_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL))
+#define GDK_IS_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL))
+#define GDK_SURFACE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
+
+typedef struct _GdkSurfaceImpl GdkSurfaceImpl;
+typedef struct _GdkSurfaceImplClass GdkSurfaceImplClass;
+
+struct _GdkSurfaceImpl
+{
+ GObject parent;
+};
+
+struct _GdkSurfaceImplClass
+{
+ GObjectClass parent_class;
+
+ cairo_surface_t *
+ (* ref_cairo_surface) (GdkSurface *surface);
+ cairo_surface_t *
+ (* create_similar_image_surface) (GdkSurface * surface,
+ cairo_format_t format,
+ int width,
+ int height);
+
+ void (* show) (GdkSurface *surface,
+ gboolean already_mapped);
+ 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 *surface,
+ gboolean with_move,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+ void (* move_to_rect) (GdkSurface *surface,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity surface_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy);
+
+ GdkEventMask (* get_events) (GdkSurface *surface);
+ void (* set_events) (GdkSurface *surface,
+ GdkEventMask event_mask);
+
+ void (* get_geometry) (GdkSurface *surface,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height);
+ void (* get_root_coords) (GdkSurface *surface,
+ gint x,
+ gint y,
+ gint *root_x,
+ gint *root_y);
+ gboolean (* get_device_state) (GdkSurface *surface,
+ GdkDevice *device,
+ gdouble *x,
+ gdouble *y,
+ GdkModifierType *mask);
+ gboolean (* begin_paint) (GdkSurface *surface);
+ void (* end_paint) (GdkSurface *surface);
+
+ void (* shape_combine_region) (GdkSurface *surface,
+ const cairo_region_t *shape_region,
+ gint offset_x,
+ gint offset_y);
+ 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 surface. This gives the windowing
+ * layer a chance to save the region for later use in avoiding duplicate
+ * exposes.
+ */
+ void (* queue_antiexpose) (GdkSurface *surface,
+ cairo_region_t *update_area);
+
+/* Called to do the windowing system specific part of gdk_surface_destroy(),
+ *
+ * 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 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 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 *surface,
+ gboolean recursing,
+ gboolean foreign_destroy);
+
+
+ /* optional */
+ gboolean (* beep) (GdkSurface *surface);
+
+ void (* focus) (GdkSurface *surface,
+ guint32 timestamp);
+ void (* set_type_hint) (GdkSurface *surface,
+ GdkSurfaceTypeHint hint);
+ GdkSurfaceTypeHint (* get_type_hint) (GdkSurface *surface);
+ void (* set_modal_hint) (GdkSurface *surface,
+ gboolean modal);
+ void (* set_skip_taskbar_hint) (GdkSurface *surface,
+ gboolean skips_taskbar);
+ void (* set_skip_pager_hint) (GdkSurface *surface,
+ gboolean skips_pager);
+ void (* set_urgency_hint) (GdkSurface *surface,
+ gboolean urgent);
+ void (* set_geometry_hints) (GdkSurface *surface,
+ const GdkGeometry *geometry,
+ GdkSurfaceHints geom_mask);
+ void (* set_title) (GdkSurface *surface,
+ const gchar *title);
+ void (* set_role) (GdkSurface *surface,
+ const gchar *role);
+ void (* set_startup_id) (GdkSurface *surface,
+ const gchar *startup_id);
+ void (* set_transient_for) (GdkSurface *surface,
+ GdkSurface *parent);
+ void (* get_frame_extents) (GdkSurface *surface,
+ GdkRectangle *rect);
+ void (* set_accept_focus) (GdkSurface *surface,
+ gboolean accept_focus);
+ void (* set_focus_on_map) (GdkSurface *surface,
+ gboolean focus_on_map);
+ void (* set_icon_list) (GdkSurface *surface,
+ GList *pixbufs);
+ void (* set_icon_name) (GdkSurface *surface,
+ const gchar *name);
+ 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 *surface);
+ void (* unfullscreen) (GdkSurface *surface);
+ void (* set_keep_above) (GdkSurface *surface,
+ gboolean setting);
+ void (* set_keep_below) (GdkSurface *surface,
+ gboolean setting);
+ GdkSurface * (* get_group) (GdkSurface *surface);
+ void (* set_group) (GdkSurface *surface,
+ GdkSurface *leader);
+ void (* set_decorations) (GdkSurface *surface,
+ GdkWMDecoration decorations);
+ gboolean (* get_decorations) (GdkSurface *surface,
+ GdkWMDecoration *decorations);
+ void (* set_functions) (GdkSurface *surface,
+ GdkWMFunction functions);
+ 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 *surface,
+ GdkDevice *device,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp);
+ void (* enable_synchronized_configure) (GdkSurface *surface);
+ void (* configure_finished) (GdkSurface *surface);
+ void (* set_opacity) (GdkSurface *surface,
+ gdouble opacity);
+ 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 *surface,
+ cairo_region_t *region);
+
+ gint (* get_scale_factor) (GdkSurface *surface);
+ void (* get_unscaled_size) (GdkSurface *surface,
+ int *unscaled_width,
+ int *unscaled_height);
+
+ void (* set_opaque_region) (GdkSurface *surface,
+ cairo_region_t *region);
+ void (* set_shadow_width) (GdkSurface *surface,
+ gint left,
+ gint right,
+ gint top,
+ gint bottom);
+ gboolean (* show_window_menu) (GdkSurface *surface,
+ GdkEvent *event);
+ GdkGLContext *(*create_gl_context) (GdkSurface *surface,
+ gboolean attached,
+ GdkGLContext *share,
+ GError **error);
+ gboolean (* supports_edge_constraints)(GdkSurface *surface);
+};
+
+/* Interface Functions */
+GType gdk_surface_impl_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GDK_SURFACE_IMPL_H__ */
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 2622d05619..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
@@ -128,7 +128,7 @@ typedef struct _GdkDragContext GdkDragContext;
typedef struct _GdkClipboard GdkClipboard;
typedef struct _GdkDisplayManager GdkDisplayManager;
typedef struct _GdkDisplay GdkDisplay;
-typedef struct _GdkWindow GdkWindow;
+typedef struct _GdkSurface GdkSurface;
typedef struct _GdkKeymap GdkKeymap;
typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
typedef struct _GdkSeat GdkSeat;
@@ -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.
*
@@ -387,10 +387,10 @@ typedef enum
*
* Since GTK 3.8, motion events are already compressed by default, independent
* of this mechanism. This compression can be disabled with
- * gdk_window_set_event_compression(). See the documentation of that function
+ * 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.
*
@@ -461,27 +461,27 @@ typedef enum {
} GdkVulkanError;
/**
- * GdkWindowTypeHint:
- * @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window.
- * @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window.
- * @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses
+ * GdkSurfaceTypeHint:
+ * @GDK_SURFACE_TYPE_HINT_NORMAL: Normal toplevel window.
+ * @GDK_SURFACE_TYPE_HINT_DIALOG: Dialog window.
+ * @GDK_SURFACE_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses
* this hint only for torn-off menus, see #GtkTearoffMenuItem.
- * @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
- * @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash
+ * @GDK_SURFACE_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
+ * @GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: Window used to display a splash
* screen during application startup.
- * @GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached
+ * @GDK_SURFACE_TYPE_HINT_UTILITY: Utility windows which are not detached
* toolbars or dialogs.
- * @GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows.
- * @GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background
+ * @GDK_SURFACE_TYPE_HINT_DOCK: Used for creating dock or panel windows.
+ * @GDK_SURFACE_TYPE_HINT_DESKTOP: Used for creating the desktop background
* window.
- * @GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar.
- * @GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar,
+ * @GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar.
+ * @GDK_SURFACE_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar,
* e.g. a context menu.
- * @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip.
- * @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a “bubble”
+ * @GDK_SURFACE_TYPE_HINT_TOOLTIP: A tooltip.
+ * @GDK_SURFACE_TYPE_HINT_NOTIFICATION: A notification - typically a “bubble”
* that belongs to a status icon.
- * @GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box.
- * @GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor.
+ * @GDK_SURFACE_TYPE_HINT_COMBO: A popup from a combo box.
+ * @GDK_SURFACE_TYPE_HINT_DND: A window that is used to implement a DND cursor.
*
* These are hints for the window manager that indicate what type of function
* the window has. The window manager can use this when determining decoration
@@ -492,21 +492,21 @@ typedef enum {
*/
typedef enum
{
- GDK_WINDOW_TYPE_HINT_NORMAL,
- GDK_WINDOW_TYPE_HINT_DIALOG,
- GDK_WINDOW_TYPE_HINT_MENU, /* Torn off menu */
- GDK_WINDOW_TYPE_HINT_TOOLBAR,
- GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
- GDK_WINDOW_TYPE_HINT_UTILITY,
- GDK_WINDOW_TYPE_HINT_DOCK,
- GDK_WINDOW_TYPE_HINT_DESKTOP,
- GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */
- GDK_WINDOW_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */
- GDK_WINDOW_TYPE_HINT_TOOLTIP,
- GDK_WINDOW_TYPE_HINT_NOTIFICATION,
- GDK_WINDOW_TYPE_HINT_COMBO,
- GDK_WINDOW_TYPE_HINT_DND
-} GdkWindowTypeHint;
+ GDK_SURFACE_TYPE_HINT_NORMAL,
+ GDK_SURFACE_TYPE_HINT_DIALOG,
+ GDK_SURFACE_TYPE_HINT_MENU, /* Torn off menu */
+ GDK_SURFACE_TYPE_HINT_TOOLBAR,
+ GDK_SURFACE_TYPE_HINT_SPLASHSCREEN,
+ GDK_SURFACE_TYPE_HINT_UTILITY,
+ GDK_SURFACE_TYPE_HINT_DOCK,
+ GDK_SURFACE_TYPE_HINT_DESKTOP,
+ GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */
+ GDK_SURFACE_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */
+ GDK_SURFACE_TYPE_HINT_TOOLTIP,
+ GDK_SURFACE_TYPE_HINT_NOTIFICATION,
+ GDK_SURFACE_TYPE_HINT_COMBO,
+ GDK_SURFACE_TYPE_HINT_DND
+} GdkSurfaceTypeHint;
/**
* GdkAxisUse:
diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c
index 3cd70dd868..ba2c44b5c9 100644
--- a/gdk/gdkvulkancontext.c
+++ b/gdk/gdkvulkancontext.c
@@ -36,9 +36,9 @@
* #GdkVulkanContext is an object representing the platform-specific
* Vulkan draw context.
*
- * #GdkVulkanContexts are created for a #GdkWindow using
- * gdk_window_create_vulkan_context(), and the context will match the
- * the characteristics of the window.
+ * #GdkVulkanContexts are created for a #GdkSurface using
+ * gdk_surface_create_vulkan_context(), and the context will match the
+ * 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);
- GdkWindow *window = gdk_draw_context_get_window (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_window_get_width (window) * gdk_window_get_scale_factor (window) == priv->swapchain_width &&
- gdk_window_get_height (window) * gdk_window_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_window_get_width (window) * gdk_window_get_scale_factor (window);
- capabilities.currentExtent.height = gdk_window_get_height (window) * gdk_window_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_window_get_width (window),
- gdk_window_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)
{
@@ -705,8 +705,8 @@ 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_window_begin_draw_frame() and
- * gdk_window_end_draw_frame() calls for the toplevel window that the
+ * This function can only be used between gdk_surface_begin_draw_frame() and
+ * 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
@@ -729,8 +729,8 @@ gdk_vulkan_context_get_draw_index (GdkVulkanContext *context)
* Gets the Vulkan semaphore that protects access to the image that is
* currently being drawn.
*
- * This function can only be used between gdk_window_begin_draw_frame() and
- * gdk_window_end_draw_frame() calls for the toplevel window that the
+ * This function can only be used between gdk_surface_begin_draw_frame() and
+ * 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/gdkwindow.c b/gdk/gdkwindow.c
deleted file mode 100644
index 2be8f8d109..0000000000
--- a/gdk/gdkwindow.c
+++ /dev/null
@@ -1,6957 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball,
- * Josh MacDonald, Ryan Lortie
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include <cairo-gobject.h>
-
-#include "gdkwindow.h"
-
-#include "gdkrectangle.h"
-#include "gdkinternals.h"
-#include "gdkintl.h"
-#include "gdkdisplayprivate.h"
-#include "gdkdeviceprivate.h"
-#include "gdkmarshalers.h"
-#include "gdkframeclockidle.h"
-#include "gdkwindowimpl.h"
-#include "gdkglcontextprivate.h"
-#include "gdkdrawingcontextprivate.h"
-#include "gdk-private.h"
-
-#include <math.h>
-
-#include <epoxy/gl.h>
-
-/* for the use of round() */
-#include "fallback-c89.c"
-
-#ifdef GDK_WINDOWING_WAYLAND
-#include "wayland/gdkwayland.h"
-#endif
-
-#undef DEBUG_WINDOW_PRINTING
-
-
-/**
- * SECTION:windows
- * @Short_description: Onscreen display areas in the target window system
- * @Title: Windows
- *
- * A #GdkWindow 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
- * and so on; a #GtkWindow may contain many sub-GdkWindows.
- */
-
-/**
- * GdkWindow:
- *
- * The GdkWindow struct contains only private fields and
- * should not be accessed directly.
- */
-
-/* Historically a GdkWindow always matches a platform native window,
- * be it a toplevel window or a child window. In this setup the
- * GdkWindow (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.
- *
- * With the addition of client side windows this changes a bit. The
- * application-visible GdkWindow 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
- * that clipping, drawing, moving, events etc work as expected.
- *
- * GdkWindows have a pointer to the “impl window” they are in, i.e.
- * the topmost GdkWindow which have the same “impl” value. This is stored
- * in impl_window, which is different from the window itself only for client
- * side windows.
- * All GdkWindows (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).
- */
-
-enum {
- MOVED_TO_RECT,
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_CURSOR,
- PROP_DISPLAY,
- PROP_STATE,
- LAST_PROP
-};
-
-/* Global info */
-
-static void gdk_window_finalize (GObject *object);
-
-static void gdk_window_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gdk_window_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-
-static void gdk_window_clear_backing_region (GdkWindow *window);
-
-static void recompute_visible_regions (GdkWindow *private,
- gboolean recalculate_children);
-static void gdk_window_invalidate_in_parent (GdkWindow *private);
-static void update_cursor (GdkDisplay *display,
- GdkDevice *device);
-static void impl_window_add_update_area (GdkWindow *impl_window,
- cairo_region_t *region);
-static void gdk_window_invalidate_region_full (GdkWindow *window,
- const cairo_region_t *region,
- gboolean invalidate_children);
-static void gdk_window_invalidate_rect_full (GdkWindow *window,
- const GdkRectangle *rect,
- gboolean invalidate_children);
-static cairo_surface_t *gdk_window_ref_impl_surface (GdkWindow *window);
-
-static void gdk_window_set_frame_clock (GdkWindow *window,
- GdkFrameClock *clock);
-
-
-static guint signals[LAST_SIGNAL] = { 0 };
-static GParamSpec *properties[LAST_PROP] = { NULL, };
-
-G_DEFINE_ABSTRACT_TYPE (GdkWindow, gdk_window, G_TYPE_OBJECT)
-
-#ifdef DEBUG_WINDOW_PRINTING
-char *
-print_region (cairo_region_t *region)
-{
- GString *s = g_string_new ("{");
- if (cairo_region_is_empty (region))
- {
- g_string_append (s, "empty");
- }
- else
- {
- int num = cairo_region_num_rectangles (region);
- cairo_rectangle_int_t r;
-
- if (num == 1)
- {
- cairo_region_get_rectangle (region, 0, &r);
- g_string_append_printf (s, "%dx%d @%d,%d", r.width, r.height, r.x, r.y);
- }
- else
- {
- int i;
- cairo_region_get_extents (region, &r);
- g_string_append_printf (s, "extent: %dx%d @%d,%d, details: ", r.width, r.height, r.x, r.y);
- for (i = 0; i < num; i++)
- {
- cairo_region_get_rectangle (region, i, &r);
- g_string_append_printf (s, "[%dx%d @%d,%d]", r.width, r.height, r.x, r.y);
- if (i != num -1)
- g_string_append (s, ", ");
- }
- }
- }
- g_string_append (s, "}");
- return g_string_free (s, FALSE);
-}
-#endif
-
-static GList *
-list_insert_link_before (GList *list,
- GList *sibling,
- GList *link)
-{
- if (list == NULL || sibling == list)
- {
- link->prev = NULL;
- link->next = list;
- if (list)
- list->prev = link;
- return link;
- }
- else if (sibling == NULL)
- {
- GList *last = g_list_last (list);
-
- last->next = link;
- link->prev = last;
- link->next = NULL;
-
- return list;
- }
- else
- {
- link->next = sibling;
- link->prev = sibling->prev;
- sibling->prev = link;
-
- if (link->prev)
- link->prev->next = link;
-
- return list;
- }
-}
-
-static void
-gdk_window_init (GdkWindow *window)
-{
- /* 0-initialization is good for all other fields. */
-
- window->window_type = GDK_WINDOW_CHILD;
-
- window->state = GDK_WINDOW_STATE_WITHDRAWN;
- window->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
- window->width = 1;
- window->height = 1;
- window->toplevel_window_type = -1;
- window->children_list_node.data = window;
-
- window->device_cursor = g_hash_table_new_full (NULL, NULL,
- NULL, g_object_unref);
-}
-
-static void
-gdk_window_class_init (GdkWindowClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = gdk_window_finalize;
- object_class->set_property = gdk_window_set_property;
- object_class->get_property = gdk_window_get_property;
-
- /* Properties */
-
- /**
- * GdkWindow:cursor:
- *
- * The mouse pointer for a #GdkWindow. See gdk_window_set_cursor() and
- * gdk_window_get_cursor() for details.
- */
- properties[PROP_CURSOR] =
- g_param_spec_object ("cursor",
- P_("Cursor"),
- P_("Cursor"),
- GDK_TYPE_CURSOR,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * GdkWindow:display:
- *
- * The #GdkDisplay connection of the window. See gdk_window_get_display()
- * for details.
- */
- properties[PROP_DISPLAY] =
- g_param_spec_object ("display",
- P_("Display"),
- P_("Display"),
- GDK_TYPE_DISPLAY,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-
- properties[PROP_STATE] =
- g_param_spec_flags ("state",
- P_("State"),
- P_("State"),
- GDK_TYPE_WINDOW_STATE, GDK_WINDOW_STATE_WITHDRAWN,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-
- g_object_class_install_properties (object_class, LAST_PROP, properties);
-
- /**
- * GdkWindow::moved-to-rect:
- * @window: the #GdkWindow that moved
- * @flipped_rect: (nullable): the position of @window 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
- * 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
- * destination rectangle.
- *
- * @window 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
- * 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.
- * Stability: Private
- */
- signals[MOVED_TO_RECT] =
- g_signal_new (g_intern_static_string ("moved-to-rect"),
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- 0,
- NULL,
- NULL,
- _gdk_marshal_VOID__POINTER_POINTER_BOOLEAN_BOOLEAN,
- G_TYPE_NONE,
- 4,
- G_TYPE_POINTER,
- G_TYPE_POINTER,
- G_TYPE_BOOLEAN,
- G_TYPE_BOOLEAN);
-}
-
-static void
-seat_removed_cb (GdkDisplay *display,
- GdkSeat *seat,
- GdkWindow *window)
-{
- 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);
-
- if (window->device_events)
- g_hash_table_remove (window->device_events, device);
-}
-
-static void
-gdk_window_finalize (GObject *object)
-{
- GdkWindow *window = GDK_WINDOW (object);
-
- g_signal_handlers_disconnect_by_func (gdk_window_get_display (window),
- seat_removed_cb, window);
-
- if (!GDK_WINDOW_DESTROYED (window))
- {
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
- {
- g_warning ("losing last reference to undestroyed window");
- _gdk_window_destroy (window, FALSE);
- }
- else
- /* We use TRUE here, to keep us from actually calling
- * XDestroyWindow() on the window
- */
- _gdk_window_destroy (window, TRUE);
- }
-
- if (window->impl)
- {
- g_object_unref (window->impl);
- window->impl = NULL;
- }
-
- if (window->impl_window != window)
- {
- g_object_unref (window->impl_window);
- window->impl_window = NULL;
- }
-
- if (window->shape)
- cairo_region_destroy (window->shape);
-
- if (window->input_shape)
- cairo_region_destroy (window->input_shape);
-
- if (window->cursor)
- g_object_unref (window->cursor);
-
- if (window->device_cursor)
- g_hash_table_destroy (window->device_cursor);
-
- if (window->device_events)
- g_hash_table_destroy (window->device_events);
-
- if (window->devices_inside)
- g_list_free (window->devices_inside);
-
- g_clear_object (&window->display);
-
- if (window->opaque_region)
- cairo_region_destroy (window->opaque_region);
-
- G_OBJECT_CLASS (gdk_window_parent_class)->finalize (object);
-}
-
-static void
-gdk_window_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GdkWindow *window = GDK_WINDOW (object);
-
- switch (prop_id)
- {
- case PROP_CURSOR:
- gdk_window_set_cursor (window, g_value_get_object (value));
- break;
-
- case PROP_DISPLAY:
- window->display = g_value_dup_object (value);
- g_assert (window->display != NULL);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gdk_window_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GdkWindow *window = GDK_WINDOW (object);
-
- switch (prop_id)
- {
- case PROP_CURSOR:
- g_value_set_object (value, gdk_window_get_cursor (window));
- break;
-
- case PROP_DISPLAY:
- g_value_set_object (value, window->display);
- break;
-
- case PROP_STATE:
- g_value_set_flags (value, window->state);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static gboolean
-gdk_window_is_subsurface (GdkWindow *window)
-{
- return window->window_type == GDK_WINDOW_SUBSURFACE;
-}
-
-static GdkWindow *
-gdk_window_get_impl_window (GdkWindow *window)
-{
- return window->impl_window;
-}
-
-GdkWindow *
-_gdk_window_get_impl_window (GdkWindow *window)
-{
- return gdk_window_get_impl_window (window);
-}
-
-static gboolean
-gdk_window_has_impl (GdkWindow *window)
-{
- return window->impl_window == window;
-}
-
-static gboolean
-gdk_window_is_toplevel (GdkWindow *window)
-{
- return
- window->parent == NULL ||
- window->parent->window_type == GDK_WINDOW_ROOT;
-}
-
-gboolean
-_gdk_window_has_impl (GdkWindow *window)
-{
- return gdk_window_has_impl (window);
-}
-
-static gboolean
-gdk_window_has_no_impl (GdkWindow *window)
-{
- return window->impl_window != window;
-}
-
-static void
-remove_sibling_overlapped_area (GdkWindow *window,
- cairo_region_t *region)
-{
- GdkWindow *parent;
- GdkWindow *sibling;
- cairo_region_t *child_region;
- GdkRectangle r;
- GList *l;
-
- parent = window->parent;
-
- if (gdk_window_is_toplevel (window))
- return;
-
- /* Convert from from window coords to parent coords */
- cairo_region_translate (region, window->x, window->y);
-
- for (l = parent->children; l; l = l->next)
- {
- sibling = l->data;
-
- if (sibling == window)
- break;
-
- if (!GDK_WINDOW_IS_MAPPED (sibling) || sibling->input_only)
- continue;
-
- r.x = sibling->x;
- r.y = sibling->y;
- r.width = sibling->width;
- r.height = sibling->height;
-
- child_region = cairo_region_create_rectangle (&r);
-
- if (sibling->shape)
- {
- /* Adjust shape region to parent window 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);
- }
-
- cairo_region_subtract (region, child_region);
- cairo_region_destroy (child_region);
- }
-
- remove_sibling_overlapped_area (parent, region);
-
- /* Convert back to window coords */
- cairo_region_translate (region, -window->x, -window->y);
-}
-
-static void
-remove_child_area (GdkWindow *window,
- gboolean for_input,
- cairo_region_t *region)
-{
- GdkWindow *child;
- cairo_region_t *child_region;
- GdkRectangle r;
- GList *l;
-
- for (l = window->children; l; l = l->next)
- {
- child = l->data;
-
- /* If region is empty already, no need to do
- anything potentially costly */
- if (cairo_region_is_empty (region))
- break;
-
- if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only)
- continue;
-
- r.x = child->x;
- r.y = child->y;
- r.width = child->width;
- r.height = child->height;
-
- /* Bail early if child totally outside region */
- if (cairo_region_contains_rectangle (region, &r) == CAIRO_REGION_OVERLAP_OUT)
- continue;
-
- child_region = cairo_region_create_rectangle (&r);
-
- if (child->shape)
- {
- /* Adjust shape region to parent window 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);
- }
-
- if (for_input)
- {
- if (child->input_shape)
- cairo_region_intersect (child_region, child->input_shape);
- }
-
- cairo_region_subtract (region, child_region);
- cairo_region_destroy (child_region);
- }
-}
-
-static gboolean
-should_apply_clip_as_shape (GdkWindow *window)
-{
- return
- gdk_window_has_impl (window) &&
- /* Not for non-shaped toplevels */
- (window->shape != NULL || window->applied_shape) &&
- /* or for foreign windows */
- window->window_type != GDK_WINDOW_FOREIGN &&
- /* or for the root window */
- window->window_type != GDK_WINDOW_ROOT;
-}
-
-static void
-apply_shape (GdkWindow *window,
- cairo_region_t *region)
-{
- GdkWindowImplClass *impl_class;
-
- /* 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_WINDOW_IMPL_GET_CLASS (window->impl);
- if (region)
- impl_class->shape_combine_region (window,
- region, 0, 0);
- else if (window->applied_shape)
- impl_class->shape_combine_region (window,
- NULL, 0, 0);
-
- window->applied_shape = region != NULL;
-}
-
-static gboolean
-region_rect_equal (const cairo_region_t *region,
- const GdkRectangle *rect)
-{
- GdkRectangle extents;
-
- if (cairo_region_num_rectangles (region) != 1)
- return FALSE;
-
- cairo_region_get_extents (region, &extents);
-
- return extents.x == rect->x &&
- extents.y == rect->y &&
- extents.width == rect->width &&
- extents.height == rect->height;
-}
-
-static void
-apply_clip_as_shape (GdkWindow *window)
-{
- GdkRectangle r;
- cairo_region_t *region;
-
- r.x = r.y = 0;
- r.width = window->width;
- r.height = window->height;
-
- region = cairo_region_copy (window->clip_region);
- remove_sibling_overlapped_area (window, 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 */
- if (!region_rect_equal (region, &r))
- apply_shape (window, region);
- else
- apply_shape (window, NULL);
-
- cairo_region_destroy (region);
-}
-
-static void
-recompute_visible_regions_internal (GdkWindow *private,
- gboolean recalculate_clip,
- gboolean recalculate_children)
-{
- GdkRectangle r;
- GList *l;
- GdkWindow *child;
- cairo_region_t *new_clip;
- gboolean clip_region_changed;
- gboolean abs_pos_changed;
- int old_abs_x, old_abs_y;
-
- old_abs_x = private->abs_x;
- old_abs_y = private->abs_y;
-
- /* Update absolute position */
- if ((gdk_window_has_impl (private) &&
- private->window_type != GDK_WINDOW_SUBSURFACE) ||
- (gdk_window_is_toplevel (private) &&
- private->window_type == GDK_WINDOW_SUBSURFACE))
- {
- /* Native windows and toplevel subsurfaces start here */
- private->abs_x = 0;
- private->abs_y = 0;
- }
- else
- {
- private->abs_x = private->parent->abs_x + private->x;
- private->abs_y = private->parent->abs_y + private->y;
- }
-
- abs_pos_changed =
- private->abs_x != old_abs_x ||
- private->abs_y != old_abs_y;
-
- /* Update clip region based on:
- * parent clip
- * window size/position
- */
- clip_region_changed = FALSE;
- if (recalculate_clip)
- {
- if (private->viewable)
- {
- /* Calculate visible region (sans children) in parent window coords */
- r.x = private->x;
- r.y = private->y;
- r.width = private->width;
- r.height = private->height;
- new_clip = cairo_region_create_rectangle (&r);
-
- if (!gdk_window_is_toplevel (private))
- cairo_region_intersect (new_clip, private->parent->clip_region);
-
- /* Convert from parent coords to window coords */
- cairo_region_translate (new_clip, -private->x, -private->y);
-
- if (should_apply_clip_as_shape (private) && private->shape)
- cairo_region_intersect (new_clip, private->shape);
- }
- else
- new_clip = cairo_region_create ();
-
- if (private->clip_region == NULL ||
- !cairo_region_equal (private->clip_region, new_clip))
- clip_region_changed = TRUE;
-
- if (private->clip_region)
- cairo_region_destroy (private->clip_region);
- private->clip_region = new_clip;
- }
-
- /* Update all children, recursively (except for root, where children are not exact). */
- if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
- private->window_type != GDK_WINDOW_ROOT)
- {
- for (l = private->children; l; l = l->next)
- {
- child = l->data;
- /* Only recalculate clip if the the clip region changed, otherwise
- * there is no way the child clip region could change (its has not e.g. moved)
- * Except if recalculate_children is set to force child updates
- */
- recompute_visible_regions_internal (child,
- recalculate_clip && (clip_region_changed || recalculate_children),
- FALSE);
- }
- }
-}
-
-/* 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
- * 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
- * for recalculate_siblings. (Mostly used internally for the recursion)
- *
- * If a child window was removed (and you can’t use that child for
- * recompute_visible_regions), pass in TRUE for recalculate_children on the parent
- */
-static void
-recompute_visible_regions (GdkWindow *private,
- gboolean recalculate_children)
-{
- GdkWindow *toplevel;
-
- toplevel = gdk_window_get_toplevel (private);
- toplevel->geometry_dirty = TRUE;
-
- recompute_visible_regions_internal (private,
- TRUE,
- recalculate_children);
-}
-
-static void
-gdk_window_clear_old_updated_area (GdkWindow *window)
-{
- int i;
-
- for (i = 0; i < 2; i++)
- {
- if (window->old_updated_area[i])
- {
- cairo_region_destroy (window->old_updated_area[i]);
- window->old_updated_area[i] = NULL;
- }
- }
-}
-
-static void
-gdk_window_append_old_updated_area (GdkWindow *window,
- 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);
-}
-
-void
-_gdk_window_update_size (GdkWindow *window)
-{
- gdk_window_clear_old_updated_area (window);
- recompute_visible_regions (window, FALSE);
-}
-
-static GdkEventMask
-get_native_device_event_mask (GdkWindow *private,
- GdkDevice *device)
-{
- GdkEventMask event_mask;
-
- if (device)
- event_mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device));
- else
- event_mask = private->event_mask;
-
- if (private->window_type == GDK_WINDOW_ROOT ||
- private->window_type == GDK_WINDOW_FOREIGN)
- return event_mask;
- else
- {
- GdkEventMask mask;
-
- mask = private->event_mask;
-
- /* We need thse for all native windows so we can
- emulate events on children: */
- mask |=
- GDK_EXPOSURE_MASK |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_TOUCH_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_SCROLL_MASK;
-
- return mask;
- }
-}
-
-static GdkEventMask
-get_native_event_mask (GdkWindow *private)
-{
- return get_native_device_event_mask (private, NULL);
-}
-
-GdkWindow*
-gdk_window_new (GdkDisplay *display,
- GdkWindow *parent,
- GdkWindowAttr *attributes)
-{
- GdkWindow *window;
- gboolean native;
- GdkEventMask event_mask;
-
- g_return_val_if_fail (attributes != NULL, NULL);
-
- if (parent != NULL && GDK_WINDOW_DESTROYED (parent))
- {
- g_warning ("gdk_window_new(): parent is destroyed");
- return NULL;
- }
-
- window = _gdk_display_create_window (display);
-
- window->parent = parent;
-
- window->accept_focus = TRUE;
- window->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;
-
- if (attributes->wclass == GDK_INPUT_ONLY)
- {
- /* Backwards compatiblity - we've always ignored
- * attributes->window_type for input-only windows
- * before
- */
- if (parent == NULL)
- window->window_type = GDK_WINDOW_TEMP;
- else
- window->window_type = GDK_WINDOW_CHILD;
- }
- else
- window->window_type = attributes->window_type;
-
- /* Sanity checks */
- switch (window->window_type)
- {
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
- if (parent != NULL && GDK_WINDOW_TYPE (parent) != GDK_WINDOW_ROOT)
- g_warning (G_STRLOC "Toplevel windows must be created as children of\n"
- "a window of type GDK_WINDOW_ROOT");
- break;
- case GDK_WINDOW_SUBSURFACE:
-#ifdef GDK_WINDOWING_WAYLAND
- if (!GDK_IS_WAYLAND_DISPLAY (display))
- {
- g_warning (G_STRLOC "Subsurface windows can only be used on Wayland");
- return NULL;
- }
-#endif
- break;
- case GDK_WINDOW_CHILD:
- if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT ||
- GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
- {
- g_warning (G_STRLOC "Child windows must not be created as children of\n"
- "a window of type GDK_WINDOW_ROOT or GDK_WINDOW_FOREIGN");
- return NULL;
- }
- break;
- default:
- g_warning (G_STRLOC "cannot make windows of type %d", window->window_type);
- return NULL;
- }
-
- window->event_mask = GDK_ALL_EVENTS_MASK;
-
- if (attributes->wclass == GDK_INPUT_OUTPUT)
- {
- window->input_only = FALSE;
- }
- else
- {
- window->input_only = TRUE;
- }
-
- native = FALSE;
-
- if (window->parent != NULL)
- window->parent->children = g_list_concat (&window->children_list_node, window->parent->children);
- else
- {
- GdkFrameClock *frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
- gdk_window_set_frame_clock (window, frame_clock);
- g_object_unref (frame_clock);
-
- native = TRUE; /* Always use native windows for toplevels */
- }
-
-#ifdef GDK_WINDOWING_WAYLAND
- if (window->window_type == GDK_WINDOW_SUBSURFACE)
- native = TRUE; /* Always use native windows for subsurfaces as well */
-#endif
-
- if (native)
- {
- event_mask = get_native_event_mask (window);
-
- /* Create the impl */
- _gdk_display_create_window_impl (display, window, parent, event_mask, attributes);
- window->impl_window = window;
- }
- else
- {
- window->impl_window = g_object_ref (window->parent->impl_window);
- window->impl = g_object_ref (window->impl_window->impl);
- }
-
- recompute_visible_regions (window, FALSE);
-
- g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), window);
-
- return window;
-}
-
-/**
- * gdk_window_new_toplevel: (constructor)
- * @display: the display to create the window on
- * @width: width of new window
- * @height: height of new window
- *
- * Creates a new toplevel window. The window will be managed by the window
- * manager.
- *
- * Returns: (transfer full): the new #GdkWindow
- **/
-GdkWindow *
-gdk_window_new_toplevel (GdkDisplay *display,
- gint width,
- gint height)
-{
- GdkWindowAttr attr;
-
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- attr.wclass = GDK_INPUT_OUTPUT;
- attr.x = 0;
- attr.y = 0;
- attr.width = width;
- attr.height = height;
- attr.window_type = GDK_WINDOW_TOPLEVEL;
-
- return gdk_window_new (display, NULL, &attr);
-}
-
-/**
- * gdk_window_new_popup: (constructor)
- * @display: the display to create the window on
- * @position: position of the window on screen
- *
- * Creates a new toplevel popup window. The window will bypass window
- * management.
- *
- * Returns: (transfer full): the new #GdkWindow
- **/
-GdkWindow *
-gdk_window_new_popup (GdkDisplay *display,
- const GdkRectangle *position)
-{
- GdkWindowAttr attr;
-
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- g_return_val_if_fail (position != NULL, NULL);
-
- attr.wclass = GDK_INPUT_OUTPUT;
- attr.x = position->x;
- attr.y = position->y;
- attr.width = position->width;
- attr.height = position->height;
- attr.window_type = GDK_WINDOW_TEMP;
-
- return gdk_window_new (display, NULL, &attr);
-}
-
-/**
- * gdk_window_new_temp: (constructor)
- * @display: the display to create the window on
- *
- * Creates a new toplevel temporary window. The window will be
- * situated off-screen and not handle output.
- *
- * You most likely do not want to use this function.
- *
- * Returns: (transfer full): the new #GdkWindow
- **/
-GdkWindow *
-gdk_window_new_temp (GdkDisplay *display)
-{
- GdkWindowAttr attr;
-
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- attr.wclass = GDK_INPUT_ONLY;
- attr.x = -100;
- attr.y = -100;
- attr.width = 10;
- attr.height = 10;
- attr.window_type = GDK_WINDOW_TEMP;
-
- return gdk_window_new (display, NULL, &attr);
-}
-
-/**
- * gdk_window_new_child: (constructor)
- * @parent: the parent window
- * @position: placement of the window inside @parent
- *
- * Creates a new client-side child window.
- *
- * Returns: (transfer full): the new #GdkWindow
- **/
-GdkWindow *
-gdk_window_new_child (GdkWindow *parent,
- const GdkRectangle *position)
-{
- GdkWindowAttr attr;
-
- g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
-
- attr.wclass = GDK_INPUT_OUTPUT;
- attr.x = position->x;
- attr.y = position->y;
- attr.width = position->width;
- attr.height = position->height;
- attr.window_type = GDK_WINDOW_CHILD;
-
- return gdk_window_new (gdk_window_get_display (parent), parent, &attr);
-}
-
-static void
-update_pointer_info_foreach (GdkDisplay *display,
- GdkDevice *device,
- GdkPointerWindowInfo *pointer_info,
- gpointer user_data)
-{
- GdkWindow *window = user_data;
-
- if (pointer_info->window_under_pointer == window)
- {
- g_object_unref (pointer_info->window_under_pointer);
- pointer_info->window_under_pointer = NULL;
- }
-}
-
-static void
-window_remove_from_pointer_info (GdkWindow *window,
- GdkDisplay *display)
-{
- _gdk_display_pointer_info_foreach (display,
- update_pointer_info_foreach,
- window);
-}
-
-static void
-gdk_window_free_current_paint (GdkWindow *window)
-{
- cairo_surface_destroy (window->current_paint.surface);
- window->current_paint.surface = NULL;
-
- cairo_region_destroy (window->current_paint.region);
- window->current_paint.region = NULL;
-
- window->current_paint.surface_needs_composite = FALSE;
-}
-
-/**
- * _gdk_window_destroy_hierarchy:
- * @window: a #GdkWindow
- * @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
- * 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
- * windowing system calls should be made. (This may never happen
- * for some windowing systems.)
- *
- * Internal function to destroy a window. Like gdk_window_destroy(),
- * but does not drop the reference count created by gdk_window_new().
- **/
-static void
-_gdk_window_destroy_hierarchy (GdkWindow *window,
- gboolean recursing,
- gboolean recursing_native,
- gboolean foreign_destroy)
-{
- GdkWindowImplClass *impl_class;
- GdkWindow *temp_window;
- GdkDisplay *display;
- GList *tmp;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- display = gdk_window_get_display (window);
-
- switch (window->window_type)
- {
- default:
- g_assert_not_reached ();
- break;
-
- case GDK_WINDOW_ROOT:
- if (!gdk_display_is_closed (display))
- {
- g_error ("attempted to destroy root window");
- break;
- }
- /* else fall thru */
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_CHILD:
- case GDK_WINDOW_TEMP:
- case GDK_WINDOW_FOREIGN:
- case GDK_WINDOW_SUBSURFACE:
- if (window->window_type == GDK_WINDOW_FOREIGN && !foreign_destroy)
- {
- }
- else
- {
- if (window->parent)
- {
- if (window->parent->children)
- window->parent->children = g_list_remove_link (window->parent->children, &window->children_list_node);
-
- if (!recursing &&
- GDK_WINDOW_IS_MAPPED (window))
- {
- recompute_visible_regions (window, FALSE);
- gdk_window_invalidate_in_parent (window);
- }
- }
-
- if (window->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;
- }
-
- if (window->frame_clock)
- {
- g_object_run_dispose (G_OBJECT (window->frame_clock));
- gdk_window_set_frame_clock (window, NULL);
- }
-
- gdk_window_free_current_paint (window);
-
- if (window->window_type == GDK_WINDOW_FOREIGN)
- g_assert (window->children == NULL);
- else
- {
- tmp = window->children;
- window->children = NULL;
- /* No need to free children list, its all made up of in-struct nodes */
-
- while (tmp)
- {
- temp_window = tmp->data;
- tmp = tmp->next;
-
- if (temp_window)
- _gdk_window_destroy_hierarchy (temp_window,
- TRUE,
- recursing_native || gdk_window_has_impl (window),
- foreign_destroy);
- }
- }
-
- _gdk_window_clear_update_area (window);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (gdk_window_has_impl (window))
- impl_class->destroy (window, recursing_native, foreign_destroy);
- else
- {
- /* hide to make sure we repaint and break grabs */
- gdk_window_hide (window);
- }
-
- window->state |= GDK_WINDOW_STATE_WITHDRAWN;
- window->parent = NULL;
- window->destroyed = TRUE;
-
- window_remove_from_pointer_info (window, display);
-
- if (window->clip_region)
- {
- cairo_region_destroy (window->clip_region);
- window->clip_region = NULL;
- }
-
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
- }
- break;
- }
-}
-
-/**
- * _gdk_window_destroy:
- * @window: a #GdkWindow
- * @foreign_destroy: If %TRUE, the window or a parent was destroyed by some
- * external agency. The window 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_window_destroy(),
- * but does not drop the reference count created by gdk_window_new().
- **/
-void
-_gdk_window_destroy (GdkWindow *window,
- gboolean foreign_destroy)
-{
- _gdk_window_destroy_hierarchy (window, FALSE, FALSE, foreign_destroy);
-}
-
-/**
- * gdk_window_destroy:
- * @window: a #GdkWindow
- *
- * 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
- * destroyed, but the children’s reference counts are not decremented.
- *
- * Note that a window will not be destroyed automatically when its reference count
- * reaches zero. You must call this function yourself before that happens.
- *
- **/
-void
-gdk_window_destroy (GdkWindow *window)
-{
- _gdk_window_destroy_hierarchy (window, FALSE, FALSE, FALSE);
- g_object_unref (window);
-}
-
-/**
- * gdk_window_set_user_data:
- * @window: a #GdkWindow
- * @user_data: (allow-none) (type GObject.Object): user data
- *
- * For most purposes this function is deprecated in favor of
- * g_object_set_data(). However, for historical reasons GTK+ stores
- * the #GtkWidget that owns a #GdkWindow as user data on the
- * #GdkWindow. So, custom widget implementations should use
- * this function for that. If GTK+ receives an event for a #GdkWindow,
- * and the user data for the window is non-%NULL, GTK+ will assume the
- * user data is a #GtkWidget, and forward the event to that widget.
- *
- **/
-void
-gdk_window_set_user_data (GdkWindow *window,
- gpointer user_data)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- window->user_data = user_data;
-}
-
-/**
- * gdk_window_get_user_data:
- * @window: a #GdkWindow
- * @data: (out): return location for user data
- *
- * Retrieves the user data for @window, which is normally the widget
- * that @window belongs to. See gdk_window_set_user_data().
- *
- **/
-void
-gdk_window_get_user_data (GdkWindow *window,
- gpointer *data)
-{
- *data = window->user_data;
-}
-
-/**
- * gdk_window_get_window_type:
- * @window: a #GdkWindow
- *
- * Gets the type of the window. See #GdkWindowType.
- *
- * Returns: type of window
- **/
-GdkWindowType
-gdk_window_get_window_type (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), (GdkWindowType) -1);
-
- return GDK_WINDOW_TYPE (window);
-}
-
-/**
- * gdk_window_get_display:
- * @window: a #GdkWindow
- *
- * Gets the #GdkDisplay associated with a #GdkWindow.
- *
- * Returns: (transfer none): the #GdkDisplay associated with @window
- **/
-GdkDisplay *
-gdk_window_get_display (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- return window->display;
-}
-/**
- * gdk_window_is_destroyed:
- * @window: a #GdkWindow
- *
- * Check to see if a window is destroyed..
- *
- * Returns: %TRUE if the window is destroyed
- **/
-gboolean
-gdk_window_is_destroyed (GdkWindow *window)
-{
- return GDK_WINDOW_DESTROYED (window);
-}
-
-/**
- * gdk_window_has_native:
- * @window: a #GdkWindow
- *
- * Checks whether the window has a native window or not.
- *
- * Returns: %TRUE if the @window has a native window, %FALSE otherwise.
- */
-gboolean
-gdk_window_has_native (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->parent == NULL || window->parent->impl != window->impl;
-}
-
-/**
- * gdk_window_get_position:
- * @window: a #GdkWindow
- * @x: (out) (allow-none): X coordinate of window
- * @y: (out) (allow-none): Y coordinate of window
- *
- * Obtains the position of the window as reported in the
- * most-recently-processed #GdkEventConfigure. Contrast with
- * gdk_window_get_geometry() which queries the X server for the
- * current window position, regardless of which events have been
- * received or processed.
- *
- * The position coordinates are relative to the window’s parent window.
- *
- **/
-void
-gdk_window_get_position (GdkWindow *window,
- gint *x,
- gint *y)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (x)
- *x = window->x;
- if (y)
- *y = window->y;
-}
-
-/**
- * gdk_window_get_parent:
- * @window: a #GdkWindow
- *
- * Obtains the parent of @window, as known to GDK. Does not query the
- * X server; thus this returns the parent as passed to gdk_window_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
- **/
-GdkWindow*
-gdk_window_get_parent (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- if (gdk_window_is_subsurface (window))
- return window->transient_for;
- else
- return window->parent;
-}
-
-/**
- * gdk_window_get_toplevel:
- * @window: a #GdkWindow
- *
- * Gets the toplevel window that’s an ancestor of @window.
- *
- * Any window type but %GDK_WINDOW_CHILD is considered a
- * toplevel window, as is a %GDK_WINDOW_CHILD window that
- * has a root window as parent.
- *
- * Returns: (transfer none): the toplevel window containing @window
- **/
-GdkWindow *
-gdk_window_get_toplevel (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- while (window->window_type == GDK_WINDOW_CHILD ||
- window->window_type == GDK_WINDOW_SUBSURFACE)
- {
- if (gdk_window_is_toplevel (window))
- break;
- window = window->parent;
- }
-
- return window;
-}
-
-/**
- * gdk_window_get_children:
- * @window: a #GdkWindow
- *
- * Gets the list of children of @window 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.
- *
- * The returned list must be freed, but the elements in the
- * list need not be.
- *
- * Returns: (transfer container) (element-type GdkWindow):
- * list of child windows inside @window
- **/
-GList*
-gdk_window_get_children (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- if (GDK_WINDOW_DESTROYED (window))
- return NULL;
-
- return g_list_copy (window->children);
-}
-
-/**
- * gdk_window_peek_children:
- * @window: a #GdkWindow
- *
- * Like gdk_window_get_children(), but does not copy the list of
- * children, so the list does not need to be freed.
- *
- * Returns: (transfer none) (element-type GdkWindow):
- * a reference to the list of child windows in @window
- **/
-GList *
-gdk_window_peek_children (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- if (GDK_WINDOW_DESTROYED (window))
- return NULL;
-
- return window->children;
-}
-
-
-/**
- * gdk_window_get_children_with_user_data:
- * @window: a #GdkWindow
- * @user_data: user data to look for
- *
- * Gets the list of children of @window 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.
- *
- * Returns: (transfer container) (element-type GdkWindow):
- * list of child windows inside @window
- **/
-GList *
-gdk_window_get_children_with_user_data (GdkWindow *window,
- gpointer user_data)
-{
- GdkWindow *child;
- GList *res, *l;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- if (GDK_WINDOW_DESTROYED (window))
- return NULL;
-
- res = NULL;
- for (l = window->children; l != NULL; l = l->next)
- {
- child = l->data;
-
- if (child->user_data == user_data)
- res = g_list_prepend (res, child);
- }
-
- return res;
-}
-
-
-/**
- * gdk_window_is_visible:
- * @window: a #GdkWindow
- *
- * Checks whether the window has been mapped (with gdk_window_show() or
- * gdk_window_show_unraised()).
- *
- * Returns: %TRUE if the window is mapped
- **/
-gboolean
-gdk_window_is_visible (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return GDK_WINDOW_IS_MAPPED (window);
-}
-
-/**
- * gdk_window_is_viewable:
- * @window: a #GdkWindow
- *
- * Check if the window and all ancestors of the window are
- * mapped. (This is not necessarily "viewable" in the X sense, since
- * we only check as far as we have GDK window parents, not to the root
- * window.)
- *
- * Returns: %TRUE if the window is viewable
- **/
-gboolean
-gdk_window_is_viewable (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- if (window->destroyed)
- return FALSE;
-
- return window->viewable;
-}
-
-/**
- * gdk_window_get_state:
- * @window: a #GdkWindow
- *
- * Gets the bitwise OR of the currently active window state flags,
- * from the #GdkWindowState enumeration.
- *
- * Returns: window state bitfield
- **/
-GdkWindowState
-gdk_window_get_state (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->state;
-}
-
-static cairo_content_t
-gdk_window_get_content (GdkWindow *window)
-{
- cairo_surface_t *surface;
- cairo_content_t content;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
- surface = gdk_window_ref_impl_surface (window);
- content = cairo_surface_get_content (surface);
- cairo_surface_destroy (surface);
-
- return content;
-}
-
-static cairo_surface_t *
-gdk_window_ref_impl_surface (GdkWindow *window)
-{
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window));
-}
-
-GdkGLContext *
-gdk_window_get_paint_gl_context (GdkWindow *window,
- GError **error)
-{
- GError *internal_error = NULL;
-
- if (GDK_DISPLAY_DEBUG_CHECK (window->display, GL_DISABLE))
- {
- g_set_error_literal (error, GDK_GL_ERROR,
- GDK_GL_ERROR_NOT_AVAILABLE,
- _("GL support disabled via GDK_DEBUG"));
- return NULL;
- }
-
- if (window->impl_window->gl_paint_context == NULL)
- {
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->create_gl_context == NULL)
- {
- g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
- _("The current backend does not support OpenGL"));
- return NULL;
- }
-
- window->impl_window->gl_paint_context =
- impl_class->create_gl_context (window->impl_window,
- TRUE,
- NULL,
- &internal_error);
- }
-
- if (internal_error != NULL)
- {
- g_propagate_error (error, internal_error);
- g_clear_object (&(window->impl_window->gl_paint_context));
- return NULL;
- }
-
- gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_error);
- if (internal_error != NULL)
- {
- g_propagate_error (error, internal_error);
- g_clear_object (&(window->impl_window->gl_paint_context));
- return NULL;
- }
-
- return window->impl_window->gl_paint_context;
-}
-
-/**
- * gdk_window_create_gl_context:
- * @window: a #GdkWindow
- * @error: return location for an error
- *
- * Creates a new #GdkGLContext matching the
- * framebuffer format to the visual of the #GdkWindow. The context
- * is disconnected from any particular window or surface.
- *
- * If the creation of the #GdkGLContext failed, @error will be set.
- *
- * Before using the returned #GdkGLContext, you will need to
- * call gdk_gl_context_make_current() or gdk_gl_context_realize().
- *
- * Returns: (transfer full): the newly created #GdkGLContext, or
- * %NULL on error
- **/
-GdkGLContext *
-gdk_window_create_gl_context (GdkWindow *window,
- GError **error)
-{
- GdkGLContext *paint_context;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- paint_context = gdk_window_get_paint_gl_context (window, error);
- if (paint_context == NULL)
- return NULL;
-
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
- FALSE,
- paint_context,
- error);
-}
-
-/**
- * gdk_window_create_vulkan_context:
- * @window: a #GdkWindow
- * @error: return location for an error
- *
- * Creates a new #GdkVulkanContext for rendering on @window.
- *
- * If the creation of the #GdkVulkanContext failed, @error will be set.
- *
- * Returns: (transfer full): the newly created #GdkVulkanContext, or
- * %NULL on error
- **/
-GdkVulkanContext *
-gdk_window_create_vulkan_context (GdkWindow *window,
- GError **error)
-{
- GdkDisplay *display;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- if (GDK_DISPLAY_DEBUG_CHECK (window->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_window_get_display (window);
-
- if (GDK_DISPLAY_GET_CLASS (display)->vk_extension_name == NULL)
- {
- g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
- "The %s backend has no Vulkan support.", G_OBJECT_TYPE_NAME (display));
- return FALSE;
- }
-
- return g_initable_new (GDK_DISPLAY_GET_CLASS (display)->vk_context_type,
- NULL,
- error,
- "window", window,
- NULL);
-}
-
-static void
-gdk_window_begin_paint_internal (GdkWindow *window,
- const cairo_region_t *region)
-{
- GdkRectangle clip_box;
- GdkWindowImplClass *impl_class;
- double sx, sy;
- gboolean needs_surface;
- cairo_content_t surface_content;
-
- if (window->current_paint.surface != NULL)
- {
- g_warning ("A paint operation on the window is alredy in progress. "
- "This is not allowed.");
- return;
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- needs_surface = TRUE;
- if (impl_class->begin_paint)
- needs_surface = impl_class->begin_paint (window);
-
- 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_content = gdk_window_get_content (window);
-
- if (needs_surface)
- {
- window->current_paint.surface = gdk_window_create_similar_surface (window,
- 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);
-
- window->current_paint.surface_needs_composite = TRUE;
- }
- else
- {
- window->current_paint.surface = gdk_window_ref_impl_surface (window);
- window->current_paint.surface_needs_composite = FALSE;
- }
-
- if (!cairo_region_is_empty (window->current_paint.region))
- gdk_window_clear_backing_region (window);
-}
-
-static void
-gdk_window_end_paint_internal (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
- cairo_t *cr;
-
- if (window->current_paint.surface == NULL)
- {
- g_warning (G_STRLOC": no preceding call to gdk_window_begin_draw_frame(), see documentation");
- return;
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->end_paint)
- impl_class->end_paint (window);
-
- if (window->current_paint.surface_needs_composite)
- {
- cairo_surface_t *surface;
-
- surface = gdk_window_ref_impl_surface (window);
- cr = cairo_create (surface);
-
- cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
- gdk_cairo_region (cr, window->current_paint.region);
- cairo_clip (cr);
-
- cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_paint (cr);
-
- cairo_destroy (cr);
-
- cairo_surface_flush (surface);
- cairo_surface_destroy (surface);
- }
-
- gdk_window_free_current_paint (window);
-}
-
-/**
- * gdk_window_begin_draw_frame:
- * @window: a #GdkWindow
- * @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.
- *
- * If @window is a top level #GdkWindow, backed by a native window
- * 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
- * backing store. When you call gdk_window_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
- * 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_window_end_draw_frame(). If you draw to @window directly without
- * calling gdk_window_begin_draw_frame(), the user may see flicker
- * as individual drawing operations are performed in sequence.
- *
- * When using GTK+, the widget system automatically places calls to
- * gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() around
- * emissions of the `GtkWidget::draw` signal. That is, if you’re
- * drawing the contents of the widget yourself, you can assume that the
- * widget has a cleared background, is already set as the clip region,
- * and already has a backing store. Therefore in most cases, application
- * code in GTK does not need to call gdk_window_begin_draw_frame()
- * explicitly.
- *
- * Returns: (transfer none): a #GdkDrawingContext context that should be
- * used to draw the contents of the window; the returned context is owned
- * by GDK.
- */
-GdkDrawingContext *
-gdk_window_begin_draw_frame (GdkWindow *window,
- GdkDrawContext *draw_context,
- const cairo_region_t *region)
-{
- GdkDrawingContext *context;
- cairo_region_t *real_region;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- g_return_val_if_fail (gdk_window_has_native (window), NULL);
- g_return_val_if_fail (gdk_window_is_toplevel (window), 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_window (draw_context) == window, NULL);
- }
-
- if (GDK_WINDOW_DESTROYED (window))
- return NULL;
-
- if (window->drawing_context != NULL)
- {
- g_critical ("The window %p already has a drawing context. You cannot "
- "call gdk_window_begin_draw_frame() without calling "
- "gdk_window_end_draw_frame() first.", window);
- return NULL;
- }
-
- real_region = cairo_region_copy (region);
-
- if (draw_context)
- gdk_draw_context_begin_frame (draw_context, real_region);
- else
- gdk_window_begin_paint_internal (window, real_region);
-
- context = g_object_new (GDK_TYPE_DRAWING_CONTEXT,
- "window", window,
- "paint-context", draw_context,
- "clip", real_region,
- NULL);
-
- /* Do not take a reference, to avoid creating cycles */
- window->drawing_context = context;
-
- cairo_region_destroy (real_region);
-
- return context;
-}
-
-/**
- * gdk_window_end_draw_frame:
- * @window: a #GdkWindow
- * @context: the #GdkDrawingContext created by gdk_window_begin_draw_frame()
- *
- * Indicates that the drawing of the contents of @window started with
- * gdk_window_begin_frame() has been completed.
- *
- * This function will take care of destroying the #GdkDrawingContext.
- *
- * It is an error to call this function without a matching
- * gdk_window_begin_frame() first.
- */
-void
-gdk_window_end_draw_frame (GdkWindow *window,
- GdkDrawingContext *context)
-{
- GdkDrawContext *paint_context;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_IS_DRAWING_CONTEXT (context));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (window->drawing_context == NULL)
- {
- g_critical ("The window %p has no drawing context. You must call "
- "gdk_window_begin_draw_frame() before calling "
- "gdk_window_end_draw_frame().", window);
- return;
- }
- g_return_if_fail (window->drawing_context == context);
-
- paint_context = gdk_drawing_context_get_paint_context (context);
- if (paint_context)
- {
- cairo_region_t *clip = gdk_drawing_context_get_clip (context);
-
- gdk_draw_context_end_frame (paint_context,
- clip,
- window->active_update_area);
-
- cairo_region_destroy (clip);
- }
- else
- {
- gdk_window_end_paint_internal (window);
- }
-
- window->drawing_context = NULL;
-
- g_object_unref (context);
-}
-
-/*< private >
- * gdk_window_get_current_paint_region:
- * @window: a #GdkWindow
- *
- * Retrieves a copy of the current paint region.
- *
- * Returns: (transfer full): a Cairo region
- */
-cairo_region_t *
-gdk_window_get_current_paint_region (GdkWindow *window)
-{
- cairo_region_t *region;
-
- if (window->impl_window->current_paint.region != NULL)
- {
- region = cairo_region_copy (window->impl_window->current_paint.region);
- cairo_region_translate (region, -window->abs_x, -window->abs_y);
- }
- else
- {
- region = cairo_region_copy (window->clip_region);
- }
-
- return region;
-}
-
-/*< private >
- * gdk_window_get_drawing_context:
- * @window: a #GdkWindow
- *
- * Retrieves the #GdkDrawingContext associated to @window by
- * gdk_window_begin_draw_frame().
- *
- * Returns: (transfer none) (nullable): a #GdkDrawingContext, if any is set
- */
-GdkDrawingContext *
-gdk_window_get_drawing_context (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- if (GDK_WINDOW_DESTROYED (window))
- return NULL;
-
- return window->drawing_context;
-}
-
-/**
- * gdk_window_get_clip_region:
- * @window: a #GdkWindow
- *
- * Computes the region of a window 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,
- * but no area outside of this region will be affected by drawing
- * primitives.
- *
- * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
- * when you are done.
- **/
-cairo_region_t*
-gdk_window_get_clip_region (GdkWindow *window)
-{
- cairo_region_t *result;
-
- g_return_val_if_fail (GDK_WINDOW (window), NULL);
-
- result = cairo_region_copy (window->clip_region);
-
- if (window->current_paint.region != NULL)
- cairo_region_intersect (result, window->current_paint.region);
-
- return result;
-}
-
-/**
- * gdk_window_get_visible_region:
- * @window: a #GdkWindow
- *
- * 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
- * is visible.
- *
- * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
- * when you are done.
- **/
-cairo_region_t *
-gdk_window_get_visible_region (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- return cairo_region_copy (window->clip_region);
-}
-
-static void
-gdk_window_clear_backing_region (GdkWindow *window)
-{
- cairo_t *cr;
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- cr = cairo_create (window->current_paint.surface);
-
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- gdk_cairo_region (cr, window->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
- * from very many places: be careful! */
-static cairo_surface_t *
-ref_window_surface (GdkWindow *window)
-{
- if (window->impl_window->current_paint.surface)
- return cairo_surface_reference (window->impl_window->current_paint.surface);
- else
- return gdk_window_ref_impl_surface (window);
-}
-
-/* This is used in places like gdk_cairo_set_source_window and
- * other places to take "screenshots" of windows. Thus, we allow
- * it to be used outside of a begin_paint / end_paint. */
-cairo_surface_t *
-_gdk_window_ref_cairo_surface (GdkWindow *window)
-{
- cairo_surface_t *surface;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- surface = ref_window_surface (window);
-
- if (gdk_window_has_impl (window))
- {
- return 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);
- return subsurface;
- }
-}
-
-/* Code for dirty-region queueing
- */
-static GSList *update_windows = NULL;
-
-static inline gboolean
-gdk_window_is_ancestor (GdkWindow *window,
- GdkWindow *ancestor)
-{
- while (window)
- {
- GdkWindow *parent = window->parent;
-
- if (parent == ancestor)
- return TRUE;
-
- window = parent;
- }
-
- return FALSE;
-}
-
-static void
-gdk_window_add_update_window (GdkWindow *window)
-{
- GSList *tmp;
- GSList *prev = NULL;
- gboolean has_ancestor_in_list = FALSE;
-
- /* Check whether "window" is already in "update_windows" 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);
- if (tmp != NULL)
- return;
-
- for (tmp = update_windows; tmp; tmp = tmp->next)
- {
- GdkWindow *parent = window->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
- */
- if (!has_ancestor_in_list && gdk_window_is_ancestor (window, 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
- */
- if (parent == GDK_WINDOW (tmp->data)->parent)
- {
- if (parent != NULL)
- {
- gint index = g_list_index (parent->children, window);
- for (; tmp && parent == GDK_WINDOW (tmp->data)->parent; tmp = tmp->next)
- {
- gint sibling_index = g_list_index (parent->children, tmp->data);
- if (index > sibling_index)
- break;
- prev = tmp;
- }
- }
- /* here, tmp got advanced past all lower stacked siblings */
- tmp = g_slist_prepend (tmp, g_object_ref (window));
- if (prev)
- prev->next = tmp;
- else
- update_windows = tmp;
- return;
- }
-
- /* if "window" has an ancestor in the list and tmp is one of
- * "window's" children, insert "window" before tmp
- */
- if (has_ancestor_in_list && gdk_window_is_ancestor (tmp->data, window))
- {
- tmp = g_slist_prepend (tmp, g_object_ref (window));
-
- if (prev)
- prev->next = tmp;
- else
- update_windows = tmp;
- return;
- }
-
- /* if we're at the end of the list and had an ancestor it it,
- * append to the list
- */
- if (! tmp->next && has_ancestor_in_list)
- {
- tmp = g_slist_append (tmp, g_object_ref (window));
- return;
- }
-
- prev = tmp;
- }
-
- /* if all above checks failed ("window" 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));
-}
-
-static void
-gdk_window_remove_update_window (GdkWindow *window)
-{
- GSList *link;
-
- link = g_slist_find (update_windows, window);
- if (link != NULL)
- {
- update_windows = g_slist_delete_link (update_windows, link);
- g_object_unref (window);
- }
-}
-
-static gboolean
-gdk_window_is_toplevel_frozen (GdkWindow *window)
-{
- GdkWindow *toplevel;
-
- toplevel = gdk_window_get_toplevel (window);
-
- return toplevel->update_and_descendants_freeze_count > 0;
-}
-
-static void
-gdk_window_schedule_update (GdkWindow *window)
-{
- GdkFrameClock *frame_clock;
-
- if (window &&
- (window->update_freeze_count ||
- gdk_window_is_toplevel_frozen (window)))
- return;
-
- /* If there's no frame clock (a foreign window), then the invalid
- * region will just stick around unless gdk_window_process_updates()
- * is called. */
- frame_clock = gdk_window_get_frame_clock (window);
- if (frame_clock)
- gdk_frame_clock_request_phase (gdk_window_get_frame_clock (window),
- GDK_FRAME_CLOCK_PHASE_PAINT);
-}
-
-void
-_gdk_window_process_updates_recurse (GdkWindow *window,
- cairo_region_t *expose_region)
-{
- cairo_region_t *clipped_expose_region;
- GdkEvent *event;
-
- if (window->destroyed)
- return;
-
- clipped_expose_region = cairo_region_copy (expose_region);
-
- cairo_region_intersect (clipped_expose_region, window->clip_region);
-
- if (cairo_region_is_empty (clipped_expose_region))
- goto out;
-
- /* Paint the window before the children, clipped to the window region */
-
- event = gdk_event_new (GDK_EXPOSE);
- event->any.window = g_object_ref (window);
- event->any.send_event = FALSE;
- event->expose.count = 0;
- event->expose.region = cairo_region_reference (clipped_expose_region);
- cairo_region_get_extents (clipped_expose_region, &event->expose.area);
-
- _gdk_event_emit (event);
- gdk_event_free (event);
-
- out:
- cairo_region_destroy (clipped_expose_region);
-}
-
-
-static void
-gdk_window_update_native_shapes (GdkWindow *window)
-{
- if (should_apply_clip_as_shape (window))
- apply_clip_as_shape (window);
-}
-
-/* Process and remove any invalid area on the native window by creating
- * expose events for the window and all non-native descendants.
- */
-static void
-gdk_window_process_updates_internal (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
- GdkWindow *toplevel;
-
- toplevel = gdk_window_get_toplevel (window);
- if (toplevel->geometry_dirty)
- {
- gdk_window_update_native_shapes (toplevel);
- toplevel->geometry_dirty = FALSE;
- }
-
- /* Ensure the window lives while updating it */
- g_object_ref (window);
-
- window->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.
- * just ignore it.
- */
- if (window->update_area)
- {
- g_assert (window->active_update_area == NULL); /* No reentrancy */
-
- window->active_update_area = window->update_area;
- window->update_area = NULL;
-
- if (gdk_window_is_viewable (window))
- {
- cairo_region_t *expose_region;
-
- expose_region = cairo_region_copy (window->active_update_area);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- /* Clip to part visible in impl window */
- cairo_region_intersect (expose_region, window->clip_region);
-
- if (impl_class->queue_antiexpose)
- impl_class->queue_antiexpose (window, expose_region);
-
- impl_class->process_updates_recurse (window, expose_region);
-
- gdk_window_append_old_updated_area (window, window->active_update_area);
-
- cairo_region_destroy (expose_region);
- }
-
- cairo_region_destroy (window->active_update_area);
- window->active_update_area = NULL;
- }
-
- window->in_update = FALSE;
-
- g_object_unref (window);
-}
-
-static void
-gdk_window_paint_on_clock (GdkFrameClock *clock,
- void *data)
-{
- GdkWindow *window;
-
- window = GDK_WINDOW (data);
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (window->impl_window == window);
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- g_object_ref (window);
-
- if (window->update_area &&
- !window->update_freeze_count &&
- !gdk_window_is_toplevel_frozen (window) &&
-
- /* Don't recurse into process_updates_internal, we'll
- * do the update later when idle instead. */
- !window->in_update)
- {
- gdk_window_process_updates_internal (window);
- gdk_window_remove_update_window (window);
- }
-
- g_object_unref (window);
-}
-
-static void
-gdk_window_invalidate_rect_full (GdkWindow *window,
- const GdkRectangle *rect,
- gboolean invalidate_children)
-{
- GdkRectangle window_rect;
- cairo_region_t *region;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (window->input_only || !window->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;
- }
-
- region = cairo_region_create_rectangle (rect);
- gdk_window_invalidate_region_full (window, region, invalidate_children);
- cairo_region_destroy (region);
-}
-
-/**
- * gdk_window_invalidate_rect:
- * @window: a #GdkWindow
- * @rect: (allow-none): rectangle to invalidate or %NULL to invalidate the whole
- * window
- * @invalidate_children: whether to also invalidate child windows
- *
- * A convenience wrapper around gdk_window_invalidate_region() which
- * invalidates a rectangular region. See
- * gdk_window_invalidate_region() for details.
- **/
-void
-gdk_window_invalidate_rect (GdkWindow *window,
- const GdkRectangle *rect,
- gboolean invalidate_children)
-{
- gdk_window_invalidate_rect_full (window, rect, invalidate_children);
-}
-
-static void
-impl_window_add_update_area (GdkWindow *impl_window,
- cairo_region_t *region)
-{
- if (impl_window->update_area)
- cairo_region_union (impl_window->update_area, region);
- else
- {
- gdk_window_add_update_window (impl_window);
- impl_window->update_area = cairo_region_copy (region);
- gdk_window_schedule_update (impl_window);
- }
-}
-
-static void
-gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
- const cairo_region_t *region,
- GdkWindowChildFunc child_func,
- gpointer user_data)
-{
- cairo_region_t *visible_region;
- cairo_rectangle_int_t r;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (window->input_only ||
- !window->viewable ||
- cairo_region_is_empty (region) ||
- window->window_type == GDK_WINDOW_ROOT)
- return;
-
- r.x = 0;
- r.y = 0;
-
- visible_region = cairo_region_copy (region);
-
- while (window != NULL &&
- !cairo_region_is_empty (visible_region))
- {
- r.width = window->width;
- r.height = window->height;
- cairo_region_intersect_rectangle (visible_region, &r);
-
- if (gdk_window_has_impl (window))
- {
- impl_window_add_update_area (window, visible_region);
- break;
- }
- else
- {
- cairo_region_translate (visible_region,
- window->x, window->y);
- window = window->parent;
- }
- }
-
- cairo_region_destroy (visible_region);
-}
-
-/**
- * gdk_window_invalidate_maybe_recurse:
- * @window: a #GdkWindow
- * @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
- * region that needs to be redrawn, or “dirty region.”
- *
- * 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.
- *
- * The @child_func parameter controls whether the region of
- * each child window that intersects @region will also be invalidated.
- * Only children for which @child_func returns #TRUE will have the area
- * invalidated.
- **/
-void
-gdk_window_invalidate_maybe_recurse (GdkWindow *window,
- const cairo_region_t *region,
- GdkWindowChildFunc child_func,
- gpointer user_data)
-{
- gdk_window_invalidate_maybe_recurse_full (window, region,
- child_func, user_data);
-}
-
-static gboolean
-true_predicate (GdkWindow *window,
- gpointer user_data)
-{
- return TRUE;
-}
-
-static void
-gdk_window_invalidate_region_full (GdkWindow *window,
- const cairo_region_t *region,
- gboolean invalidate_children)
-{
- gdk_window_invalidate_maybe_recurse_full (window, region,
- invalidate_children ?
- true_predicate : (gboolean (*) (GdkWindow *, gpointer))NULL,
- NULL);
-}
-
-/**
- * gdk_window_invalidate_region:
- * @window: a #GdkWindow
- * @region: a #cairo_region_t
- * @invalidate_children: %TRUE to also invalidate child windows
- *
- * Adds @region to the update area for @window. 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,
- * so there’s no need to do forces redraws manually, you just need to
- * 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
- * unaffected. See gdk_window_invalidate_maybe_recurse if you need
- * fine grained control over which children are invalidated.
- **/
-void
-gdk_window_invalidate_region (GdkWindow *window,
- const cairo_region_t *region,
- gboolean invalidate_children)
-{
- gdk_window_invalidate_maybe_recurse (window, region,
- invalidate_children ?
- true_predicate : (gboolean (*) (GdkWindow *, gpointer))NULL,
- NULL);
-}
-
-/**
- * _gdk_window_invalidate_for_expose:
- * @window: a #GdkWindow
- * @region: a #cairo_region_t
- *
- * Adds @region to the update area for @window.
- *
- * 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.
- **/
-void
-_gdk_window_invalidate_for_expose (GdkWindow *window,
- cairo_region_t *region)
-{
- gdk_window_invalidate_maybe_recurse_full (window, region,
- (gboolean (*) (GdkWindow *, gpointer))gdk_window_has_no_impl,
- NULL);
-}
-
-
-/**
- * gdk_window_get_update_area:
- * @window: a #GdkWindow
- *
- * Transfers ownership of the update area from @window to the caller
- * of the function. That is, after calling this function, @window 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,
- * gdk_window_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
- **/
-cairo_region_t *
-gdk_window_get_update_area (GdkWindow *window)
-{
- GdkWindow *impl_window;
- cairo_region_t *tmp_region, *to_remove;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- impl_window = gdk_window_get_impl_window (window);
-
- if (impl_window->update_area)
- {
- tmp_region = cairo_region_copy (window->clip_region);
- /* Convert to impl coords */
- cairo_region_translate (tmp_region, window->abs_x, window->abs_y);
- cairo_region_intersect (tmp_region, impl_window->update_area);
-
- if (cairo_region_is_empty (tmp_region))
- {
- cairo_region_destroy (tmp_region);
- return NULL;
- }
- else
- {
- /* Convert from impl coords */
- cairo_region_translate (tmp_region, -window->abs_x, -window->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. */
- to_remove = cairo_region_copy (tmp_region);
-
- remove_child_area (window, FALSE, to_remove);
- remove_sibling_overlapped_area (window, to_remove);
-
- /* Remove from update_area */
- cairo_region_translate (to_remove, window->abs_x, window->abs_y);
- cairo_region_subtract (impl_window->update_area, to_remove);
-
- cairo_region_destroy (to_remove);
-
- if (cairo_region_is_empty (impl_window->update_area))
- {
- cairo_region_destroy (impl_window->update_area);
- impl_window->update_area = NULL;
-
- gdk_window_remove_update_window ((GdkWindow *)impl_window);
- }
-
- return tmp_region;
- }
- }
- else
- return NULL;
-}
-
-/**
- * _gdk_window_clear_update_area:
- * @window: a #GdkWindow.
- *
- * Internal function to clear the update area for a window. This
- * is called when the window is hidden or destroyed.
- **/
-void
-_gdk_window_clear_update_area (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->update_area)
- {
- gdk_window_remove_update_window (window);
-
- cairo_region_destroy (window->update_area);
- window->update_area = NULL;
- }
-}
-
-/**
- * gdk_window_freeze_updates:
- * @window: a #GdkWindow
- *
- * Temporarily freezes a window such that it won’t receive expose
- * events. The window will begin receiving expose events again when
- * gdk_window_thaw_updates() is called. If gdk_window_freeze_updates()
- * has been called more than once, gdk_window_thaw_updates() must be called
- * an equal number of times to begin processing exposes.
- **/
-void
-gdk_window_freeze_updates (GdkWindow *window)
-{
- GdkWindow *impl_window;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- impl_window = gdk_window_get_impl_window (window);
- impl_window->update_freeze_count++;
-}
-
-/**
- * gdk_window_thaw_updates:
- * @window: a #GdkWindow
- *
- * Thaws a window frozen with gdk_window_freeze_updates().
- **/
-void
-gdk_window_thaw_updates (GdkWindow *window)
-{
- GdkWindow *impl_window;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- impl_window = gdk_window_get_impl_window (window);
-
- g_return_if_fail (impl_window->update_freeze_count > 0);
-
- if (--impl_window->update_freeze_count == 0)
- gdk_window_schedule_update (GDK_WINDOW (impl_window));
-}
-
-void
-gdk_window_freeze_toplevel_updates (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
-
- window->update_and_descendants_freeze_count++;
- _gdk_frame_clock_freeze (gdk_window_get_frame_clock (window));
-}
-
-void
-gdk_window_thaw_toplevel_updates (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
- g_return_if_fail (window->update_and_descendants_freeze_count > 0);
-
- window->update_and_descendants_freeze_count--;
- _gdk_frame_clock_thaw (gdk_window_get_frame_clock (window));
-
- gdk_window_schedule_update (window);
-}
-
-/**
- * gdk_window_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
- * @new_width: (out): location to store resulting width
- * @new_height: (out): location to store resulting height
- *
- * Constrains a desired width and height according to a
- * set of geometry hints (such as minimum and maximum size).
- */
-void
-gdk_window_constrain_size (GdkGeometry *geometry,
- GdkWindowHints flags,
- gint width,
- gint height,
- gint *new_width,
- gint *new_height)
-{
- /* This routine is partially borrowed from fvwm.
- *
- * Copyright 1993, Robert Nation
- * You may use this code for any purpose, as long as the original
- * copyright remains in the source code and all documentation
- *
- * which in turn borrows parts of the algorithm from uwm
- */
- gint min_width = 0;
- gint min_height = 0;
- gint base_width = 0;
- gint base_height = 0;
- gint xinc = 1;
- gint yinc = 1;
- gint max_width = G_MAXINT;
- gint max_height = G_MAXINT;
-
-#define FLOOR(value, base) ( ((gint) ((value) / (base))) * (base) )
-
- if ((flags & GDK_HINT_BASE_SIZE) && (flags & GDK_HINT_MIN_SIZE))
- {
- base_width = geometry->base_width;
- base_height = geometry->base_height;
- min_width = geometry->min_width;
- min_height = geometry->min_height;
- }
- else if (flags & GDK_HINT_BASE_SIZE)
- {
- base_width = geometry->base_width;
- base_height = geometry->base_height;
- min_width = geometry->base_width;
- min_height = geometry->base_height;
- }
- else if (flags & GDK_HINT_MIN_SIZE)
- {
- base_width = geometry->min_width;
- base_height = geometry->min_height;
- min_width = geometry->min_width;
- min_height = geometry->min_height;
- }
-
- if (flags & GDK_HINT_MAX_SIZE)
- {
- max_width = geometry->max_width ;
- max_height = geometry->max_height;
- }
-
- if (flags & GDK_HINT_RESIZE_INC)
- {
- xinc = MAX (xinc, geometry->width_inc);
- yinc = MAX (yinc, geometry->height_inc);
- }
-
- /* clamp width and height to min and max values
- */
- width = CLAMP (width, min_width, max_width);
- height = CLAMP (height, min_height, max_height);
-
- /* shrink to base + N * inc
- */
- width = base_width + FLOOR (width - base_width, xinc);
- height = base_height + FLOOR (height - base_height, yinc);
-
- /* constrain aspect ratio, according to:
- *
- * width
- * min_aspect <= -------- <= max_aspect
- * height
- */
-
- if (flags & GDK_HINT_ASPECT &&
- geometry->min_aspect > 0 &&
- geometry->max_aspect > 0)
- {
- gint delta;
-
- if (geometry->min_aspect * height > width)
- {
- delta = FLOOR (height - width / geometry->min_aspect, yinc);
- if (height - delta >= min_height)
- height -= delta;
- else
- {
- delta = FLOOR (height * geometry->min_aspect - width, xinc);
- if (width + delta <= max_width)
- width += delta;
- }
- }
-
- if (geometry->max_aspect * height < width)
- {
- delta = FLOOR (width - height * geometry->max_aspect, xinc);
- if (width - delta >= min_width)
- width -= delta;
- else
- {
- delta = FLOOR (width / geometry->max_aspect - height, yinc);
- if (height + delta <= max_height)
- height += delta;
- }
- }
- }
-
-#undef FLOOR
-
- *new_width = width;
- *new_height = height;
-}
-
-/**
- * gdk_window_get_device_position_double:
- * @window: a #GdkWindow.
- * @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.
- * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
- *
- * Obtains the current device position in doubles and modifier state.
- * The position is given in coordinates relative to the upper left
- * corner of @window.
- *
- * Returns: (nullable) (transfer none): The window underneath @device
- * (as with gdk_device_get_window_at_position()), or %NULL if the
- * window is not known to GDK.
- **/
-GdkWindow *
-gdk_window_get_device_position_double (GdkWindow *window,
- GdkDevice *device,
- double *x,
- double *y,
- GdkModifierType *mask)
-{
- gdouble tmp_x, tmp_y;
- GdkModifierType tmp_mask;
- gboolean normal_child;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), 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_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
- 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;
-
- if (x)
- *x = tmp_x;
- if (y)
- *y = tmp_y;
- if (mask)
- *mask = tmp_mask;
-
- if (normal_child)
- return _gdk_window_find_child_at (window, tmp_x, tmp_y);
- return NULL;
-}
-
-/**
- * gdk_window_get_device_position:
- * @window: a #GdkWindow.
- * @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.
- * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
- *
- * Obtains the current device position and modifier state.
- * The position is given in coordinates relative to the upper left
- * corner of @window.
- *
- * Use gdk_window_get_device_position_double() if you need subpixel precision.
- *
- * Returns: (nullable) (transfer none): The window underneath @device
- * (as with gdk_device_get_window_at_position()), or %NULL if the
- * window is not known to GDK.
- **/
-GdkWindow *
-gdk_window_get_device_position (GdkWindow *window,
- GdkDevice *device,
- gint *x,
- gint *y,
- GdkModifierType *mask)
-{
- gdouble tmp_x, tmp_y;
-
- window = gdk_window_get_device_position_double (window, device,
- &tmp_x, &tmp_y, mask);
- if (x)
- *x = round (tmp_x);
- if (y)
- *y = round (tmp_y);
-
- return window;
-}
-
-static gboolean
-gdk_window_raise_internal (GdkWindow *window)
-{
- GdkWindow *parent = window->parent;
- GdkWindowImplClass *impl_class;
- gboolean did_raise = FALSE;
-
- if (parent && parent->children->data != window)
- {
- parent->children = g_list_remove_link (parent->children, &window->children_list_node);
- parent->children = g_list_concat (&window->children_list_node, parent->children);
- did_raise = TRUE;
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- /* Just do native raise for toplevels */
- if (gdk_window_has_impl (window))
- impl_class->raise (window);
-
- return did_raise;
-}
-
-/* Returns TRUE If the native window was mapped or unmapped */
-static gboolean
-set_viewable (GdkWindow *w,
- gboolean val)
-{
- GdkWindow *child;
- GList *l;
-
- if (w->viewable == val)
- return FALSE;
-
- w->viewable = val;
-
- if (val)
- recompute_visible_regions (w, FALSE);
-
- for (l = w->children; l != NULL; l = l->next)
- {
- child = l->data;
-
- if (GDK_WINDOW_IS_MAPPED (child))
- set_viewable (child, val);
- }
-
- return FALSE;
-}
-
-/* Returns TRUE If the native window was mapped or unmapped */
-gboolean
-_gdk_window_update_viewable (GdkWindow *window)
-{
- gboolean viewable;
-
- if (window->window_type == GDK_WINDOW_FOREIGN ||
- window->window_type == GDK_WINDOW_ROOT)
- viewable = TRUE;
- else if (gdk_window_is_toplevel (window) ||
- window->parent->viewable)
- viewable = GDK_WINDOW_IS_MAPPED (window);
- else
- viewable = FALSE;
-
- return set_viewable (window, viewable);
-}
-
-static void
-gdk_window_show_internal (GdkWindow *window, gboolean raise)
-{
- GdkWindowImplClass *impl_class;
- gboolean was_mapped, was_viewable;
- gboolean did_show, did_raise = FALSE;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- was_mapped = GDK_WINDOW_IS_MAPPED (window);
- was_viewable = window->viewable;
-
- if (raise)
- {
- /* Keep children in (reverse) stacking order */
- did_raise = gdk_window_raise_internal (window);
- }
-
- if (gdk_window_has_impl (window))
- {
- if (!was_mapped)
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_WITHDRAWN,
- 0);
- }
- else
- {
- window->state = 0;
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
- }
-
- did_show = _gdk_window_update_viewable (window);
-
- /* 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.
- Dunno if this is strictly needed but its what happened pre-csw.
- Also show if not done by gdk_window_update_viewable. */
- if (gdk_window_has_impl (window) && (was_viewable || !did_show))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->show (window, !did_show ? was_mapped : TRUE);
- }
-
- if (!was_mapped && !gdk_window_has_impl (window))
- {
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_MAP, NULL, FALSE);
-
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_MAP, NULL, FALSE);
- }
-
- if (!was_mapped || did_raise)
- {
- recompute_visible_regions (window, FALSE);
-
- if (gdk_window_is_viewable (window))
- gdk_window_invalidate_rect_full (window, NULL, TRUE);
- }
-}
-
-/**
- * gdk_window_show_unraised:
- * @window: a #GdkWindow
- *
- * Shows a #GdkWindow onscreen, but does not modify its stacking
- * order. In contrast, gdk_window_show() will raise the window
- * to the top of the window 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 window).
- */
-void
-gdk_window_show_unraised (GdkWindow *window)
-{
- gdk_window_show_internal (window, FALSE);
-}
-
-/**
- * gdk_window_raise:
- * @window: a #GdkWindow
- *
- * 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.
- *
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_window_raise() only
- * requests the restack, does not guarantee it.
- */
-void
-gdk_window_raise (GdkWindow *window)
-{
- gboolean did_raise;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- /* Keep children in (reverse) stacking order */
- did_raise = gdk_window_raise_internal (window);
-
- if (did_raise &&
- !gdk_window_is_toplevel (window) &&
- gdk_window_is_viewable (window) &&
- !window->input_only)
- gdk_window_invalidate_region_full (window, window->clip_region, TRUE);
-}
-
-static void
-gdk_window_lower_internal (GdkWindow *window)
-{
- GdkWindow *parent = window->parent;
- GdkWindowImplClass *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);
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- /* Just do native lower for toplevels */
- if (gdk_window_has_impl (window))
- impl_class->lower (window);
-}
-
-static void
-gdk_window_invalidate_in_parent (GdkWindow *private)
-{
- GdkRectangle r, child;
-
- if (gdk_window_is_toplevel (private))
- return;
-
- /* get the visible rectangle of the parent */
- r.x = r.y = 0;
- r.width = private->parent->width;
- r.height = private->parent->height;
-
- child.x = private->x;
- child.y = private->y;
- child.width = private->width;
- child.height = private->height;
- gdk_rectangle_intersect (&r, &child, &r);
-
- gdk_window_invalidate_rect_full (private->parent, &r, TRUE);
-}
-
-
-/**
- * gdk_window_lower:
- * @window: a #GdkWindow
- *
- * 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.
- *
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_window_lower() only
- * requests the restack, does not guarantee it.
- *
- * Note that gdk_window_show() raises the window again, so don’t call this
- * function before gdk_window_show(). (Try gdk_window_show_unraised().)
- */
-void
-gdk_window_lower (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- /* Keep children in (reverse) stacking order */
- gdk_window_lower_internal (window);
-
- gdk_window_invalidate_in_parent (window);
-}
-
-/**
- * gdk_window_restack:
- * @window: a #GdkWindow
- * @sibling: (allow-none): a #GdkWindow that is a sibling of @window, or %NULL
- * @above: a boolean
- *
- * Changes the position of @window 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.
- *
- * If @window is a toplevel, the window manager may choose to deny the
- * request to move the window in the Z-order, gdk_window_restack() only
- * requests the restack, does not guarantee it.
- */
-void
-gdk_window_restack (GdkWindow *window,
- GdkWindow *sibling,
- gboolean above)
-{
- GdkWindowImplClass *impl_class;
- GdkWindow *parent;
- GList *sibling_link;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (sibling == NULL || GDK_IS_WINDOW (sibling));
-
- if (window->destroyed)
- return;
-
- if (sibling == NULL)
- {
- if (above)
- gdk_window_raise (window);
- else
- gdk_window_lower (window);
- return;
- }
-
- if (gdk_window_is_toplevel (window))
- {
- g_return_if_fail (gdk_window_is_toplevel (sibling));
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->restack_toplevel (window, sibling, above);
- return;
- }
-
- parent = window->parent;
- if (parent)
- {
- sibling_link = g_list_find (parent->children, sibling);
- g_return_if_fail (sibling_link != NULL);
- if (sibling_link == NULL)
- return;
-
- parent->children = g_list_remove_link (parent->children, &window->children_list_node);
- if (above)
- parent->children = list_insert_link_before (parent->children,
- sibling_link,
- &window->children_list_node);
- else
- parent->children = list_insert_link_before (parent->children,
- sibling_link->next,
- &window->children_list_node);
- }
-
- gdk_window_invalidate_in_parent (window);
-}
-
-
-/**
- * gdk_window_show:
- * @window: a #GdkWindow
- *
- * Like gdk_window_show_unraised(), but also raises the window to the
- * top of the window stack (moves the window to the front of the
- * Z-order).
- *
- * This function maps a window so it’s visible onscreen. Its opposite
- * is gdk_window_hide().
- *
- * When implementing a #GtkWidget, you should call this function on the widget's
- * #GdkWindow as part of the “map” method.
- */
-void
-gdk_window_show (GdkWindow *window)
-{
- gdk_window_show_internal (window, TRUE);
-}
-
-/**
- * gdk_window_hide:
- * @window: a #GdkWindow
- *
- * For toplevel windows, withdraws them, so they will no longer be
- * known to the window manager; for all windows, unmaps them, so
- * they won’t be displayed. Normally done automatically as
- * part of gtk_widget_hide().
- */
-void
-gdk_window_hide (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
- gboolean was_mapped, did_hide;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- was_mapped = GDK_WINDOW_IS_MAPPED (window);
-
- if (gdk_window_has_impl (window))
- {
-
- if (GDK_WINDOW_IS_MAPPED (window))
- gdk_synthesize_window_state (window,
- 0,
- GDK_WINDOW_STATE_WITHDRAWN);
- }
- else if (was_mapped)
- {
- window->state = GDK_WINDOW_STATE_WITHDRAWN;
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]);
- }
-
- if (was_mapped)
- {
- GdkDisplay *display;
- GdkSeat *seat;
- GList *devices, *d;
-
- /* May need to break grabs on children */
- display = gdk_window_get_display (window);
- seat = gdk_display_get_default_seat (display);
-
- devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
- devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
- devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
-
- for (d = devices; d; d = d->next)
- {
- GdkDevice *device = d->data;
-
- if (_gdk_display_end_device_grab (display,
- device,
- _gdk_display_get_next_serial (display),
- window,
- TRUE))
- {
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gdk_device_ungrab (device, GDK_CURRENT_TIME);
-G_GNUC_END_IGNORE_DEPRECATIONS
- }
- }
-
- g_list_free (devices);
- }
-
- did_hide = _gdk_window_update_viewable (window);
-
- /* Hide foreign window as those are not handled by update_viewable. */
- if (gdk_window_has_impl (window) && (!did_hide))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->hide (window);
- }
-
- gdk_window_clear_old_updated_area (window);
- recompute_visible_regions (window, FALSE);
-
- if (was_mapped && !gdk_window_has_impl (window))
- {
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
-
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- }
-
- /* Invalidate the rect */
- if (was_mapped)
- gdk_window_invalidate_in_parent (window);
-}
-
-/**
- * gdk_window_withdraw:
- * @window: a toplevel #GdkWindow
- *
- * Withdraws a window (unmaps it and asks the window manager to forget about it).
- * This function is not really useful as gdk_window_hide() automatically
- * withdraws toplevel windows before hiding them.
- **/
-void
-gdk_window_withdraw (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
- gboolean was_mapped;
- GdkGLContext *current_context;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- was_mapped = GDK_WINDOW_IS_MAPPED (window);
-
- if (gdk_window_has_impl (window))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->withdraw (window);
-
- if (was_mapped)
- {
- if (window->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
-
- if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- }
-
- current_context = gdk_gl_context_get_current ();
- if (current_context != NULL && gdk_gl_context_get_window (current_context) == window)
- gdk_gl_context_clear_current ();
-
- recompute_visible_regions (window, FALSE);
- gdk_window_clear_old_updated_area (window);
- }
-}
-
-/**
- * gdk_window_set_events:
- * @window: a #GdkWindow
- * @event_mask: event mask for @window
- *
- * 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
- * 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_window_set_events (GdkWindow *window,
- GdkEventMask event_mask)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- window->event_mask = event_mask;
-
- if (gdk_window_has_impl (window))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->set_events (window,
- get_native_event_mask (window));
- }
-
-}
-
-/**
- * gdk_window_get_events:
- * @window: a #GdkWindow
- *
- * Gets the event mask for @window for all master input devices. See
- * gdk_window_set_events().
- *
- * Returns: event mask for @window
- **/
-GdkEventMask
-gdk_window_get_events (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
- if (window->destroyed)
- return 0;
-
- return window->event_mask;
-}
-
-/**
- * gdk_window_set_device_events:
- * @window: a #GdkWindow
- * @device: #GdkDevice to enable events for.
- * @event_mask: event mask for @window
- *
- * 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
- * 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_window_set_device_events (GdkWindow *window,
- GdkDevice *device,
- GdkEventMask event_mask)
-{
- GdkEventMask device_mask;
- GdkWindow *native;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_IS_DEVICE (device));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (G_UNLIKELY (!window->device_events))
- window->device_events = g_hash_table_new (NULL, NULL);
-
- if (event_mask == 0)
- {
- /* FIXME: unsetting events on a master device
- * would restore window->event_mask
- */
- g_hash_table_remove (window->device_events, device);
- }
- else
- g_hash_table_insert (window->device_events, device,
- GINT_TO_POINTER (event_mask));
-
- native = gdk_window_get_toplevel (window);
-
- device_mask = get_native_device_event_mask (window, device);
- GDK_DEVICE_GET_CLASS (device)->select_window_events (device, native, device_mask);
-}
-
-/**
- * gdk_window_get_device_events:
- * @window: a #GdkWindow.
- * @device: a #GdkDevice.
- *
- * Returns the event mask for @window corresponding to an specific device.
- *
- * Returns: device event mask for @window
- **/
-GdkEventMask
-gdk_window_get_device_events (GdkWindow *window,
- GdkDevice *device)
-{
- GdkEventMask mask;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
-
- if (GDK_WINDOW_DESTROYED (window))
- return 0;
-
- if (!window->device_events)
- return 0;
-
- mask = GPOINTER_TO_INT (g_hash_table_lookup (window->device_events, device));
-
- /* FIXME: device could be controlled by window->event_mask */
-
- return mask;
-}
-
-static void
-gdk_window_move_resize_toplevel (GdkWindow *window,
- gboolean with_move,
- gint x,
- gint y,
- gint width,
- gint height)
-{
- cairo_region_t *old_region, *new_region;
- GdkWindowImplClass *impl_class;
- gboolean expose;
- gboolean is_resize;
-
- expose = FALSE;
- old_region = NULL;
-
- is_resize = (width != -1) || (height != -1);
-
- if (gdk_window_is_viewable (window) &&
- !window->input_only)
- {
- expose = TRUE;
- old_region = cairo_region_copy (window->clip_region);
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->move_resize (window, with_move, x, y, width, height);
-
- /* Avoid recomputing for pure toplevel moves, for performance reasons */
- if (is_resize)
- recompute_visible_regions (window, FALSE);
-
- if (expose)
- {
- new_region = cairo_region_copy (window->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_window_invalidate_region_full (window, new_region, TRUE);
-
- cairo_region_destroy (old_region);
- cairo_region_destroy (new_region);
- }
-}
-
-
-static void
-gdk_window_move_resize_internal (GdkWindow *window,
- gboolean with_move,
- gint x,
- gint y,
- gint width,
- gint height)
-{
- cairo_region_t *old_region, *new_region;
- gboolean expose;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->destroyed)
- return;
-
- if (gdk_window_is_toplevel (window))
- {
- gdk_window_move_resize_toplevel (window, with_move, x, y, width, height);
- return;
- }
-
- if (width == 0)
- width = 1;
- if (height == 0)
- height = 1;
-
- /* Bail early if no change */
- if (window->width == width &&
- window->height == height &&
- (!with_move ||
- (window->x == x &&
- window->y == y)))
- return;
-
- /* Handle child windows */
-
- expose = FALSE;
- old_region = NULL;
-
- if (gdk_window_is_viewable (window) &&
- !window->input_only)
- {
- GdkRectangle r;
-
- expose = TRUE;
-
- r.x = window->x;
- r.y = window->y;
- r.width = window->width;
- r.height = window->height;
-
- old_region = cairo_region_create_rectangle (&r);
- }
-
- /* Set the new position and size */
- if (with_move)
- {
- window->x = x;
- window->y = y;
- }
- if (!(width < 0 && height < 0))
- {
- window->width = width;
- window->height = height;
- }
-
- recompute_visible_regions (window, FALSE);
-
- if (expose)
- {
- GdkRectangle r;
-
- r.x = window->x;
- r.y = window->y;
- r.width = window->width;
- r.height = window->height;
-
- new_region = cairo_region_create_rectangle (&r);
-
- cairo_region_union (new_region, old_region);
-
- gdk_window_invalidate_region_full (window->parent, new_region, TRUE);
-
- cairo_region_destroy (old_region);
- cairo_region_destroy (new_region);
- }
-}
-
-
-
-/**
- * gdk_window_move:
- * @window: a #GdkWindow
- * @x: X coordinate relative to window’s parent
- * @y: Y coordinate relative to window’s parent
- *
- * Repositions a window relative to its parent window.
- * For toplevel windows, 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,
- * the move will reliably succeed.
- *
- * If you’re also planning to resize the window, use gdk_window_move_resize()
- * to both move and resize simultaneously, for a nicer visual effect.
- **/
-void
-gdk_window_move (GdkWindow *window,
- gint x,
- gint y)
-{
- gdk_window_move_resize_internal (window, TRUE, x, y, -1, -1);
-}
-
-/**
- * gdk_window_resize:
- * @window: a #GdkWindow
- * @width: new width of the window
- * @height: new height of the window
- *
- * Resizes @window; for toplevel windows, asks the window manager to resize
- * the window. 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.
- *
- * If you’re also planning to move the window, use gdk_window_move_resize()
- * to both move and resize simultaneously, for a nicer visual effect.
- **/
-void
-gdk_window_resize (GdkWindow *window,
- gint width,
- gint height)
-{
- gdk_window_move_resize_internal (window, FALSE, 0, 0, width, height);
-}
-
-
-/**
- * gdk_window_move_resize:
- * @window: a #GdkWindow
- * @x: new X position relative to window’s parent
- * @y: new Y position relative to window’s parent
- * @width: new width
- * @height: new height
- *
- * Equivalent to calling gdk_window_move() and gdk_window_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
- * move, then resize, if you don’t use gdk_window_move_resize().)
- **/
-void
-gdk_window_move_resize (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height)
-{
- gdk_window_move_resize_internal (window, TRUE, x, y, width, height);
-}
-
-/**
- * gdk_window_move_to_rect:
- * @window: the #GdkWindow to move
- * @rect: (not nullable): the destination #GdkRectangle to align @window with
- * @rect_anchor: the point on @rect to align with @window's anchor point
- * @window_anchor: the point on @window to align with @rect's anchor point
- * @anchor_hints: positioning hints to use when limited on space
- * @rect_anchor_dx: horizontal offset to shift @window, i.e. @rect's anchor
- * point
- * @rect_anchor_dy: vertical offset to shift @window, i.e. @rect's anchor point
- *
- * Moves @window to @rect, aligning their anchor points.
- *
- * @rect is relative to the top-left corner of the window that @window is
- * transient for. @rect_anchor and @window_anchor determine anchor points on
- * @rect and @window to pin together. @rect's anchor point can optionally be
- * offset by @rect_anchor_dx and @rect_anchor_dy, which is equivalent to
- * offsetting the position of @window.
- *
- * @anchor_hints determines how @window 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.
- *
- * Connect to the #GdkWindow::moved-to-rect signal to find out how it was
- * actually positioned.
- *
- * Stability: Private
- */
-void
-gdk_window_move_to_rect (GdkWindow *window,
- const GdkRectangle *rect,
- GdkGravity rect_anchor,
- GdkGravity window_anchor,
- GdkAnchorHints anchor_hints,
- gint rect_anchor_dx,
- gint rect_anchor_dy)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (window->transient_for);
- g_return_if_fail (rect);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->move_to_rect (window,
- rect,
- rect_anchor,
- window_anchor,
- anchor_hints,
- rect_anchor_dx,
- rect_anchor_dy);
-}
-
-/**
- * gdk_window_scroll:
- * @window: a #GdkWindow
- * @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
- * 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
- * artifacts and unnecessary invalidations.
- **/
-void
-gdk_window_scroll (GdkWindow *window,
- gint dx,
- gint dy)
-{
- GList *tmp_list;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (dx == 0 && dy == 0)
- return;
-
- if (window->destroyed)
- return;
-
- /* First move all child windows, without causing invalidation */
-
- tmp_list = window->children;
- while (tmp_list)
- {
- GdkWindow *child = GDK_WINDOW (tmp_list->data);
-
- /* Just update the positions, the bits will move with the copy */
- child->x += dx;
- child->y += dy;
-
- tmp_list = tmp_list->next;
- }
-
- recompute_visible_regions (window, TRUE);
-
- gdk_window_invalidate_rect_full (window, NULL, TRUE);
-}
-
-/**
- * gdk_window_move_region:
- * @window: a #GdkWindow
- * @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
- * 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.
- */
-void
-gdk_window_move_region (GdkWindow *window,
- const cairo_region_t *region,
- gint dx,
- gint dy)
-{
- cairo_region_t *expose_area;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (region != NULL);
-
- if (dx == 0 && dy == 0)
- return;
-
- if (window->destroyed)
- return;
-
- expose_area = cairo_region_copy (region);
- cairo_region_translate (expose_area, dx, dy);
- cairo_region_union (expose_area, region);
-
- gdk_window_invalidate_region_full (window, expose_area, FALSE);
- cairo_region_destroy (expose_area);
-}
-
-static void
-gdk_window_set_cursor_internal (GdkWindow *window,
- GdkDevice *device,
- GdkCursor *cursor)
-{
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- g_assert (gdk_window_get_display (window) == gdk_device_get_display (device));
-
- if (window->window_type == GDK_WINDOW_ROOT ||
- window->window_type == GDK_WINDOW_FOREIGN)
- GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor);
- else
- {
- GdkPointerWindowInfo *pointer_info;
- GdkDisplay *display;
-
- display = gdk_window_get_display (window);
- pointer_info = _gdk_display_get_pointer_info (display, device);
-
- if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer))
- update_cursor (display, device);
- }
-}
-
-/**
- * gdk_window_get_cursor:
- * @window: a #GdkWindow
- *
- * Retrieves a #GdkCursor pointer for the cursor currently set on the
- * specified #GdkWindow, 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.
- *
- * Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
- * returned object is owned by the #GdkWindow and should not be
- * unreferenced directly. Use gdk_window_set_cursor() to unset the
- * cursor of the window
- */
-GdkCursor *
-gdk_window_get_cursor (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- return window->cursor;
-}
-
-/**
- * gdk_window_set_cursor:
- * @window: a #GdkWindow
- * @cursor: (allow-none): a cursor
- *
- * Sets the default mouse pointer for a #GdkWindow.
- *
- * Note that @cursor must be for the same display as @window.
- *
- * 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_window_set_cursor() means
- * that @window will use the cursor of its parent window. Most windows
- * should use this default.
- */
-void
-gdk_window_set_cursor (GdkWindow *window,
- GdkCursor *cursor)
-{
- GdkDisplay *display;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- display = gdk_window_get_display (window);
-
- if (window->cursor)
- {
- g_object_unref (window->cursor);
- window->cursor = NULL;
- }
-
- if (!GDK_WINDOW_DESTROYED (window))
- {
- GdkDevice *device;
- GList *seats, *s;
-
- if (cursor)
- window->cursor = g_object_ref (cursor);
-
- seats = gdk_display_list_seats (display);
-
- for (s = seats; s; s = s->next)
- {
- GList *devices, *d;
-
- device = gdk_seat_get_pointer (s->data);
- gdk_window_set_cursor_internal (window, device, window->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_window_set_cursor_internal (window, device, window->cursor);
- }
- g_list_free (devices);
- }
-
- g_list_free (seats);
- g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_CURSOR]);
- }
-}
-
-/**
- * gdk_window_get_device_cursor:
- * @window: a #GdkWindow.
- * @device: a master, pointer #GdkDevice.
- *
- * Retrieves a #GdkCursor pointer for the @device currently set on the
- * specified #GdkWindow, 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.
- *
- * Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
- * returned object is owned by the #GdkWindow and should not be
- * unreferenced directly. Use gdk_window_set_cursor() to unset the
- * cursor of the window
- **/
-GdkCursor *
-gdk_window_get_device_cursor (GdkWindow *window,
- GdkDevice *device)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), 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);
-}
-
-/**
- * gdk_window_set_device_cursor:
- * @window: a #GdkWindow
- * @device: a master, pointer #GdkDevice
- * @cursor: a #GdkCursor
- *
- * Sets a specific #GdkCursor for a given device when it gets inside @window.
- * 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_window_set_cursor() means that
- * @window will use the cursor of its parent window. Most windows should
- * use this default.
- **/
-void
-gdk_window_set_device_cursor (GdkWindow *window,
- GdkDevice *device,
- GdkCursor *cursor)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
- 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);
- else
- g_hash_table_replace (window->device_cursor, device, g_object_ref (cursor));
-
- gdk_window_set_cursor_internal (window, device, cursor);
-}
-
-/**
- * gdk_window_get_geometry:
- * @window: a #GdkWindow
- * @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
- *
- * 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
- * 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
- * #GdkEventConfigure. gdk_window_get_position() in contrast gets the
- * position from the most recent configure event.
- *
- * Note: If @window is not a toplevel, it is much better
- * to call gdk_window_get_position(), gdk_window_get_width() and
- * gdk_window_get_height() instead, because it avoids the roundtrip to
- * the X server and because these functions support the full 32-bit
- * coordinate space, whereas gdk_window_get_geometry() is restricted to
- * the 16-bit coordinates of X11.
- */
-void
-gdk_window_get_geometry (GdkWindow *window,
- gint *x,
- gint *y,
- gint *width,
- gint *height)
-{
- GdkWindow *parent;
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (!GDK_WINDOW_DESTROYED (window))
- {
- if (gdk_window_has_impl (window))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->get_geometry (window, 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;
- if (parent && !gdk_window_has_impl (parent))
- {
- if (x)
- *x -= parent->abs_x;
- if (y)
- *y -= parent->abs_y;
- }
- }
- else
- {
- if (x)
- *x = window->x;
- if (y)
- *y = window->y;
- if (width)
- *width = window->width;
- if (height)
- *height = window->height;
- }
- }
-}
-
-/**
- * gdk_window_get_width:
- * @window: a #GdkWindow
- *
- * Returns the width of the given @window.
- *
- * 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
- */
-int
-gdk_window_get_width (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
- return window->width;
-}
-
-/**
- * gdk_window_get_height:
- * @window: a #GdkWindow
- *
- * Returns the height of the given @window.
- *
- * 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
- */
-int
-gdk_window_get_height (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
- return window->height;
-}
-
-/**
- * gdk_window_get_origin:
- * @window: a #GdkWindow
- * @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.
- * (Compare with gdk_window_get_position() and
- * gdk_window_get_geometry() which return the position of a window
- * relative to its parent window.)
- *
- * Returns: not meaningful, ignore
- */
-gint
-gdk_window_get_origin (GdkWindow *window,
- gint *x,
- gint *y)
-{
- gint dummy_x, dummy_y;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
- gdk_window_get_root_coords (window,
- 0, 0,
- x ? x : &dummy_x,
- y ? y : &dummy_y);
-
- return TRUE;
-}
-
-/**
- * gdk_window_get_root_coords:
- * @window: a #GdkWindow
- * @x: X coordinate in window
- * @y: Y coordinate in window
- * @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
- * window coordinates. This is similar to
- * gdk_window_get_origin() but allows you to pass
- * in any position in the window, not just the origin.
- */
-void
-gdk_window_get_root_coords (GdkWindow *window,
- gint x,
- gint y,
- gint *root_x,
- gint *root_y)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- {
- *root_x = 0;
- *root_y = 0;
- return;
- }
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->get_root_coords (window->impl_window,
- x + window->abs_x,
- y + window->abs_y,
- root_x, root_y);
-}
-
-/**
- * gdk_window_coords_to_parent:
- * @window: a child window
- * @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
- * in parent’s coordinate system, or %NULL
- * @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
- * values of gdk_window_get_position() to the child coordinates.
- *
- * See also: gdk_window_coords_from_parent()
- **/
-void
-gdk_window_coords_to_parent (GdkWindow *window,
- gdouble x,
- gdouble y,
- gdouble *parent_x,
- gdouble *parent_y)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (parent_x)
- *parent_x = x + window->x;
-
- if (parent_y)
- *parent_y = y + window->y;
-}
-
-/**
- * gdk_window_coords_from_parent:
- * @window: a child window
- * @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.
- *
- * Calling this function is equivalent to subtracting the return
- * values of gdk_window_get_position() from the parent coordinates.
- *
- * See also: gdk_window_coords_to_parent()
- **/
-void
-gdk_window_coords_from_parent (GdkWindow *window,
- gdouble parent_x,
- gdouble parent_y,
- gdouble *x,
- gdouble *y)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (x)
- *x = parent_x - window->x;
-
- if (y)
- *y = parent_y - window->y;
-}
-
-/**
- * gdk_window_shape_combine_region:
- * @window: a #GdkWindow
- * @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
- *
- * Makes pixels in @window outside @shape_region be transparent,
- * so that the window 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
- * if @shape_region is %NULL.
- *
- * On the X11 platform, this uses an X server extension which is
- * widely available on most common platforms, but not available on
- * very old X servers, and occasionally the implementation will be
- * buggy. On servers without the shape extension, this function
- * will do nothing.
- *
- * This function works on both toplevel and child windows.
- */
-void
-gdk_window_shape_combine_region (GdkWindow *window,
- 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_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (!window->shape && shape_region == NULL)
- return;
-
- window->shaped = (shape_region != NULL);
-
- if (window->shape)
- cairo_region_destroy (window->shape);
-
- old_region = NULL;
- if (GDK_WINDOW_IS_MAPPED (window))
- old_region = cairo_region_copy (window->clip_region);
-
- if (shape_region)
- {
- window->shape = cairo_region_copy (shape_region);
- cairo_region_translate (window->shape, offset_x, offset_y);
- }
- else
- window->shape = NULL;
-
- recompute_visible_regions (window, FALSE);
-
- if (old_region)
- {
- new_region = cairo_region_copy (window->clip_region);
-
- /* New area in the window, needs invalidation */
- diff = cairo_region_copy (new_region);
- cairo_region_subtract (diff, old_region);
-
- gdk_window_invalidate_region_full (window, diff, TRUE);
-
- cairo_region_destroy (diff);
-
- if (!gdk_window_is_toplevel (window))
- {
- /* New area in the non-root parent window, 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);
-
- gdk_window_invalidate_region_full (window->parent, diff, TRUE);
-
- cairo_region_destroy (diff);
- }
-
- cairo_region_destroy (new_region);
- cairo_region_destroy (old_region);
- }
-}
-
-static void
-do_child_shapes (GdkWindow *window,
- gboolean merge)
-{
- GdkRectangle r;
- cairo_region_t *region;
-
- r.x = 0;
- r.y = 0;
- r.width = window->width;
- r.height = window->height;
-
- region = cairo_region_create_rectangle (&r);
- remove_child_area (window, FALSE, region);
-
- if (merge && window->shape)
- cairo_region_subtract (region, window->shape);
-
- cairo_region_xor_rectangle (region, &r);
-
- gdk_window_shape_combine_region (window, region, 0, 0);
-
- cairo_region_destroy (region);
-}
-
-/**
- * gdk_window_set_child_shapes:
- * @window: a #GdkWindow
- *
- * Sets the shape mask of @window to the union of shape masks
- * for all children of @window, ignoring the shape mask of @window
- * itself. Contrast with gdk_window_merge_child_shapes() which includes
- * the shape mask of @window in the masks to be merged.
- **/
-void
-gdk_window_set_child_shapes (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- do_child_shapes (window, FALSE);
-}
-
-/**
- * gdk_window_merge_child_shapes:
- * @window: a #GdkWindow
- *
- * 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_window_shape_combine_region().
- *
- * This function is distinct from gdk_window_set_child_shapes()
- * because it includes @window’s shape mask in the set of shapes to
- * be merged.
- */
-void
-gdk_window_merge_child_shapes (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- do_child_shapes (window, TRUE);
-}
-
-/**
- * gdk_window_input_shape_combine_region:
- * @window: a #GdkWindow
- * @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
- *
- * Like gdk_window_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.
- *
- * An input shape is typically used with RGBA windows.
- * The alpha channel of the window defines which pixels are
- * invisible and allows for nicely antialiased borders,
- * and the input shape controls where the window is
- * “clickable”.
- *
- * On the X11 platform, this requires version 1.1 of the
- * shape extension.
- *
- * On the Win32 platform, this functionality is not present and the
- * function does nothing.
- */
-void
-gdk_window_input_shape_combine_region (GdkWindow *window,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (window->input_shape)
- cairo_region_destroy (window->input_shape);
-
- if (shape_region)
- {
- window->input_shape = cairo_region_copy (shape_region);
- cairo_region_translate (window->input_shape, offset_x, offset_y);
- }
- else
- window->input_shape = NULL;
-
- if (gdk_window_has_impl (window))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- impl_class->input_shape_combine_region (window, window->input_shape, 0, 0);
- }
-}
-
-static void
-do_child_input_shapes (GdkWindow *window,
- gboolean merge)
-{
- GdkRectangle r;
- cairo_region_t *region;
-
- r.x = 0;
- r.y = 0;
- r.width = window->width;
- r.height = window->height;
-
- region = cairo_region_create_rectangle (&r);
- remove_child_area (window, TRUE, region);
-
- if (merge && window->shape)
- cairo_region_subtract (region, window->shape);
- if (merge && window->input_shape)
- cairo_region_subtract (region, window->input_shape);
-
- cairo_region_xor_rectangle (region, &r);
-
- gdk_window_input_shape_combine_region (window, region, 0, 0);
-}
-
-
-/**
- * gdk_window_set_child_input_shapes:
- * @window: a #GdkWindow
- *
- * 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
- * itself. Contrast with gdk_window_merge_child_input_shapes() which includes
- * the input shape mask of @window in the masks to be merged.
- **/
-void
-gdk_window_set_child_input_shapes (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- do_child_input_shapes (window, FALSE);
-}
-
-/**
- * gdk_window_set_pass_through:
- * @window: a #GdkWindow
- * @pass_through: a boolean
- *
- * Sets whether input to the window is passed through to the window
- * below.
- *
- * The default value of this is %FALSE, which means that pointer
- * events that happen inside the window are send first to the window,
- * 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.
- *
- * 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
- * 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
- * that cases you would get the in-between related events such as the pointer
- * enter/leave events on its way to the destination window.
- **/
-void
-gdk_window_set_pass_through (GdkWindow *window,
- gboolean pass_through)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- window->pass_through = !!pass_through;
-}
-
-/**
- * gdk_window_get_pass_through:
- * @window: a #GdkWindow
- *
- * Returns whether input to the window is passed through to the window
- * below.
- *
- * See gdk_window_set_pass_through() for details
- **/
-gboolean
-gdk_window_get_pass_through (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->pass_through;
-}
-
-/**
- * gdk_window_merge_child_input_shapes:
- * @window: a #GdkWindow
- *
- * 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_window_input_shape_combine_region().
- *
- * This function is distinct from gdk_window_set_child_input_shapes()
- * because it includes @window’s input shape mask in the set of
- * shapes to be merged.
- **/
-void
-gdk_window_merge_child_input_shapes (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- do_child_input_shapes (window, TRUE);
-}
-
-
-/**
- * gdk_window_get_modal_hint:
- * @window: A toplevel #GdkWindow.
- *
- * Determines whether or not the window manager is hinted that @window
- * has modal behaviour.
- *
- * Returns: whether or not the window has the modal hint set.
- */
-gboolean
-gdk_window_get_modal_hint (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->modal_hint;
-}
-
-/**
- * gdk_window_get_accept_focus:
- * @window: a toplevel #GdkWindow.
- *
- * Determines whether or not the desktop environment shuld be hinted that
- * the window does not want to receive input focus.
- *
- * Returns: whether or not the window should receive input focus.
- */
-gboolean
-gdk_window_get_accept_focus (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->accept_focus;
-}
-
-/**
- * gdk_window_get_focus_on_map:
- * @window: a toplevel #GdkWindow.
- *
- * Determines whether or not the desktop environment should be hinted that the
- * window does not want to receive input focus when it is mapped.
- *
- * Returns: whether or not the window wants to receive input focus when
- * it is mapped.
- */
-gboolean
-gdk_window_get_focus_on_map (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->focus_on_map;
-}
-
-/**
- * gdk_window_is_input_only:
- * @window: a toplevel #GdkWindow
- *
- * Determines whether or not the window is an input only window.
- *
- * Returns: %TRUE if @window is input only
- */
-gboolean
-gdk_window_is_input_only (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->input_only;
-}
-
-/**
- * gdk_window_is_shaped:
- * @window: a toplevel #GdkWindow
- *
- * Determines whether or not the window is shaped.
- *
- * Returns: %TRUE if @window is shaped
- */
-gboolean
-gdk_window_is_shaped (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return window->shaped;
-}
-
-/* Gets the toplevel for a window as used for events,
- i.e. including offscreen parents going up to the native
- toplevel */
-static GdkWindow *
-get_event_toplevel (GdkWindow *window)
-{
- GdkWindow *parent;
-
- while ((parent = window->parent) != NULL &&
- (parent->window_type != GDK_WINDOW_ROOT))
- window = parent;
-
- return window;
-}
-
-gboolean
-_gdk_window_event_parent_of (GdkWindow *parent,
- GdkWindow *child)
-{
- GdkWindow *w;
-
- w = child;
- while (w != NULL)
- {
- if (w == parent)
- return TRUE;
-
- w = w->parent;
- }
-
- return FALSE;
-}
-
-static void
-update_cursor (GdkDisplay *display,
- GdkDevice *device)
-{
- GdkWindow *cursor_window, *parent, *toplevel;
- GdkWindow *pointer_window;
- GdkPointerWindowInfo *pointer_info;
- GdkDeviceGrabInfo *grab;
- GdkCursor *cursor;
-
- pointer_info = _gdk_display_get_pointer_info (display, device);
- pointer_window = pointer_info->window_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_window_event_parent_of (grab->window, pointer_window))
- {
- /* use the cursor from the grab window */
- cursor_window = grab->window;
- }
- else
- {
- /* otherwise use the cursor from the pointer window */
- cursor_window = pointer_window;
- }
-
- /* Find the first window 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 &&
- parent->window_type != GDK_WINDOW_ROOT)
- cursor_window = parent;
-
- cursor = g_hash_table_lookup (cursor_window->device_cursor, device);
-
- if (!cursor)
- cursor = cursor_window->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);
- GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, toplevel, cursor);
-}
-
-static gboolean
-point_in_window (GdkWindow *window,
- 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, y)) &&
- (window->input_shape == NULL ||
- cairo_region_contains_point (window->input_shape,
- x, y));
-}
-
-/* Same as point_in_window, except it also takes pass_through and its
- interaction with child windows into account */
-static gboolean
-point_in_input_window (GdkWindow *window,
- gdouble x,
- gdouble y,
- GdkWindow **input_window,
- gdouble *input_window_x,
- gdouble *input_window_y)
-{
- GdkWindow *sub;
- double child_x, child_y;
- GList *l;
-
- if (!point_in_window (window, x, y))
- return FALSE;
-
- if (!window->pass_through)
- {
- if (input_window)
- {
- *input_window = window;
- *input_window_x = x;
- *input_window_y = y;
- }
- return TRUE;
- }
-
- /* For pass-through, must be over a child input window */
-
- /* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = window->children; l != NULL; l = l->next)
- {
- sub = l->data;
-
- if (!GDK_WINDOW_IS_MAPPED (sub))
- continue;
-
- gdk_window_coords_from_parent ((GdkWindow *)sub,
- x, y,
- &child_x, &child_y);
- if (point_in_input_window (sub, child_x, child_y,
- input_window, input_window_x, input_window_y))
- {
- if (input_window)
- gdk_window_coords_to_parent (sub,
- *input_window_x,
- *input_window_y,
- input_window_x,
- input_window_y);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-GdkWindow *
-_gdk_window_find_child_at (GdkWindow *window,
- double x,
- double y)
-{
- GdkWindow *sub;
- double child_x, child_y;
- GList *l;
-
- if (point_in_window (window, x, y))
- {
- /* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = window->children; l != NULL; l = l->next)
- {
- sub = l->data;
-
- if (!GDK_WINDOW_IS_MAPPED (sub))
- continue;
-
- gdk_window_coords_from_parent ((GdkWindow *)sub,
- x, y,
- &child_x, &child_y);
- if (point_in_input_window (sub, child_x, child_y,
- NULL, NULL, NULL))
- return (GdkWindow *)sub;
- }
- }
-
- return NULL;
-}
-
-GdkWindow *
-_gdk_window_find_descendant_at (GdkWindow *window,
- gdouble x,
- gdouble y,
- gdouble *found_x,
- gdouble *found_y)
-{
- GdkWindow *sub, *input_window;
- gdouble child_x, child_y;
- GList *l;
- gboolean found;
-
- if (point_in_window (window, 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)
- {
- sub = l->data;
-
- if (!GDK_WINDOW_IS_MAPPED (sub))
- continue;
-
- gdk_window_coords_from_parent ((GdkWindow *)sub,
- x, y,
- &child_x, &child_y);
- if (point_in_input_window (sub, child_x, child_y,
- &input_window, &child_x, &child_y))
- {
- x = child_x;
- y = child_y;
- window = input_window;
- found = TRUE;
- break;
- }
- }
- }
- while (found);
- }
- else
- {
- /* Not in window at all */
- window = NULL;
- }
-
- if (found_x)
- *found_x = x;
- if (found_y)
- *found_y = y;
-
- return window;
-}
-
-/**
- * gdk_window_beep:
- * @window: a toplevel #GdkWindow
- *
- * Emits a short beep associated to @window in the appropriate
- * display, if supported. Otherwise, emits a short beep on
- * the display just as gdk_display_beep().
- **/
-void
-gdk_window_beep (GdkWindow *window)
-{
- GdkDisplay *display;
- GdkWindow *toplevel;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- toplevel = get_event_toplevel (window);
- display = gdk_window_get_display (window);
-
- if (toplevel)
- {
- if (GDK_WINDOW_IMPL_GET_CLASS (toplevel->impl)->beep (toplevel))
- return;
- }
-
- /* If windows fail to beep, we beep the display. */
- gdk_display_beep (display);
-}
-
-/**
- * gdk_window_set_support_multidevice:
- * @window: a #GdkWindow.
- * @support_multidevice: %TRUE to enable multidevice support in @window.
- *
- * This function will enable multidevice features in @window.
- *
- * Multidevice aware windows will need to handle properly multiple,
- * per device enter/leave events, device grabs and grab ownerships.
- **/
-void
-gdk_window_set_support_multidevice (GdkWindow *window,
- gboolean support_multidevice)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (GDK_WINDOW_DESTROYED (window))
- return;
-
- if (window->support_multidevice == support_multidevice)
- return;
-
- window->support_multidevice = support_multidevice;
-
- /* FIXME: What to do if called when some pointers are inside the window ? */
-}
-
-/**
- * gdk_window_get_support_multidevice:
- * @window: a #GdkWindow.
- *
- * Returns %TRUE if the window is aware of the existence of multiple
- * devices.
- *
- * Returns: %TRUE if the window handles multidevice features.
- **/
-gboolean
-gdk_window_get_support_multidevice (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- if (GDK_WINDOW_DESTROYED (window))
- return FALSE;
-
- return window->support_multidevice;
-}
-
-/* send motion events if the right buttons are down */
-
-GdkEvent *
-_gdk_make_event (GdkWindow *window,
- GdkEventType type,
- GdkEvent *event_in_queue,
- gboolean before_event)
-{
- GdkEvent *event = gdk_event_new (type);
- guint32 the_time;
- GdkModifierType the_state;
-
- 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.send_event = FALSE;
- if (event_in_queue && event_in_queue->any.send_event)
- event->any.send_event = TRUE;
-
- switch ((guint) type)
- {
- case GDK_MOTION_NOTIFY:
- event->motion.time = the_time;
- event->motion.axes = NULL;
- event->motion.state = the_state;
- break;
-
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- event->button.time = the_time;
- event->button.axes = NULL;
- event->button.state = the_state;
- break;
-
- case GDK_TOUCH_BEGIN:
- case GDK_TOUCH_UPDATE:
- case GDK_TOUCH_END:
- case GDK_TOUCH_CANCEL:
- event->touch.time = the_time;
- event->touch.axes = NULL;
- event->touch.state = the_state;
- break;
-
- case GDK_SCROLL:
- event->scroll.time = the_time;
- event->scroll.state = the_state;
- break;
-
- case GDK_KEY_PRESS:
- case GDK_KEY_RELEASE:
- event->key.time = the_time;
- event->key.state = the_state;
- break;
-
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY:
- event->crossing.time = the_time;
- event->crossing.state = the_state;
- break;
-
- case GDK_PROXIMITY_IN:
- case GDK_PROXIMITY_OUT:
- event->proximity.time = the_time;
- break;
-
- case GDK_DRAG_ENTER:
- case GDK_DRAG_LEAVE:
- case GDK_DRAG_MOTION:
- case GDK_DROP_START:
- event->dnd.time = the_time;
- break;
-
- case GDK_TOUCHPAD_SWIPE:
- event->touchpad_swipe.time = the_time;
- event->touchpad_swipe.state = the_state;
- break;
-
- case GDK_TOUCHPAD_PINCH:
- event->touchpad_pinch.time = the_time;
- event->touchpad_pinch.state = the_state;
- break;
-
- case GDK_FOCUS_CHANGE:
- case GDK_CONFIGURE:
- case GDK_MAP:
- case GDK_UNMAP:
- case GDK_DELETE:
- case GDK_DESTROY:
- case GDK_EXPOSE:
- default:
- break;
- }
-
- if (event_in_queue)
- {
- if (before_event)
- _gdk_event_queue_insert_before (gdk_window_get_display (window), event_in_queue, event);
- else
- _gdk_event_queue_insert_after (gdk_window_get_display (window), event_in_queue, event);
- }
- else
- _gdk_event_queue_append (gdk_window_get_display (window), event);
-
- return event;
-}
-
-void
-_gdk_display_set_window_under_pointer (GdkDisplay *display,
- GdkDevice *device,
- GdkWindow *window)
-{
- GdkPointerWindowInfo *device_info;
-
- device_info = _gdk_display_get_pointer_info (display, device);
-
- if (device_info->window_under_pointer)
- g_object_unref (device_info->window_under_pointer);
- device_info->window_under_pointer = window;
-
- if (window)
- {
- g_object_ref (window);
- update_cursor (display, device);
- }
-}
-
-#define GDK_ANY_BUTTON_MASK (GDK_BUTTON1_MASK | \
- GDK_BUTTON2_MASK | \
- GDK_BUTTON3_MASK | \
- GDK_BUTTON4_MASK | \
- GDK_BUTTON5_MASK)
-
-#ifdef DEBUG_WINDOW_PRINTING
-
-#ifdef GDK_WINDOWING_X11
-#include "x11/gdkx.h"
-#endif
-
-static void
-gdk_window_print (GdkWindow *window,
- int indent)
-{
- char *s;
- const char *window_types[] = {
- "root",
- "toplevel",
- "child",
- "dialog",
- "temp",
- "foreign",
- "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
- );
-
- if (gdk_window_has_impl (window))
- {
-#ifdef GDK_WINDOWING_X11
- g_print (" impl(0x%lx)", gdk_x11_window_get_xid (window));
-#endif
- }
-
- if (window->window_type != GDK_WINDOW_CHILD)
- g_print (" %s", window_types[window->window_type]);
-
- if (window->input_only)
- g_print (" input-only");
-
- if (window->shaped)
- g_print (" shaped");
-
- if (!gdk_window_is_visible ((GdkWindow *)window))
- g_print (" hidden");
-
- g_print (" abs[%d,%d]",
- window->abs_x, window->abs_y);
-
- if (window->alpha != 255)
- g_print (" alpha[%d]",
- window->alpha);
-
- s = print_region (window->clip_region);
- g_print (" clipbox[%s]", s);
-
- g_print ("\n");
-}
-
-
-static void
-gdk_window_print_tree (GdkWindow *window,
- int indent,
- gboolean include_input_only)
-{
- GList *l;
-
- if (window->input_only && !include_input_only)
- return;
-
- gdk_window_print (window, indent);
-
- for (l = window->children; l != NULL; l = l->next)
- gdk_window_print_tree (l->data, indent + 4, include_input_only);
-}
-
-#endif /* DEBUG_WINDOW_PRINTING */
-
-void
-_gdk_windowing_got_event (GdkDisplay *display,
- GList *event_link,
- GdkEvent *event,
- gulong serial)
-{
- GdkWindow *event_window;
- gboolean unlink_event = FALSE;
- GdkDeviceGrabInfo *button_release_grab;
- GdkPointerWindowInfo *pointer_info = NULL;
- GdkDevice *device, *source_device;
-
- _gdk_display_update_last_event (display, event);
-
- device = gdk_event_get_device (event);
- source_device = gdk_event_get_source_device (event);
-
- if (device)
- {
- if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD &&
- gdk_device_get_source (device) != GDK_SOURCE_TABLET_PAD)
- {
- pointer_info = _gdk_display_get_pointer_info (display, device);
-
- if (source_device != pointer_info->last_slave &&
- gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
- pointer_info->last_slave = source_device;
- else if (pointer_info->last_slave)
- source_device = pointer_info->last_slave;
- }
-
- _gdk_display_device_grab_update (display, device, source_device, serial);
-
- if (gdk_device_get_input_mode (device) == GDK_MODE_DISABLED ||
- !_gdk_display_check_grab_ownership (display, device, serial))
- {
- /* Device events are blocked by another
- * device grab, or the device is disabled
- */
- unlink_event = TRUE;
- goto out;
- }
- }
-
- event_window = event->any.window;
- if (!event_window)
- goto out;
-
-#ifdef DEBUG_WINDOW_PRINTING
- if (event->any.type == GDK_KEY_PRESS &&
- (event->key.keyval == 0xa7 ||
- event->key.keyval == 0xbd))
- {
- gdk_window_print_tree (event_window, 0, event->key.keyval == 0xbd);
- }
-#endif
-
- if (event_window->window_type == GDK_WINDOW_ROOT)
- goto out;
-
- if (event->any.type == GDK_ENTER_NOTIFY)
- _gdk_display_set_window_under_pointer (display, device, event_window);
- else if (event->any.type == GDK_LEAVE_NOTIFY)
- _gdk_display_set_window_under_pointer (display, device, NULL);
-
- if ((event->any.type == GDK_BUTTON_RELEASE ||
- event->any.type == GDK_TOUCH_CANCEL ||
- event->any.type == GDK_TOUCH_END) &&
- !event->any.send_event)
- {
- if (event->any.type == GDK_BUTTON_RELEASE ||
- gdk_event_get_pointer_emulated (event))
- {
- button_release_grab =
- _gdk_display_has_device_grab (display, device, serial);
-
- if (button_release_grab &&
- button_release_grab->implicit &&
- (event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0)
- {
- button_release_grab->serial_end = serial;
- button_release_grab->implicit_ungrab = FALSE;
- _gdk_display_device_grab_update (display, device, source_device, serial);
- }
- }
- }
-
- out:
- if (unlink_event)
- {
- _gdk_event_queue_remove_link (display, event_link);
- g_list_free_1 (event_link);
- gdk_event_free (event);
- }
-
- /* This does two things - first it sees if there are motions at the
- * end of the queue that can be compressed. Second, if there is just
- * a single motion that won't be dispatched because it is a compression
- * candidate it queues up flushing the event queue.
- */
- _gdk_event_queue_handle_motion_compression (display);
-}
-
-/**
- * gdk_window_create_similar_surface:
- * @window: window 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
- * not possible for some reason. The type of the returned surface may
- * be examined with cairo_surface_get_type().
- *
- * Initially the surface contents are all 0 (transparent if contents
- * have transparency, black otherwise.)
- *
- * Returns: a pointer to the newly allocated surface. The caller
- * owns the surface and should call cairo_surface_destroy() when done
- * with it.
- *
- * This function always returns a valid pointer, but it will return a
- * pointer to a “nil” surface if @other is already in an error state
- * or any other error occurs.
- **/
-cairo_surface_t *
-gdk_window_create_similar_surface (GdkWindow * window,
- cairo_content_t content,
- int width,
- int height)
-{
- cairo_surface_t *window_surface, *surface;
- double sx, sy;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- window_surface = gdk_window_ref_impl_surface (window);
- sx = sy = 1;
- cairo_surface_get_device_scale (window_surface, &sx, &sy);
-
- if (GDK_DISPLAY_DEBUG_CHECK (window->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);
- }
- else
- {
- surface = cairo_surface_create_similar (window_surface,
- content,
- width, height);
- }
-
- cairo_surface_destroy (window_surface);
-
- return surface;
-}
-
-
-/**
- * gdk_window_create_similar_image_surface:
- * @window: (nullable): window 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
- *
- * Create a new image surface that is efficient to draw on the
- * given @window.
- *
- * 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
- * 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
- * use:
- *
- * |[<!-- language="C" -->
- * int scale = gdk_window_get_scale_factor (window);
- * int width = gdk_window_get_width (window) * scale;
- * int height = gdk_window_get_height (window) * scale;
- *
- * // format is set elsewhere
- * cairo_surface_t *surface =
- * gdk_window_create_similar_image_surface (window,
- * format,
- * width, height,
- * scale);
- * ]|
- *
- * 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.
- *
- * Returns: a pointer to the newly allocated surface. The caller
- * owns the surface and should call cairo_surface_destroy() when done
- * with it.
- *
- * This function always returns a valid pointer, but it will return a
- * pointer to a “nil” surface if @other is already in an error state
- * or any other error occurs.
- **/
-cairo_surface_t *
-gdk_window_create_similar_image_surface (GdkWindow * window,
- cairo_format_t format,
- int width,
- int height,
- int scale)
-{
- cairo_surface_t *surface;
-
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
-
- if (window == NULL)
- {
- surface = cairo_image_surface_create (format, width, height);
- }
- else if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_similar_image_surface)
- {
- surface =
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_similar_image_surface (window, format, width, height);
- }
- else
- {
- cairo_surface_t *window_surface;
-
- window_surface = gdk_window_ref_impl_surface (window);
- surface =
- cairo_surface_create_similar_image (window_surface,
- format,
- width,
- height);
- cairo_surface_destroy (window_surface);
- }
-
- if (scale == 0)
- scale = gdk_window_get_scale_factor (window);
-
- cairo_surface_set_device_scale (surface, scale, scale);
-
- return surface;
-}
-
-
-/**
- * gdk_window_focus:
- * @window: a #GdkWindow
- * @timestamp: timestamp of the event triggering the window focus
- *
- * Sets keyboard focus to @window. In most cases, gtk_window_present()
- * should be used on a #GtkWindow, rather than calling this function.
- *
- **/
-void
-gdk_window_focus (GdkWindow *window,
- guint32 timestamp)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->focus (window, timestamp);
-}
-
-/**
- * gdk_window_set_type_hint:
- * @window: A toplevel #GdkWindow
- * @hint: A hint of the function this window 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
- * can use this information when determining the decoration and behaviour
- * of the window.
- *
- * The hint must be set before the window is mapped.
- **/
-void
-gdk_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_type_hint (window, hint);
-}
-
-/**
- * gdk_window_get_type_hint:
- * @window: A toplevel #GdkWindow
- *
- * This function returns the type hint set for a window.
- *
- * Returns: The type hint set for @window
- **/
-GdkWindowTypeHint
-gdk_window_get_type_hint (GdkWindow *window)
-{
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_type_hint (window);
-}
-
-/**
- * gdk_window_set_modal_hint:
- * @window: A toplevel #GdkWindow
- * @modal: %TRUE if the window 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
- * way.
- *
- * You should only use this on windows for which you have
- * previously called gdk_window_set_transient_for()
- **/
-void
-gdk_window_set_modal_hint (GdkWindow *window,
- gboolean modal)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_modal_hint (window, modal);
-}
-
-/**
- * gdk_window_set_skip_taskbar_hint:
- * @window: a toplevel #GdkWindow
- * @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_window_set_type_hint() already fully describes the window, this
- * function should not be called in addition,
- * instead you should allow the window to be treated according to
- * standard policy for its semantic type.
- **/
-void
-gdk_window_set_skip_taskbar_hint (GdkWindow *window,
- gboolean skips_taskbar)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_skip_taskbar_hint (window, skips_taskbar);
-}
-
-/**
- * gdk_window_set_skip_pager_hint:
- * @window: a toplevel #GdkWindow
- * @skips_pager: %TRUE to skip the pager
- *
- * Toggles whether a window 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_window_set_type_hint()
- * already fully describes the window, this function should
- * not be called in addition, instead you should
- * allow the window to be treated according to standard policy for
- * its semantic type.
- **/
-void
-gdk_window_set_skip_pager_hint (GdkWindow *window,
- gboolean skips_pager)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_skip_pager_hint (window, skips_pager);
-}
-
-/**
- * gdk_window_set_urgency_hint:
- * @window: a toplevel #GdkWindow
- * @urgent: %TRUE if the window is urgent
- *
- * Toggles whether a window needs the user's
- * urgent attention.
- **/
-void
-gdk_window_set_urgency_hint (GdkWindow *window,
- gboolean urgent)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_urgency_hint (window, urgent);
-}
-
-/**
- * gdk_window_set_geometry_hints:
- * @window: a toplevel #GdkWindow
- * @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
- * 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 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
- * constrain programatic resizing via gdk_window_resize() or
- * gdk_window_move_resize().
- *
- * Note that on X11, this effect has no effect on windows
- * of type %GDK_WINDOW_TEMP since these windows are not resizable
- * by the user.
- *
- * Since you can’t count on the windowing system doing the
- * constraints for programmatic resizes, you should generally
- * call gdk_window_constrain_size() yourself to determine
- * appropriate sizes.
- *
- **/
-void
-gdk_window_set_geometry_hints (GdkWindow *window,
- const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
-{
- g_return_if_fail (geometry != NULL || geom_mask == 0);
-
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_geometry_hints (window, geometry, geom_mask);
-}
-
-/**
- * gdk_window_set_title:
- * @window: a toplevel #GdkWindow
- * @title: title of @window
- *
- * 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
- * (using gdk_window_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_window_set_title (GdkWindow *window,
- const gchar *title)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_title (window, title);
-}
-
-/**
- * gdk_window_set_role:
- * @window: a toplevel #GdkWindow
- * @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.
- * 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
- * that should be distinguished for session management purposes, you
- * should set the role on those windows. 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.
- *
- **/
-void
-gdk_window_set_role (GdkWindow *window,
- const gchar *role)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_role (window, role);
-}
-
-/**
- * gdk_window_set_startup_id:
- * @window: a toplevel #GdkWindow
- * @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_window_set_startup_id (GdkWindow *window,
- const gchar *startup_id)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_startup_id (window, startup_id);
-}
-
-/**
- * gdk_window_set_transient_for:
- * @window: a toplevel #GdkWindow
- * @parent: another toplevel #GdkWindow
- *
- * 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.
- *
- * See gtk_window_set_transient_for() if you’re using #GtkWindow or
- * #GtkDialog.
- **/
-void
-gdk_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
-{
- window->transient_for = parent;
-
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_transient_for (window, parent);
-}
-
-/**
- * gdk_window_get_root_origin:
- * @window: a toplevel #GdkWindow
- * @x: (out): return location for X position of window frame
- * @y: (out): return location for Y position of window frame
- *
- * Obtains the top-left corner of the window manager frame in root
- * window coordinates.
- *
- **/
-void
-gdk_window_get_root_origin (GdkWindow *window,
- gint *x,
- gint *y)
-{
- GdkRectangle rect;
-
- gdk_window_get_frame_extents (window, &rect);
-
- if (x)
- *x = rect.x;
-
- if (y)
- *y = rect.y;
-}
-
-/**
- * gdk_window_get_frame_extents:
- * @window: a toplevel #GdkWindow
- * @rect: (out): rectangle to fill with bounding box of the window frame
- *
- * Obtains the bounding box of the window, 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
- * the frame) in root window coordinates, use gdk_window_get_origin().
- *
- **/
-void
-gdk_window_get_frame_extents (GdkWindow *window,
- GdkRectangle *rect)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_frame_extents (window, rect);
-}
-
-/**
- * gdk_window_set_accept_focus:
- * @window: a toplevel #GdkWindow
- * @accept_focus: %TRUE if the window should receive input focus
- *
- * Setting @accept_focus to %FALSE hints the desktop environment that the
- * window 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_window_set_accept_focus (GdkWindow *window,
- gboolean accept_focus)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_accept_focus (window, accept_focus);
-}
-
-/**
- * gdk_window_set_focus_on_map:
- * @window: a toplevel #GdkWindow
- * @focus_on_map: %TRUE if the window 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
- * interactively (such as popups from network activity).
- *
- * On X, it is the responsibility of the window manager to interpret
- * this hint. Window managers following the freedesktop.org window
- * manager extension specification should respect it.
- **/
-void
-gdk_window_set_focus_on_map (GdkWindow *window,
- gboolean focus_on_map)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map);
-}
-
-/**
- * gdk_window_set_icon_list:
- * @window: The #GdkWindow toplevel window 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
- * 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.
- */
-void
-gdk_window_set_icon_list (GdkWindow *window,
- GList *textures)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_icon_list (window, textures);
-}
-
-/**
- * gdk_window_set_icon_name:
- * @window: a toplevel #GdkWindow
- * @name: (allow-none): name of window while iconified (minimized)
- *
- * Windows 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.
- *
- * After calling this with a non-%NULL @name, calls to gdk_window_set_title()
- * will not update the icon title.
- *
- * Using %NULL for @name unsets the icon title; further calls to
- * gdk_window_set_title() will again update the icon title as well.
- *
- * Note that some platforms don't support window icons.
- **/
-void
-gdk_window_set_icon_name (GdkWindow *window,
- const gchar *name)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_icon_name (window, name);
-}
-
-/**
- * gdk_window_iconify:
- * @window: a toplevel #GdkWindow
- *
- * Asks to iconify (minimize) @window. 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.
- *
- **/
-void
-gdk_window_iconify (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->iconify (window);
-}
-
-/**
- * gdk_window_deiconify:
- * @window: a toplevel #GdkWindow
- *
- * Attempt to deiconify (unminimize) @window. On X11 the window manager may
- * choose to ignore the request to deiconify. When using GTK+,
- * use gtk_window_deiconify() instead of the #GdkWindow variant. Or better yet,
- * you probably want to use gtk_window_present(), which raises the window, focuses it,
- * unminimizes it, and puts it on the current desktop.
- *
- **/
-void
-gdk_window_deiconify (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->deiconify (window);
-}
-
-/**
- * gdk_window_stick:
- * @window: a toplevel #GdkWindow
- *
- * “Pins” a window 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,
- * there’s nothing you can do to force it to happen.
- *
- **/
-void
-gdk_window_stick (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->stick (window);
-}
-
-/**
- * gdk_window_unstick:
- * @window: a toplevel #GdkWindow
- *
- * Reverse operation for gdk_window_stick(); see gdk_window_stick(),
- * and gtk_window_unstick().
- *
- **/
-void
-gdk_window_unstick (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unstick (window);
-}
-
-/**
- * gdk_window_maximize:
- * @window: a toplevel #GdkWindow
- *
- * Maximizes the window. If the window was already maximized, then
- * this function does nothing.
- *
- * On X11, asks the window manager to maximize @window, 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.
- *
- **/
-void
-gdk_window_maximize (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->maximize (window);
-}
-
-/**
- * gdk_window_unmaximize:
- * @window: a toplevel #GdkWindow
- *
- * Unmaximizes the window. If the window wasn’t maximized, then this
- * function does nothing.
- *
- * On X11, asks the window manager to unmaximize @window, 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.
- *
- **/
-void
-gdk_window_unmaximize (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unmaximize (window);
-}
-
-/**
- * gdk_window_fullscreen:
- * @window: a toplevel #GdkWindow
- *
- * Moves the window into fullscreen mode. This means the
- * window covers the entire screen and is above any panels
- * or task bars.
- *
- * If the window was already fullscreen, then this function does nothing.
- *
- * On X11, asks the window manager to put @window 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
- * fullscreenification actually happening. But it will happen with
- * most standard window managers, and GDK makes a best effort to get
- * it to happen.
- **/
-void
-gdk_window_fullscreen (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen (window);
-}
-
-/**
- * gdk_window_fullscreen_on_monitor:
- * @window: a toplevel #GdkWindow
- * @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.
- *
- * If the window was already fullscreen, then this function does nothing.
- **/
-void
-gdk_window_fullscreen_on_monitor (GdkWindow *window,
- GdkMonitor *monitor)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_IS_MONITOR (monitor));
- g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_window_get_display (window));
- g_return_if_fail (gdk_monitor_is_valid (monitor));
-
- if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor != NULL)
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor (window, monitor);
- else
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen (window);
-}
-
-/**
- * gdk_window_set_fullscreen_mode:
- * @window: a toplevel #GdkWindow
- * @mode: fullscreen mode
- *
- * Specifies whether the @window 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
- * 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.
- *
- * 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
- * is specified.
- **/
-void
-gdk_window_set_fullscreen_mode (GdkWindow *window,
- GdkFullscreenMode mode)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->fullscreen_mode != mode)
- {
- window->fullscreen_mode = mode;
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- if (impl_class->apply_fullscreen_mode != NULL)
- impl_class->apply_fullscreen_mode (window);
- }
-}
-
-/**
- * gdk_window_get_fullscreen_mode:
- * @window: a toplevel #GdkWindow
- *
- * Obtains the #GdkFullscreenMode of the @window.
- *
- * Returns: The #GdkFullscreenMode applied to the window when fullscreen.
- **/
-GdkFullscreenMode
-gdk_window_get_fullscreen_mode (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
-
- return window->fullscreen_mode;
-}
-
-/**
- * gdk_window_unfullscreen:
- * @window: a toplevel #GdkWindow
- *
- * Moves the window out of fullscreen mode. If the window was not
- * fullscreen, does nothing.
- *
- * On X11, asks the window manager to move @window 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
- * unfullscreenification actually happening. But it will happen with
- * most standard window managers, and GDK makes a best effort to get
- * it to happen.
- **/
-void
-gdk_window_unfullscreen (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unfullscreen (window);
-}
-
-/**
- * gdk_window_set_keep_above:
- * @window: a toplevel #GdkWindow
- * @setting: whether to keep @window above other windows
- *
- * Set if @window must be kept above other windows. If the
- * window was already above, then this function does nothing.
- *
- * On X11, asks the window manager to keep @window 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.
- * But it will happen with most standard window managers,
- * and GDK makes a best effort to get it to happen.
- **/
-void
-gdk_window_set_keep_above (GdkWindow *window,
- gboolean setting)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_keep_above (window, setting);
-}
-
-/**
- * gdk_window_set_keep_below:
- * @window: a toplevel #GdkWindow
- * @setting: whether to keep @window below other windows
- *
- * Set if @window must be kept below other windows. If the
- * window was already below, then this function does nothing.
- *
- * On X11, asks the window manager to keep @window 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.
- * But it will happen with most standard window managers,
- * and GDK makes a best effort to get it to happen.
- **/
-void
-gdk_window_set_keep_below (GdkWindow *window, gboolean setting)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_keep_below (window, setting);
-}
-
-/**
- * gdk_window_get_group:
- * @window: a toplevel #GdkWindow
- *
- * Returns the group leader window for @window. See gdk_window_set_group().
- *
- * Returns: (transfer none): the group leader window for @window
- **/
-GdkWindow *
-gdk_window_get_group (GdkWindow *window)
-{
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_group (window);
-}
-
-/**
- * gdk_window_set_group:
- * @window: a toplevel #GdkWindow
- * @leader: (allow-none): group leader window, or %NULL to restore the default group leader window
- *
- * 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
- * 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
- * if your application pretends to be multiple applications.
- **/
-void
-gdk_window_set_group (GdkWindow *window,
- GdkWindow *leader)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_group (window, leader);
-}
-
-/**
- * gdk_window_set_decorations:
- * @window: a toplevel #GdkWindow
- * @decorations: decoration hint mask
- *
- * “Decorations” are the features the window manager adds to a toplevel #GdkWindow.
- * This function sets the traditional Motif window manager hints that tell the
- * window manager which decorations you would like your window to have.
- * Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
- * using the GDK function directly.
- *
- * The @decorations argument is the logical OR of the fields in
- * the #GdkWMDecoration enumeration. If #GDK_DECOR_ALL is included in the
- * mask, the other bits indicate which decorations should be turned off.
- * If #GDK_DECOR_ALL is not included, then the other bits indicate
- * which decorations should be turned on.
- *
- * Most window managers honor a decorations hint of 0 to disable all decorations,
- * but very few honor all possible combinations of bits.
- *
- **/
-void
-gdk_window_set_decorations (GdkWindow *window,
- GdkWMDecoration decorations)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_decorations (window, decorations);
-}
-
-/**
- * gdk_window_get_decorations:
- * @window: The toplevel #GdkWindow to get the decorations from
- * @decorations: (out): The window decorations will be written here
- *
- * Returns the decorations set on the GdkWindow with
- * gdk_window_set_decorations().
- *
- * Returns: %TRUE if the window has decorations set, %FALSE otherwise.
- **/
-gboolean
-gdk_window_get_decorations(GdkWindow *window,
- GdkWMDecoration *decorations)
-{
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_decorations (window, decorations);
-}
-
-/**
- * gdk_window_set_functions:
- * @window: a toplevel #GdkWindow
- * @functions: bitmask of operations to allow on @window
- *
- * Sets hints about the window management functions to make available
- * via buttons on the window frame.
- *
- * On the X backend, this function sets the traditional Motif window
- * manager hint for this purpose. However, few window managers do
- * anything reliable or interesting with this hint. Many ignore it
- * entirely.
- *
- * The @functions argument is the logical OR of values from the
- * #GdkWMFunction enumeration. If the bitmask includes #GDK_FUNC_ALL,
- * then the other bits indicate which functions to disable; if
- * it doesn’t include #GDK_FUNC_ALL, it indicates which functions to
- * enable.
- *
- **/
-void
-gdk_window_set_functions (GdkWindow *window,
- GdkWMFunction functions)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_functions (window, functions);
-}
-
-/**
- * gdk_window_begin_resize_drag_for_device:
- * @window: a toplevel #GdkWindow
- * @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
- * @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).
- * 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
- * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
- * but has a fallback implementation for other window managers.
- */
-void
-gdk_window_begin_resize_drag_for_device (GdkWindow *window,
- GdkWindowEdge edge,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->begin_resize_drag (window, edge, device, button, root_x, root_y, timestamp);
-}
-
-/**
- * gdk_window_begin_resize_drag:
- * @window: a toplevel #GdkWindow
- * @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).
- *
- * This function assumes that the drag is controlled by the
- * client pointer device, use gdk_window_begin_resize_drag_for_device()
- * to begin a drag with a different device.
- */
-void
-gdk_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp)
-{
- GdkDisplay *display;
- GdkDevice *device;
-
- display = gdk_window_get_display (window);
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_window_begin_resize_drag_for_device (window, edge,
- device, button, root_x, root_y, timestamp);
-}
-
-/**
- * gdk_window_begin_move_drag_for_device:
- * @window: a toplevel #GdkWindow
- * @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).
- * 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_window_begin_move_drag_for_device (GdkWindow *window,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->begin_move_drag (window,
- device, button, root_x, root_y, timestamp);
-}
-
-/**
- * gdk_window_begin_move_drag:
- * @window: a toplevel #GdkWindow
- * @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).
- *
- * This function assumes that the drag is controlled by the
- * client pointer device, use gdk_window_begin_move_drag_for_device()
- * to begin a drag with a different device.
- */
-void
-gdk_window_begin_move_drag (GdkWindow *window,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp)
-{
- GdkDisplay *display;
- GdkDevice *device;
-
- display = gdk_window_get_display (window);
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_window_begin_move_drag_for_device (window, device, button, root_x, root_y, timestamp);
-}
-
-/**
- * gdk_window_set_opacity:
- * @window: a top-level or non-native #GdkWindow
- * @opacity: opacity
- *
- * Set @window 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
- * 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_window_set_opaque_region (window, NULL)` to tell the compositor
- * that the entire window 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.
- */
-void
-gdk_window_set_opacity (GdkWindow *window,
- gdouble opacity)
-{
- if (opacity < 0)
- opacity = 0;
- else if (opacity > 1)
- opacity = 1;
-
- window->alpha = round (opacity * 255);
-
- if (window->destroyed)
- return;
-
- if (gdk_window_has_impl (window))
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_opacity (window, opacity);
- else
- {
- recompute_visible_regions (window, FALSE);
- gdk_window_invalidate_rect_full (window, NULL, TRUE);
- }
-}
-
-/* This function is called when the XWindow is really gone.
- */
-void
-gdk_window_destroy_notify (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->destroy_notify (window);
-}
-
-/**
- * gdk_window_register_dnd:
- * @window: a #GdkWindow.
- *
- * Registers a window as a potential drop destination.
- */
-void
-gdk_window_register_dnd (GdkWindow *window)
-{
- GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (window);
-}
-
-/**
- * gdk_drag_begin:
- * @window: the source window for this drag
- * @device: the device that controls this drag
- * @content: (transfer none): the offered content
- * @actions: the actions supported by this drag
- * @dx: the x offset to @device's position where the drag nominally started
- * @dy: the y offset to @device's position where the drag nominally started
- *
- * Starts a drag and creates a new drag context for it.
- *
- * This function is called by the drag source.
- *
- * Returns: (transfer full) (nullable): a newly created #GdkDragContext or
- * %NULL on error.
- */
-GdkDragContext *
-gdk_drag_begin (GdkWindow *window,
- GdkDevice *device,
- GdkContentProvider *content,
- GdkDragAction actions,
- gint dx,
- gint dy)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
- g_return_val_if_fail (gdk_window_get_display (window) == gdk_device_get_display (device), NULL);
- g_return_val_if_fail (GDK_IS_CONTENT_PROVIDER (content), NULL);
-
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->drag_begin (window, device, content, actions, dx, dy);
-}
-
-static void
-gdk_window_flush_events (GdkFrameClock *clock,
- void *data)
-{
- GdkWindow *window;
- GdkDisplay *display;
-
- window = GDK_WINDOW (data);
-
- display = gdk_window_get_display (window);
- _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;
-}
-
-static void
-gdk_window_resume_events (GdkFrameClock *clock,
- void *data)
-{
- GdkWindow *window;
- GdkDisplay *display;
-
- window = GDK_WINDOW (data);
-
- display = gdk_window_get_display (window);
- _gdk_display_unpause_events (display);
-
- window->frame_clock_events_paused = FALSE;
-}
-
-static void
-gdk_window_set_frame_clock (GdkWindow *window,
- GdkFrameClock *clock)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (clock == NULL || GDK_IS_FRAME_CLOCK (clock));
- g_return_if_fail (clock == NULL || gdk_window_is_toplevel (window));
-
- if (clock == window->frame_clock)
- return;
-
- if (clock)
- {
- g_object_ref (clock);
- g_signal_connect (G_OBJECT (clock),
- "flush-events",
- G_CALLBACK (gdk_window_flush_events),
- window);
- g_signal_connect (G_OBJECT (clock),
- "paint",
- G_CALLBACK (gdk_window_paint_on_clock),
- window);
- g_signal_connect (G_OBJECT (clock),
- "resume-events",
- G_CALLBACK (gdk_window_resume_events),
- window);
- }
-
- if (window->frame_clock)
- {
- if (window->frame_clock_events_paused)
- gdk_window_resume_events (window->frame_clock, G_OBJECT (window));
-
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
- G_CALLBACK (gdk_window_flush_events),
- window);
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
- G_CALLBACK (gdk_window_paint_on_clock),
- window);
- g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
- G_CALLBACK (gdk_window_resume_events),
- window);
- g_object_unref (window->frame_clock);
- }
-
- window->frame_clock = clock;
-}
-
-/**
- * gdk_window_get_frame_clock:
- * @window: window 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.
- *
- * Returns: (transfer none): the frame clock
- */
-GdkFrameClock*
-gdk_window_get_frame_clock (GdkWindow *window)
-{
- GdkWindow *toplevel;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- toplevel = gdk_window_get_toplevel (window);
-
- return toplevel->frame_clock;
-}
-
-/**
- * gdk_window_get_scale_factor:
- * @window: window to get scale factor for
- *
- * Returns the internal scale factor that maps from window 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).
- *
- * A higher value means that drawing is automatically scaled up to
- * a higher resolution, so any code doing drawing will automatically look
- * nicer. However, if you are supplying pixel-based data the scale
- * 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.
- *
- * Returns: the scale factor
- */
-gint
-gdk_window_get_scale_factor (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), 1);
-
- if (GDK_WINDOW_DESTROYED (window))
- return 1;
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->get_scale_factor)
- return impl_class->get_scale_factor (window);
-
- return 1;
-}
-
-/* Returns the *real* unscaled size, which may be a fractional size
- in window scale coordinates. We need this to properly handle GL
- coordinates which are y-flipped in the real coordinates. */
-void
-gdk_window_get_unscaled_size (GdkWindow *window,
- int *unscaled_width,
- int *unscaled_height)
-{
- GdkWindowImplClass *impl_class;
- gint scale;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->impl_window == window)
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->get_unscaled_size)
- {
- impl_class->get_unscaled_size (window, unscaled_width, unscaled_height);
- return;
- }
- }
-
- scale = gdk_window_get_scale_factor (window);
-
- if (unscaled_width)
- *unscaled_width = window->width * scale;
-
- if (unscaled_height)
- *unscaled_height = window->height * scale;
-}
-
-
-/**
- * gdk_window_set_opaque_region:
- * @window: a top-level or non-native #GdkWindow
- * @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
- * 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.
- *
- * 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
- * property in your #GtkWidget::style-updated handler.
- */
-void
-gdk_window_set_opaque_region (GdkWindow *window,
- cairo_region_t *region)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (!GDK_WINDOW_DESTROYED (window));
-
- if (cairo_region_equal (window->opaque_region, region))
- return;
-
- g_clear_pointer (&window->opaque_region, cairo_region_destroy);
-
- if (region != NULL)
- window->opaque_region = cairo_region_reference (region);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->set_opaque_region)
- impl_class->set_opaque_region (window, region);
-}
-
-/**
- * gdk_window_set_shadow_width:
- * @window: a #GdkWindow
- * @left: The left extent
- * @right: The right extent
- * @top: The top extent
- * @bottom: The bottom extent
- *
- * Newer GTK+ windows using client-side decorations use extra geometry
- * around their frames for effects like shadows and invisible borders.
- * Window managers that want to maximize windows or snap to edges need
- * to know where the extents of the actual frame lie, so that users
- * don’t feel like windows are snapping against random invisible edges.
- *
- * 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.
- */
-void
-gdk_window_set_shadow_width (GdkWindow *window,
- gint left,
- gint right,
- gint top,
- gint bottom)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (!GDK_WINDOW_DESTROYED (window));
- 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;
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->set_shadow_width)
- impl_class->set_shadow_width (window, left, right, top, bottom);
-}
-
-/**
- * gdk_window_show_window_menu:
- * @window: a #GdkWindow
- * @event: a #GdkEvent to show the menu for
- *
- * Asks the windowing system to show the window menu. The window menu
- * is the menu shown when right-clicking the titlebar on traditional
- * windows managed by the window manager. This is useful for windows
- * using client-side decorations, activating it with a right-click
- * on the window decorations.
- *
- * Returns: %TRUE if the window menu was shown and %FALSE otherwise.
- */
-gboolean
-gdk_window_show_window_menu (GdkWindow *window,
- GdkEvent *event)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), FALSE);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->show_window_menu)
- return impl_class->show_window_menu (window, event);
- else
- return FALSE;
-}
-
-gboolean
-gdk_window_supports_edge_constraints (GdkWindow *window)
-{
- GdkWindowImplClass *impl_class;
-
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), FALSE);
-
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-
- if (impl_class->supports_edge_constraints)
- return impl_class->supports_edge_constraints (window);
- else
- return FALSE;
-}
-
-void
-gdk_window_set_state (GdkWindow *window,
- GdkWindowState new_state)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (new_state == window->state)
- return; /* No actual work to do, nothing changed. */
-
- /* Actually update the field in GdkWindow, this is sort of an odd
- * place to do it, but seems like the safest since it ensures we expose no
- * inconsistent state to the user.
- */
-
- window->state = new_state;
-
- _gdk_window_update_viewable (window);
-
- /* We only really send the event to toplevels, since
- * all the window states don't apply to non-toplevels.
- * Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag
- * internally so we needed to update window->state.
- */
- switch (window->window_type)
- {
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP: /* ? */
- g_object_notify (G_OBJECT (window), "state");
- break;
- case GDK_WINDOW_FOREIGN:
- case GDK_WINDOW_ROOT:
- case GDK_WINDOW_CHILD:
- default:
- break;
- }
-}
-
-void
-gdk_synthesize_window_state (GdkWindow *window,
- GdkWindowState unset_flags,
- GdkWindowState set_flags)
-{
- gdk_window_set_state (window, (window->state | set_flags) & ~unset_flags);
-}
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
deleted file mode 100644
index 2185b6aedc..0000000000
--- a/gdk/gdkwindowimpl.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GDK_WINDOW_IMPL_H__
-#define __GDK_WINDOW_IMPL_H__
-
-#include <gdk/gdkwindow.h>
-#include <gdk/gdkproperty.h>
-
-G_BEGIN_DECLS
-
-#define GDK_TYPE_WINDOW_IMPL (gdk_window_impl_get_type ())
-#define GDK_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl))
-#define GDK_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
-#define GDK_IS_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL))
-#define GDK_IS_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL))
-#define GDK_WINDOW_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
-
-typedef struct _GdkWindowImpl GdkWindowImpl;
-typedef struct _GdkWindowImplClass GdkWindowImplClass;
-
-struct _GdkWindowImpl
-{
- GObject parent;
-};
-
-struct _GdkWindowImplClass
-{
- GObjectClass parent_class;
-
- cairo_surface_t *
- (* ref_cairo_surface) (GdkWindow *window);
- cairo_surface_t *
- (* create_similar_image_surface) (GdkWindow * window,
- cairo_format_t format,
- int width,
- int height);
-
- void (* show) (GdkWindow *window,
- gboolean already_mapped);
- void (* hide) (GdkWindow *window);
- void (* withdraw) (GdkWindow *window);
- void (* raise) (GdkWindow *window);
- void (* lower) (GdkWindow *window);
- void (* restack_toplevel) (GdkWindow *window,
- GdkWindow *sibling,
- gboolean above);
-
- void (* move_resize) (GdkWindow *window,
- gboolean with_move,
- gint x,
- gint y,
- gint width,
- gint height);
- void (* move_to_rect) (GdkWindow *window,
- const GdkRectangle *rect,
- GdkGravity rect_anchor,
- GdkGravity window_anchor,
- GdkAnchorHints anchor_hints,
- gint rect_anchor_dx,
- gint rect_anchor_dy);
-
- GdkEventMask (* get_events) (GdkWindow *window);
- void (* set_events) (GdkWindow *window,
- GdkEventMask event_mask);
-
- void (* get_geometry) (GdkWindow *window,
- gint *x,
- gint *y,
- gint *width,
- gint *height);
- void (* get_root_coords) (GdkWindow *window,
- gint x,
- gint y,
- gint *root_x,
- gint *root_y);
- gboolean (* get_device_state) (GdkWindow *window,
- GdkDevice *device,
- gdouble *x,
- gdouble *y,
- GdkModifierType *mask);
- gboolean (* begin_paint) (GdkWindow *window);
- void (* end_paint) (GdkWindow *window);
-
- void (* shape_combine_region) (GdkWindow *window,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y);
- void (* input_shape_combine_region) (GdkWindow *window,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y);
-
- /* Called before processing updates for a window. This gives the windowing
- * layer a chance to save the region for later use in avoiding duplicate
- * exposes.
- */
- void (* queue_antiexpose) (GdkWindow *window,
- cairo_region_t *update_area);
-
-/* Called to do the windowing system specific part of gdk_window_destroy(),
- *
- * window: 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
- * 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
- * windowing system calls should be made. (This may never happen
- * for some windowing systems.)
- */
- void (* destroy) (GdkWindow *window,
- gboolean recursing,
- gboolean foreign_destroy);
-
-
- /* optional */
- gboolean (* beep) (GdkWindow *window);
-
- void (* focus) (GdkWindow *window,
- guint32 timestamp);
- void (* set_type_hint) (GdkWindow *window,
- GdkWindowTypeHint hint);
- GdkWindowTypeHint (* get_type_hint) (GdkWindow *window);
- void (* set_modal_hint) (GdkWindow *window,
- gboolean modal);
- void (* set_skip_taskbar_hint) (GdkWindow *window,
- gboolean skips_taskbar);
- void (* set_skip_pager_hint) (GdkWindow *window,
- gboolean skips_pager);
- void (* set_urgency_hint) (GdkWindow *window,
- gboolean urgent);
- void (* set_geometry_hints) (GdkWindow *window,
- const GdkGeometry *geometry,
- GdkWindowHints geom_mask);
- void (* set_title) (GdkWindow *window,
- const gchar *title);
- void (* set_role) (GdkWindow *window,
- const gchar *role);
- void (* set_startup_id) (GdkWindow *window,
- const gchar *startup_id);
- void (* set_transient_for) (GdkWindow *window,
- GdkWindow *parent);
- void (* get_frame_extents) (GdkWindow *window,
- GdkRectangle *rect);
- void (* set_accept_focus) (GdkWindow *window,
- gboolean accept_focus);
- void (* set_focus_on_map) (GdkWindow *window,
- gboolean focus_on_map);
- void (* set_icon_list) (GdkWindow *window,
- GList *pixbufs);
- void (* set_icon_name) (GdkWindow *window,
- const gchar *name);
- void (* iconify) (GdkWindow *window);
- void (* deiconify) (GdkWindow *window);
- void (* stick) (GdkWindow *window);
- void (* unstick) (GdkWindow *window);
- void (* maximize) (GdkWindow *window);
- void (* unmaximize) (GdkWindow *window);
- void (* fullscreen) (GdkWindow *window);
- void (* fullscreen_on_monitor) (GdkWindow *window,
- GdkMonitor *monitor);
- void (* apply_fullscreen_mode) (GdkWindow *window);
- void (* unfullscreen) (GdkWindow *window);
- void (* set_keep_above) (GdkWindow *window,
- gboolean setting);
- void (* set_keep_below) (GdkWindow *window,
- gboolean setting);
- GdkWindow * (* get_group) (GdkWindow *window);
- void (* set_group) (GdkWindow *window,
- GdkWindow *leader);
- void (* set_decorations) (GdkWindow *window,
- GdkWMDecoration decorations);
- gboolean (* get_decorations) (GdkWindow *window,
- GdkWMDecoration *decorations);
- void (* set_functions) (GdkWindow *window,
- GdkWMFunction functions);
- void (* begin_resize_drag) (GdkWindow *window,
- GdkWindowEdge edge,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
- void (* begin_move_drag) (GdkWindow *window,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
- void (* enable_synchronized_configure) (GdkWindow *window);
- void (* configure_finished) (GdkWindow *window);
- void (* set_opacity) (GdkWindow *window,
- gdouble opacity);
- void (* destroy_notify) (GdkWindow *window);
- void (* register_dnd) (GdkWindow *window);
- GdkDragContext * (*drag_begin) (GdkWindow *window,
- GdkDevice *device,
- GdkContentProvider*content,
- GdkDragAction actions,
- gint dx,
- gint dy);
-
- void (*process_updates_recurse) (GdkWindow *window,
- cairo_region_t *region);
-
- gint (* get_scale_factor) (GdkWindow *window);
- void (* get_unscaled_size) (GdkWindow *window,
- int *unscaled_width,
- int *unscaled_height);
-
- void (* set_opaque_region) (GdkWindow *window,
- cairo_region_t *region);
- void (* set_shadow_width) (GdkWindow *window,
- gint left,
- gint right,
- gint top,
- gint bottom);
- gboolean (* show_window_menu) (GdkWindow *window,
- GdkEvent *event);
- GdkGLContext *(*create_gl_context) (GdkWindow *window,
- gboolean attached,
- GdkGLContext *share,
- GError **error);
- gboolean (* supports_edge_constraints)(GdkWindow *window);
-};
-
-/* Interface Functions */
-GType gdk_window_impl_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif /* __GDK_WINDOW_IMPL_H__ */
diff --git a/gdk/meson.build b/gdk/meson.build
index 8f69e1ca24..d562d6c84f 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -42,8 +42,8 @@ gdk_public_sources = files([
'gdksnapshot.c',
'gdktexture.c',
'gdkvulkancontext.c',
- 'gdkwindow.c',
- 'gdkwindowimpl.c',
+ 'gdksurface.c',
+ 'gdksurfaceimpl.c',
])
gdk_public_headers = files([
@@ -86,7 +86,7 @@ gdk_public_headers = files([
'gdktexture.h',
'gdktypes.h',
'gdkvulkancontext.h',
- 'gdkwindow.h',
+ 'gdksurface.h',
])
install_headers(gdk_public_headers, subdir: 'gtk-4.0/gdk/')
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index c5296b12ea..f5359d8318 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -1,4 +1,4 @@
-/* GdkQuartzWindow.m
+/* GdkQuartzSurface.m
*
* Copyright (C) 2005-2007 Imendio AB
*
@@ -18,7 +18,7 @@
#include "config.h"
#import "GdkQuartzNSWindow.h"
-#include "gdkquartzwindow.h"
+#include "gdkquartzsurface.h"
#include "gdkdnd-quartz.h"
#include "gdkprivate-quartz.h"
@@ -34,12 +34,12 @@
-(BOOL)windowShouldClose:(id)sender
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event;
event = gdk_event_new (GDK_DELETE);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
event->any.send_event = FALSE;
_gdk_event_queue_append (gdk_display_get_default (), event);
@@ -49,47 +49,47 @@
-(void)windowWillMiniaturize:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
- _gdk_quartz_window_detach_from_parent (window);
+ _gdk_quartz_surface_detach_from_parent (window);
}
-(void)windowDidMiniaturize:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
- gdk_synthesize_window_state (window, 0,
- GDK_WINDOW_STATE_ICONIFIED);
+ gdk_synthesize_surface_state (window, 0,
+ GDK_SURFACE_STATE_ICONIFIED);
}
-(void)windowDidDeminiaturize:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
- _gdk_quartz_window_attach_to_parent (window);
+ _gdk_quartz_surface_attach_to_parent (window);
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0);
}
-(void)windowDidBecomeKey:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED);
_gdk_quartz_events_update_focus_window (window, TRUE);
}
-(void)windowDidResignKey:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
_gdk_quartz_events_update_focus_window (window, FALSE);
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0);
}
-(void)windowDidBecomeMain:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
if (![self isVisible])
{
@@ -101,15 +101,15 @@
return;
}
- _gdk_quartz_window_did_become_main (window);
+ _gdk_quartz_surface_did_become_main (window);
}
-(void)windowDidResignMain:(NSNotification *)aNotification
{
- GdkWindow *window;
+ GdkSurface *window;
window = [[self contentView] gdkWindow];
- _gdk_quartz_window_did_resign_main (window);
+ _gdk_quartz_surface_did_resign_main (window);
}
/* Used in combination with NSLeftMouseUp in sendEvent to keep track
@@ -154,8 +154,8 @@
-(void)checkSendEnterNotify
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
/* When a new window has been created, and the mouse
* is in the window area, we will not receive an NSMouseEntered
@@ -186,21 +186,21 @@
-(void)windowDidMove:(NSNotification *)aNotification
{
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event;
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
/* In case the window is changed when maximized remove the maximized state */
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
{
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_MAXIMIZED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_MAXIMIZED,
0);
}
- _gdk_quartz_window_update_position (window);
+ _gdk_quartz_surface_update_position (window);
/* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE);
@@ -218,16 +218,16 @@
-(void)windowDidResize:(NSNotification *)aNotification
{
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
- GdkWindow *window = [[self contentView] gdkWindow];
+ GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event;
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
/* see same in windowDidMove */
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
{
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_MAXIMIZED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_MAXIMIZED,
0);
}
@@ -237,11 +237,11 @@
/* Certain resize operations (e.g. going fullscreen), also move the
* origin of the window.
*/
- _gdk_quartz_window_update_position (window);
+ _gdk_quartz_surface_update_position (window);
[[self contentView] setFrame:NSMakeRect (0, 0, window->width, window->height)];
- _gdk_window_update_size (window);
+ _gdk_surface_update_size (window);
/* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE);
@@ -273,27 +273,27 @@
-(BOOL)canBecomeMainWindow
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
switch (impl->type_hint)
{
- case GDK_WINDOW_TYPE_HINT_NORMAL:
- case GDK_WINDOW_TYPE_HINT_DIALOG:
+ case GDK_SURFACE_TYPE_HINT_NORMAL:
+ case GDK_SURFACE_TYPE_HINT_DIALOG:
return YES;
- case GDK_WINDOW_TYPE_HINT_MENU:
- case GDK_WINDOW_TYPE_HINT_TOOLBAR:
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- case GDK_WINDOW_TYPE_HINT_DOCK:
- case GDK_WINDOW_TYPE_HINT_DESKTOP:
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
- case GDK_WINDOW_TYPE_HINT_COMBO:
- case GDK_WINDOW_TYPE_HINT_DND:
+ case GDK_SURFACE_TYPE_HINT_MENU:
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR:
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_DESKTOP:
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_DND:
return NO;
}
@@ -302,8 +302,8 @@
-(BOOL)canBecomeKeyWindow
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!window->accept_focus)
return NO;
@@ -311,27 +311,27 @@
/* Popup windows should not be able to get focused in the window
* manager sense, it's only handled through grabs.
*/
- if (window->window_type == GDK_WINDOW_TEMP)
+ if (window->surface_type == GDK_SURFACE_TEMP)
return NO;
switch (impl->type_hint)
{
- case GDK_WINDOW_TYPE_HINT_NORMAL:
- case GDK_WINDOW_TYPE_HINT_DIALOG:
- case GDK_WINDOW_TYPE_HINT_MENU:
- case GDK_WINDOW_TYPE_HINT_TOOLBAR:
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- case GDK_WINDOW_TYPE_HINT_DOCK:
- case GDK_WINDOW_TYPE_HINT_DESKTOP:
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_NORMAL:
+ case GDK_SURFACE_TYPE_HINT_DIALOG:
+ case GDK_SURFACE_TYPE_HINT_MENU:
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_DESKTOP:
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
return YES;
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
- case GDK_WINDOW_TYPE_HINT_DND:
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_DND:
return NO;
}
@@ -340,8 +340,8 @@
- (void)showAndMakeKey:(BOOL)makeKey
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
inShowOrHide = YES;
@@ -357,8 +357,8 @@
- (void)hide
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
inShowOrHide = YES;
[impl->toplevel orderOut:nil];
@@ -369,8 +369,8 @@
- (BOOL)trackManualMove
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
NSPoint currentLocation;
NSPoint newOrigin;
NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
@@ -435,28 +435,28 @@
* height and position.
*/
dw = dh = dx = dy = 0.0;
- if (resizeEdge == GDK_WINDOW_EDGE_EAST ||
- resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST ||
- resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST)
+ if (resizeEdge == GDK_SURFACE_EDGE_EAST ||
+ resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST ||
+ resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST)
{
dw = -1.0;
}
- if (resizeEdge == GDK_WINDOW_EDGE_NORTH ||
- resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST ||
- resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST)
+ if (resizeEdge == GDK_SURFACE_EDGE_NORTH ||
+ resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST ||
+ resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST)
{
dh = -1.0;
}
- if (resizeEdge == GDK_WINDOW_EDGE_SOUTH ||
- resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST ||
- resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST)
+ if (resizeEdge == GDK_SURFACE_EDGE_SOUTH ||
+ resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST ||
+ resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST)
{
dh = 1.0;
dy = -1.0;
}
- if (resizeEdge == GDK_WINDOW_EDGE_WEST ||
- resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST ||
- resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST)
+ if (resizeEdge == GDK_SURFACE_EDGE_WEST ||
+ resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST ||
+ resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST)
{
dw = 1.0;
dx = -1.0;
@@ -503,7 +503,7 @@
return YES;
}
--(void)beginManualResize:(GdkWindowEdge)edge
+-(void)beginManualResize:(GdkSurfaceEdge)edge
{
if (inMove || inManualMove || inManualResize)
return;
@@ -579,7 +579,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
GdkEvent *event;
- GdkWindow *window;
+ GdkSurface *window;
if (current_context)
g_object_unref (current_context);
@@ -589,7 +589,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
window = [[self contentView] gdkWindow];
- current_context->display = gdk_window_get_display (window);
+ current_context->display = gdk_surface_get_display (window);
gdk_drag_context_set_device (current_context,
gdk_seat_get_pointer (gdk_display_get_default_seat (current_context->display)));
@@ -650,7 +650,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
int gx, gy;
update_context_from_dragging_info (sender);
- _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gx, &gy);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy);
event = gdk_event_new (GDK_DRAG_MOTION);
event->dnd.window = g_object_ref ([[self contentView] gdkWindow]);
@@ -678,7 +678,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
int gy, gx;
update_context_from_dragging_info (sender);
- _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gx, &gy);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy);
event = gdk_event_new (GDK_DROP_START);
event->dnd.window = g_object_ref ([[self contentView] gdkWindow]);
@@ -719,30 +719,30 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.send_event = FALSE;
event->dnd.context = g_object_ref (_gdk_quartz_drag_source_context);
- display = gdk_window_get_display (event->dnd.window);
+ display = gdk_surface_get_display (event->dnd.window);
if (display)
{
GList* windows, *list;
gint gx, gy;
- event->dnd.context->dest_window = NULL;
+ event->dnd.context->dest_surface = NULL;
windows = get_toplevels ();
- _gdk_quartz_window_nspoint_to_gdk_xy (aPoint, &gx, &gy);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (aPoint, &gx, &gy);
for (list = windows; list; list = list->next)
{
- GdkWindow* win = (GdkWindow*) list->data;
+ GdkSurface* win = (GdkSurface*) list->data;
gint wx, wy;
gint ww, wh;
- gdk_window_get_root_origin (win, &wx, &wy);
- ww = gdk_window_get_width (win);
- wh = gdk_window_get_height (win);
+ gdk_surface_get_root_origin (win, &wx, &wy);
+ ww = gdk_surface_get_width (win);
+ wh = gdk_surface_get_height (win);
if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh)
- event->dnd.context->dest_window = win;
+ event->dnd.context->dest_surface = win;
}
}
@@ -772,7 +772,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
is_fullscreen = (([self styleMask] & NSFullScreenWindowMask) != 0);
if (was_fullscreen != is_fullscreen)
- _gdk_quartz_window_update_fullscreen_state ([[self contentView] gdkWindow]);
+ _gdk_quartz_surface_update_fullscreen_state ([[self contentView] gdkWindow]);
}
#endif
@@ -780,8 +780,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{
NSRect rect;
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
/* Allow the window to move up "shadow_top" more than normally allowed
* by the default impl. This makes it possible to move windows with
@@ -797,9 +797,9 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
defaultFrame:(NSRect)newFrame
{
NSRect screenFrame = [[self screen] visibleFrame];
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
if (!maximized)
return screenFrame;
@@ -811,23 +811,23 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
toFrame:(NSRect)newFrame
{
- GdkWindow *window = [[self contentView] gdkWindow];
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ GdkSurface *window = [[self contentView] gdkWindow];
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
if (maximized)
{
lastMaximizedFrame = newFrame;
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_MAXIMIZED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_MAXIMIZED,
0);
}
else
{
lastUnmaximizedFrame = [nsWindow frame];
- gdk_synthesize_window_state (window,
+ gdk_synthesize_surface_state (window,
0,
- GDK_WINDOW_STATE_MAXIMIZED);
+ GDK_SURFACE_STATE_MAXIMIZED);
}
inMaximizeTransition = YES;
diff --git a/gdk/quartz/GdkQuartzNSWindow.h b/gdk/quartz/GdkQuartzNSWindow.h
index b8edf43e69..2bf8b65d03 100644
--- a/gdk/quartz/GdkQuartzNSWindow.h
+++ b/gdk/quartz/GdkQuartzNSWindow.h
@@ -33,7 +33,7 @@
NSPoint initialMoveLocation;
NSPoint initialResizeLocation;
NSRect initialResizeFrame;
- GdkWindowEdge resizeEdge;
+ GdkSurfaceEdge resizeEdge;
NSRect lastUnmaximizedFrame;
NSRect lastMaximizedFrame;
@@ -45,7 +45,7 @@
-(void)beginManualMove;
-(BOOL)trackManualMove;
-(BOOL)isInManualResizeOrMove;
--(void)beginManualResize:(GdkWindowEdge)edge;
+-(void)beginManualResize:(GdkSurfaceEdge)edge;
-(BOOL)trackManualResize;
-(void)showAndMakeKey:(BOOL)makeKey;
-(void)hide;
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 6a20cd06d7..39d3821406 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -19,7 +19,7 @@
#include "config.h"
#import "GdkQuartzView.h"
-#include "gdkquartzwindow.h"
+#include "gdkquartzsurface.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz.h"
@@ -76,10 +76,10 @@
gint ns_x, ns_y;
GdkRectangle *rect;
- rect = g_object_get_data (G_OBJECT (gdk_window), GIC_CURSOR_RECT);
+ rect = g_object_get_data (G_OBJECT (gdk_surface), GIC_CURSOR_RECT);
if (rect)
{
- _gdk_quartz_window_gdk_xy_to_xy (rect->x, rect->y + rect->height,
+ _gdk_quartz_surface_gdk_xy_to_xy (rect->x, rect->y + rect->height,
&ns_x, &ns_y);
return NSMakeRect (ns_x, ns_y, rect->width, rect->height);
@@ -126,7 +126,7 @@
gchar *prev_str;
markedRange = selectedRange = NSMakeRange (NSNotFound, 0);
- g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, NULL, g_free);
+ g_object_set_data_full (G_OBJECT (gdk_surface), TIC_MARKED_TEXT, NULL, g_free);
}
-(void)setMarkedText: (id)aString selectedRange: (NSRange)newSelection replacementRange: (NSRange)replacementRange
@@ -153,21 +153,21 @@
str = [aString UTF8String];
}
- g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, g_strdup (str), g_free);
- g_object_set_data (G_OBJECT (gdk_window), TIC_SELECTED_POS,
+ g_object_set_data_full (G_OBJECT (gdk_surface), TIC_MARKED_TEXT, g_strdup (str), g_free);
+ g_object_set_data (G_OBJECT (gdk_surface), TIC_SELECTED_POS,
GUINT_TO_POINTER (selectedRange.location));
- g_object_set_data (G_OBJECT (gdk_window), TIC_SELECTED_LEN,
+ g_object_set_data (G_OBJECT (gdk_surface), TIC_SELECTED_LEN,
GUINT_TO_POINTER (selectedRange.length));
GDK_NOTE (EVENTS, g_message ("setMarkedText: set %s (%p, nsview %p): %s",
- TIC_MARKED_TEXT, gdk_window, self,
+ TIC_MARKED_TEXT, gdk_surface, self,
str ? str : "(empty)"));
/* handle text input changes by mouse events */
- if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_window),
+ if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_surface),
TIC_IN_KEY_DOWN)))
{
- _gdk_quartz_synthesize_null_key_event(gdk_window);
+ _gdk_quartz_synthesize_null_key_event(gdk_surface);
}
}
@@ -209,326 +209,326 @@
str = [string UTF8String];
}
- g_object_set_data_full (G_OBJECT (gdk_window), TIC_INSERT_TEXT, g_strdup (str), g_free);
+ g_object_set_data_full (G_OBJECT (gdk_surface), TIC_INSERT_TEXT, g_strdup (str), g_free);
GDK_NOTE (EVENTS, g_message ("insertText: set %s (%p, nsview %p): %s",
- TIC_INSERT_TEXT, gdk_window, self,
+ TIC_INSERT_TEXT, gdk_surface, self,
str ? str : "(empty)"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_FILTERED));
/* handle text input changes by mouse events */
- if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_window),
+ if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_surface),
TIC_IN_KEY_DOWN)))
{
- _gdk_quartz_synthesize_null_key_event(gdk_window);
+ _gdk_quartz_synthesize_null_key_event(gdk_surface);
}
}
-(void)deleteBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteBackward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteForward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordBackward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordForward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertBacktab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertBacktab"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertNewline: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertNewline"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertTab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertTab"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDown"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeft"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRight"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLine"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUp"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForward"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeft"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRight"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDown"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUp"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectAll: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectAll"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectLine"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectWord: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectWord"));
- g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+ g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
@@ -550,14 +550,14 @@
[super dealloc];
}
--(void)setGdkWindow: (GdkWindow *)window
+-(void)setGdkSurface: (GdkSurface *)window
{
- gdk_window = window;
+ gdk_surface = window;
}
--(GdkWindow *)gdkWindow
+-(GdkSurface *)gdkWindow
{
- return gdk_window;
+ return gdk_surface;
}
-(NSTrackingRectTag)trackingRect
@@ -572,7 +572,7 @@
-(BOOL)isOpaque
{
- if (GDK_WINDOW_DESTROYED (gdk_window))
+ if (GDK_SURFACE_DESTROYED (gdk_surface))
return YES;
return NO;
@@ -581,13 +581,13 @@
-(void)drawRect: (NSRect)rect
{
GdkRectangle gdk_rect;
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (gdk_window->impl);
const NSRect *drawn_rects;
NSInteger count;
int i;
cairo_region_t *region;
- if (GDK_WINDOW_DESTROYED (gdk_window))
+ if (GDK_SURFACE_DESTROYED (gdk_surface))
return;
if (! (gdk_window->event_mask & GDK_EXPOSURE_MASK))
@@ -596,7 +596,7 @@
if (NSEqualRects (rect, NSZeroRect))
return;
- if (!GDK_WINDOW_IS_MAPPED (gdk_window))
+ if (!GDK_SURFACE_IS_MAPPED (gdk_surface))
{
/* If the window is not yet mapped, clip_region_with_children
* will be empty causing the usual code below to draw nothing.
@@ -636,7 +636,7 @@
}
impl->in_paint_rect_count++;
- _gdk_window_process_updates_recurse (gdk_window, region);
+ _gdk_surface_process_updates_recurse (gdk_surface, region);
impl->in_paint_rect_count--;
cairo_region_destroy (region);
@@ -658,7 +658,7 @@
*/
-(void)updateTrackingRect
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (gdk_window->impl);
NSRect rect;
if (!impl || !impl->toplevel)
diff --git a/gdk/quartz/GdkQuartzView.h b/gdk/quartz/GdkQuartzView.h
index 732c677ee5..01045dc613 100644
--- a/gdk/quartz/GdkQuartzView.h
+++ b/gdk/quartz/GdkQuartzView.h
@@ -34,15 +34,15 @@
@interface GdkQuartzView : NSView <NSTextInputClient>
{
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
NSTrackingRectTag trackingRect;
BOOL needsInvalidateShadow;
NSRange markedRange;
NSRange selectedRange;
}
-- (void)setGdkWindow: (GdkWindow *)window;
-- (GdkWindow *)gdkWindow;
+- (void)setGdkSurface: (GdkSurface *)window;
+- (GdkSurface *)gdkWindow;
- (NSTrackingRectTag)trackingRect;
- (void)setNeedsInvalidateShadow: (BOOL)invalidate;
diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c
index e31ad6de86..bc1ef6f6c5 100644
--- a/gdk/quartz/gdkdevice-core-quartz.c
+++ b/gdk/quartz/gdkdevice-core-quartz.c
@@ -22,7 +22,7 @@
#include <gdk/gdkdisplayprivate.h>
#import "GdkQuartzView.h"
-#include "gdkquartzwindow.h"
+#include "gdkquartzsurface.h"
#include "gdkquartzcursor.h"
#include "gdkprivate-quartz.h"
#include "gdkquartzdevice-core.h"
@@ -38,46 +38,46 @@ struct _GdkQuartzDeviceCoreClass
};
static gboolean gdk_quartz_device_core_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_quartz_device_core_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask);
-static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+static void gdk_quartz_device_core_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor);
static void gdk_quartz_device_core_warp (GdkDevice *device,
gdouble x,
gdouble y);
static void gdk_quartz_device_core_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **root_window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **root_window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_quartz_device_core_ungrab (GdkDevice *device,
guint32 time_);
-static GdkWindow * gdk_quartz_device_core_window_at_position (GdkDevice *device,
+static GdkSurface * gdk_quartz_device_core_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
-static void gdk_quartz_device_core_select_window_events (GdkDevice *device,
- GdkWindow *window,
+static void gdk_quartz_device_core_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask);
@@ -90,13 +90,13 @@ gdk_quartz_device_core_class_init (GdkQuartzDeviceCoreClass *klass)
device_class->get_history = gdk_quartz_device_core_get_history;
device_class->get_state = gdk_quartz_device_core_get_state;
- device_class->set_window_cursor = gdk_quartz_device_core_set_window_cursor;
+ device_class->set_surface_cursor = gdk_quartz_device_core_set_surface_cursor;
device_class->warp = gdk_quartz_device_core_warp;
device_class->query_state = gdk_quartz_device_core_query_state;
device_class->grab = gdk_quartz_device_core_grab;
device_class->ungrab = gdk_quartz_device_core_ungrab;
- device_class->window_at_position = gdk_quartz_device_core_window_at_position;
- device_class->select_window_events = gdk_quartz_device_core_select_window_events;
+ device_class->surface_at_position = gdk_quartz_device_core_surface_at_position;
+ device_class->select_surface_events = gdk_quartz_device_core_select_surface_events;
}
static void
@@ -112,7 +112,7 @@ gdk_quartz_device_core_init (GdkQuartzDeviceCore *quartz_device_core)
static gboolean
gdk_quartz_device_core_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -123,13 +123,13 @@ gdk_quartz_device_core_get_history (GdkDevice *device,
static void
gdk_quartz_device_core_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x_pos, y_pos;
- gdk_window_get_device_position_double (window, device, &x_pos, &y_pos, mask);
+ gdk_surface_get_device_position_double (window, device, &x_pos, &y_pos, mask);
if (axes)
{
@@ -139,12 +139,12 @@ gdk_quartz_device_core_get_state (GdkDevice *device,
}
static void
-translate_coords_to_child_coords (GdkWindow *parent,
- GdkWindow *child,
+translate_coords_to_child_coords (GdkSurface *parent,
+ GdkSurface *child,
gint *x,
gint *y)
{
- GdkWindow *current = child;
+ GdkSurface *current = child;
if (child == parent)
return;
@@ -153,23 +153,23 @@ translate_coords_to_child_coords (GdkWindow *parent,
{
gint tmp_x, tmp_y;
- gdk_window_get_origin (current, &tmp_x, &tmp_y);
+ gdk_surface_get_origin (current, &tmp_x, &tmp_y);
*x -= tmp_x;
*y -= tmp_y;
- current = gdk_window_get_parent (current);
+ current = gdk_surface_get_parent (current);
}
}
static void
-gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_quartz_device_core_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor)
{
NSCursor *nscursor;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
nscursor = _gdk_quartz_cursor_get_ns_cursor (cursor);
@@ -185,21 +185,21 @@ gdk_quartz_device_core_warp (GdkDevice *device,
CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y));
}
-static GdkWindow *
-gdk_quartz_device_core_query_state_helper (GdkWindow *window,
+static GdkSurface *
+gdk_quartz_device_core_query_state_helper (GdkSurface *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
NSPoint point;
gint x_tmp, y_tmp;
- GdkWindow *found_window;
+ GdkSurface *found_window;
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
{
*x = 0;
*y = 0;
@@ -207,7 +207,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
return NULL;
}
- toplevel = gdk_window_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (window);
if (mask)
*mask = _gdk_quartz_events_get_current_keyboard_modifiers () |
@@ -217,14 +217,14 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
if (window == _gdk_root)
{
point = [NSEvent mouseLocation];
- _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
}
else
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
NSWindow *nswindow;
- impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl);
nswindow = impl->toplevel;
point = [nswindow mouseLocationOutsideOfEventStream];
@@ -235,7 +235,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
window = toplevel;
}
- found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp,
+ found_window = _gdk_quartz_surface_find_child (window, x_tmp, y_tmp,
FALSE);
if (found_window == _gdk_root)
@@ -255,15 +255,15 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
static void
gdk_quartz_device_core_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask)
{
- GdkWindow *found_window;
+ GdkSurface *found_window;
NSPoint point;
gint x_tmp, y_tmp;
@@ -281,7 +281,7 @@ gdk_quartz_device_core_query_state (GdkDevice *device,
*child_window = found_window;
point = [NSEvent mouseLocation];
- _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
if (root_x)
*root_x = x_tmp;
@@ -292,10 +292,10 @@ gdk_quartz_device_core_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_quartz_device_core_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -316,22 +316,22 @@ gdk_quartz_device_core_ungrab (GdkDevice *device,
_gdk_display_device_grab_update (_gdk_display, device, NULL, 0);
}
-static GdkWindow *
-gdk_quartz_device_core_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_quartz_device_core_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- GdkWindow *found_window;
+ GdkSurface *found_window;
NSPoint point;
gint x_tmp, y_tmp;
/* Get mouse coordinates, find window under the mouse pointer */
point = [NSEvent mouseLocation];
- _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
- found_window = _gdk_quartz_window_find_child (_gdk_root, x_tmp, y_tmp, get_toplevel);
+ found_window = _gdk_quartz_surface_find_child (_gdk_root, x_tmp, y_tmp, get_toplevel);
if (found_window)
translate_coords_to_child_coords (_gdk_root, found_window, &x_tmp, &y_tmp);
@@ -350,8 +350,8 @@ gdk_quartz_device_core_window_at_position (GdkDevice *device,
}
static void
-gdk_quartz_device_core_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_quartz_device_core_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask)
{
/* The mask is set in the common code. */
diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
index 2f96ab20cd..dc933f9106 100644
--- a/gdk/quartz/gdkdisplay-quartz.c
+++ b/gdk/quartz/gdkdisplay-quartz.c
@@ -23,14 +23,14 @@
#include "gdkprivate-quartz.h"
#include "gdkquartzscreen.h"
-#include "gdkquartzwindow.h"
+#include "gdkquartzsurface.h"
#include "gdkquartzdisplay.h"
#include "gdkquartzdevicemanager-core.h"
#include "gdkmonitorprivate.h"
#include "gdkdisplay-quartz.h"
-static GdkWindow *
+static GdkSurface *
gdk_quartz_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@@ -62,7 +62,7 @@ _gdk_quartz_display_open (const gchar *display_name)
_gdk_screen = g_object_new (gdk_quartz_screen_get_type (), NULL);
- _gdk_quartz_window_init_windowing (_gdk_display);
+ _gdk_quartz_surface_init_windowing (_gdk_display);
_gdk_quartz_events_init ();
@@ -215,7 +215,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
object_class->finalize = gdk_quartz_display_finalize;
object_class->dispose = gdk_quartz_display_dispose;
- display_class->window_type = GDK_TYPE_QUARTZ_WINDOW;
+ display_class->surface_type = GDK_TYPE_QUARTZ_SURFACE;
display_class->get_name = gdk_quartz_display_get_name;
display_class->beep = gdk_quartz_display_beep;
@@ -235,7 +235,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
display_class->notify_startup_complete = gdk_quartz_display_notify_startup_complete;
display_class->event_data_copy = _gdk_quartz_display_event_data_copy;
display_class->event_data_free = _gdk_quartz_display_event_data_free;
- display_class->create_window_impl = _gdk_quartz_display_create_window_impl;
+ display_class->create_surface_impl = _gdk_quartz_display_create_surface_impl;
display_class->get_keymap = _gdk_quartz_display_get_keymap;
display_class->text_property_to_utf8_list = _gdk_quartz_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_quartz_display_utf8_to_string_target;
diff --git a/gdk/quartz/gdkdisplay-quartz.h b/gdk/quartz/gdkdisplay-quartz.h
index 6f2ed37152..3799f54d61 100644
--- a/gdk/quartz/gdkdisplay-quartz.h
+++ b/gdk/quartz/gdkdisplay-quartz.h
@@ -22,7 +22,7 @@
#include "gdkdisplayprivate.h"
#include "gdkkeys.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
@@ -62,11 +62,11 @@ void _gdk_quartz_display_get_maximal_cursor_size (GdkDisplay *display,
/* Display methods - window */
void _gdk_quartz_display_before_process_all_updates (GdkDisplay *display);
void _gdk_quartz_display_after_process_all_updates (GdkDisplay *display);
-void _gdk_quartz_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_quartz_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
/* Display methods - keymap */
GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);
diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c
index d1ebe5fa04..d1a7ec0936 100644
--- a/gdk/quartz/gdkdnd-quartz.c
+++ b/gdk/quartz/gdkdnd-quartz.c
@@ -34,7 +34,7 @@ gdk_quartz_drag_source_context_libgtk_only ()
}
GdkDragContext *
-_gdk_quartz_window_drag_begin (GdkWindow *window,
+_gdk_quartz_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GList *targets,
gint dx,
@@ -48,7 +48,7 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
NULL);
_gdk_quartz_drag_source_context->is_source = TRUE;
- _gdk_quartz_drag_source_context->source_window = window;
+ _gdk_quartz_drag_source_context->source_surface = window;
g_object_ref (window);
_gdk_quartz_drag_source_context->targets = targets;
@@ -97,7 +97,7 @@ gdk_quartz_drag_context_drop_finish (GdkDragContext *context,
}
void
-_gdk_quartz_window_register_dnd (GdkWindow *window)
+_gdk_quartz_surface_register_dnd (GdkSurface *window)
{
/* FIXME: Implement */
}
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 4544bc11ea..b1109b0bc3 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -39,16 +39,16 @@
#define GRIP_HEIGHT 15
#define GDK_LION_RESIZE 5
-#define WINDOW_IS_TOPLEVEL(window) (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
+#define SURFACE_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
/* This is the window corresponding to the key window */
-static GdkWindow *current_keyboard_window;
+static GdkSurface *current_keyboard_window;
static void append_event (GdkEvent *event,
gboolean windowing);
-static GdkWindow *find_toplevel_under_pointer (GdkDisplay *display,
+static GdkSurface *find_toplevel_under_pointer (GdkDisplay *display,
NSPoint screen_point,
gint *x,
gint *y);
@@ -146,12 +146,12 @@ _gdk_quartz_events_break_all_grabs (guint32 time)
static void
fixup_event (GdkEvent *event)
{
- 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_window != NULL))
+ g_object_ref (event->crossing.child_window);
event->any.send_event = FALSE;
}
@@ -378,7 +378,7 @@ get_event_mask_from_ns_event (NSEvent *nsevent)
}
static void
-get_window_point_from_screen_point (GdkWindow *window,
+get_window_point_from_screen_point (GdkSurface *window,
NSPoint screen_point,
gint *x,
gint *y)
@@ -386,7 +386,7 @@ get_window_point_from_screen_point (GdkWindow *window,
NSPoint point;
NSWindow *nswindow;
- nswindow = ((GdkWindowImplQuartz *)window->impl)->toplevel;
+ nswindow = ((GdkSurfaceImplQuartz *)window->impl)->toplevel;
point = [nswindow convertScreenToBase:screen_point];
@@ -408,13 +408,13 @@ is_mouse_button_press_event (NSEventType type)
return FALSE;
}
-static GdkWindow *
+static GdkSurface *
get_toplevel_from_ns_event (NSEvent *nsevent,
NSPoint *screen_point,
gint *x,
gint *y)
{
- GdkWindow *toplevel = NULL;
+ GdkSurface *toplevel = NULL;
if ([nsevent window])
{
@@ -488,7 +488,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
}
static GdkEvent *
-create_focus_event (GdkWindow *window,
+create_focus_event (GdkSurface *window,
gboolean in)
{
GdkEvent *event;
@@ -507,7 +507,7 @@ create_focus_event (GdkWindow *window,
static void
-generate_motion_event (GdkWindow *window)
+generate_motion_event (GdkSurface *window)
{
NSPoint screen_point;
GdkEvent *event;
@@ -515,12 +515,12 @@ generate_motion_event (GdkWindow *window)
GdkQuartzDeviceManagerCore *device_manager;
event = gdk_event_new (GDK_MOTION_NOTIFY);
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.send_event = TRUE;
screen_point = [NSEvent mouseLocation];
- _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
get_window_point_from_screen_point (window, screen_point, &x, &y);
event->any.type = GDK_MOTION_NOTIFY;
@@ -542,7 +542,7 @@ generate_motion_event (GdkWindow *window)
/* Note: Used to both set a new focus window and to unset the old one. */
void
-_gdk_quartz_events_update_focus_window (GdkWindow *window,
+_gdk_quartz_events_update_focus_window (GdkSurface *window,
gboolean got_focus)
{
GdkEvent *event;
@@ -586,9 +586,9 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window,
}
void
-_gdk_quartz_events_send_map_event (GdkWindow *window)
+_gdk_quartz_events_send_map_event (GdkSurface *window)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->toplevel)
return;
@@ -598,24 +598,24 @@ _gdk_quartz_events_send_map_event (GdkWindow *window)
GdkEvent event;
event.any.type = GDK_MAP;
- event.any.window = window;
+ event.any.surface = window;
gdk_event_put (&event);
}
}
-static GdkWindow *
+static GdkSurface *
find_toplevel_under_pointer (GdkDisplay *display,
NSPoint screen_point,
gint *x,
gint *y)
{
- GdkWindow *toplevel;
- GdkPointerWindowInfo *info;
+ GdkSurface *toplevel;
+ GdkPointerSurfaceInfo *info;
info = _gdk_display_get_pointer_info (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer);
toplevel = info->toplevel_under_pointer;
- if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
+ if (toplevel && SURFACE_IS_TOPLEVEL (toplevel))
get_window_point_from_screen_point (toplevel, screen_point, x, y);
if (toplevel)
@@ -624,7 +624,7 @@ find_toplevel_under_pointer (GdkDisplay *display,
* under the pointer and we thus return NULL. This can occur when
* toplevel under pointer has not yet been updated due to a very recent
* window resize. Alternatively, we should no longer be relying on
- * the toplevel_under_pointer value which is maintained in gdkwindow.c.
+ * the toplevel_under_pointer value which is maintained in gdksurface.c.
*/
if (*x < 0 || *y < 0 || *x >= toplevel->width || *y >= toplevel->height)
return NULL;
@@ -633,11 +633,11 @@ find_toplevel_under_pointer (GdkDisplay *display,
return toplevel;
}
-static GdkWindow *
+static GdkSurface *
find_toplevel_for_keyboard_event (NSEvent *nsevent)
{
GList *devices = NULL, *l;
- GdkWindow *window;
+ GdkSurface *window;
GdkDisplay *display;
GdkQuartzView *view;
GdkSeat *seat;
@@ -645,7 +645,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
view = (GdkQuartzView *)[[nsevent window] contentView];
window = [view gdkWindow];
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
seat = gdk_display_get_default_seat (display);
@@ -663,7 +663,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
grab = _gdk_display_get_last_device_grab (display, device);
if (grab && grab->window && !grab->owner_events)
{
- window = gdk_window_get_toplevel (grab->window);
+ window = gdk_surface_get_toplevel (grab->window);
break;
}
}
@@ -673,20 +673,20 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
return window;
}
-static GdkWindow *
+static GdkSurface *
find_toplevel_for_mouse_event (NSEvent *nsevent,
gint *x,
gint *y)
{
NSPoint screen_point;
NSEventType event_type;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
GdkDisplay *display;
GdkDeviceGrabInfo *grab;
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
- display = gdk_window_get_display (toplevel);
+ display = gdk_surface_get_display (toplevel);
event_type = [nsevent type];
@@ -701,7 +701,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
*/
grab = _gdk_display_get_last_device_grab (display,
GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer);
- if (WINDOW_IS_TOPLEVEL (toplevel) && grab)
+ if (SURFACE_IS_TOPLEVEL (toplevel) && grab)
{
/* Implicit grabs do not go through XGrabPointer and thus the
* event mask should not be checked.
@@ -717,7 +717,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
* reported with respect to the key window, which could be
* wrong.
*/
- GdkWindow *toplevel_under_pointer;
+ GdkSurface *toplevel_under_pointer;
gint x_tmp, y_tmp;
toplevel_under_pointer = find_toplevel_under_pointer (display,
@@ -735,9 +735,9 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
else
{
/* Finally check the grab window. */
- GdkWindow *grab_toplevel;
+ GdkSurface *grab_toplevel;
- grab_toplevel = gdk_window_get_toplevel (grab->window);
+ grab_toplevel = gdk_surface_get_toplevel (grab->window);
get_window_point_from_screen_point (grab_toplevel, screen_point,
x, y);
@@ -749,7 +749,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
else
{
/* The non-grabbed case. */
- GdkWindow *toplevel_under_pointer;
+ GdkSurface *toplevel_under_pointer;
gint x_tmp, y_tmp;
/* Ignore all events but mouse moved that might be on the title
@@ -768,13 +768,13 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
screen_point,
&x_tmp, &y_tmp);
if (toplevel_under_pointer
- && WINDOW_IS_TOPLEVEL (toplevel_under_pointer))
+ && SURFACE_IS_TOPLEVEL (toplevel_under_pointer))
{
- GdkWindowImplQuartz *toplevel_impl;
+ GdkSurfaceImplQuartz *toplevel_impl;
toplevel = toplevel_under_pointer;
- toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
+ toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl;
*x = x_tmp;
*y = y_tmp;
@@ -789,7 +789,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
/* This function finds the correct window to send an event to, taking
* into account grabs, event propagation, and event masks.
*/
-static GdkWindow *
+static GdkSurface *
find_window_for_ns_event (NSEvent *nsevent,
gint *x,
gint *y,
@@ -797,7 +797,7 @@ find_window_for_ns_event (NSEvent *nsevent,
gint *y_root)
{
GdkQuartzView *view;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
NSPoint screen_point;
NSEventType event_type;
@@ -806,7 +806,7 @@ find_window_for_ns_event (NSEvent *nsevent,
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
if (!toplevel)
return NULL;
- _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, x_root, y_root);
event_type = [nsevent type];
@@ -851,7 +851,7 @@ find_window_for_ns_event (NSEvent *nsevent,
}
static void
-fill_crossing_event (GdkWindow *toplevel,
+fill_crossing_event (GdkSurface *toplevel,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -866,7 +866,7 @@ fill_crossing_event (GdkWindow *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;
@@ -899,7 +899,7 @@ fill_crossing_event (GdkWindow *toplevel,
*/
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
static void
-fill_pinch_event (GdkWindow *window,
+fill_pinch_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -996,7 +996,7 @@ fill_pinch_event (GdkWindow *window,
#endif /* OSX Version >= 10.8 */
static void
-fill_button_event (GdkWindow *window,
+fill_button_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -1047,7 +1047,7 @@ fill_button_event (GdkWindow *window,
}
static void
-fill_motion_event (GdkWindow *window,
+fill_motion_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -1073,7 +1073,7 @@ fill_motion_event (GdkWindow *window,
}
static void
-fill_scroll_event (GdkWindow *window,
+fill_scroll_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -1106,7 +1106,7 @@ fill_scroll_event (GdkWindow *window,
}
static void
-fill_key_event (GdkWindow *window,
+fill_key_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
GdkEventType type)
@@ -1236,7 +1236,7 @@ fill_key_event (GdkWindow *window,
}
static gboolean
-synthesize_crossing_event (GdkWindow *window,
+synthesize_crossing_event (GdkSurface *window,
GdkEvent *event,
NSEvent *nsevent,
gint x,
@@ -1283,7 +1283,7 @@ synthesize_crossing_event (GdkWindow *window,
}
void
-_gdk_quartz_synthesize_null_key_event (GdkWindow *window)
+_gdk_quartz_synthesize_null_key_event (GdkSurface *window)
{
GdkEvent *event;
GdkQuartzDeviceManagerCore *device_manager;
@@ -1344,15 +1344,15 @@ _gdk_quartz_events_get_current_mouse_modifiers (void)
/* Detect window resizing */
static gboolean
-test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
+test_resize (NSEvent *event, GdkSurface *toplevel, gint x, gint y)
{
- GdkWindowImplQuartz *toplevel_impl;
+ GdkSurfaceImplQuartz *toplevel_impl;
gboolean lion;
/* Resizing from the resize indicator only begins if an NSLeftMouseButton
* event is received in the resizing area.
*/
- toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
+ toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl;
if ([toplevel_impl->toplevel showsResizeIndicator])
if ([event type] == NSLeftMouseDown &&
[toplevel_impl->toplevel showsResizeIndicator])
@@ -1385,10 +1385,10 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
* dragging before GDK recognizes the grab.
*
* We perform this check for a button press of all buttons, because we
- * do receive, for instance, a right mouse down event for a GDK window
+ * do receive, for instance, a right mouse down event for a GDK surface
* for x-coordinate range [-3, 0], but we do not want to forward this
* into GDK. Forwarding such events into GDK will confuse the pointer
- * window finding code, because there are no GdkWindows present in
+ * window finding code, because there are no GdkSurfaces present in
* the range [-3, 0].
*/
lion = gdk_quartz_osx_version () >= GDK_OSX_LION;
@@ -1412,7 +1412,7 @@ gdk_event_translate (GdkEvent *event,
{
NSEventType event_type;
NSWindow *nswindow;
- GdkWindow *window;
+ GdkSurface *window;
int x, y;
int x_root, y_root;
gboolean return_val;
@@ -1457,7 +1457,7 @@ gdk_event_translate (GdkEvent *event,
/* Ignore events for ones with no windows */
if (!nswindow)
{
- GdkWindow *toplevel = NULL;
+ GdkSurface *toplevel = NULL;
if (event_type == NSMouseMoved)
{
@@ -1493,7 +1493,7 @@ gdk_event_translate (GdkEvent *event,
if ([(GdkQuartzNSWindow *)nswindow isInManualResizeOrMove])
return FALSE;
- /* Find the right GDK window to send the event to, taking grabs and
+ /* Find the right GDK surface to send the event to, taking grabs and
* event masks into consideration.
*/
window = find_window_for_ns_event (nsevent, &x, &y, &x_root, &y_root);
@@ -1505,7 +1505,7 @@ gdk_event_translate (GdkEvent *event,
return FALSE;
/* Apply any window filters. */
- if (GDK_IS_WINDOW (window))
+ if (GDK_IS_SURFACE (window))
{
GdkFilterReturn result;
@@ -1534,7 +1534,7 @@ gdk_event_translate (GdkEvent *event,
event_type == NSOtherMouseDown ||
event_type == NSLeftMouseDown))
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (![NSApp isActive])
{
@@ -1650,7 +1650,7 @@ gdk_event_translate (GdkEvent *event,
break;
#endif
case NSMouseExited:
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
[[NSCursor arrowCursor] set];
/* fall through */
case NSMouseEntered:
@@ -1680,17 +1680,17 @@ gdk_event_translate (GdkEvent *event,
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_window != NULL))
+ g_object_ref (event->crossing.child_window);
}
else
{
/* Mark this event as having no resources to be freed */
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.type = GDK_NOTHING;
}
@@ -1710,7 +1710,7 @@ _gdk_quartz_display_queue_events (GdkDisplay *display)
event = gdk_event_new (GDK_NOTHING);
- event->any.window = NULL;
+ event->any.surface = NULL;
event->any.send_event = FALSE;
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
diff --git a/gdk/quartz/gdkglcontext-quartz.c b/gdk/quartz/gdkglcontext-quartz.c
index a6cc3b6a35..cc2e02d54c 100644
--- a/gdk/quartz/gdkglcontext-quartz.c
+++ b/gdk/quartz/gdkglcontext-quartz.c
@@ -27,7 +27,7 @@
#include "gdkintl.h"
GdkGLContext *
-gdk_quartz_window_create_gl_context (GdkWindow *window,
+gdk_quartz_surface_create_gl_context (GdkSurface *window,
gboolean attached,
GdkGLContext *share,
GError **error)
diff --git a/gdk/quartz/gdkglcontext-quartz.h b/gdk/quartz/gdkglcontext-quartz.h
index ffd56b3dd9..080316e5bc 100644
--- a/gdk/quartz/gdkglcontext-quartz.h
+++ b/gdk/quartz/gdkglcontext-quartz.h
@@ -24,12 +24,12 @@
#define __GDK_QUARTZ_GL_CONTEXT__
#include "gdkglcontextprivate.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
-GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window,
+GdkGLContext * gdk_quartz_surface_create_gl_context (GdkSurface *window,
gboolean attach,
GdkGLContext *share,
GError **error);
diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c
index 6b8c59f757..a1cfc2f3e4 100644
--- a/gdk/quartz/gdkglobals-quartz.c
+++ b/gdk/quartz/gdkglobals-quartz.c
@@ -23,7 +23,7 @@
GdkDisplay *_gdk_display = NULL;
GdkQuartzScreen *_gdk_screen = NULL;
-GdkWindow *_gdk_root = NULL;
+GdkSurface *_gdk_root = NULL;
GdkDeviceManager *_gdk_device_manager = NULL;
GdkOSXVersion
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 99d24431a3..e65a5f227f 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -1,4 +1,4 @@
-/* gdkwindow-quartz.c
+/* gdksurface-quartz.c
*
* Copyright (C) 2005-2007 Imendio AB
*
@@ -26,7 +26,7 @@
#include <gdk/quartz/gdkdevicemanager-core-quartz.h>
#include <gdk/quartz/gdkdnd-quartz.h>
#include <gdk/quartz/gdkscreen-quartz.h>
-#include <gdk/quartz/gdkwindow-quartz.h>
+#include <gdk/quartz/gdksurface-quartz.h>
#include <gdk/gdk.h>
@@ -36,15 +36,15 @@
extern GdkDisplay *_gdk_display;
extern GdkQuartzScreen *_gdk_screen;
-extern GdkWindow *_gdk_root;
+extern GdkSurface *_gdk_root;
extern GdkDeviceManager *_gdk_device_manager;
extern GdkDragContext *_gdk_quartz_drag_source_context;
-#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl))
+#define GDK_SURFACE_IS_QUARTZ(win) (GDK_IS_SURFACE_IMPL_QUARTZ (((GdkSurface *)win)->impl))
/* Initialization */
-void _gdk_quartz_window_init_windowing (GdkDisplay *display);
+void _gdk_quartz_surface_init_windowing (GdkDisplay *display);
void _gdk_quartz_events_init (void);
void _gdk_quartz_event_loop_init (void);
@@ -56,9 +56,9 @@ typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
-void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
+void _gdk_quartz_events_update_focus_window (GdkSurface *new_window,
gboolean got_focus);
-void _gdk_quartz_events_send_map_event (GdkWindow *window);
+void _gdk_quartz_events_send_map_event (GdkSurface *window);
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
@@ -73,11 +73,11 @@ void _gdk_quartz_event_loop_release_event (NSEvent *event);
/* Keys */
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
-void _gdk_quartz_synthesize_null_key_event (GdkWindow *window);
+void _gdk_quartz_synthesize_null_key_event (GdkSurface *window);
/* Drag and Drop */
-void _gdk_quartz_window_register_dnd (GdkWindow *window);
-GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window,
+void _gdk_quartz_surface_register_dnd (GdkSurface *window);
+GdkDragContext * _gdk_quartz_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GList *targets,
gint x_root,
@@ -98,35 +98,35 @@ gboolean _gdk_quartz_get_setting (const gchar *name,
/* Window */
-gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
- GdkWindow *window);
-void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
+gboolean _gdk_quartz_surface_is_ancestor (GdkSurface *ancestor,
+ GdkSurface *window);
+void _gdk_quartz_surface_gdk_xy_to_xy (gint gdk_x,
gint gdk_y,
gint *ns_x,
gint *ns_y);
-void _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
+void _gdk_quartz_surface_xy_to_gdk_xy (gint ns_x,
gint ns_y,
gint *gdk_x,
gint *gdk_y);
-void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point,
+void _gdk_quartz_surface_nspoint_to_gdk_xy (NSPoint point,
gint *x,
gint *y);
-GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window,
+GdkSurface *_gdk_quartz_surface_find_child (GdkSurface *window,
gint x,
gint y,
gboolean get_toplevel);
-void _gdk_quartz_window_attach_to_parent (GdkWindow *window);
-void _gdk_quartz_window_detach_from_parent (GdkWindow *window);
-void _gdk_quartz_window_did_become_main (GdkWindow *window);
-void _gdk_quartz_window_did_resign_main (GdkWindow *window);
-void _gdk_quartz_window_debug_highlight (GdkWindow *window,
+void _gdk_quartz_surface_attach_to_parent (GdkSurface *window);
+void _gdk_quartz_surface_detach_from_parent (GdkSurface *window);
+void _gdk_quartz_surface_did_become_main (GdkSurface *window);
+void _gdk_quartz_surface_did_resign_main (GdkSurface *window);
+void _gdk_quartz_surface_debug_highlight (GdkSurface *window,
gint number);
-void _gdk_quartz_window_update_position (GdkWindow *window);
-void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window);
+void _gdk_quartz_surface_update_position (GdkSurface *window);
+void _gdk_quartz_surface_update_fullscreen_state (GdkSurface *window);
/* Window methods - property */
-gboolean _gdk_quartz_window_get_property (GdkWindow *window,
+gboolean _gdk_quartz_surface_get_property (GdkSurface *window,
GdkAtom property,
GdkAtom type,
gulong offset,
@@ -136,14 +136,14 @@ gboolean _gdk_quartz_window_get_property (GdkWindow *window,
gint *actual_format_type,
gint *actual_length,
guchar **data);
-void _gdk_quartz_window_change_property (GdkWindow *window,
+void _gdk_quartz_surface_change_property (GdkSurface *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements);
-void _gdk_quartz_window_delete_property (GdkWindow *window,
+void _gdk_quartz_surface_delete_property (GdkSurface *window,
GdkAtom property);
diff --git a/gdk/quartz/gdkquartz.h b/gdk/quartz/gdkquartz.h
index 0479c72303..132245d09f 100644
--- a/gdk/quartz/gdkquartz.h
+++ b/gdk/quartz/gdkquartz.h
@@ -80,7 +80,7 @@ G_END_DECLS
#include <gdk/quartz/gdkquartzmonitor.h>
#include <gdk/quartz/gdkquartzscreen.h>
#include <gdk/quartz/gdkquartzutils.h>
-#include <gdk/quartz/gdkquartzwindow.h>
+#include <gdk/quartz/gdkquartzsurface.h>
#undef __GDKQUARTZ_H_INSIDE__
diff --git a/gdk/quartz/gdkquartzsurface.h b/gdk/quartz/gdkquartzsurface.h
new file mode 100644
index 0000000000..a37cb37c1d
--- /dev/null
+++ b/gdk/quartz/gdkquartzsurface.h
@@ -0,0 +1,55 @@
+/* gdkquartzsurface.h
+ *
+ * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2010 Kristian Rietveld <kris@gtk.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_QUARTZ_SURFACE_H__
+#define __GDK_QUARTZ_SURFACE_H__
+
+#if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdkquartz.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
+
+G_BEGIN_DECLS
+
+#define GDK_TYPE_QUARTZ_SURFACE (gdk_quartz_surface_get_type ())
+#define GDK_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurface))
+#define GDK_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass))
+#define GDK_IS_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_SURFACE))
+#define GDK_IS_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_SURFACE))
+#define GDK_QUARTZ_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass))
+
+#ifdef GDK_COMPILATION
+typedef struct _GdkQuartzSurface GdkQuartzSurface;
+#else
+typedef GdkSurface GdkQuartzSurface;
+#endif
+typedef struct _GdkQuartzSurfaceClass GdkQuartzSurfaceClass;
+
+GDK_AVAILABLE_IN_ALL
+GType gdk_quartz_surface_get_type (void);
+
+GDK_AVAILABLE_IN_ALL
+NSWindow *gdk_quartz_surface_get_nswindow (GdkSurface *window);
+GDK_AVAILABLE_IN_ALL
+NSView *gdk_quartz_surface_get_nsview (GdkSurface *window);
+
+G_END_DECLS
+
+#endif /* __GDK_QUARTZ_SURFACE_H__ */
diff --git a/gdk/quartz/gdkquartzwindow.h b/gdk/quartz/gdkquartzwindow.h
deleted file mode 100644
index a88eb16e9b..0000000000
--- a/gdk/quartz/gdkquartzwindow.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* gdkquartzwindow.h
- *
- * Copyright (C) 2005 Imendio AB
- * Copyright (C) 2010 Kristian Rietveld <kris@gtk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GDK_QUARTZ_WINDOW_H__
-#define __GDK_QUARTZ_WINDOW_H__
-
-#if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only <gdk/gdkquartz.h> can be included directly."
-#endif
-
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-#define GDK_TYPE_QUARTZ_WINDOW (gdk_quartz_window_get_type ())
-#define GDK_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindow))
-#define GDK_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass))
-#define GDK_IS_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_WINDOW))
-#define GDK_IS_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_WINDOW))
-#define GDK_QUARTZ_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass))
-
-#ifdef GDK_COMPILATION
-typedef struct _GdkQuartzWindow GdkQuartzWindow;
-#else
-typedef GdkWindow GdkQuartzWindow;
-#endif
-typedef struct _GdkQuartzWindowClass GdkQuartzWindowClass;
-
-GDK_AVAILABLE_IN_ALL
-GType gdk_quartz_window_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
-GDK_AVAILABLE_IN_ALL
-NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
-
-G_END_DECLS
-
-#endif /* __GDK_QUARTZ_WINDOW_H__ */
diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c
index 6f53f36a2b..f8094354a0 100644
--- a/gdk/quartz/gdkscreen-quartz.c
+++ b/gdk/quartz/gdkscreen-quartz.c
@@ -53,9 +53,9 @@
*
* A Cocoa coordinate is always relative to the origin of the monitor
* coordinate space. Such coordinates are mapped to their respective
- * position in the GdkScreen root window (_gdk_quartz_window_xy_to_gdk_xy)
- * and vice versa (_gdk_quartz_window_gdk_xy_to_xy). Both functions can
- * be found in gdkwindow-quartz.c. Note that Cocoa coordinates can have
+ * position in the GdkScreen root window (_gdk_quartz_surface_xy_to_gdk_xy)
+ * and vice versa (_gdk_quartz_surface_gdk_xy_to_xy). Both functions can
+ * be found in gdksurface-quartz.c. Note that Cocoa coordinates can have
* negative values (in case a monitor is located left or below of screen 0),
* but GDK coordinates can *not*!
*/
@@ -208,7 +208,7 @@ _gdk_quartz_screen_update_window_sizes (GdkQuartzScreen *screen)
windows = get_toplevels ();
for (list = windows; list; list = list->next)
- _gdk_quartz_window_update_position (list->data);
+ _gdk_quartz_surface_update_position (list->data);
}
static void
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdksurface-quartz.c
index d105612199..915edff0a0 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdksurface-quartz.c
@@ -1,4 +1,4 @@
-/* gdkwindow-quartz.c
+/* gdksurface-quartz.c
*
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 2005-2007 Imendio AB
@@ -23,7 +23,7 @@
#include <gdk/gdkdeviceprivate.h>
#include <gdk/gdkdisplayprivate.h>
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkprivate-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkquartzscreen.h"
@@ -43,7 +43,7 @@ static gboolean in_process_all_updates = FALSE;
static GSList *main_window_stack;
-void _gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl);
+void _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *surface_impl);
typedef struct
{
@@ -54,7 +54,7 @@ typedef struct
#ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window);
+static FullscreenSavedGeometry *get_fullscreen_geometry (GdkSurface *window);
#endif
#define FULLSCREEN_DATA "fullscreen-data"
@@ -62,65 +62,65 @@ static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window);
static void update_toplevel_order (void);
static void clear_toplevel_order (void);
-#define WINDOW_IS_TOPLEVEL(window) (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
+#define SURFACE_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
/*
- * GdkQuartzWindow
+ * GdkQuartzSurface
*/
-struct _GdkQuartzWindow
+struct _GdkQuartzSurface
{
- GdkWindow parent;
+ GdkSurface parent;
};
-struct _GdkQuartzWindowClass
+struct _GdkQuartzSurfaceClass
{
- GdkWindowClass parent_class;
+ GdkSurfaceClass parent_class;
};
-G_DEFINE_TYPE (GdkQuartzWindow, gdk_quartz_window, GDK_TYPE_WINDOW);
+G_DEFINE_TYPE (GdkQuartzSurface, gdk_quartz_surface, GDK_TYPE_SURFACE);
static void
-gdk_quartz_window_class_init (GdkQuartzWindowClass *quartz_window_class)
+gdk_quartz_surface_class_init (GdkQuartzSurfaceClass *quartz_surface_class)
{
}
static void
-gdk_quartz_window_init (GdkQuartzWindow *quartz_window)
+gdk_quartz_surface_init (GdkQuartzSurface *quartz_surface)
{
}
/*
- * GdkQuartzWindowImpl
+ * GdkQuartzSurfaceImpl
*/
NSView *
-gdk_quartz_window_get_nsview (GdkWindow *window)
+gdk_quartz_surface_get_nsview (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return NULL;
- return ((GdkWindowImplQuartz *)window->impl)->view;
+ return ((GdkSurfaceImplQuartz *)window->impl)->view;
}
NSWindow *
-gdk_quartz_window_get_nswindow (GdkWindow *window)
+gdk_quartz_surface_get_nswindow (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return NULL;
- return ((GdkWindowImplQuartz *)window->impl)->toplevel;
+ return ((GdkSurfaceImplQuartz *)window->impl)->toplevel;
}
static CGContextRef
-gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
+gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *surface_impl,
gboolean antialias)
{
CGContextRef cg_context;
CGSize scale;
- if (GDK_WINDOW_DESTROYED (window_impl->wrapper))
+ if (GDK_SURFACE_DESTROYED (surface_impl->wrapper))
return NULL;
/* Lock focus when not called as part of a drawRect call. This
@@ -129,9 +129,9 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
* and for widgets that send fake expose events like the arrow
* buttons in spinbuttons or the position marker in rulers.
*/
- if (window_impl->in_paint_rect_count == 0)
+ if (surface_impl->in_paint_rect_count == 0)
{
- if (![window_impl->view lockFocusIfCanDraw])
+ if (![surface_impl->view lockFocusIfCanDraw])
return NULL;
}
@@ -149,25 +149,25 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
}
static void
-gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl,
+gdk_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *surface_impl,
CGContextRef cg_context)
{
CGContextRestoreGState (cg_context);
CGContextSetAllowsAntialiasing (cg_context, TRUE);
- /* See comment in gdk_quartz_window_get_context(). */
- if (window_impl->in_paint_rect_count == 0)
+ /* See comment in gdk_quartz_surface_get_context(). */
+ if (surface_impl->in_paint_rect_count == 0)
{
- _gdk_quartz_window_flush (window_impl);
- [window_impl->view unlockFocus];
+ _gdk_quartz_surface_flush (surface_impl);
+ [surface_impl->view unlockFocus];
}
}
static void
-check_grab_destroy (GdkWindow *window)
+check_grab_destroy (GdkSurface *window)
{
GList *devices = NULL, *l;
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
GdkSeat *seat;
seat = gdk_display_get_default_seat (display);
@@ -180,7 +180,7 @@ check_grab_destroy (GdkWindow *window)
GdkDeviceGrabInfo *grab;
grab = _gdk_display_get_last_device_grab (display, l->data);
- if (grab && grab->native_window == window)
+ if (grab && grab->native_surface == window)
{
/* Serials are always 0 in quartz, but for clarity: */
grab->serial_end = grab->serial_start;
@@ -192,11 +192,11 @@ check_grab_destroy (GdkWindow *window)
}
static void
-gdk_window_impl_quartz_finalize (GObject *object)
+gdk_surface_impl_quartz_finalize (GObject *object)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (object);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (object);
- check_grab_destroy (GDK_WINDOW_IMPL_QUARTZ (object)->wrapper);
+ check_grab_destroy (GDK_SURFACE_IMPL_QUARTZ (object)->wrapper);
if (impl->transient_for)
g_object_unref (impl->transient_for);
@@ -216,7 +216,7 @@ gdk_window_impl_quartz_finalize (GObject *object)
* done externally.
*/
void
-_gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl)
+_gdk_quartz_surface_flush (GdkSurfaceImplQuartz *surface_impl)
{
static struct timeval prev_tv;
static gint intervals[4];
@@ -228,15 +228,15 @@ _gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl)
ms = (tv.tv_sec - prev_tv.tv_sec) * 1000 + (tv.tv_usec - prev_tv.tv_usec) / 1000;
intervals[index++ % 4] = ms;
- if (window_impl)
+ if (surface_impl)
{
ms = intervals[0] + intervals[1] + intervals[2] + intervals[3];
/* ~25Hz on average. */
if (ms > 4*40)
{
- if (window_impl)
- [window_impl->toplevel flushWindow];
+ if (surface_impl)
+ [surface_impl->toplevel flushWindow];
prev_tv = tv;
}
@@ -248,7 +248,7 @@ _gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl)
static cairo_user_data_key_t gdk_quartz_cairo_key;
typedef struct {
- GdkWindowImplQuartz *window_impl;
+ GdkSurfaceImplQuartz *surface_impl;
CGContextRef cg_context;
} GdkQuartzCairoSurfaceData;
@@ -257,16 +257,16 @@ gdk_quartz_cairo_surface_destroy (void *data)
{
GdkQuartzCairoSurfaceData *surface_data = data;
- surface_data->window_impl->cairo_surface = NULL;
+ surface_data->surface_impl->cairo_surface = NULL;
- gdk_quartz_window_release_context (surface_data->window_impl,
+ gdk_quartz_surface_release_context (surface_data->surface_impl,
surface_data->cg_context);
g_free (surface_data);
}
static cairo_surface_t *
-gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl,
+gdk_quartz_create_cairo_surface (GdkSurfaceImplQuartz *impl,
int width,
int height)
{
@@ -274,13 +274,13 @@ gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl,
GdkQuartzCairoSurfaceData *surface_data;
cairo_surface_t *surface;
- cg_context = gdk_quartz_window_get_context (impl, TRUE);
+ cg_context = gdk_quartz_surface_get_context (impl, TRUE);
if (!cg_context)
return NULL;
surface_data = g_new (GdkQuartzCairoSurfaceData, 1);
- surface_data->window_impl = impl;
+ surface_data->surface_impl = impl;
surface_data->cg_context = cg_context;
surface = cairo_quartz_surface_create_for_cg_context (cg_context,
@@ -294,21 +294,21 @@ gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl,
}
static cairo_surface_t *
-gdk_quartz_ref_cairo_surface (GdkWindow *window)
+gdk_quartz_ref_cairo_surface (GdkSurface *window)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return NULL;
if (!impl->cairo_surface)
{
- gint scale = gdk_window_get_scale_factor (impl->wrapper);
+ gint scale = gdk_surface_get_scale_factor (impl->wrapper);
impl->cairo_surface =
gdk_quartz_create_cairo_surface (impl,
- gdk_window_get_width (impl->wrapper) * scale,
- gdk_window_get_height (impl->wrapper) * scale);
+ gdk_surface_get_width (impl->wrapper) * scale,
+ gdk_surface_get_height (impl->wrapper) * scale);
cairo_surface_set_device_scale (impl->cairo_surface, scale, scale);
}
@@ -319,25 +319,25 @@ gdk_quartz_ref_cairo_surface (GdkWindow *window)
}
static void
-gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl)
+gdk_surface_impl_quartz_init (GdkSurfaceImplQuartz *impl)
{
- impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
+ impl->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL;
}
static gboolean
-gdk_window_impl_quartz_begin_paint (GdkWindow *window)
+gdk_surface_impl_quartz_begin_paint (GdkSurface *window)
{
return FALSE;
}
static void
-gdk_quartz_window_set_needs_display_in_region (GdkWindow *window,
+gdk_quartz_surface_set_needs_display_in_region (GdkSurface *window,
cairo_region_t *region)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
int i, n_rects;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->needs_display_region)
impl->needs_display_region = cairo_region_create ();
@@ -355,7 +355,7 @@ gdk_quartz_window_set_needs_display_in_region (GdkWindow *window,
}
void
-_gdk_quartz_window_process_updates_recurse (GdkWindow *window,
+_gdk_quartz_surface_process_updates_recurse (GdkSurface *window,
cairo_region_t *region)
{
/* Make sure to only flush each toplevel at most once if we're called
@@ -363,15 +363,15 @@ _gdk_quartz_window_process_updates_recurse (GdkWindow *window,
*/
if (in_process_all_updates)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
- toplevel = gdk_window_get_toplevel (window);
- if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
+ toplevel = gdk_surface_get_toplevel (window);
+ if (toplevel && SURFACE_IS_TOPLEVEL (toplevel))
{
- GdkWindowImplQuartz *toplevel_impl;
+ GdkSurfaceImplQuartz *toplevel_impl;
NSWindow *nswindow;
- toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
+ toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl;
nswindow = toplevel_impl->toplevel;
/* In theory, we could skip the flush disabling, since we only
@@ -386,10 +386,10 @@ _gdk_quartz_window_process_updates_recurse (GdkWindow *window,
}
}
- if (WINDOW_IS_TOPLEVEL (window))
- gdk_quartz_window_set_needs_display_in_region (window, region);
+ if (SURFACE_IS_TOPLEVEL (window))
+ gdk_quartz_surface_set_needs_display_in_region (window, region);
else
- _gdk_window_process_updates_recurse (window, region);
+ _gdk_surface_process_updates_recurse (window, region);
/* NOTE: I'm not sure if we should displayIfNeeded here. It slows down a
* lot (since it triggers the beam syncing) and things seem to work
@@ -410,10 +410,10 @@ get_default_title (void)
}
static void
-get_ancestor_coordinates_from_child (GdkWindow *child_window,
+get_ancestor_coordinates_from_child (GdkSurface *child_window,
gint child_x,
gint child_y,
- GdkWindow *ancestor_window,
+ GdkSurface *ancestor_window,
gint *ancestor_x,
gint *ancestor_y)
{
@@ -430,11 +430,11 @@ get_ancestor_coordinates_from_child (GdkWindow *child_window,
}
void
-_gdk_quartz_window_debug_highlight (GdkWindow *window, gint number)
+_gdk_quartz_surface_debug_highlight (GdkSurface *window, gint number)
{
gint x, y;
gint gx, gy;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
gint tx, ty;
static NSWindow *debug_window[10];
static NSRect old_rect[10];
@@ -455,14 +455,14 @@ _gdk_quartz_window_debug_highlight (GdkWindow *window, gint number)
return;
}
- toplevel = gdk_window_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (window);
get_ancestor_coordinates_from_child (window, 0, 0, toplevel, &x, &y);
- gdk_window_get_origin (toplevel, &tx, &ty);
+ gdk_surface_get_origin (toplevel, &tx, &ty);
x += tx;
y += ty;
- _gdk_quartz_window_gdk_xy_to_xy (x, y + window->height,
+ _gdk_quartz_surface_gdk_xy_to_xy (x, y + window->height,
&gx, &gy);
rect = NSMakeRect (gx, gy, window->width, window->height);
@@ -516,21 +516,21 @@ _gdk_quartz_window_debug_highlight (GdkWindow *window, gint number)
}
gboolean
-_gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
- GdkWindow *window)
+_gdk_quartz_surface_is_ancestor (GdkSurface *ancestor,
+ GdkSurface *window)
{
if (ancestor == NULL || window == NULL)
return FALSE;
- return (gdk_window_get_parent (window) == ancestor ||
- _gdk_quartz_window_is_ancestor (ancestor,
- gdk_window_get_parent (window)));
+ return (gdk_surface_get_parent (window) == ancestor ||
+ _gdk_quartz_surface_is_ancestor (ancestor,
+ gdk_surface_get_parent (window)));
}
/* See notes on top of gdkscreen-quartz.c */
void
-_gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
+_gdk_quartz_surface_gdk_xy_to_xy (gint gdk_x,
gint gdk_y,
gint *ns_x,
gint *ns_y)
@@ -545,7 +545,7 @@ _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
}
void
-_gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
+_gdk_quartz_surface_xy_to_gdk_xy (gint ns_x,
gint ns_y,
gint *gdk_x,
gint *gdk_y)
@@ -560,37 +560,37 @@ _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
}
void
-_gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point,
+_gdk_quartz_surface_nspoint_to_gdk_xy (NSPoint point,
gint *x,
gint *y)
{
- _gdk_quartz_window_xy_to_gdk_xy (point.x, point.y,
+ _gdk_quartz_surface_xy_to_gdk_xy (point.x, point.y,
x, y);
}
-static GdkWindow *
-find_child_window_helper (GdkWindow *window,
+static GdkSurface *
+find_child_window_helper (GdkSurface *window,
gint x,
gint y,
gint x_offset,
gint y_offset,
gboolean get_toplevel)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
GList *l;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (window == _gdk_root)
update_toplevel_order ();
for (l = impl->sorted_children; l; l = l->next)
{
- GdkWindow *child = l->data;
- GdkWindowImplQuartz *child_impl = GDK_WINDOW_IMPL_QUARTZ (child->impl);
+ GdkSurface *child = l->data;
+ GdkSurfaceImplQuartz *child_impl = GDK_SURFACE_IMPL_QUARTZ (child->impl);
int temp_x, temp_y;
- if (!GDK_WINDOW_IS_MAPPED (child))
+ if (!GDK_SURFACE_IS_MAPPED (child))
continue;
temp_x = x_offset + child->x;
@@ -623,7 +623,7 @@ find_child_window_helper (GdkWindow *window,
/* The root means "unknown" i.e. a window not managed by
* GDK.
*/
- return (GdkWindow *)_gdk_root;
+ return (GdkSurface *)_gdk_root;
}
}
@@ -642,12 +642,12 @@ find_child_window_helper (GdkWindow *window,
return window;
}
-/* Given a GdkWindow and coordinates relative to it, returns the
+/* Given a GdkSurface and coordinates relative to it, returns the
* innermost subwindow that contains the point. If the coordinates are
* outside the passed in window, NULL is returned.
*/
-GdkWindow *
-_gdk_quartz_window_find_child (GdkWindow *window,
+GdkSurface *
+_gdk_quartz_surface_find_child (GdkSurface *window,
gint x,
gint y,
gboolean get_toplevel)
@@ -660,20 +660,20 @@ _gdk_quartz_window_find_child (GdkWindow *window,
void
-_gdk_quartz_window_did_become_main (GdkWindow *window)
+_gdk_quartz_surface_did_become_main (GdkSurface *window)
{
main_window_stack = g_slist_remove (main_window_stack, window);
- if (window->window_type != GDK_WINDOW_TEMP)
+ if (window->surface_type != GDK_SURFACE_TEMP)
main_window_stack = g_slist_prepend (main_window_stack, window);
clear_toplevel_order ();
}
void
-_gdk_quartz_window_did_resign_main (GdkWindow *window)
+_gdk_quartz_surface_did_resign_main (GdkSurface *window)
{
- GdkWindow *new_window = NULL;
+ GdkSurface *new_window = NULL;
if (main_window_stack)
new_window = main_window_stack->data;
@@ -688,10 +688,10 @@ _gdk_quartz_window_did_resign_main (GdkWindow *window)
if (new_window &&
new_window != window &&
- GDK_WINDOW_IS_MAPPED (new_window) &&
- WINDOW_IS_TOPLEVEL (new_window))
+ GDK_SURFACE_IS_MAPPED (new_window) &&
+ SURFACE_IS_TOPLEVEL (new_window))
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (new_window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (new_window->impl);
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
}
@@ -728,31 +728,31 @@ get_nsscreen_for_point (gint x, gint y)
}
void
-_gdk_quartz_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_quartz_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
- GdkWindowImplQuartz *impl;
- GdkWindowImplQuartz *parent_impl;
+ GdkSurfaceImplQuartz *impl;
+ GdkSurfaceImplQuartz *parent_impl;
GDK_QUARTZ_ALLOC_POOL;
- impl = g_object_new (GDK_TYPE_WINDOW_IMPL_QUARTZ, NULL);
- window->impl = GDK_WINDOW_IMPL (impl);
+ impl = g_object_new (GDK_TYPE_SURFACE_IMPL_QUARTZ, NULL);
+ window->impl = GDK_SURFACE_IMPL (impl);
impl->wrapper = window;
- parent_impl = GDK_WINDOW_IMPL_QUARTZ (window->parent->impl);
+ parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl);
- switch (window->window_type)
+ switch (window->surface_type)
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
- if (GDK_WINDOW_TYPE (window->parent) != GDK_WINDOW_ROOT)
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP:
+ if (GDK_SURFACE_TYPE (window->parent) != GDK_SURFACE_ROOT)
{
/* The common code warns for this case */
- parent_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl);
+ parent_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl);
}
}
@@ -764,10 +764,10 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = NULL;
- switch (window->window_type)
+ switch (window->surface_type)
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP:
{
NSScreen *screen;
NSRect screen_rect;
@@ -780,7 +780,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
* to find the screen the window will be on and correct the
* content_rect coordinates to be relative to that screen.
*/
- _gdk_quartz_window_gdk_xy_to_xy (window->x, window->y, &nx, &ny);
+ _gdk_quartz_surface_gdk_xy_to_xy (window->x, window->y, &nx, &ny);
screen = get_nsscreen_for_point (nx, ny);
screen_rect = [screen frame];
@@ -791,7 +791,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
window->width,
window->height);
- if (window->window_type == GDK_WINDOW_TEMP)
+ if (window->surface_type == GDK_SURFACE_TEMP)
{
style_mask = NSBorderlessWindowMask;
}
@@ -809,7 +809,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
defer:NO
screen:screen];
- gdk_window_set_title (window, get_default_title ());
+ gdk_surface_set_title (window, get_default_title ());
[impl->toplevel setOpaque:NO];
[impl->toplevel setBackgroundColor:[NSColor clearColor]];
@@ -818,15 +818,15 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
content_rect.origin.y = 0;
impl->view = [[GdkQuartzView alloc] initWithFrame:content_rect];
- [impl->view setGdkWindow:window];
+ [impl->view setGdkSurface:window];
[impl->toplevel setContentView:impl->view];
[impl->view release];
}
break;
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
{
- GdkWindowImplQuartz *parent_impl = GDK_WINDOW_IMPL_QUARTZ (window->parent->impl);
+ GdkSurfaceImplQuartz *parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl);
if (!window->input_only)
{
@@ -837,9 +837,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = [[GdkQuartzView alloc] initWithFrame:frame_rect];
- [impl->view setGdkWindow:window];
+ [impl->view setGdkSurface:window];
- /* GdkWindows should be hidden by default */
+ /* GdkSurfaces should be hidden by default */
[impl->view setHidden:YES];
[parent_impl->view addSubview:impl->view];
[impl->view release];
@@ -855,18 +855,18 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
}
void
-_gdk_quartz_window_update_position (GdkWindow *window)
+_gdk_quartz_surface_update_position (GdkSurface *window)
{
NSRect frame_rect;
NSRect content_rect;
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
GDK_QUARTZ_ALLOC_POOL;
frame_rect = [impl->toplevel frame];
content_rect = [impl->toplevel contentRectForFrameRect:frame_rect];
- _gdk_quartz_window_xy_to_gdk_xy (content_rect.origin.x,
+ _gdk_quartz_surface_xy_to_gdk_xy (content_rect.origin.x,
content_rect.origin.y + content_rect.size.height,
&window->x, &window->y);
@@ -875,37 +875,37 @@ _gdk_quartz_window_update_position (GdkWindow *window)
}
void
-_gdk_quartz_window_init_windowing (GdkDisplay *display)
+_gdk_quartz_surface_init_windowing (GdkDisplay *display)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
g_assert (_gdk_root == NULL);
_gdk_root = _gdk_display_create_window (display);
- _gdk_root->impl = g_object_new (_gdk_root_window_impl_quartz_get_type (), NULL);
- _gdk_root->impl_window = _gdk_root;
+ _gdk_root->impl = g_object_new (_gdk_root_surface_impl_quartz_get_type (), NULL);
+ _gdk_root->impl_surface = _gdk_root;
- impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl);
_gdk_quartz_screen_update_window_sizes (screen);
- _gdk_root->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
- _gdk_root->window_type = GDK_WINDOW_ROOT;
+ _gdk_root->state = 0; /* We don't want GDK_SURFACE_STATE_WITHDRAWN here */
+ _gdk_root->surface_type = GDK_SURFACE_ROOT;
_gdk_root->viewable = TRUE;
impl->wrapper = _gdk_root;
}
static void
-gdk_quartz_window_destroy (GdkWindow *window,
+gdk_quartz_surface_destroy (GdkSurface *window,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowImplQuartz *impl;
- GdkWindow *parent;
+ GdkSurfaceImplQuartz *impl;
+ GdkSurface *parent;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
main_window_stack = g_slist_remove (main_window_stack, window);
@@ -915,7 +915,7 @@ gdk_quartz_window_destroy (GdkWindow *window,
parent = window->parent;
if (parent)
{
- GdkWindowImplQuartz *parent_impl = GDK_WINDOW_IMPL_QUARTZ (parent->impl);
+ GdkSurfaceImplQuartz *parent_impl = GDK_SURFACE_IMPL_QUARTZ (parent->impl);
parent_impl->sorted_children = g_list_remove (parent_impl->sorted_children, window);
}
@@ -945,24 +945,24 @@ gdk_quartz_window_destroy (GdkWindow *window,
* note that already_mapped is not used yet, see the x11 backend.
*/
static void
-gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped)
+gdk_surface_quartz_show (GdkSurface *window, gboolean already_mapped)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gboolean focus_on_map;
GDK_QUARTZ_ALLOC_POOL;
- if (!GDK_WINDOW_IS_MAPPED (window))
+ if (!GDK_SURFACE_IS_MAPPED (window))
focus_on_map = window->focus_on_map;
else
focus_on_map = TRUE;
- if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel)
+ if (SURFACE_IS_TOPLEVEL (window) && impl->toplevel)
{
gboolean make_key;
make_key = (window->accept_focus && focus_on_map &&
- window->window_type != GDK_WINDOW_TEMP);
+ window->surface_type != GDK_SURFACE_TEMP);
[(GdkQuartzNSWindow*)impl->toplevel showAndMakeKey:make_key];
clear_toplevel_order ();
@@ -976,16 +976,16 @@ gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped)
[impl->view setNeedsDisplay:YES];
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_WITHDRAWN, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_WITHDRAWN, 0);
- if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
- gdk_window_maximize (window);
+ if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
+ gdk_surface_maximize (window);
- if (window->state & GDK_WINDOW_STATE_ICONIFIED)
- gdk_window_iconify (window);
+ if (window->state & GDK_SURFACE_STATE_ICONIFIED)
+ gdk_surface_iconify (window);
- if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for))
- _gdk_quartz_window_attach_to_parent (window);
+ if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for))
+ _gdk_quartz_surface_attach_to_parent (window);
GDK_QUARTZ_RELEASE_POOL;
}
@@ -994,21 +994,21 @@ gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped)
* transient.
*/
void
-_gdk_quartz_window_detach_from_parent (GdkWindow *window)
+_gdk_quartz_surface_detach_from_parent (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
g_return_if_fail (impl->toplevel != NULL);
- if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for))
+ if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for))
{
- GdkWindowImplQuartz *parent_impl;
+ GdkSurfaceImplQuartz *parent_impl;
- parent_impl = GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl);
+ parent_impl = GDK_SURFACE_IMPL_QUARTZ (impl->transient_for->impl);
[parent_impl->toplevel removeChildWindow:impl->toplevel];
clear_toplevel_order ();
}
@@ -1016,30 +1016,30 @@ _gdk_quartz_window_detach_from_parent (GdkWindow *window)
/* Re-sets the parent window, if the window is a transient. */
void
-_gdk_quartz_window_attach_to_parent (GdkWindow *window)
+_gdk_quartz_surface_attach_to_parent (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
g_return_if_fail (impl->toplevel != NULL);
- if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for))
+ if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for))
{
- GdkWindowImplQuartz *parent_impl;
+ GdkSurfaceImplQuartz *parent_impl;
- parent_impl = GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl);
+ parent_impl = GDK_SURFACE_IMPL_QUARTZ (impl->transient_for->impl);
[parent_impl->toplevel addChildWindow:impl->toplevel ordered:NSWindowAbove];
clear_toplevel_order ();
}
}
void
-gdk_window_quartz_hide (GdkWindow *window)
+gdk_surface_quartz_hide (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
/* Make sure we're not stuck in fullscreen mode. */
#ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
@@ -1047,19 +1047,19 @@ gdk_window_quartz_hide (GdkWindow *window)
SetSystemUIMode (kUIModeNormal, 0);
#endif
- _gdk_window_clear_update_area (window);
+ _gdk_surface_clear_update_area (window);
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
{
/* Update main window. */
main_window_stack = g_slist_remove (main_window_stack, window);
if ([NSApp mainWindow] == impl->toplevel)
- _gdk_quartz_window_did_resign_main (window);
+ _gdk_quartz_surface_did_resign_main (window);
if (impl->transient_for)
- _gdk_quartz_window_detach_from_parent (window);
+ _gdk_quartz_surface_detach_from_parent (window);
[(GdkQuartzNSWindow*)impl->toplevel hide];
}
@@ -1070,19 +1070,19 @@ gdk_window_quartz_hide (GdkWindow *window)
}
void
-gdk_window_quartz_withdraw (GdkWindow *window)
+gdk_surface_quartz_withdraw (GdkSurface *window)
{
- gdk_window_hide (window);
+ gdk_surface_hide (window);
}
static void
-move_resize_window_internal (GdkWindow *window,
+move_resize_window_internal (GdkSurface *window,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
GdkRectangle old_visible;
GdkRectangle new_visible;
GdkRectangle scroll_rect;
@@ -1090,10 +1090,10 @@ move_resize_window_internal (GdkWindow *window,
cairo_region_t *expose_region;
NSSize delta;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if ((x == -1 || (x == window->x)) &&
(y == -1 || (y == window->y)) &&
@@ -1149,7 +1149,7 @@ move_resize_window_internal (GdkWindow *window,
NSRect frame_rect;
gint gx, gy;
- _gdk_quartz_window_gdk_xy_to_xy (window->x, window->y + window->height,
+ _gdk_quartz_surface_gdk_xy_to_xy (window->x, window->y + window->height,
&gx, &gy);
content_rect = NSMakeRect (gx, gy, window->width, window->height);
@@ -1198,7 +1198,7 @@ move_resize_window_internal (GdkWindow *window,
[impl->view setFrame:nsrect];
- gdk_quartz_window_set_needs_display_in_region (window, expose_region);
+ gdk_quartz_surface_set_needs_display_in_region (window, expose_region);
}
else
{
@@ -1215,26 +1215,26 @@ move_resize_window_internal (GdkWindow *window,
}
static inline void
-window_quartz_move (GdkWindow *window,
+window_quartz_move (GdkSurface *window,
gint x,
gint y)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
move_resize_window_internal (window, x, y, -1, -1);
}
static inline void
-window_quartz_resize (GdkWindow *window,
+window_quartz_resize (GdkSurface *window,
gint width,
gint height)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
if (width < 1)
@@ -1246,7 +1246,7 @@ window_quartz_resize (GdkWindow *window,
}
static inline void
-window_quartz_move_resize (GdkWindow *window,
+window_quartz_move_resize (GdkSurface *window,
gint x,
gint y,
gint width,
@@ -1261,7 +1261,7 @@ window_quartz_move_resize (GdkWindow *window,
}
static void
-gdk_window_quartz_move_resize (GdkWindow *window,
+gdk_surface_quartz_move_resize (GdkSurface *window,
gboolean with_move,
gint x,
gint y,
@@ -1286,12 +1286,12 @@ gdk_window_quartz_move_resize (GdkWindow *window,
static void
update_toplevel_order (void)
{
- GdkWindowImplQuartz *root_impl;
+ GdkSurfaceImplQuartz *root_impl;
NSEnumerator *enumerator;
id nswindow;
GList *toplevels = NULL;
- root_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl);
+ root_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl);
if (root_impl->sorted_children)
return;
@@ -1301,7 +1301,7 @@ update_toplevel_order (void)
enumerator = [[NSApp orderedWindows] objectEnumerator];
while ((nswindow = [enumerator nextObject]))
{
- GdkWindow *window;
+ GdkSurface *window;
if (![[nswindow contentView] isKindOfClass:[GdkQuartzView class]])
continue;
@@ -1318,38 +1318,38 @@ update_toplevel_order (void)
static void
clear_toplevel_order (void)
{
- GdkWindowImplQuartz *root_impl;
+ GdkSurfaceImplQuartz *root_impl;
- root_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl);
+ root_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl);
g_list_free (root_impl->sorted_children);
root_impl->sorted_children = NULL;
}
static void
-gdk_window_quartz_raise (GdkWindow *window)
+gdk_surface_quartz_raise (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
[impl->toplevel orderFront:impl->toplevel];
clear_toplevel_order ();
}
else
{
- GdkWindow *parent = window->parent;
+ GdkSurface *parent = window->parent;
if (parent)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- impl = (GdkWindowImplQuartz *)parent->impl;
+ impl = (GdkSurfaceImplQuartz *)parent->impl;
impl->sorted_children = g_list_remove (impl->sorted_children, window);
impl->sorted_children = g_list_prepend (impl->sorted_children, window);
@@ -1358,29 +1358,29 @@ gdk_window_quartz_raise (GdkWindow *window)
}
static void
-gdk_window_quartz_lower (GdkWindow *window)
+gdk_surface_quartz_lower (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
[impl->toplevel orderBack:impl->toplevel];
clear_toplevel_order ();
}
else
{
- GdkWindow *parent = window->parent;
+ GdkSurface *parent = window->parent;
if (parent)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- impl = (GdkWindowImplQuartz *)parent->impl;
+ impl = (GdkSurfaceImplQuartz *)parent->impl;
impl->sorted_children = g_list_remove (impl->sorted_children, window);
impl->sorted_children = g_list_append (impl->sorted_children, window);
@@ -1389,17 +1389,17 @@ gdk_window_quartz_lower (GdkWindow *window)
}
static void
-gdk_window_quartz_restack_toplevel (GdkWindow *window,
- GdkWindow *sibling,
+gdk_surface_quartz_restack_toplevel (GdkSurface *window,
+ GdkSurface *sibling,
gboolean above)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
gint sibling_num;
- impl = GDK_WINDOW_IMPL_QUARTZ (sibling->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (sibling->impl);
sibling_num = [impl->toplevel windowNumber];
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (above)
[impl->toplevel orderWindow:NSWindowAbove relativeTo:sibling_num];
@@ -1408,19 +1408,19 @@ gdk_window_quartz_restack_toplevel (GdkWindow *window,
}
static void
-gdk_window_quartz_get_geometry (GdkWindow *window,
+gdk_surface_quartz_get_geometry (GdkSurface *window,
gint *x,
gint *y,
gint *width,
gint *height)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
NSRect ns_rect;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (window == _gdk_root)
{
if (x)
@@ -1433,7 +1433,7 @@ gdk_window_quartz_get_geometry (GdkWindow *window,
if (height)
*height = window->height;
}
- else if (WINDOW_IS_TOPLEVEL (window))
+ else if (SURFACE_IS_TOPLEVEL (window))
{
ns_rect = [impl->toplevel contentRectForFrameRect:[impl->toplevel frame]];
@@ -1447,7 +1447,7 @@ gdk_window_quartz_get_geometry (GdkWindow *window,
*/
if ([impl->toplevel styleMask] == NSBorderlessWindowMask)
{
- _gdk_quartz_window_xy_to_gdk_xy (ns_rect.origin.x,
+ _gdk_quartz_surface_xy_to_gdk_xy (ns_rect.origin.x,
ns_rect.origin.y + ns_rect.size.height,
x, y);
}
@@ -1480,18 +1480,18 @@ gdk_window_quartz_get_geometry (GdkWindow *window,
}
static void
-gdk_window_quartz_get_root_coords (GdkWindow *window,
+gdk_surface_quartz_get_root_coords (GdkSurface *window,
gint x,
gint y,
gint *root_x,
gint *root_y)
{
int tmp_x = 0, tmp_y = 0;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
NSRect content_rect;
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
{
if (root_x)
*root_x = 0;
@@ -1511,12 +1511,12 @@ gdk_window_quartz_get_root_coords (GdkWindow *window,
return;
}
- toplevel = gdk_window_get_toplevel (window);
- impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl);
+ toplevel = gdk_surface_get_toplevel (window);
+ impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl);
content_rect = [impl->toplevel contentRectForFrameRect:[impl->toplevel frame]];
- _gdk_quartz_window_xy_to_gdk_xy (content_rect.origin.x,
+ _gdk_quartz_surface_xy_to_gdk_xy (content_rect.origin.x,
content_rect.origin.y + content_rect.size.height,
&tmp_x, &tmp_y);
@@ -1525,7 +1525,7 @@ gdk_window_quartz_get_root_coords (GdkWindow *window,
while (window != toplevel)
{
- if (_gdk_window_has_impl ((GdkWindow *)window))
+ if (_gdk_surface_has_impl ((GdkSurface *)window))
{
tmp_x += window->x;
tmp_y += window->y;
@@ -1541,8 +1541,8 @@ gdk_window_quartz_get_root_coords (GdkWindow *window,
}
/* Returns coordinates relative to the passed in window. */
-static GdkWindow *
-gdk_window_quartz_get_device_state_helper (GdkWindow *window,
+static GdkSurface *
+gdk_surface_quartz_get_device_state_helper (GdkSurface *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
@@ -1550,12 +1550,12 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window,
{
NSPoint point;
gint x_tmp, y_tmp;
- GdkWindow *toplevel;
- GdkWindow *found_window;
+ GdkSurface *toplevel;
+ GdkSurface *found_window;
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
{
*x = 0;
*y = 0;
@@ -1563,7 +1563,7 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window,
return NULL;
}
- toplevel = gdk_window_get_toplevel (window);
+ toplevel = gdk_surface_get_toplevel (window);
*mask = _gdk_quartz_events_get_current_keyboard_modifiers () |
_gdk_quartz_events_get_current_mouse_modifiers ();
@@ -1572,14 +1572,14 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window,
if (window == _gdk_root)
{
point = [NSEvent mouseLocation];
- _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
+ _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
}
else
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
NSWindow *nswindow;
- impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl);
nswindow = impl->toplevel;
point = [nswindow mouseLocationOutsideOfEventStream];
@@ -1587,10 +1587,10 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window,
x_tmp = point.x;
y_tmp = toplevel->height - point.y;
- window = (GdkWindow *)toplevel;
+ window = (GdkSurface *)toplevel;
}
- found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp,
+ found_window = _gdk_quartz_surface_find_child (window, x_tmp, y_tmp,
FALSE);
/* We never return the root window. */
@@ -1604,58 +1604,58 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window,
}
static gboolean
-gdk_window_quartz_get_device_state (GdkWindow *window,
+gdk_surface_quartz_get_device_state (GdkSurface *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
- return gdk_window_quartz_get_device_state_helper (window,
+ return gdk_surface_quartz_get_device_state_helper (window,
device,
x, y, mask) != NULL;
}
static GdkEventMask
-gdk_window_quartz_get_events (GdkWindow *window)
+gdk_surface_quartz_get_events (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return 0;
else
return window->event_mask;
}
static void
-gdk_window_quartz_set_events (GdkWindow *window,
+gdk_surface_quartz_set_events (GdkSurface *window,
GdkEventMask event_mask)
{
/* The mask is set in the common code. */
}
static void
-gdk_quartz_window_set_urgency_hint (GdkWindow *window,
+gdk_quartz_surface_set_urgency_hint (GdkSurface *window,
gboolean urgent)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
/* FIXME: Implement */
}
static void
-gdk_quartz_window_set_geometry_hints (GdkWindow *window,
+gdk_quartz_surface_set_geometry_hints (GdkSurface *window,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
+ GdkSurfaceHints geom_mask)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
g_return_if_fail (geometry != NULL);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->toplevel)
return;
@@ -1731,18 +1731,18 @@ gdk_quartz_window_set_geometry_hints (GdkWindow *window,
}
static void
-gdk_quartz_window_set_title (GdkWindow *window,
+gdk_quartz_surface_set_title (GdkSurface *window,
const gchar *title)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
g_return_if_fail (title != NULL);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (impl->toplevel)
{
@@ -1753,49 +1753,49 @@ gdk_quartz_window_set_title (GdkWindow *window,
}
static void
-gdk_quartz_window_set_role (GdkWindow *window,
+gdk_quartz_surface_set_role (GdkSurface *window,
const gchar *role)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ SURFACE_IS_TOPLEVEL (window))
return;
/* FIXME: Implement */
}
static void
-gdk_quartz_window_set_startup_id (GdkWindow *window,
+gdk_quartz_surface_set_startup_id (GdkSurface *window,
const gchar *startup_id)
{
/* FIXME: Implement? */
}
static void
-gdk_quartz_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
+gdk_quartz_surface_set_transient_for (GdkSurface *window,
+ GdkSurface *parent)
{
- GdkWindowImplQuartz *window_impl;
- GdkWindowImplQuartz *parent_impl;
+ GdkSurfaceImplQuartz *surface_impl;
+ GdkSurfaceImplQuartz *parent_impl;
- if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (parent) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) || GDK_SURFACE_DESTROYED (parent) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- window_impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- if (!window_impl->toplevel)
+ surface_impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ if (!surface_impl->toplevel)
return;
GDK_QUARTZ_ALLOC_POOL;
- if (window_impl->transient_for)
+ if (surface_impl->transient_for)
{
- _gdk_quartz_window_detach_from_parent (window);
+ _gdk_quartz_surface_detach_from_parent (window);
- g_object_unref (window_impl->transient_for);
- window_impl->transient_for = NULL;
+ g_object_unref (surface_impl->transient_for);
+ surface_impl->transient_for = NULL;
}
- parent_impl = GDK_WINDOW_IMPL_QUARTZ (parent->impl);
+ parent_impl = GDK_SURFACE_IMPL_QUARTZ (parent->impl);
if (parent_impl->toplevel)
{
/* We save the parent because it needs to be unset/reset when
@@ -1807,16 +1807,16 @@ gdk_quartz_window_set_transient_for (GdkWindow *window,
* the parent window will be brought to the top just because the
* tooltip is, which is not what we want.
*/
- if (gdk_window_get_type_hint (window) != GDK_WINDOW_TYPE_HINT_TOOLTIP)
+ if (gdk_surface_get_type_hint (window) != GDK_SURFACE_TYPE_HINT_TOOLTIP)
{
- window_impl->transient_for = g_object_ref (parent);
+ surface_impl->transient_for = g_object_ref (parent);
/* We only add the window if it is shown, otherwise it will
* be shown unconditionally here. If it is not shown, the
* window will be added in show() instead.
*/
- if (!(window->state & GDK_WINDOW_STATE_WITHDRAWN))
- _gdk_quartz_window_attach_to_parent (window);
+ if (!(window->state & GDK_SURFACE_STATE_WITHDRAWN))
+ _gdk_quartz_surface_attach_to_parent (window);
}
}
@@ -1824,7 +1824,7 @@ gdk_quartz_window_set_transient_for (GdkWindow *window,
}
static void
-gdk_window_quartz_shape_combine_region (GdkWindow *window,
+gdk_surface_quartz_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape,
gint x,
gint y)
@@ -1833,7 +1833,7 @@ gdk_window_quartz_shape_combine_region (GdkWindow *window,
}
static void
-gdk_window_quartz_input_shape_combine_region (GdkWindow *window,
+gdk_surface_quartz_input_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
@@ -1842,39 +1842,39 @@ gdk_window_quartz_input_shape_combine_region (GdkWindow *window,
}
static void
-gdk_quartz_window_set_accept_focus (GdkWindow *window,
+gdk_quartz_surface_set_accept_focus (GdkSurface *window,
gboolean accept_focus)
{
window->accept_focus = accept_focus != FALSE;
}
static void
-gdk_quartz_window_set_focus_on_map (GdkWindow *window,
+gdk_quartz_surface_set_focus_on_map (GdkSurface *window,
gboolean focus_on_map)
{
window->focus_on_map = focus_on_map != FALSE;
}
static void
-gdk_quartz_window_set_icon_name (GdkWindow *window,
+gdk_quartz_surface_set_icon_name (GdkSurface *window,
const gchar *name)
{
/* FIXME: Implement */
}
static void
-gdk_quartz_window_focus (GdkWindow *window,
+gdk_quartz_surface_focus (GdkSurface *window,
guint32 timestamp)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- if (window->accept_focus && window->window_type != GDK_WINDOW_TEMP)
+ if (window->accept_focus && window->surface_type != GDK_SURFACE_TEMP)
{
GDK_QUARTZ_ALLOC_POOL;
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
@@ -1884,37 +1884,37 @@ gdk_quartz_window_focus (GdkWindow *window,
}
static gint
-window_type_hint_to_level (GdkWindowTypeHint hint)
+surface_type_hint_to_level (GdkSurfaceTypeHint hint)
{
/* the order in this switch statement corresponds to the actual
* stacking order: the first group is top, the last group is bottom
*/
switch (hint)
{
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
- case GDK_WINDOW_TYPE_HINT_DND:
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_DND:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
return NSPopUpMenuWindowLevel;
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
return NSStatusWindowLevel;
- case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
+ case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
return NSTornOffMenuWindowLevel;
- case GDK_WINDOW_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_DOCK:
return NSFloatingWindowLevel; /* NSDockWindowLevel is deprecated, and not replaced */
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */
- case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */
- case GDK_WINDOW_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_DIALOG: /* Dialog window */
+ case GDK_SURFACE_TYPE_HINT_NORMAL: /* Normal toplevel window */
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */
return NSNormalWindowLevel;
- case GDK_WINDOW_TYPE_HINT_DESKTOP:
+ case GDK_SURFACE_TYPE_HINT_DESKTOP:
return kCGDesktopWindowLevelKey; /* doesn't map to any real Cocoa model */
default:
@@ -1925,26 +1925,26 @@ window_type_hint_to_level (GdkWindowTypeHint hint)
}
static gboolean
-window_type_hint_to_shadow (GdkWindowTypeHint hint)
+surface_type_hint_to_shadow (GdkSurfaceTypeHint hint)
{
switch (hint)
{
- case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */
- case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */
- case GDK_WINDOW_TYPE_HINT_DOCK:
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_NORMAL: /* Normal toplevel window */
+ case GDK_SURFACE_TYPE_HINT_DIALOG: /* Dialog window */
+ case GDK_SURFACE_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
return TRUE;
- case GDK_WINDOW_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */
- case GDK_WINDOW_TYPE_HINT_DESKTOP: /* N/A */
- case GDK_WINDOW_TYPE_HINT_DND:
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */
+ case GDK_SURFACE_TYPE_HINT_DESKTOP: /* N/A */
+ case GDK_SURFACE_TYPE_HINT_DND:
break;
default:
@@ -1955,15 +1955,15 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint)
}
static gboolean
-window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
+surface_type_hint_to_hides_on_deactivate (GdkSurfaceTypeHint hint)
{
switch (hint)
{
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
return TRUE;
default:
@@ -1974,105 +1974,105 @@ window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
}
static void
-_gdk_quartz_window_update_has_shadow (GdkWindowImplQuartz *impl)
+_gdk_quartz_surface_update_has_shadow (GdkSurfaceImplQuartz *impl)
{
gboolean has_shadow;
/* In case there is any shadow set we have to turn off the
* NSWindow setHasShadow as the system drawn ones wont match our
* window boundary anymore */
- has_shadow = (window_type_hint_to_shadow (impl->type_hint) && !impl->shadow_max);
+ has_shadow = (surface_type_hint_to_shadow (impl->type_hint) && !impl->shadow_max);
[impl->toplevel setHasShadow: has_shadow];
}
static void
-gdk_quartz_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
+gdk_quartz_surface_set_type_hint (GdkSurface *window,
+ GdkSurfaceTypeHint hint)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
impl->type_hint = hint;
/* Match the documentation, only do something if we're not mapped yet. */
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
return;
- _gdk_quartz_window_update_has_shadow (impl);
- [impl->toplevel setLevel: window_type_hint_to_level (hint)];
- [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
+ _gdk_quartz_surface_update_has_shadow (impl);
+ [impl->toplevel setLevel: surface_type_hint_to_level (hint)];
+ [impl->toplevel setHidesOnDeactivate: surface_type_hint_to_hides_on_deactivate (hint)];
}
-static GdkWindowTypeHint
-gdk_quartz_window_get_type_hint (GdkWindow *window)
+static GdkSurfaceTypeHint
+gdk_quartz_surface_get_type_hint (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
- return GDK_WINDOW_TYPE_HINT_NORMAL;
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
+ return GDK_SURFACE_TYPE_HINT_NORMAL;
- return GDK_WINDOW_IMPL_QUARTZ (window->impl)->type_hint;
+ return GDK_SURFACE_IMPL_QUARTZ (window->impl)->type_hint;
}
static void
-gdk_quartz_window_set_modal_hint (GdkWindow *window,
+gdk_quartz_surface_set_modal_hint (GdkSurface *window,
gboolean modal)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
/* FIXME: Implement */
}
static void
-gdk_quartz_window_set_skip_taskbar_hint (GdkWindow *window,
+gdk_quartz_surface_set_skip_taskbar_hint (GdkSurface *window,
gboolean skips_taskbar)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
/* FIXME: Implement */
}
static void
-gdk_quartz_window_set_skip_pager_hint (GdkWindow *window,
+gdk_quartz_surface_set_skip_pager_hint (GdkSurface *window,
gboolean skips_pager)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
/* FIXME: Implement */
}
static void
-gdk_quartz_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+gdk_quartz_surface_begin_resize_drag (GdkSurface *window,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->toplevel)
{
- g_warning ("Can't call gdk_window_begin_resize_drag on non-toplevel window");
+ g_warning ("Can't call gdk_surface_begin_resize_drag on non-toplevel window");
return;
}
@@ -2080,24 +2080,24 @@ gdk_quartz_window_begin_resize_drag (GdkWindow *window,
}
static void
-gdk_quartz_window_begin_move_drag (GdkWindow *window,
+gdk_quartz_surface_begin_move_drag (GdkSurface *window,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->toplevel)
{
- g_warning ("Can't call gdk_window_begin_move_drag on non-toplevel window");
+ g_warning ("Can't call gdk_surface_begin_move_drag on non-toplevel window");
return;
}
@@ -2105,18 +2105,18 @@ gdk_quartz_window_begin_move_drag (GdkWindow *window,
}
static void
-gdk_quartz_window_set_icon_list (GdkWindow *window,
+gdk_quartz_surface_set_icon_list (GdkSurface *window,
GList *surfaces)
{
/* FIXME: Implement */
}
static void
-gdk_quartz_window_get_frame_extents (GdkWindow *window,
+gdk_quartz_surface_get_frame_extents (GdkSurface *window,
GdkRectangle *rect)
{
- GdkWindow *toplevel;
- GdkWindowImplQuartz *impl;
+ GdkSurface *toplevel;
+ GdkSurfaceImplQuartz *impl;
NSRect ns_rect;
g_return_if_fail (rect != NULL);
@@ -2127,12 +2127,12 @@ gdk_quartz_window_get_frame_extents (GdkWindow *window,
rect->width = 1;
rect->height = 1;
- toplevel = gdk_window_get_toplevel (window);
- impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl);
+ toplevel = gdk_surface_get_toplevel (window);
+ impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl);
ns_rect = [impl->toplevel frame];
- _gdk_quartz_window_xy_to_gdk_xy (ns_rect.origin.x,
+ _gdk_quartz_surface_xy_to_gdk_xy (ns_rect.origin.x,
ns_rect.origin.y + ns_rect.size.height,
&rect->x, &rect->y);
@@ -2149,21 +2149,21 @@ gdk_quartz_window_get_frame_extents (GdkWindow *window,
@end
static void
-gdk_quartz_window_set_decorations (GdkWindow *window,
+gdk_quartz_surface_set_decorations (GdkSurface *window,
GdkWMDecoration decorations)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
NSUInteger old_mask, new_mask;
NSView *old_view;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (decorations == 0 || GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN )
+ if (decorations == 0 || GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN )
{
new_mask = NSBorderlessWindowMask;
}
@@ -2232,7 +2232,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
NSScreen *screen = [impl->toplevel screen];
/* Make sure the old window is closed, recall that releasedWhenClosed
- * is set on GdkQuartzWindows.
+ * is set on GdkQuartzSurfaces.
*/
[impl->toplevel close];
@@ -2241,13 +2241,13 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
backing:NSBackingStoreBuffered
defer:NO
screen:screen];
- _gdk_quartz_window_update_has_shadow (impl);
+ _gdk_quartz_surface_update_has_shadow (impl);
- [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
+ [impl->toplevel setLevel: surface_type_hint_to_level (impl->type_hint)];
if (title)
[impl->toplevel setTitle:title];
[impl->toplevel setBackgroundColor:bg];
- [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
+ [impl->toplevel setHidesOnDeactivate: surface_type_hint_to_hides_on_deactivate (impl->type_hint)];
[impl->toplevel setContentView:old_view];
}
@@ -2272,16 +2272,16 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
}
static gboolean
-gdk_quartz_window_get_decorations (GdkWindow *window,
+gdk_quartz_surface_get_decorations (GdkSurface *window,
GdkWMDecoration *decorations)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return FALSE;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (decorations)
{
@@ -2301,15 +2301,15 @@ gdk_quartz_window_get_decorations (GdkWindow *window,
}
static void
-gdk_quartz_window_set_functions (GdkWindow *window,
+gdk_quartz_surface_set_functions (GdkSurface *window,
GdkWMFunction functions)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
gboolean min, max, close;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (functions & GDK_FUNC_ALL)
{
@@ -2348,35 +2348,35 @@ gdk_quartz_window_set_functions (GdkWindow *window,
}
static void
-gdk_quartz_window_stick (GdkWindow *window)
+gdk_quartz_surface_stick (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_quartz_window_unstick (GdkWindow *window)
+gdk_quartz_surface_unstick (GdkSurface *window)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
}
static void
-gdk_quartz_window_maximize (GdkWindow *window)
+gdk_quartz_surface_maximize (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
gboolean maximized;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
GDK_QUARTZ_ALLOC_POOL;
@@ -2388,19 +2388,19 @@ gdk_quartz_window_maximize (GdkWindow *window)
}
static void
-gdk_quartz_window_unmaximize (GdkWindow *window)
+gdk_quartz_surface_unmaximize (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
gboolean maximized;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
- maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
+ maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
GDK_QUARTZ_ALLOC_POOL;
@@ -2412,17 +2412,17 @@ gdk_quartz_window_unmaximize (GdkWindow *window)
}
static void
-gdk_quartz_window_iconify (GdkWindow *window)
+gdk_quartz_surface_iconify (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
GDK_QUARTZ_ALLOC_POOL;
@@ -2433,24 +2433,24 @@ gdk_quartz_window_iconify (GdkWindow *window)
}
else
{
- gdk_synthesize_window_state (window,
+ gdk_synthesize_surface_state (window,
0,
- GDK_WINDOW_STATE_ICONIFIED);
+ GDK_SURFACE_STATE_ICONIFIED);
}
}
static void
-gdk_quartz_window_deiconify (GdkWindow *window)
+gdk_quartz_surface_deiconify (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
GDK_QUARTZ_ALLOC_POOL;
@@ -2461,8 +2461,8 @@ gdk_quartz_window_deiconify (GdkWindow *window)
}
else
{
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_ICONIFIED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_ICONIFIED,
0);
}
}
@@ -2470,78 +2470,78 @@ gdk_quartz_window_deiconify (GdkWindow *window)
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
static gboolean
-window_is_fullscreen (GdkWindow *window)
+window_is_fullscreen (GdkSurface *window)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
return ([impl->toplevel styleMask] & NSFullScreenWindowMask) != 0;
}
static void
-gdk_quartz_window_fullscreen (GdkWindow *window)
+gdk_quartz_surface_fullscreen (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!window_is_fullscreen (window))
[impl->toplevel toggleFullScreen:nil];
}
static void
-gdk_quartz_window_unfullscreen (GdkWindow *window)
+gdk_quartz_surface_unfullscreen (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (window_is_fullscreen (window))
[impl->toplevel toggleFullScreen:nil];
}
void
-_gdk_quartz_window_update_fullscreen_state (GdkWindow *window)
+_gdk_quartz_surface_update_fullscreen_state (GdkSurface *window)
{
gboolean is_fullscreen;
gboolean was_fullscreen;
is_fullscreen = window_is_fullscreen (window);
- was_fullscreen = (gdk_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) != 0;
+ was_fullscreen = (gdk_surface_get_state (window) & GDK_SURFACE_STATE_FULLSCREEN) != 0;
if (is_fullscreen != was_fullscreen)
{
if (is_fullscreen)
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
else
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0);
}
}
#else
static FullscreenSavedGeometry *
-get_fullscreen_geometry (GdkWindow *window)
+get_fullscreen_geometry (GdkSurface *window)
{
return g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA);
}
static void
-gdk_quartz_window_fullscreen (GdkWindow *window)
+gdk_quartz_surface_fullscreen (GdkSurface *window)
{
FullscreenSavedGeometry *geometry;
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
NSRect frame;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
geometry = get_fullscreen_geometry (window);
@@ -2554,14 +2554,14 @@ gdk_quartz_window_fullscreen (GdkWindow *window)
geometry->width = window->width;
geometry->height = window->height;
- if (!gdk_window_get_decorations (window, &geometry->decor))
+ if (!gdk_surface_get_decorations (window, &geometry->decor))
geometry->decor = GDK_DECOR_ALL;
g_object_set_data_full (G_OBJECT (window),
FULLSCREEN_DATA, geometry,
g_free);
- gdk_window_set_decorations (window, 0);
+ gdk_surface_set_decorations (window, 0);
frame = [[impl->toplevel screen] frame];
move_resize_window_internal (window,
@@ -2575,17 +2575,17 @@ gdk_quartz_window_fullscreen (GdkWindow *window)
SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar);
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
}
static void
-gdk_quartz_window_unfullscreen (GdkWindow *window)
+gdk_quartz_surface_unfullscreen (GdkSurface *window)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
FullscreenSavedGeometry *geometry;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
geometry = get_fullscreen_geometry (window);
@@ -2599,64 +2599,64 @@ gdk_quartz_window_unfullscreen (GdkWindow *window)
geometry->width,
geometry->height);
- gdk_window_set_decorations (window, geometry->decor);
+ gdk_surface_set_decorations (window, geometry->decor);
g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL);
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
clear_toplevel_order ();
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0);
}
}
#endif
static void
-gdk_quartz_window_set_keep_above (GdkWindow *window,
+gdk_quartz_surface_set_keep_above (GdkSurface *window,
gboolean setting)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gint level;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- level = window_type_hint_to_level (gdk_window_get_type_hint (window));
+ level = surface_type_hint_to_level (gdk_surface_get_type_hint (window));
/* Adjust normal window level by one if necessary. */
[impl->toplevel setLevel: level + (setting ? 1 : 0)];
}
static void
-gdk_quartz_window_set_keep_below (GdkWindow *window,
+gdk_quartz_surface_set_keep_below (GdkSurface *window,
gboolean setting)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gint level;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
- level = window_type_hint_to_level (gdk_window_get_type_hint (window));
+ level = surface_type_hint_to_level (gdk_surface_get_type_hint (window));
/* Adjust normal window level by one if necessary. */
[impl->toplevel setLevel: level - (setting ? 1 : 0)];
}
-static GdkWindow *
-gdk_quartz_window_get_group (GdkWindow *window)
+static GdkSurface *
+gdk_quartz_surface_get_group (GdkSurface *window)
{
- g_return_val_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD, NULL);
+ g_return_val_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD, NULL);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return NULL;
/* FIXME: Implement */
@@ -2665,29 +2665,29 @@ gdk_quartz_window_get_group (GdkWindow *window)
}
static void
-gdk_quartz_window_set_group (GdkWindow *window,
- GdkWindow *leader)
+gdk_quartz_surface_set_group (GdkSurface *window,
+ GdkSurface *leader)
{
/* FIXME: Implement */
}
static void
-gdk_quartz_window_destroy_notify (GdkWindow *window)
+gdk_quartz_surface_destroy_notify (GdkSurface *window)
{
check_grab_destroy (window);
}
static void
-gdk_quartz_window_set_opacity (GdkWindow *window,
+gdk_quartz_surface_set_opacity (GdkSurface *window,
gdouble opacity)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (SURFACE_IS_TOPLEVEL (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
if (opacity < 0)
@@ -2699,24 +2699,24 @@ gdk_quartz_window_set_opacity (GdkWindow *window,
}
static void
-gdk_quartz_window_set_shadow_width (GdkWindow *window,
+gdk_quartz_surface_set_shadow_width (GdkSurface *window,
gint left,
gint right,
gint top,
gint bottom)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (SURFACE_IS_TOPLEVEL (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ !SURFACE_IS_TOPLEVEL (window))
return;
impl->shadow_top = top;
impl->shadow_max = MAX (MAX (left, right), MAX (top, bottom));
- _gdk_quartz_window_update_has_shadow (impl);
+ _gdk_quartz_surface_update_has_shadow (impl);
}
/* Protocol to build cleanly for OSX < 10.7 */
@@ -2725,14 +2725,14 @@ gdk_quartz_window_set_shadow_width (GdkWindow *window,
@end
static gint
-gdk_quartz_window_get_scale_factor (GdkWindow *window)
+gdk_quartz_surface_get_scale_factor (GdkSurface *window)
{
- GdkWindowImplQuartz *impl;
+ GdkSurfaceImplQuartz *impl;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return 1;
- impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+ impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (impl->toplevel != NULL && gdk_quartz_osx_version() >= GDK_OSX_LION)
return [(id <ScaleFactor>) impl->toplevel backingScaleFactor];
@@ -2741,85 +2741,85 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
}
static void
-gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
+gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
- GdkWindowImplQuartzClass *impl_quartz_class = GDK_WINDOW_IMPL_QUARTZ_CLASS (klass);
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
+ GdkSurfaceImplQuartzClass *impl_quartz_class = GDK_SURFACE_IMPL_QUARTZ_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = gdk_window_impl_quartz_finalize;
+ object_class->finalize = gdk_surface_impl_quartz_finalize;
impl_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
- impl_class->show = gdk_window_quartz_show;
- impl_class->hide = gdk_window_quartz_hide;
- impl_class->withdraw = gdk_window_quartz_withdraw;
- impl_class->set_events = gdk_window_quartz_set_events;
- impl_class->get_events = gdk_window_quartz_get_events;
- impl_class->raise = gdk_window_quartz_raise;
- impl_class->lower = gdk_window_quartz_lower;
- impl_class->restack_toplevel = gdk_window_quartz_restack_toplevel;
- impl_class->move_resize = gdk_window_quartz_move_resize;
- impl_class->get_geometry = gdk_window_quartz_get_geometry;
- impl_class->get_root_coords = gdk_window_quartz_get_root_coords;
- impl_class->get_device_state = gdk_window_quartz_get_device_state;
- impl_class->shape_combine_region = gdk_window_quartz_shape_combine_region;
- impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region;
- impl_class->destroy = gdk_quartz_window_destroy;
- impl_class->begin_paint = gdk_window_impl_quartz_begin_paint;
- impl_class->get_scale_factor = gdk_quartz_window_get_scale_factor;
-
- impl_class->focus = gdk_quartz_window_focus;
- impl_class->set_type_hint = gdk_quartz_window_set_type_hint;
- impl_class->get_type_hint = gdk_quartz_window_get_type_hint;
- impl_class->set_modal_hint = gdk_quartz_window_set_modal_hint;
- impl_class->set_skip_taskbar_hint = gdk_quartz_window_set_skip_taskbar_hint;
- impl_class->set_skip_pager_hint = gdk_quartz_window_set_skip_pager_hint;
- impl_class->set_urgency_hint = gdk_quartz_window_set_urgency_hint;
- impl_class->set_geometry_hints = gdk_quartz_window_set_geometry_hints;
- impl_class->set_title = gdk_quartz_window_set_title;
- impl_class->set_role = gdk_quartz_window_set_role;
- impl_class->set_startup_id = gdk_quartz_window_set_startup_id;
- impl_class->set_transient_for = gdk_quartz_window_set_transient_for;
- impl_class->get_frame_extents = gdk_quartz_window_get_frame_extents;
- impl_class->set_accept_focus = gdk_quartz_window_set_accept_focus;
- impl_class->set_focus_on_map = gdk_quartz_window_set_focus_on_map;
- impl_class->set_icon_list = gdk_quartz_window_set_icon_list;
- impl_class->set_icon_name = gdk_quartz_window_set_icon_name;
- impl_class->iconify = gdk_quartz_window_iconify;
- impl_class->deiconify = gdk_quartz_window_deiconify;
- impl_class->stick = gdk_quartz_window_stick;
- impl_class->unstick = gdk_quartz_window_unstick;
- impl_class->maximize = gdk_quartz_window_maximize;
- impl_class->unmaximize = gdk_quartz_window_unmaximize;
- impl_class->fullscreen = gdk_quartz_window_fullscreen;
- impl_class->unfullscreen = gdk_quartz_window_unfullscreen;
- impl_class->set_keep_above = gdk_quartz_window_set_keep_above;
- impl_class->set_keep_below = gdk_quartz_window_set_keep_below;
- impl_class->get_group = gdk_quartz_window_get_group;
- impl_class->set_group = gdk_quartz_window_set_group;
- impl_class->set_decorations = gdk_quartz_window_set_decorations;
- impl_class->get_decorations = gdk_quartz_window_get_decorations;
- impl_class->set_functions = gdk_quartz_window_set_functions;
- impl_class->set_functions = gdk_quartz_window_set_functions;
- impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag;
- impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag;
- impl_class->set_opacity = gdk_quartz_window_set_opacity;
- impl_class->set_shadow_width = gdk_quartz_window_set_shadow_width;
- impl_class->destroy_notify = gdk_quartz_window_destroy_notify;
- impl_class->register_dnd = _gdk_quartz_window_register_dnd;
- impl_class->drag_begin = _gdk_quartz_window_drag_begin;
- impl_class->process_updates_recurse = _gdk_quartz_window_process_updates_recurse;
-
- impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
-
- impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
- impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;
+ impl_class->show = gdk_surface_quartz_show;
+ impl_class->hide = gdk_surface_quartz_hide;
+ impl_class->withdraw = gdk_surface_quartz_withdraw;
+ impl_class->set_events = gdk_surface_quartz_set_events;
+ impl_class->get_events = gdk_surface_quartz_get_events;
+ impl_class->raise = gdk_surface_quartz_raise;
+ impl_class->lower = gdk_surface_quartz_lower;
+ impl_class->restack_toplevel = gdk_surface_quartz_restack_toplevel;
+ impl_class->move_resize = gdk_surface_quartz_move_resize;
+ impl_class->get_geometry = gdk_surface_quartz_get_geometry;
+ impl_class->get_root_coords = gdk_surface_quartz_get_root_coords;
+ impl_class->get_device_state = gdk_surface_quartz_get_device_state;
+ impl_class->shape_combine_region = gdk_surface_quartz_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_surface_quartz_input_shape_combine_region;
+ impl_class->destroy = gdk_quartz_surface_destroy;
+ impl_class->begin_paint = gdk_surface_impl_quartz_begin_paint;
+ impl_class->get_scale_factor = gdk_quartz_surface_get_scale_factor;
+
+ impl_class->focus = gdk_quartz_surface_focus;
+ impl_class->set_type_hint = gdk_quartz_surface_set_type_hint;
+ impl_class->get_type_hint = gdk_quartz_surface_get_type_hint;
+ impl_class->set_modal_hint = gdk_quartz_surface_set_modal_hint;
+ impl_class->set_skip_taskbar_hint = gdk_quartz_surface_set_skip_taskbar_hint;
+ impl_class->set_skip_pager_hint = gdk_quartz_surface_set_skip_pager_hint;
+ impl_class->set_urgency_hint = gdk_quartz_surface_set_urgency_hint;
+ impl_class->set_geometry_hints = gdk_quartz_surface_set_geometry_hints;
+ impl_class->set_title = gdk_quartz_surface_set_title;
+ impl_class->set_role = gdk_quartz_surface_set_role;
+ impl_class->set_startup_id = gdk_quartz_surface_set_startup_id;
+ impl_class->set_transient_for = gdk_quartz_surface_set_transient_for;
+ impl_class->get_frame_extents = gdk_quartz_surface_get_frame_extents;
+ impl_class->set_accept_focus = gdk_quartz_surface_set_accept_focus;
+ impl_class->set_focus_on_map = gdk_quartz_surface_set_focus_on_map;
+ impl_class->set_icon_list = gdk_quartz_surface_set_icon_list;
+ impl_class->set_icon_name = gdk_quartz_surface_set_icon_name;
+ impl_class->iconify = gdk_quartz_surface_iconify;
+ impl_class->deiconify = gdk_quartz_surface_deiconify;
+ impl_class->stick = gdk_quartz_surface_stick;
+ impl_class->unstick = gdk_quartz_surface_unstick;
+ impl_class->maximize = gdk_quartz_surface_maximize;
+ impl_class->unmaximize = gdk_quartz_surface_unmaximize;
+ impl_class->fullscreen = gdk_quartz_surface_fullscreen;
+ impl_class->unfullscreen = gdk_quartz_surface_unfullscreen;
+ impl_class->set_keep_above = gdk_quartz_surface_set_keep_above;
+ impl_class->set_keep_below = gdk_quartz_surface_set_keep_below;
+ impl_class->get_group = gdk_quartz_surface_get_group;
+ impl_class->set_group = gdk_quartz_surface_set_group;
+ impl_class->set_decorations = gdk_quartz_surface_set_decorations;
+ impl_class->get_decorations = gdk_quartz_surface_get_decorations;
+ impl_class->set_functions = gdk_quartz_surface_set_functions;
+ impl_class->set_functions = gdk_quartz_surface_set_functions;
+ impl_class->begin_resize_drag = gdk_quartz_surface_begin_resize_drag;
+ impl_class->begin_move_drag = gdk_quartz_surface_begin_move_drag;
+ impl_class->set_opacity = gdk_quartz_surface_set_opacity;
+ impl_class->set_shadow_width = gdk_quartz_surface_set_shadow_width;
+ impl_class->destroy_notify = gdk_quartz_surface_destroy_notify;
+ impl_class->register_dnd = _gdk_quartz_surface_register_dnd;
+ impl_class->drag_begin = _gdk_quartz_surface_drag_begin;
+ impl_class->process_updates_recurse = _gdk_quartz_surface_process_updates_recurse;
+
+ impl_class->create_gl_context = gdk_quartz_surface_create_gl_context;
+
+ impl_quartz_class->get_context = gdk_surface_impl_quartz_get_context;
+ impl_quartz_class->release_context = gdk_surface_impl_quartz_release_context;
}
GType
-_gdk_window_impl_quartz_get_type (void)
+_gdk_surface_impl_quartz_get_type (void)
{
static GType object_type = 0;
@@ -2827,19 +2827,19 @@ _gdk_window_impl_quartz_get_type (void)
{
const GTypeInfo object_info =
{
- sizeof (GdkWindowImplQuartzClass),
+ sizeof (GdkSurfaceImplQuartzClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_window_impl_quartz_class_init,
+ (GClassInitFunc) gdk_surface_impl_quartz_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
- sizeof (GdkWindowImplQuartz),
+ sizeof (GdkSurfaceImplQuartz),
0, /* n_preallocs */
- (GInstanceInitFunc) gdk_window_impl_quartz_init,
+ (GInstanceInitFunc) gdk_surface_impl_quartz_init,
};
- object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL,
- "GdkWindowImplQuartz",
+ object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL,
+ "GdkSurfaceImplQuartz",
&object_info, 0);
}
@@ -2847,44 +2847,44 @@ _gdk_window_impl_quartz_get_type (void)
}
CGContextRef
-gdk_quartz_window_get_context (GdkWindowImplQuartz *window,
+gdk_quartz_surface_get_context (GdkSurfaceImplQuartz *window,
gboolean antialias)
{
- if (!GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->get_context)
+ if (!GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->get_context)
{
- g_warning ("%s doesn't implement GdkWindowImplQuartzClass::get_context()",
+ g_warning ("%s doesn't implement GdkSurfaceImplQuartzClass::get_context()",
G_OBJECT_TYPE_NAME (window));
return NULL;
}
- return GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->get_context (window, antialias);
+ return GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->get_context (window, antialias);
}
void
-gdk_quartz_window_release_context (GdkWindowImplQuartz *window,
+gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window,
CGContextRef cg_context)
{
- if (!GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->release_context)
+ if (!GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->release_context)
{
- g_warning ("%s doesn't implement GdkWindowImplQuartzClass::release_context()",
+ g_warning ("%s doesn't implement GdkSurfaceImplQuartzClass::release_context()",
G_OBJECT_TYPE_NAME (window));
return;
}
- GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->release_context (window, cg_context);
+ GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->release_context (window, cg_context);
}
static CGContextRef
-gdk_root_window_impl_quartz_get_context (GdkWindowImplQuartz *window,
+gdk_root_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window,
gboolean antialias)
{
CGColorSpaceRef colorspace;
CGContextRef cg_context;
- GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (window);
+ GdkSurfaceImplQuartz *surface_impl = GDK_SURFACE_IMPL_QUARTZ (window);
- if (GDK_WINDOW_DESTROYED (window_impl->wrapper))
+ if (GDK_SURFACE_DESTROYED (surface_impl->wrapper))
return NULL;
/* We do not have the notion of a root window on OS X. We fake this
@@ -2900,30 +2900,30 @@ gdk_root_window_impl_quartz_get_context (GdkWindowImplQuartz *window,
}
static void
-gdk_root_window_impl_quartz_release_context (GdkWindowImplQuartz *window,
+gdk_root_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *window,
CGContextRef cg_context)
{
CGContextRelease (cg_context);
}
static void
-gdk_root_window_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass)
+gdk_root_surface_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass)
{
- GdkWindowImplQuartzClass *window_quartz_class = GDK_WINDOW_IMPL_QUARTZ_CLASS (klass);
+ GdkSurfaceImplQuartzClass *window_quartz_class = GDK_SURFACE_IMPL_QUARTZ_CLASS (klass);
root_window_parent_class = g_type_class_peek_parent (klass);
- window_quartz_class->get_context = gdk_root_window_impl_quartz_get_context;
- window_quartz_class->release_context = gdk_root_window_impl_quartz_release_context;
+ window_quartz_class->get_context = gdk_root_surface_impl_quartz_get_context;
+ window_quartz_class->release_context = gdk_root_surface_impl_quartz_release_context;
}
static void
-gdk_root_window_impl_quartz_init (GdkRootWindowImplQuartz *impl)
+gdk_root_surface_impl_quartz_init (GdkRootWindowImplQuartz *impl)
{
}
GType
-_gdk_root_window_impl_quartz_get_type (void)
+_gdk_root_surface_impl_quartz_get_type (void)
{
static GType object_type = 0;
@@ -2934,15 +2934,15 @@ _gdk_root_window_impl_quartz_get_type (void)
sizeof (GdkRootWindowImplQuartzClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_root_window_impl_quartz_class_init,
+ (GClassInitFunc) gdk_root_surface_impl_quartz_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkRootWindowImplQuartz),
0, /* n_preallocs */
- (GInstanceInitFunc) gdk_root_window_impl_quartz_init,
+ (GInstanceInitFunc) gdk_root_surface_impl_quartz_init,
};
- object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL_QUARTZ,
+ object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL_QUARTZ,
"GdkRootWindowQuartz",
&object_info, 0);
}
@@ -2954,5 +2954,5 @@ GList *
get_toplevels (void)
{
update_toplevel_order ();
- return GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl)->sorted_children;
+ return GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl)->sorted_children;
}
diff --git a/gdk/quartz/gdksurface-quartz.h b/gdk/quartz/gdksurface-quartz.h
new file mode 100644
index 0000000000..74ccfc26a3
--- /dev/null
+++ b/gdk/quartz/gdksurface-quartz.h
@@ -0,0 +1,115 @@
+/* gdkdrawable-quartz.h
+ *
+ * Copyright (C) 2005 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_SURFACE_QUARTZ_H__
+#define __GDK_SURFACE_QUARTZ_H__
+
+#import <gdk/quartz/GdkQuartzView.h>
+#import <gdk/quartz/GdkQuartzNSWindow.h>
+#include "gdk/gdksurfaceimpl.h"
+
+G_BEGIN_DECLS
+
+/* Window implementation for Quartz
+ */
+
+typedef struct _GdkSurfaceImplQuartz GdkSurfaceImplQuartz;
+typedef struct _GdkSurfaceImplQuartzClass GdkSurfaceImplQuartzClass;
+
+#define GDK_TYPE_SURFACE_IMPL_QUARTZ (_gdk_surface_impl_quartz_get_type ())
+#define GDK_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartz))
+#define GDK_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartzClass))
+#define GDK_IS_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ))
+#define GDK_IS_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ))
+#define GDK_SURFACE_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartzClass))
+
+struct _GdkSurfaceImplQuartz
+{
+ GdkSurfaceImpl parent_instance;
+
+ GdkSurface *wrapper;
+
+ NSWindow *toplevel;
+ NSTrackingRectTag tracking_rect;
+ GdkQuartzView *view;
+
+ GdkSurfaceTypeHint type_hint;
+
+ gint in_paint_rect_count;
+
+ GdkSurface *transient_for;
+
+ /* Sorted by z-order */
+ GList *sorted_children;
+
+ cairo_region_t *needs_display_region;
+
+ cairo_surface_t *cairo_surface;
+
+ gint shadow_top;
+
+ gint shadow_max;
+};
+
+struct _GdkSurfaceImplQuartzClass
+{
+ GdkSurfaceImplClass parent_class;
+
+ CGContextRef (* get_context) (GdkSurfaceImplQuartz *window,
+ gboolean antialias);
+ void (* release_context) (GdkSurfaceImplQuartz *window,
+ CGContextRef cg_context);
+};
+
+GType _gdk_surface_impl_quartz_get_type (void);
+
+CGContextRef gdk_quartz_surface_get_context (GdkSurfaceImplQuartz *window,
+ gboolean antialias);
+void gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window,
+ CGContextRef context);
+
+/* Root window implementation for Quartz
+ */
+
+typedef struct _GdkRootWindowImplQuartz GdkRootWindowImplQuartz;
+typedef struct _GdkRootWindowImplQuartzClass GdkRootWindowImplQuartzClass;
+
+#define GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ (_gdk_root_surface_impl_quartz_get_type ())
+#define GDK_ROOT_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartz))
+#define GDK_ROOT_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartzClass))
+#define GDK_IS_ROOT_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ))
+#define GDK_IS_ROOT_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ))
+#define GDK_ROOT_SURFACE_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_ROOT_SURFACE_IMPL_QUARTZ, GdkRootWindowImplQuartzClass))
+
+struct _GdkRootWindowImplQuartz
+{
+ GdkSurfaceImplQuartz parent_instance;
+};
+
+struct _GdkRootWindowImplQuartzClass
+{
+ GdkSurfaceImplQuartzClass parent_class;
+};
+
+GType _gdk_root_surface_impl_quartz_get_type (void);
+
+GList *get_toplevels (void);
+
+G_END_DECLS
+
+#endif /* __GDK_SURFACE_QUARTZ_H__ */
diff --git a/gdk/quartz/gdkwindow-quartz.h b/gdk/quartz/gdkwindow-quartz.h
deleted file mode 100644
index 963e436ad8..0000000000
--- a/gdk/quartz/gdkwindow-quartz.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* gdkdrawable-quartz.h
- *
- * Copyright (C) 2005 Imendio AB
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GDK_WINDOW_QUARTZ_H__
-#define __GDK_WINDOW_QUARTZ_H__
-
-#import <gdk/quartz/GdkQuartzView.h>
-#import <gdk/quartz/GdkQuartzNSWindow.h>
-#include "gdk/gdkwindowimpl.h"
-
-G_BEGIN_DECLS
-
-/* Window implementation for Quartz
- */
-
-typedef struct _GdkWindowImplQuartz GdkWindowImplQuartz;
-typedef struct _GdkWindowImplQuartzClass GdkWindowImplQuartzClass;
-
-#define GDK_TYPE_WINDOW_IMPL_QUARTZ (_gdk_window_impl_quartz_get_type ())
-#define GDK_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartz))
-#define GDK_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass))
-#define GDK_IS_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ))
-#define GDK_IS_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ))
-#define GDK_WINDOW_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass))
-
-struct _GdkWindowImplQuartz
-{
- GdkWindowImpl parent_instance;
-
- GdkWindow *wrapper;
-
- NSWindow *toplevel;
- NSTrackingRectTag tracking_rect;
- GdkQuartzView *view;
-
- GdkWindowTypeHint type_hint;
-
- gint in_paint_rect_count;
-
- GdkWindow *transient_for;
-
- /* Sorted by z-order */
- GList *sorted_children;
-
- cairo_region_t *needs_display_region;
-
- cairo_surface_t *cairo_surface;
-
- gint shadow_top;
-
- gint shadow_max;
-};
-
-struct _GdkWindowImplQuartzClass
-{
- GdkWindowImplClass parent_class;
-
- CGContextRef (* get_context) (GdkWindowImplQuartz *window,
- gboolean antialias);
- void (* release_context) (GdkWindowImplQuartz *window,
- CGContextRef cg_context);
-};
-
-GType _gdk_window_impl_quartz_get_type (void);
-
-CGContextRef gdk_quartz_window_get_context (GdkWindowImplQuartz *window,
- gboolean antialias);
-void gdk_quartz_window_release_context (GdkWindowImplQuartz *window,
- CGContextRef context);
-
-/* Root window implementation for Quartz
- */
-
-typedef struct _GdkRootWindowImplQuartz GdkRootWindowImplQuartz;
-typedef struct _GdkRootWindowImplQuartzClass GdkRootWindowImplQuartzClass;
-
-#define GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ (_gdk_root_window_impl_quartz_get_type ())
-#define GDK_ROOT_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartz))
-#define GDK_ROOT_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartzClass))
-#define GDK_IS_ROOT_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ))
-#define GDK_IS_ROOT_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ))
-#define GDK_ROOT_WINDOW_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_ROOT_WINDOW_IMPL_QUARTZ, GdkRootWindowImplQuartzClass))
-
-struct _GdkRootWindowImplQuartz
-{
- GdkWindowImplQuartz parent_instance;
-};
-
-struct _GdkRootWindowImplQuartzClass
-{
- GdkWindowImplQuartzClass parent_class;
-};
-
-GType _gdk_root_window_impl_quartz_get_type (void);
-
-GList *get_toplevels (void);
-
-G_END_DECLS
-
-#endif /* __GDK_WINDOW_QUARTZ_H__ */
diff --git a/gdk/quartz/meson.build b/gdk/quartz/meson.build
index acacd791a8..8d2e0fc2c3 100644
--- a/gdk/quartz/meson.build
+++ b/gdk/quartz/meson.build
@@ -16,7 +16,7 @@ gdk_quartz_sources = files([
'gdkscreen-quartz.c',
'gdkselection-quartz.c',
'gdkutils-quartz.c',
- 'gdkwindow-quartz.c',
+ 'gdksurface-quartz.c',
])
gdk_quartz_public_headers = files([
@@ -29,7 +29,7 @@ gdk_quartz_public_headers = files([
'gdkquartzkeys.h',
'gdkquartzscreen.h',
'gdkquartzutils.h',
- 'gdkquartzwindow.h',
+ 'gdkquartzsurface.h',
])
install_headers(gdk_quartz_public_headers, subdir: 'gtk-4.0/gdk/quartz/')
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 23bfa77b91..faa41a5d46 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -22,7 +22,7 @@
#include <errno.h>
#include <string.h>
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <gdk/gdktypes.h>
#include "gdkclipboard-wayland.h"
#include "gdkclipboardprivate.h"
@@ -69,7 +69,7 @@ struct _GdkWaylandTouchData
uint32_t id;
gdouble x;
gdouble y;
- GdkWindow *window;
+ GdkSurface *surface;
uint32_t touch_down_serial;
guint initial_touch : 1;
};
@@ -86,7 +86,7 @@ struct _GdkWaylandPointerFrameData
};
struct _GdkWaylandPointerData {
- GdkWindow *focus;
+ GdkSurface *focus;
double surface_x, surface_y;
@@ -96,7 +96,7 @@ struct _GdkWaylandPointerData {
uint32_t enter_serial;
uint32_t press_serial;
- GdkWindow *grab_window;
+ GdkSurface *grab_surface;
uint32_t grab_time;
struct wl_surface *pointer_surface;
@@ -220,8 +220,8 @@ struct _GdkWaylandSeat
GdkWaylandPointerData touch_info;
GdkModifierType key_modifiers;
- GdkWindow *keyboard_focus;
- GdkWindow *grab_window;
+ GdkSurface *keyboard_focus;
+ 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 */
- GdkWindow *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,
- GdkWindow *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,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x, y;
- gdk_window_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
if (axes)
{
@@ -375,7 +375,7 @@ gdk_wayland_seat_find_pad (GdkWaylandSeat *seat,
static gboolean
-gdk_wayland_device_update_window_cursor (GdkDevice *device)
+gdk_wayland_device_update_surface_cursor (GdkDevice *device)
{
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
@@ -451,9 +451,9 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device)
/* Queue timeout for next frame */
id = g_timeout_add (next_image_delay,
- (GSourceFunc) gdk_wayland_device_update_window_cursor,
+ (GSourceFunc) gdk_wayland_device_update_surface_cursor,
device);
- g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor");
+ g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_surface_cursor");
pointer->cursor_timeout_id = id;
}
else
@@ -469,8 +469,8 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device)
}
static void
-gdk_wayland_device_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_wayland_device_set_surface_cursor (GdkDevice *device,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
@@ -501,7 +501,7 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
pointer->cursor = cursor;
- gdk_wayland_device_update_window_cursor (device);
+ gdk_wayland_device_update_surface_cursor (device);
}
static void
@@ -528,7 +528,7 @@ get_coordinates (GdkDevice *device,
if (pointer->focus)
{
- gdk_window_get_root_coords (pointer->focus,
+ gdk_surface_get_root_coords (pointer->focus,
pointer->surface_x,
pointer->surface_y,
&root_x, &root_y);
@@ -562,8 +562,8 @@ device_get_modifiers (GdkDevice *device)
static void
gdk_wayland_device_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **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 (GdkWindow *window,
- GdkWindow *subwindow,
+emulate_crossing (GdkSurface *surface,
+ GdkSurface *child_surface,
GdkDevice *device,
GdkEventType type,
GdkCrossingMode mode,
@@ -600,26 +600,26 @@ emulate_crossing (GdkWindow *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_window_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_window_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
-emulate_touch_crossing (GdkWindow *window,
- GdkWindow *subwindow,
+emulate_touch_crossing (GdkSurface *surface,
+ GdkSurface *child_surface,
GdkDevice *device,
GdkDevice *source,
GdkWaylandTouchData *touch,
@@ -630,8 +630,8 @@ emulate_touch_crossing (GdkWindow *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 (GdkWindow *window,
event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y;
- _gdk_wayland_display_deliver_event (gdk_window_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
-emulate_focus (GdkWindow *window,
+emulate_focus (GdkSurface *surface,
GdkDevice *device,
gboolean focus_in,
guint32 time_)
@@ -655,18 +655,18 @@ emulate_focus (GdkWindow *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_window_get_display (window), event);
+ _gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
static void
device_emit_grab_crossing (GdkDevice *device,
- GdkWindow *from,
- GdkWindow *to,
+ GdkSurface *from,
+ GdkSurface *to,
GdkCrossingMode mode,
guint32 time_)
{
@@ -686,7 +686,7 @@ device_emit_grab_crossing (GdkDevice *device,
}
}
-static GdkWindow *
+static GdkSurface *
gdk_wayland_device_get_focus (GdkDevice *device)
{
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
@@ -707,40 +707,40 @@ gdk_wayland_device_get_focus (GdkDevice *device)
static GdkGrabStatus
gdk_wayland_device_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
- GdkWindow *prev_focus = gdk_wayland_device_get_focus (device);
+ GdkSurface *prev_focus = gdk_wayland_device_get_focus (device);
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
- if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP &&
- gdk_window_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_window_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,16 +749,16 @@ 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_window_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);
if (cursor)
wayland_seat->cursor = g_object_ref (cursor);
- gdk_wayland_device_update_window_cursor (device);
+ gdk_wayland_device_update_surface_cursor (device);
}
return GDK_GRAB_SUCCESS;
@@ -771,7 +771,7 @@ gdk_wayland_device_ungrab (GdkDevice *device,
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
GdkDisplay *display;
GdkDeviceGrabInfo *grab;
- GdkWindow *focus, *prev_focus = NULL;
+ GdkSurface *focus, *prev_focus = NULL;
display = gdk_device_get_display (device);
@@ -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);
@@ -792,22 +792,22 @@ gdk_wayland_device_ungrab (GdkDevice *device,
{
/* Device is a keyboard */
if (prev_focus)
- gdk_wayland_window_restore_shortcuts (prev_focus,
+ gdk_wayland_surface_restore_shortcuts (prev_focus,
gdk_device_get_seat (device));
}
else
{
/* Device is a pointer */
- gdk_wayland_device_update_window_cursor (device);
+ gdk_wayland_device_update_surface_cursor (device);
- if (pointer->grab_window)
- _gdk_wayland_window_set_grab_seat (pointer->grab_window,
+ if (pointer->grab_surface)
+ _gdk_wayland_surface_set_grab_seat (pointer->grab_surface,
NULL);
}
}
-static GdkWindow *
-gdk_wayland_device_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_wayland_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
@@ -831,8 +831,8 @@ gdk_wayland_device_window_at_position (GdkDevice *device,
}
static void
-gdk_wayland_device_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_wayland_device_select_surface_events (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
}
@@ -844,13 +844,13 @@ gdk_wayland_device_class_init (GdkWaylandDeviceClass *klass)
device_class->get_history = gdk_wayland_device_get_history;
device_class->get_state = gdk_wayland_device_get_state;
- device_class->set_window_cursor = gdk_wayland_device_set_window_cursor;
+ device_class->set_surface_cursor = gdk_wayland_device_set_surface_cursor;
device_class->warp = gdk_wayland_device_warp;
device_class->query_state = gdk_wayland_device_query_state;
device_class->grab = gdk_wayland_device_grab;
device_class->ungrab = gdk_wayland_device_ungrab;
- device_class->window_at_position = gdk_wayland_device_window_at_position;
- device_class->select_window_events = gdk_wayland_device_select_window_events;
+ device_class->surface_at_position = gdk_wayland_device_surface_at_position;
+ device_class->select_surface_events = gdk_wayland_device_select_surface_events;
}
static void
@@ -1077,11 +1077,11 @@ data_device_enter (void *data,
struct wl_data_offer *offer)
{
GdkWaylandSeat *seat = data;
- GdkWindow *dest_window, *dnd_owner;
+ GdkSurface *dest_surface, *dnd_owner;
- dest_window = wl_surface_get_user_data (surface);
+ dest_surface = wl_surface_get_user_data (surface);
- if (!GDK_IS_WINDOW (dest_window))
+ if (!GDK_IS_SURFACE (dest_surface))
return;
GDK_DISPLAY_NOTE (seat->display, EVENTS,
@@ -1089,18 +1089,18 @@ data_device_enter (void *data,
data_device, serial, surface, wl_fixed_to_double (x), wl_fixed_to_double (y), offer));
/* Update pointer state, so device state queries work during DnD */
- seat->pointer_info.focus = g_object_ref (dest_window);
+ seat->pointer_info.focus = g_object_ref (dest_surface);
seat->pointer_info.surface_x = wl_fixed_to_double (x);
seat->pointer_info.surface_y = wl_fixed_to_double (y);
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_window (seat->drop_context, dnd_owner);
+ _gdk_wayland_drag_context_set_source_surface (seat->drop_context, dnd_owner);
- _gdk_wayland_drag_context_set_dest_window (seat->drop_context,
- dest_window, serial);
+ _gdk_wayland_drag_context_set_dest_surface (seat->drop_context,
+ dest_surface, serial);
_gdk_wayland_drag_context_set_coords (seat->drop_context,
wl_fixed_to_double (x),
wl_fixed_to_double (y));
@@ -1119,7 +1119,7 @@ data_device_leave (void *data,
GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device leave, data device %p", data_device));
- if (!gdk_drag_context_get_dest_window (seat->drop_context))
+ if (!gdk_drag_context_get_dest_surface (seat->drop_context))
return;
g_object_unref (seat->pointer_info.focus);
@@ -1128,7 +1128,7 @@ data_device_leave (void *data,
_gdk_wayland_drag_context_set_coords (seat->drop_context, -1, -1);
_gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_LEAVE,
GDK_CURRENT_TIME);
- _gdk_wayland_drag_context_set_dest_window (seat->drop_context, NULL, 0);
+ _gdk_wayland_drag_context_set_dest_surface (seat->drop_context, NULL, 0);
}
static void
@@ -1144,7 +1144,7 @@ data_device_motion (void *data,
g_message ("data device motion, data_device = %p, time = %d, x = %f, y = %f",
data_device, time, wl_fixed_to_double (x), wl_fixed_to_double (y)));
- if (!gdk_drag_context_get_dest_window (seat->drop_context))
+ if (!gdk_drag_context_get_dest_surface (seat->drop_context))
return;
/* Update pointer state, so device state queries work during DnD */
@@ -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;
@@ -1357,7 +1357,7 @@ pointer_handle_enter (void *data,
if (!surface)
return;
- if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+ if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return;
_gdk_wayland_display_update_serial (display_wayland, serial);
@@ -1372,17 +1372,17 @@ 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;
event->crossing.focus = TRUE;
event->crossing.state = 0;
- gdk_wayland_device_update_window_cursor (seat->master_pointer);
+ gdk_wayland_device_update_surface_cursor (seat->master_pointer);
get_coordinates (seat->master_pointer,
&event->crossing.x,
@@ -1411,7 +1411,7 @@ pointer_handle_leave (void *data,
if (!surface)
return;
- if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+ if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return;
if (!seat->pointer_info.focus)
@@ -1420,17 +1420,17 @@ 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;
event->crossing.focus = TRUE;
event->crossing.state = 0;
- gdk_wayland_device_update_window_cursor (seat->master_pointer);
+ gdk_wayland_device_update_surface_cursor (seat->master_pointer);
get_coordinates (seat->master_pointer,
&event->crossing.x,
@@ -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;
@@ -1771,7 +1771,7 @@ keyboard_handle_enter (void *data,
if (!surface)
return;
- if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+ if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return;
_gdk_wayland_display_update_serial (display, serial);
@@ -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);
@@ -1809,16 +1809,16 @@ keyboard_handle_leave (void *data,
if (!seat->keyboard_focus)
return;
- /* gdk_window_is_destroyed() might already return TRUE for
+ /* 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_window_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);
- GdkWindow *window = wl_surface_get_user_data (surface);
+ GdkSurface *surface = wl_surface_get_user_data (wsurface);
GdkEvent *event;
if (!surface)
return;
- if (!GDK_IS_WINDOW (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,14 +3418,14 @@ 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);
gdk_wayland_pointer_stop_cursor_animation (&tablet->pointer_info);
- gdk_wayland_device_update_window_cursor (tablet->master);
+ gdk_wayland_device_update_surface_cursor (tablet->master);
g_object_unref (tablet->pointer_info.focus);
tablet->pointer_info.focus = NULL;
@@ -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;
@@ -4343,7 +4343,7 @@ pointer_surface_update_scale (GdkDevice *device)
pointer->current_output_scale = scale;
- gdk_wayland_device_update_window_cursor (device);
+ gdk_wayland_device_update_surface_cursor (device);
}
static void
@@ -4386,10 +4386,10 @@ static const struct wl_surface_listener pointer_surface_listener = {
pointer_surface_leave
};
-static GdkWindow *
-create_foreign_dnd_window (GdkDisplay *display)
+static GdkSurface *
+create_foreign_dnd_surface (GdkDisplay *display)
{
- return gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 });
+ return gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 });
}
static void
@@ -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_window_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,
- GdkWindow *window)
+gdk_wayland_seat_set_grab_surface (GdkWaylandSeat *seat,
+ GdkSurface *surface)
{
- if (seat->grab_window)
+ if (seat->grab_surface)
{
- _gdk_wayland_window_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_window_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,
- GdkWindow *window,
+ GdkSurface *surface,
GdkSeatCapabilities capabilities,
gboolean owner_events,
GdkCursor *cursor,
@@ -4482,32 +4482,32 @@ gdk_wayland_seat_grab (GdkSeat *seat,
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME;
GdkDisplay *display = gdk_seat_get_display (seat);
- GdkWindow *native;
+ GdkSurface *native;
GList *l;
- native = gdk_window_get_toplevel (window);
+ native = gdk_surface_get_toplevel (surface);
- if (native == NULL || GDK_WINDOW_DESTROYED (native))
+ 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_window_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;
}
if (wayland_seat->master_pointer &&
capabilities & GDK_SEAT_CAPABILITY_POINTER)
{
- GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
+ GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus,
@@ -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,
@@ -4526,13 +4526,13 @@ gdk_wayland_seat_grab (GdkSeat *seat,
gdk_wayland_seat_set_global_cursor (seat, cursor);
g_set_object (&wayland_seat->cursor, cursor);
- gdk_wayland_device_update_window_cursor (wayland_seat->master_pointer);
+ gdk_wayland_device_update_surface_cursor (wayland_seat->master_pointer);
}
if (wayland_seat->touch_master &&
capabilities & GDK_SEAT_CAPABILITY_TOUCH)
{
- GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
+ GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->touch_master, prev_focus,
@@ -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,
@@ -4553,7 +4553,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (wayland_seat->master_keyboard &&
capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
{
- GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
+ GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus,
@@ -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_window_inhibit_shortcuts (window, seat);
+ gdk_wayland_surface_inhibit_shortcuts (surface, seat);
}
if (wayland_seat->tablets &&
@@ -4581,7 +4581,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
for (l = wayland_seat->tablets; l; l = l->next)
{
GdkWaylandTabletData *tablet = l->data;
- GdkWindow *prev_focus = gdk_wayland_device_get_focus (tablet->master);
+ GdkSurface *prev_focus = gdk_wayland_device_get_focus (tablet->master);
if (prev_focus != native)
device_emit_grab_crossing (tablet->master, prev_focus,
@@ -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,
@@ -4598,7 +4598,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
evtime,
FALSE);
- gdk_wayland_device_update_window_cursor (tablet->master);
+ gdk_wayland_device_update_surface_cursor (tablet->master);
}
}
@@ -4615,18 +4615,18 @@ 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)
{
- GdkWindow *focus, *prev_focus = NULL;
+ GdkSurface *focus, *prev_focus = NULL;
grab = _gdk_display_get_last_device_grab (display, wayland_seat->master_pointer);
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);
@@ -4636,7 +4636,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
focus, GDK_CROSSING_UNGRAB,
GDK_CURRENT_TIME);
- gdk_wayland_device_update_window_cursor (wayland_seat->master_pointer);
+ gdk_wayland_device_update_surface_cursor (wayland_seat->master_pointer);
}
if (wayland_seat->master_keyboard)
@@ -4646,8 +4646,8 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
if (grab)
{
grab->serial_end = grab->serial_start;
- if (grab->window)
- gdk_wayland_window_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);
@@ -4986,7 +4986,7 @@ gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
pointer = gdk_seat_get_pointer (seat);
g_set_object (&wayland_seat->grab_cursor, cursor);
- gdk_wayland_device_set_window_cursor (pointer,
+ gdk_wayland_device_set_surface_cursor (pointer,
gdk_wayland_device_get_focus (pointer),
NULL);
}
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 645f1352d8..2c35b65beb 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -636,7 +636,7 @@ _gdk_wayland_display_open (const gchar *display_name)
static void
destroy_toplevel (gpointer data)
{
- _gdk_window_destroy (GDK_WINDOW (data), FALSE);
+ _gdk_surface_destroy (GDK_SURFACE (data), FALSE);
}
static void
@@ -714,7 +714,7 @@ gdk_wayland_display_get_name (GdkDisplay *display)
void
gdk_wayland_display_system_bell (GdkDisplay *display,
- GdkWindow *window)
+ GdkSurface *window)
{
GdkWaylandDisplay *display_wayland;
struct gtk_surface1 *gtk_surface;
@@ -728,7 +728,7 @@ gdk_wayland_display_system_bell (GdkDisplay *display,
return;
if (window)
- gtk_surface = gdk_wayland_window_get_gtk_surface (window);
+ gtk_surface = gdk_wayland_surface_get_gtk_surface (window);
else
gtk_surface = NULL;
@@ -798,7 +798,7 @@ gdk_wayland_display_has_pending (GdkDisplay *display)
return FALSE;
}
-static GdkWindow *
+static GdkSurface *
gdk_wayland_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@@ -916,16 +916,16 @@ gdk_wayland_display_get_monitor (GdkDisplay *display,
}
static GdkMonitor *
-gdk_wayland_display_get_monitor_at_window (GdkDisplay *display,
- GdkWindow *window)
+gdk_wayland_display_get_monitor_at_surface (GdkDisplay *display,
+ GdkSurface *window)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
struct wl_output *output;
int i;
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
- output = gdk_wayland_window_get_wl_output (window);
+ output = gdk_wayland_surface_get_wl_output (window);
if (output == NULL)
return NULL;
@@ -953,7 +953,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
object_class->dispose = gdk_wayland_display_dispose;
object_class->finalize = gdk_wayland_display_finalize;
- display_class->window_type = gdk_wayland_window_get_type ();
+ display_class->surface_type = gdk_wayland_surface_get_type ();
#ifdef GDK_RENDERING_VULKAN
display_class->vk_context_type = GDK_TYPE_WAYLAND_VULKAN_CONTEXT;
@@ -973,7 +973,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class->get_app_launch_context = _gdk_wayland_display_get_app_launch_context;
display_class->get_next_serial = gdk_wayland_display_get_next_serial;
display_class->notify_startup_complete = gdk_wayland_display_notify_startup_complete;
- display_class->create_window_impl = _gdk_wayland_display_create_window_impl;
+ display_class->create_surface_impl = _gdk_wayland_display_create_surface_impl;
display_class->get_keymap = _gdk_wayland_display_get_keymap;
display_class->text_property_to_utf8_list = _gdk_wayland_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_wayland_display_utf8_to_string_target;
@@ -982,7 +982,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class->get_n_monitors = gdk_wayland_display_get_n_monitors;
display_class->get_monitor = gdk_wayland_display_get_monitor;
- display_class->get_monitor_at_window = gdk_wayland_display_get_monitor_at_window;
+ display_class->get_monitor_at_surface = gdk_wayland_display_get_monitor_at_surface;
display_class->get_setting = gdk_wayland_display_get_setting;
display_class->set_cursor_theme = gdk_wayland_display_set_cursor_theme;
}
@@ -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,8 +1847,8 @@ transform_to_string (int transform)
static void
update_scale (GdkDisplay *display)
{
- g_list_foreach (gdk_wayland_display_get_toplevel_windows (display),
- (GFunc)gdk_wayland_window_update_scale,
+ g_list_foreach (gdk_wayland_display_get_toplevel_surfaces (display),
+ (GFunc)gdk_wayland_surface_update_scale,
NULL);
}
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index 5b0fa7918b..625b5e2f4a 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -37,7 +37,7 @@
#include <glib.h>
#include <gdk/gdkkeys.h>
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <gdk/gdkinternals.h>
#include <gdk/gdk.h> /* For gdk_get_program_class() */
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index da90cbe467..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;
- GdkWindow *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);
- GdkWindow *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_window_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_)
{
- GdkWindow *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_window (context);
+ surface = gdk_drag_context_get_source_surface (context);
else
- window = gdk_drag_context_get_dest_window (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_window_get_display (window), event);
+ gdk_display_put_event (gdk_surface_get_display (surface), event);
g_object_unref (event);
}
@@ -174,7 +174,7 @@ gdk_wayland_drop_context_set_status (GdkDragContext *context,
GdkDisplay *display;
struct wl_data_offer *wl_offer;
- if (!context->dest_window)
+ if (!context->dest_surface)
return;
context_wayland = GDK_WAYLAND_DRAG_CONTEXT (context);
@@ -360,10 +360,10 @@ gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland)
context->actions = GDK_ACTION_COPY | GDK_ACTION_MOVE;
}
-static GdkWindow *
-gdk_wayland_drag_context_get_drag_window (GdkDragContext *context)
+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_window_offset_next_wl_buffer (context_wayland->dnd_window,
+ _gdk_wayland_surface_offset_next_wl_buffer (context_wayland->dnd_surface,
-hot_x, -hot_y);
- gdk_window_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_window_hide (context_wayland->dnd_window);
+ if (context_wayland->dnd_surface)
+ gdk_surface_hide (context_wayland->dnd_surface);
}
}
@@ -450,7 +450,7 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
context_class->read_async = gdk_wayland_drag_context_read_async;
context_class->read_finish = gdk_wayland_drag_context_read_finish;
context_class->drop_status = gdk_wayland_drag_context_drop_status;
- context_class->get_drag_window = gdk_wayland_drag_context_get_drag_window;
+ context_class->get_drag_surface = gdk_wayland_drag_context_get_drag_surface;
context_class->set_hotspot = gdk_wayland_drag_context_set_hotspot;
context_class->drop_done = gdk_wayland_drag_context_drop_done;
context_class->set_cursor = gdk_wayland_drag_context_set_cursor;
@@ -461,24 +461,24 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
}
void
-_gdk_wayland_window_register_dnd (GdkWindow *window)
+_gdk_wayland_surface_register_dnd (GdkSurface *surface)
{
}
-static GdkWindow *
-create_dnd_window (GdkDisplay *display)
+static GdkSurface *
+create_dnd_surface (GdkDisplay *display)
{
- GdkWindow *window;
+ GdkSurface *surface;
- window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ surface = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+ gdk_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_DND);
- return window;
+ return surface;
}
GdkDragContext *
-_gdk_wayland_window_drag_begin (GdkWindow *window,
+_gdk_wayland_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -498,15 +498,15 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
"content", content,
NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
- context->source_window = 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_window_get_display (window));
- context_wayland->dnd_surface = gdk_wayland_window_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_window_drag_begin (GdkWindow *window,
wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),
context_wayland->data_source,
- gdk_wayland_window_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));
@@ -579,24 +579,24 @@ _gdk_wayland_drag_context_set_coords (GdkDragContext *context,
}
void
-_gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
- GdkWindow *window)
+_gdk_wayland_drag_context_set_source_surface (GdkDragContext *context,
+ GdkSurface *surface)
{
- if (context->source_window)
- g_object_unref (context->source_window);
+ if (context->source_surface)
+ g_object_unref (context->source_surface);
- context->source_window = window ? g_object_ref (window) : NULL;
+ context->source_surface = surface ? g_object_ref (surface) : NULL;
}
void
-_gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
- GdkWindow *dest_window,
+_gdk_wayland_drag_context_set_dest_surface (GdkDragContext *context,
+ GdkSurface *dest_surface,
uint32_t serial)
{
- if (context->dest_window)
- g_object_unref (context->dest_window);
+ if (context->dest_surface)
+ g_object_unref (context->dest_surface);
- context->dest_window = dest_window ? g_object_ref (dest_window) : NULL;
+ context->dest_surface = dest_surface ? g_object_ref (dest_surface) : NULL;
GDK_WAYLAND_DRAG_CONTEXT (context)->serial = serial;
gdk_wayland_drop_context_update_targets (context);
}
@@ -618,13 +618,13 @@ gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source)
}
GdkDragContext *
-gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *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_window (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 14cece96c6..1e6f2ca28a 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -26,7 +26,7 @@
#include "gdkwaylanddisplay.h"
#include "gdkwaylandglcontext.h"
-#include "gdkwaylandwindow.h"
+#include "gdkwaylandsurface.h"
#include "gdkprivate-wayland.h"
#include "gdkinternals.h"
@@ -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;
- GdkWindow *window = gdk_draw_context_get_window (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_window_get_egl_surface (window->impl_window,
+ 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);
- GdkWindow *window = gdk_gl_context_get_window (context);
- GdkDisplay *display = gdk_window_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_window_get_egl_surface (window->impl_window,
+ 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_window_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_window_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_window (GdkWindow *window,
+find_eglconfig_for_surface (GdkSurface *surface,
EGLConfig *egl_config_out,
GError **error)
{
- GdkDisplay *display = gdk_window_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_window (GdkWindow *window,
}
GdkGLContext *
-gdk_wayland_window_create_gl_context (GdkWindow *window,
+gdk_wayland_surface_create_gl_context (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error)
{
- GdkDisplay *display = gdk_window_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_window_create_gl_context (GdkWindow *window,
return NULL;
}
- if (!find_eglconfig_for_window (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);
- GdkWindow *window = gdk_gl_context_get_window (context);
- GdkDisplay *display = gdk_window_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;
- GdkWindow *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_window (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_window_get_egl_surface (window->impl_window, 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_window_get_dummy_egl_surface (window->impl_window,
+ 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 819818b557..48966b90ad 100644
--- a/gdk/wayland/gdkglcontext-wayland.h
+++ b/gdk/wayland/gdkglcontext-wayland.h
@@ -24,7 +24,7 @@
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
#include <epoxy/egl.h>
@@ -46,7 +46,7 @@ struct _GdkWaylandGLContextClass
};
gboolean gdk_wayland_display_init_gl (GdkDisplay *display);
-GdkGLContext * gdk_wayland_window_create_gl_context (GdkWindow *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 6d3fe4c778..5ef028c134 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -43,7 +43,7 @@
#define WL_SURFACE_HAS_BUFFER_SCALE 3
#define WL_POINTER_HAS_FRAME 5
-#define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl))
+#define GDK_SURFACE_IS_WAYLAND(win) (GDK_IS_SURFACE_IMPL_WAYLAND (((GdkSurface *)win)->impl))
GdkKeymap *_gdk_wayland_keymap_new (GdkDisplay *display);
void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
@@ -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,
- GdkWindow *window);
+ GdkSurface *surface);
struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
GdkCursor *cursor,
@@ -88,24 +88,24 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint current_image_index,
guint *next_image_delay);
-void gdk_wayland_window_sync (GdkWindow *window);
+void gdk_wayland_surface_sync (GdkSurface *surface);
-void _gdk_wayland_window_register_dnd (GdkWindow *window);
-GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *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_window_offset_next_wl_buffer (GdkWindow *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_window (GdkDragContext *context,
- GdkWindow *window);
-void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
- GdkWindow *dest_window,
+void _gdk_wayland_drag_context_set_source_surface (GdkDragContext *context,
+ GdkSurface *surface);
+void _gdk_wayland_drag_context_set_dest_surface (GdkDragContext *context,
+ GdkSurface *dest_surface,
uint32_t serial);
void _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
GdkEventType type,
@@ -118,16 +118,16 @@ void gdk_wayland_drag_context_set_action (GdkDragContext *context,
GdkDragAction action);
GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source);
-GdkDragContext * gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *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_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_wayland_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding,
@@ -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_window_set_grab_seat (GdkWindow *window,
+void _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
GdkSeat *seat);
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
@@ -205,29 +205,29 @@ void gdk_wayland_selection_set_offer (GdkDisplay *display,
gpointer gdk_wayland_selection_get_offer (GdkDisplay *display);
GdkContentFormats *gdk_wayland_selection_get_targets (GdkDisplay *display);
-struct wl_data_source * gdk_wayland_selection_get_data_source (GdkWindow *owner);
+struct wl_data_source * gdk_wayland_selection_get_data_source (GdkSurface *owner);
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_window_get_egl_surface (GdkWindow *window,
+EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config);
-EGLSurface gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
+EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
EGLConfig config);
-struct gtk_surface1 * gdk_wayland_window_get_gtk_surface (GdkWindow *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_window_get_wl_output (GdkWindow *window);
+struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *surface);
-void gdk_wayland_window_inhibit_shortcuts (GdkWindow *window,
+void gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat);
-void gdk_wayland_window_restore_shortcuts (GdkWindow *window,
+void gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat);
-void gdk_wayland_window_update_scale (GdkWindow *window);
+void gdk_wayland_surface_update_scale (GdkSurface *surface);
#endif /* __GDK_PRIVATE_WAYLAND_H__ */
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index 9f7826e1da..757748dd7f 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -162,7 +162,7 @@ data_offer_source_actions (void *data,
GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("data offer source actions, offer %p, actions %d", wl_data_offer, source_actions));
- if (gdk_drag_context_get_dest_window (drop_context))
+ if (gdk_drag_context_get_dest_surface (drop_context))
_gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION,
GDK_CURRENT_TIME);
}
@@ -184,7 +184,7 @@ data_offer_action (void *data,
drop_context->action = _wl_to_gdk_actions (action);
- if (gdk_drag_context_get_dest_window (drop_context))
+ if (gdk_drag_context_get_dest_surface (drop_context))
_gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION,
GDK_CURRENT_TIME);
}
@@ -427,9 +427,9 @@ static const struct wl_data_source_listener data_source_listener = {
};
struct wl_data_source *
-gdk_wayland_selection_get_data_source (GdkWindow *owner)
+gdk_wayland_selection_get_data_source (GdkSurface *owner)
{
- GdkDisplay *display = gdk_window_get_display (owner);
+ GdkDisplay *display = gdk_surface_get_display (owner);
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
gpointer source = NULL;
GdkWaylandDisplay *display_wayland;
@@ -437,7 +437,7 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner)
if (wayland_selection->dnd_source)
return wayland_selection->dnd_source;
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (owner));
+ display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (owner));
source = wl_data_device_manager_create_data_source (display_wayland->data_device_manager);
wl_data_source_add_listener (source,
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 7a863776aa..d91be60e89 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -23,8 +23,8 @@
#include "gdk.h"
#include "gdkwayland.h"
-#include "gdkwindow.h"
-#include "gdkwindowimpl.h"
+#include "gdksurface.h"
+#include "gdksurfaceimpl.h"
#include "gdkdisplay-wayland.h"
#include "gdkglcontext-wayland.h"
#include "gdkframeclockprivate.h"
@@ -48,45 +48,45 @@ enum {
static guint signals[LAST_SIGNAL];
-#define WINDOW_IS_TOPLEVEL(window) \
- (GDK_WINDOW_TYPE (window) != GDK_WINDOW_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 */
-typedef struct _GdkWaylandWindow GdkWaylandWindow;
-typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass;
+typedef struct _GdkWaylandSurface GdkWaylandSurface;
+typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass;
-struct _GdkWaylandWindow
+struct _GdkWaylandSurface
{
- GdkWindow parent;
+ GdkSurface parent;
};
-struct _GdkWaylandWindowClass
+struct _GdkWaylandSurfaceClass
{
- GdkWindowClass parent_class;
+ GdkSurfaceClass parent_class;
};
-G_DEFINE_TYPE (GdkWaylandWindow, gdk_wayland_window, GDK_TYPE_WINDOW)
+G_DEFINE_TYPE (GdkWaylandSurface, gdk_wayland_surface, GDK_TYPE_SURFACE)
static void
-gdk_wayland_window_class_init (GdkWaylandWindowClass *wayland_window_class)
+gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *wayland_surface_class)
{
}
static void
-gdk_wayland_window_init (GdkWaylandWindow *wayland_window)
+gdk_wayland_surface_init (GdkWaylandSurface *wayland_surface)
{
}
-#define GDK_TYPE_WINDOW_IMPL_WAYLAND (_gdk_window_impl_wayland_get_type ())
-#define GDK_WINDOW_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWayland))
-#define GDK_WINDOW_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWaylandClass))
-#define GDK_IS_WINDOW_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_WAYLAND))
-#define GDK_IS_WINDOW_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WAYLAND))
-#define GDK_WINDOW_IMPL_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWaylandClass))
+#define GDK_TYPE_SURFACE_IMPL_WAYLAND (_gdk_surface_impl_wayland_get_type ())
+#define GDK_SURFACE_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWayland))
+#define GDK_SURFACE_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWaylandClass))
+#define GDK_IS_SURFACE_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_WAYLAND))
+#define GDK_IS_SURFACE_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_WAYLAND))
+#define GDK_SURFACE_IMPL_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWaylandClass))
-typedef struct _GdkWindowImplWayland GdkWindowImplWayland;
-typedef struct _GdkWindowImplWaylandClass GdkWindowImplWaylandClass;
+typedef struct _GdkSurfaceImplWayland GdkSurfaceImplWayland;
+typedef struct _GdkSurfaceImplWaylandClass GdkSurfaceImplWaylandClass;
typedef enum _PositionMethod
{
@@ -95,14 +95,14 @@ typedef enum _PositionMethod
POSITION_METHOD_MOVE_TO_RECT
} PositionMethod;
-struct _GdkWindowImplWayland
+struct _GdkSurfaceImplWayland
{
- GdkWindowImpl parent_instance;
+ GdkSurfaceImpl parent_instance;
- GdkWindow *wrapper;
+ 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;
@@ -126,9 +126,9 @@ struct _GdkWindowImplWayland
unsigned int pending_buffer_attached : 1;
unsigned int pending_commit : 1;
unsigned int awaiting_frame : 1;
- GdkWindowTypeHint hint;
- GdkWindow *transient_for;
- GdkWindow *popup_parent;
+ GdkSurfaceTypeHint hint;
+ GdkSurface *transient_for;
+ GdkSurface *popup_parent;
PositionMethod position_method;
cairo_surface_t *staging_cairo_surface;
@@ -152,7 +152,7 @@ struct _GdkWindowImplWayland
} application;
GdkGeometry geometry_hints;
- GdkWindowHints geometry_mask;
+ GdkSurfaceHints geometry_mask;
GdkSeat *grab_input_seat;
@@ -183,7 +183,7 @@ struct _GdkWindowImplWayland
struct {
GdkRectangle rect;
GdkGravity rect_anchor;
- GdkGravity window_anchor;
+ GdkGravity surface_anchor;
GdkAnchorHints anchor_hints;
gint rect_anchor_dx;
gint rect_anchor_dy;
@@ -192,11 +192,11 @@ struct _GdkWindowImplWayland
struct {
int width;
int height;
- GdkWindowState state;
+ GdkSurfaceState state;
} pending;
struct {
- GdkWaylandWindowExported callback;
+ GdkWaylandSurfaceExported callback;
gpointer user_data;
GDestroyNotify destroy_func;
} exported;
@@ -205,28 +205,28 @@ struct _GdkWindowImplWayland
GHashTable *shortcuts_inhibitors;
};
-struct _GdkWindowImplWaylandClass
+struct _GdkSurfaceImplWaylandClass
{
- GdkWindowImplClass parent_class;
+ GdkSurfaceImplClass parent_class;
};
-static void gdk_wayland_window_maybe_configure (GdkWindow *window,
+static void gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale);
-static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window);
-static void maybe_set_gtk_surface_modal (GdkWindow *window);
+static void maybe_set_gtk_surface_dbus_properties (GdkSurface *surface);
+static void maybe_set_gtk_surface_modal (GdkSurface *surface);
-static void gdk_window_request_transient_parent_commit (GdkWindow *window);
+static void gdk_surface_request_transient_parent_commit (GdkSurface *surface);
-static void gdk_wayland_window_sync_margin (GdkWindow *window);
-static void gdk_wayland_window_sync_input_region (GdkWindow *window);
-static void gdk_wayland_window_sync_opaque_region (GdkWindow *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 (GdkWindow *window);
+static void unset_transient_for_exported (GdkSurface *surface);
-static void calculate_moved_to_rect_result (GdkWindow *window,
+static void calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
@@ -236,14 +236,14 @@ static void calculate_moved_to_rect_result (GdkWindow *window,
gboolean *flipped_x,
gboolean *flipped_y);
-static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
+static gboolean gdk_wayland_surface_is_exported (GdkSurface *surface);
-GType _gdk_window_impl_wayland_get_type (void);
+GType _gdk_surface_impl_wayland_get_type (void);
-G_DEFINE_TYPE (GdkWindowImplWayland, _gdk_window_impl_wayland, GDK_TYPE_WINDOW_IMPL)
+G_DEFINE_TYPE (GdkSurfaceImplWayland, _gdk_surface_impl_wayland, GDK_TYPE_SURFACE_IMPL)
static void
-_gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
+_gdk_surface_impl_wayland_init (GdkSurfaceImplWayland *impl)
{
impl->scale = 1;
impl->initial_fullscreen_output = NULL;
@@ -252,20 +252,20 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
}
static void
-_gdk_wayland_screen_add_orphan_dialog (GdkWindow *window)
+_gdk_wayland_screen_add_orphan_dialog (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_window_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 (GdkWindow *window)
+drop_cairo_surfaces (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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 (GdkWindow *window)
}
static void
-_gdk_wayland_window_save_size (GdkWindow *window)
+_gdk_wayland_surface_save_size (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_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_window_clear_saved_size (GdkWindow *window)
+_gdk_wayland_surface_clear_saved_size (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED))
+ if (surface->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
return;
impl->saved_width = -1;
@@ -301,31 +301,31 @@ _gdk_wayland_window_clear_saved_size (GdkWindow *window)
}
/*
- * gdk_wayland_window_update_size:
+ * gdk_wayland_surface_update_size:
* @drawable: a #GdkDrawableImplWayland.
*
* Updates the state of the drawable (in particular the drawable's
* cairo surface) when its size has changed.
*/
static void
-gdk_wayland_window_update_size (GdkWindow *window,
+gdk_wayland_surface_update_size (GdkSurface *surface,
int32_t width,
int32_t height,
int scale)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_update_size (GdkWindow *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_window_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 (GdkWindow *window)
+read_back_cairo_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
{
- GdkWindow *window = data;
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = data;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkFrameClock *clock = gdk_window_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_WINDOW_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,
- GdkWindow *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,
- GdkWindow *window)
+ GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_update_scale (GdkWindow *window)
+gdk_wayland_surface_update_scale (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_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,47 +589,47 @@ gdk_wayland_window_update_scale (GdkWindow *window)
}
/* Notify app that scale changed */
- gdk_wayland_window_maybe_configure (window, window->width, window->height, scale);
+ gdk_wayland_surface_maybe_configure (surface, surface->width, surface->height, scale);
- children = gdk_window_get_children (window);
+ children = gdk_surface_get_children (surface);
for (c = children; c; c = c->next)
{
- GdkWindow *child = c->data;
- gdk_wayland_window_update_scale (child);
+ GdkSurface *child = c->data;
+ gdk_wayland_surface_update_scale (child);
}
g_list_free (children);
}
-static void gdk_wayland_window_create_surface (GdkWindow *window);
+static void gdk_wayland_surface_create_surface (GdkSurface *surface);
void
-_gdk_wayland_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_wayland_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
GdkFrameClock *frame_clock;
- impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
- window->impl = GDK_WINDOW_IMPL (impl);
- impl->wrapper = GDK_WINDOW (window);
+ impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WAYLAND, NULL);
+ 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,35 +638,35 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
impl->title = NULL;
- switch (GDK_WINDOW_TYPE (window))
+ switch (GDK_SURFACE_TYPE (surface))
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
- gdk_window_set_title (window, get_default_title ());
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP:
+ gdk_surface_set_title (surface, get_default_title ());
break;
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
default:
break;
}
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_window_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
- frame_clock = gdk_window_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_window_attach_image (GdkWindow *window)
+gdk_wayland_surface_attach_image (GdkSurface *surface)
{
GdkWaylandDisplay *display;
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_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_window_attach_image (GdkWindow *window)
impl->pending_buffer_offset_y = 0;
/* Only set the buffer scale if supported by the compositor */
- display = GDK_WAYLAND_DISPLAY (gdk_window_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);
@@ -688,16 +688,16 @@ gdk_wayland_window_attach_image (GdkWindow *window)
impl->pending_commit = TRUE;
}
-static const cairo_user_data_key_t gdk_wayland_window_cairo_key;
+static const cairo_user_data_key_t gdk_wayland_surface_cairo_key;
static void
buffer_release_callback (void *_data,
struct wl_buffer *wl_buffer)
{
cairo_surface_t *cairo_surface = _data;
- GdkWindowImplWayland *impl = cairo_surface_get_user_data (cairo_surface, &gdk_wayland_window_cairo_key);
+ GdkSurfaceImplWayland *impl = cairo_surface_get_user_data (cairo_surface, &gdk_wayland_surface_cairo_key);
- g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (impl));
+ g_return_if_fail (GDK_IS_SURFACE_IMPL_WAYLAND (impl));
/* The released buffer isn't the latest committed one, we have no further
* use for it, so clean it up.
@@ -752,9 +752,9 @@ static const struct wl_buffer_listener buffer_listener = {
};
static void
-gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
+gdk_wayland_surface_ensure_cairo_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
@@ -774,7 +774,7 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
}
else if (!impl->staging_cairo_surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (impl->wrapper));
struct wl_buffer *buffer;
impl->staging_cairo_surface = _gdk_wayland_display_create_shm_surface (display_wayland,
@@ -782,7 +782,7 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
impl->wrapper->height,
impl->scale);
cairo_surface_set_user_data (impl->staging_cairo_surface,
- &gdk_wayland_window_cairo_key,
+ &gdk_wayland_surface_cairo_key,
g_object_ref (impl),
(cairo_destroy_func_t)
g_object_unref);
@@ -799,14 +799,14 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
* impl->staging_cairo_surface gets nullified.
*/
static cairo_surface_t *
-gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
+gdk_wayland_surface_ref_cairo_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (impl->wrapper))
+ if (GDK_SURFACE_DESTROYED (impl->wrapper))
return NULL;
- gdk_wayland_window_ensure_cairo_surface (window);
+ gdk_wayland_surface_ensure_cairo_surface (surface);
cairo_surface_reference (impl->staging_cairo_surface);
@@ -814,7 +814,7 @@ gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
}
static cairo_surface_t *
-gdk_wayland_window_create_similar_image_surface (GdkWindow * window,
+gdk_wayland_surface_create_similar_image_surface (GdkSurface * surface,
cairo_format_t format,
int width,
int height)
@@ -823,25 +823,25 @@ gdk_wayland_window_create_similar_image_surface (GdkWindow * window,
}
static gboolean
-gdk_window_impl_wayland_begin_paint (GdkWindow *window)
+gdk_surface_impl_wayland_begin_paint (GdkSurface *surface)
{
- gdk_wayland_window_ensure_cairo_surface (window);
+ gdk_wayland_surface_ensure_cairo_surface (surface);
return FALSE;
}
static void
-gdk_window_impl_wayland_end_paint (GdkWindow *window)
+gdk_surface_impl_wayland_end_paint (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_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,57 +852,57 @@ gdk_window_impl_wayland_end_paint (GdkWindow *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_window_sync (window);
+ gdk_wayland_surface_sync (surface);
}
void
-gdk_wayland_window_sync (GdkWindow *window)
+gdk_wayland_surface_sync (GdkSurface *surface)
{
- gdk_wayland_window_sync_margin (window);
- gdk_wayland_window_sync_opaque_region (window);
- gdk_wayland_window_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_window_impl_wayland_beep (GdkWindow *window)
+gdk_surface_impl_wayland_beep (GdkSurface *surface)
{
- gdk_wayland_display_system_bell (gdk_window_get_display (window),
- window);
+ gdk_wayland_display_system_bell (gdk_surface_get_display (surface),
+ surface);
return TRUE;
}
static void
-gdk_window_impl_wayland_finalize (GObject *object)
+gdk_surface_impl_wayland_finalize (GObject *object)
{
- GdkWindow *window = GDK_WINDOW (object);
- GdkWindowImplWayland *impl;
+ GdkSurface *surface = GDK_SURFACE (object);
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
+ g_return_if_fail (GDK_IS_SURFACE_IMPL_WAYLAND (object));
- impl = GDK_WINDOW_IMPL_WAYLAND (object);
+ impl = GDK_SURFACE_IMPL_WAYLAND (object);
- if (gdk_wayland_window_is_exported (window))
- gdk_wayland_window_unexport_handle (window);
+ if (gdk_wayland_surface_is_exported (surface))
+ gdk_wayland_surface_unexport_handle (surface);
g_free (impl->title);
@@ -919,11 +919,11 @@ gdk_window_impl_wayland_finalize (GObject *object)
g_hash_table_destroy (impl->shortcuts_inhibitors);
- G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
+ G_OBJECT_CLASS (_gdk_surface_impl_wayland_parent_class)->finalize (object);
}
static void
-gdk_wayland_window_configure (GdkWindow *window,
+gdk_wayland_surface_configure (GdkSurface *surface,
int width,
int height,
int scale)
@@ -932,30 +932,30 @@ gdk_wayland_window_configure (GdkWindow *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_window_update_size (window, width, height, scale);
- _gdk_window_update_size (window);
+ gdk_wayland_surface_update_size (surface, width, height, scale);
+ _gdk_surface_update_size (surface);
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
_gdk_wayland_display_deliver_event (display, event);
}
static void
-gdk_wayland_window_maybe_configure (GdkWindow *window,
+gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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,35 +966,35 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
*/
is_xdg_popup = (impl->display_server.xdg_popup != NULL);
- is_visible = gdk_window_is_visible (window);
+ is_visible = gdk_surface_is_visible (surface);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
- gdk_window_hide (window);
+ gdk_surface_hide (surface);
- gdk_wayland_window_configure (window, width, height, scale);
+ gdk_wayland_surface_configure (surface, width, height, scale);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
- gdk_window_show (window);
+ gdk_surface_show (surface);
}
static void
-gdk_wayland_window_sync_parent (GdkWindow *window,
- GdkWindow *parent)
+gdk_wayland_surface_sync_parent (GdkSurface *surface,
+ GdkSurface *parent)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowImplWayland *impl_parent = NULL;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurfaceImplWayland *impl_parent = NULL;
struct zxdg_toplevel_v6 *parent_toplevel;
g_assert (parent == NULL ||
- gdk_window_get_display (window) == gdk_window_get_display (parent));
+ gdk_surface_get_display (surface) == gdk_surface_get_display (parent));
if (!impl->display_server.xdg_toplevel)
return;
if (impl->transient_for)
- impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+ impl_parent = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl);
else if (parent)
- impl_parent = GDK_WINDOW_IMPL_WAYLAND (parent->impl);
+ impl_parent = GDK_SURFACE_IMPL_WAYLAND (parent->impl);
if (impl_parent)
{
@@ -1012,9 +1012,9 @@ gdk_wayland_window_sync_parent (GdkWindow *window,
}
static void
-gdk_wayland_window_sync_parent_of_imported (GdkWindow *window)
+gdk_wayland_surface_sync_parent_of_imported (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_sync_parent_of_imported (GdkWindow *window)
}
static void
-gdk_wayland_window_update_dialogs (GdkWindow *window)
+gdk_wayland_surface_update_dialogs (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GList *l;
if (!display_wayland->orphan_dialogs)
@@ -1041,29 +1041,29 @@ gdk_wayland_window_update_dialogs (GdkWindow *window)
for (l = display_wayland->orphan_dialogs; l; l = l->next)
{
- GdkWindow *w = l->data;
- GdkWindowImplWayland *impl;
+ GdkSurface *w = l->data;
+ GdkSurfaceImplWayland *impl;
- if (!GDK_IS_WINDOW_IMPL_WAYLAND(w->impl))
+ if (!GDK_IS_SURFACE_IMPL_WAYLAND(w->impl))
continue;
- impl = GDK_WINDOW_IMPL_WAYLAND (w->impl);
- if (w == window)
+ impl = GDK_SURFACE_IMPL_WAYLAND (w->impl);
+ if (w == surface)
continue;
- if (impl->hint != GDK_WINDOW_TYPE_HINT_DIALOG)
+ if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG)
continue;
if (impl->transient_for)
continue;
/* Update the parent relationship only for dialogs without transients */
- gdk_wayland_window_sync_parent (w, window);
+ gdk_wayland_surface_sync_parent (w, surface);
}
}
static void
-gdk_wayland_window_sync_title (GdkWindow *window)
+gdk_wayland_surface_sync_title (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_sync_title (GdkWindow *window)
}
static void
-gdk_wayland_window_get_window_geometry (GdkWindow *window,
- GdkRectangle *geometry)
+gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
+ GdkRectangle *geometry)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_sync_margin (GdkWindow *window)
+gdk_wayland_surface_sync_margin (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle geometry;
if (!impl->display_server.xdg_surface)
return;
- gdk_wayland_window_get_window_geometry (window, &geometry);
- gdk_window_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_window_sync_opaque_region (GdkWindow *window)
+gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_sync_opaque_region (GdkWindow *window)
return;
if (impl->opaque_region != NULL)
- wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_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_window_sync_opaque_region (GdkWindow *window)
}
static void
-gdk_wayland_window_sync_input_region (GdkWindow *window)
+gdk_wayland_surface_sync_input_region (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_sync_input_region (GdkWindow *window)
return;
if (impl->input_region != NULL)
- wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_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_window_sync_input_region (GdkWindow *window)
}
static void
-gdk_wayland_set_input_region_if_empty (GdkWindow *window)
+gdk_wayland_set_input_region_if_empty (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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 (GdkWindow *window)
if (!cairo_region_is_empty (impl->input_region))
return;
- display = GDK_WAYLAND_DISPLAY (gdk_window_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)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- GDK_DISPLAY_NOTE (gdk_window_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_window_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)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- GDK_DISPLAY_NOTE (gdk_window_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_window_update_scale (window);
+ gdk_wayland_surface_update_scale (surface);
}
static const struct wl_surface_listener surface_listener = {
@@ -1242,10 +1242,10 @@ static const struct wl_surface_listener surface_listener = {
};
static void
-on_parent_surface_committed (GdkWindowImplWayland *parent_impl,
- GdkWindow *window)
+on_parent_surface_committed (GdkSurfaceImplWayland *parent_impl,
+ GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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 (GdkWindowImplWayland *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_window_create_subsurface (GdkWindow *window)
+gdk_wayland_surface_create_subsurface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl, *parent_impl = NULL;
+ GdkSurfaceImplWayland *impl, *parent_impl = NULL;
GdkWaylandDisplay *display_wayland;
- impl = GDK_WINDOW_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 */
@@ -1272,17 +1272,17 @@ gdk_wayland_window_create_subsurface (GdkWindow *window)
return;
if (impl->transient_for)
- parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+ parent_impl = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl);
if (parent_impl && parent_impl->display_server.wl_surface)
{
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_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_window_create_subsurface (GdkWindow *window)
impl->parent_surface_committed_handler =
g_signal_connect_object (parent_impl, "committed",
G_CALLBACK (on_parent_surface_committed),
- window, 0);
- gdk_window_request_transient_parent_commit (window);
+ surface, 0);
+ gdk_surface_request_transient_parent_commit (surface);
}
}
static void
-gdk_wayland_window_create_surface (GdkWindow *window)
+gdk_wayland_surface_create_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_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,9 +1311,9 @@ xdg_surface_configure (void *data,
struct zxdg_surface_v6 *xdg_surface,
uint32_t serial)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowState new_state;
+ 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;
gboolean fixed_size;
@@ -1321,7 +1321,7 @@ xdg_surface_configure (void *data,
if (!impl->initial_configure_received)
{
- gdk_window_thaw_updates (window);
+ gdk_surface_thaw_updates (surface);
impl->initial_configure_received = TRUE;
}
@@ -1335,7 +1335,7 @@ xdg_surface_configure (void *data,
impl->pending.state = 0;
fixed_size =
- new_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_TILED);
+ new_state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_TILED);
saved_size = (width == 0 && height == 0);
/* According to xdg_shell, an xdg_surface.configure with size 0x0
@@ -1354,15 +1354,15 @@ xdg_surface_configure (void *data,
if (width > 0 && height > 0)
{
- GdkWindowHints geometry_mask = impl->geometry_mask;
+ 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)
{
/* Do not reapply contrains if we are restoring original size */
- gdk_window_constrain_size (&impl->geometry_hints,
+ gdk_surface_constrain_size (&impl->geometry_hints,
geometry_mask,
width + impl->margin_left + impl->margin_right,
height + impl->margin_top + impl->margin_bottom,
@@ -1370,25 +1370,25 @@ xdg_surface_configure (void *data,
&height);
/* Save size for next time we get 0x0 */
- _gdk_wayland_window_save_size (window);
+ _gdk_wayland_surface_save_size (surface);
}
- gdk_wayland_window_configure (window, width, height, impl->scale);
+ gdk_wayland_surface_configure (surface, width, height, impl->scale);
}
- GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS,
- g_message ("configure, window %p %dx%d,%s%s%s%s",
- window, width, height,
- (new_state & GDK_WINDOW_STATE_FULLSCREEN) ? " fullscreen" : "",
- (new_state & GDK_WINDOW_STATE_MAXIMIZED) ? " maximized" : "",
- (new_state & GDK_WINDOW_STATE_FOCUSED) ? " focused" : "",
- (new_state & GDK_WINDOW_STATE_TILED) ? " tiled" : ""));
+ 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_window_set_state (window, new_state);
+ gdk_surface_set_state (surface, new_state);
zxdg_surface_v6_ack_configure (xdg_surface, serial);
- if (impl->hint != GDK_WINDOW_TYPE_HINT_DIALOG &&
- new_state & GDK_WINDOW_STATE_FOCUSED)
- gdk_wayland_window_update_dialogs (window);
+ if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG &&
+ new_state & GDK_SURFACE_STATE_FOCUSED)
+ 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)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
@@ -1412,13 +1412,13 @@ xdg_toplevel_configure (void *data,
switch (state)
{
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
- impl->pending.state |= GDK_WINDOW_STATE_FULLSCREEN;
+ impl->pending.state |= GDK_SURFACE_STATE_FULLSCREEN;
break;
case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
- impl->pending.state |= GDK_WINDOW_STATE_MAXIMIZED;
+ impl->pending.state |= GDK_SURFACE_STATE_MAXIMIZED;
break;
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
- impl->pending.state |= GDK_WINDOW_STATE_FOCUSED;
+ impl->pending.state |= GDK_SURFACE_STATE_FOCUSED;
break;
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
break;
@@ -1436,16 +1436,16 @@ static void
xdg_toplevel_close (void *data,
struct zxdg_toplevel_v6 *xdg_toplevel)
{
- GdkWindow *window = GDK_WINDOW (data);
+ GdkSurface *surface = GDK_SURFACE (data);
GdkDisplay *display;
GdkEvent *event;
- display = gdk_window_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_window_create_xdg_toplevel (GdkWindow *window)
+gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_create_xdg_toplevel (GdkWindow *window)
impl->display_server.wl_surface);
zxdg_surface_v6_add_listener (impl->display_server.xdg_surface,
&xdg_surface_listener,
- window);
- gdk_window_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_window_sync_parent (window, NULL);
- gdk_wayland_window_sync_parent_of_imported (window);
- gdk_wayland_window_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_WINDOW_STATE_MAXIMIZED)
+ if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel);
- if (window->state & GDK_WINDOW_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_window_create_xdg_toplevel (GdkWindow *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_WINDOW_TYPE_HINT_DIALOG)
- _gdk_wayland_screen_add_orphan_dialog (window);
+ if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG)
+ _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)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
{
- GdkWindow *window = GDK_WINDOW (data);
+ GdkSurface *surface = GDK_SURFACE (data);
- GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, g_message ("done %p", window));
+ GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS, g_message ("done %p", surface));
- gdk_window_hide (window);
+ gdk_surface_hide (surface);
}
static const struct zxdg_popup_v6_listener xdg_popup_listener = {
@@ -1592,7 +1592,7 @@ rect_anchor_to_anchor (GdkGravity rect_anchor)
}
static enum zxdg_positioner_v6_gravity
-window_anchor_to_gravity (GdkGravity rect_anchor)
+surface_anchor_to_gravity (GdkGravity rect_anchor)
{
switch (rect_anchor)
{
@@ -1628,10 +1628,10 @@ window_anchor_to_gravity (GdkGravity rect_anchor)
}
void
-gdk_wayland_window_announce_csd (GdkWindow *window)
+gdk_wayland_surface_announce_csd (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl = GDK_WINDOW_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 =
@@ -1642,21 +1642,21 @@ gdk_wayland_window_announce_csd (GdkWindow *window)
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
}
-static GdkWindow *
-get_real_parent_and_translate (GdkWindow *window,
+static GdkSurface *
+get_real_parent_and_translate (GdkSurface *surface,
gint *x,
gint *y)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindow *parent = impl->transient_for;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurface *parent = impl->transient_for;
while (parent)
{
- GdkWindowImplWayland *parent_impl =
- GDK_WINDOW_IMPL_WAYLAND (parent->impl);
- GdkWindow *effective_parent = gdk_window_get_parent (parent);
+ GdkSurfaceImplWayland *parent_impl =
+ GDK_SURFACE_IMPL_WAYLAND (parent->impl);
+ GdkSurface *effective_parent = gdk_surface_get_parent (parent);
- if ((gdk_window_has_native (parent) &&
+ if ((gdk_surface_has_native (parent) &&
!parent_impl->display_server.wl_subsurface) ||
!effective_parent)
break;
@@ -1664,7 +1664,7 @@ get_real_parent_and_translate (GdkWindow *window,
*x += parent->x;
*y += parent->y;
- if (gdk_window_has_native (parent) &&
+ if (gdk_surface_has_native (parent) &&
parent_impl->display_server.wl_subsurface)
parent = parent->transient_for;
else
@@ -1675,28 +1675,28 @@ get_real_parent_and_translate (GdkWindow *window,
}
static void
-translate_to_real_parent_window_geometry (GdkWindow *window,
+translate_to_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
{
- GdkWindow *parent;
+ 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 GdkWindow *
-translate_from_real_parent_window_geometry (GdkWindow *window,
+static GdkSurface *
+translate_from_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
{
- GdkWindow *parent;
+ GdkSurface *parent;
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 (GdkWindow *window,
}
static void
-calculate_popup_rect (GdkWindow *window,
+calculate_popup_rect (GdkSurface *surface,
GdkGravity rect_anchor,
- GdkGravity window_anchor,
+ GdkGravity surface_anchor,
GdkRectangle *out_rect)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkRectangle geometry;
GdkRectangle anchor_rect;
int x = 0, y = 0;
- gdk_wayland_window_get_window_geometry (window, &geometry);
+ gdk_wayland_surface_get_window_geometry (surface, &geometry);
anchor_rect = (GdkRectangle) {
.x = (impl->pending_move_to_rect.rect.x +
@@ -1768,7 +1768,7 @@ calculate_popup_rect (GdkWindow *window,
break;
}
- switch (window_anchor)
+ switch (surface_anchor)
{
default:
case GDK_GRAVITY_STATIC:
@@ -1873,7 +1873,7 @@ flip_anchor_vertically (GdkGravity anchor)
}
static void
-calculate_moved_to_rect_result (GdkWindow *window,
+calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
@@ -1883,13 +1883,13 @@ calculate_moved_to_rect_result (GdkWindow *window,
gboolean *flipped_x,
gboolean *flipped_y)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindow *parent;
- gint window_x, window_y;
- gint window_width, window_height;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurface *parent;
+ 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,18 +1897,18 @@ calculate_moved_to_rect_result (GdkWindow *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_window_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.window_anchor,
+ impl->pending_move_to_rect.surface_anchor,
&best_rect);
*flipped_rect = best_rect;
@@ -1918,15 +1918,15 @@ calculate_moved_to_rect_result (GdkWindow *window,
{
GdkRectangle flipped_x_rect;
GdkGravity flipped_rect_anchor;
- GdkGravity flipped_window_anchor;
+ GdkGravity flipped_surface_anchor;
flipped_rect_anchor =
flip_anchor_horizontally (impl->pending_move_to_rect.rect_anchor);
- flipped_window_anchor =
- flip_anchor_horizontally (impl->pending_move_to_rect.window_anchor),
- calculate_popup_rect (window,
+ flipped_surface_anchor =
+ flip_anchor_horizontally (impl->pending_move_to_rect.surface_anchor),
+ calculate_popup_rect (surface,
flipped_rect_anchor,
- flipped_window_anchor,
+ flipped_surface_anchor,
&flipped_x_rect);
if (flipped_x_rect.x == x)
@@ -1937,15 +1937,15 @@ calculate_moved_to_rect_result (GdkWindow *window,
{
GdkRectangle flipped_y_rect;
GdkGravity flipped_rect_anchor;
- GdkGravity flipped_window_anchor;
+ GdkGravity flipped_surface_anchor;
flipped_rect_anchor =
flip_anchor_vertically (impl->pending_move_to_rect.rect_anchor);
- flipped_window_anchor =
- flip_anchor_vertically (impl->pending_move_to_rect.window_anchor),
- calculate_popup_rect (window,
+ flipped_surface_anchor =
+ flip_anchor_vertically (impl->pending_move_to_rect.surface_anchor),
+ calculate_popup_rect (surface,
flipped_rect_anchor,
- flipped_window_anchor,
+ flipped_surface_anchor,
&flipped_y_rect);
if (flipped_y_rect.y == y)
@@ -1957,11 +1957,11 @@ calculate_moved_to_rect_result (GdkWindow *window,
}
static struct zxdg_positioner_v6 *
-create_dynamic_positioner (GdkWindow *window)
+create_dynamic_positioner (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_window_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 (GdkWindow *window)
positioner = zxdg_shell_v6_create_positioner (display->xdg_shell);
- gdk_wayland_window_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;
@@ -1996,7 +1996,7 @@ create_dynamic_positioner (GdkWindow *window)
anchor = rect_anchor_to_anchor (impl->pending_move_to_rect.rect_anchor);
zxdg_positioner_v6_set_anchor (positioner, anchor);
- gravity = window_anchor_to_gravity (impl->pending_move_to_rect.window_anchor);
+ gravity = surface_anchor_to_gravity (impl->pending_move_to_rect.surface_anchor);
zxdg_positioner_v6_set_gravity (positioner, gravity);
if (impl->pending_move_to_rect.anchor_hints & GDK_ANCHOR_FLIP_X)
@@ -2019,11 +2019,11 @@ create_dynamic_positioner (GdkWindow *window)
}
static struct zxdg_positioner_v6 *
-create_simple_positioner (GdkWindow *window,
- GdkWindow *parent)
+create_simple_positioner (GdkSurface *surface,
+ GdkSurface *parent)
{
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
struct zxdg_positioner_v6 *positioner;
GdkRectangle geometry;
GdkRectangle parent_geometry;
@@ -2031,19 +2031,19 @@ create_simple_positioner (GdkWindow *window,
positioner = zxdg_shell_v6_create_positioner (display->xdg_shell);
- gdk_wayland_window_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;
parent_y = parent->y;
- gdk_wayland_window_get_window_geometry (parent, &parent_geometry);
+ gdk_wayland_surface_get_window_geometry (parent, &parent_geometry);
parent_x += parent_geometry.x;
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,13 +2056,13 @@ create_simple_positioner (GdkWindow *window,
}
static void
-gdk_wayland_window_create_xdg_popup (GdkWindow *window,
- GdkWindow *parent,
+gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
+ GdkSurface *parent,
struct wl_seat *seat)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowImplWayland *parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent->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;
guint32 serial;
@@ -2097,13 +2097,13 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
impl->display_server.wl_surface);
zxdg_surface_v6_add_listener (impl->display_server.xdg_surface,
&xdg_surface_listener,
- window);
- gdk_window_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_window_create_xdg_popup (GdkWindow *window,
positioner);
zxdg_popup_v6_add_listener (impl->display_server.xdg_popup,
&xdg_popup_listener,
- window);
+ surface);
zxdg_positioner_v6_destroy (positioner);
@@ -2125,40 +2125,40 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *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 (GdkWindow *window, GdkWindow *transient_for)
+find_grab_input_seat (GdkSurface *surface, GdkSurface *transient_for)
{
- GdkWindow *attached_grab_window;
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowImplWayland *tmp_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_WINDOW_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);
}
while (transient_for)
{
- tmp_impl = GDK_WINDOW_IMPL_WAYLAND (transient_for->impl);
+ tmp_impl = GDK_SURFACE_IMPL_WAYLAND (transient_for->impl);
if (tmp_impl->grab_input_seat)
return gdk_wayland_seat_get_wl_seat (tmp_impl->grab_input_seat);
@@ -2170,46 +2170,46 @@ find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for)
}
static gboolean
-should_be_mapped (GdkWindow *window)
+should_be_mapped (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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->window_type == GDK_WINDOW_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_WINDOW_TYPE_HINT_DND)
+ if (impl->hint == GDK_SURFACE_TYPE_HINT_DND)
return FALSE;
return TRUE;
}
static gboolean
-should_map_as_popup (GdkWindow *window)
+should_map_as_popup (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_WINDOW_TYPE (window) == GDK_WINDOW_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_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
return TRUE;
default:
@@ -2220,78 +2220,78 @@ should_map_as_popup (GdkWindow *window)
}
static gboolean
-should_map_as_subsurface (GdkWindow *window)
+should_map_as_subsurface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
+ if (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_SUBSURFACE)
return TRUE;
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_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)
{
- GdkWindowImplWayland *impl_parent;
+ GdkSurfaceImplWayland *impl_parent;
- impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+ impl_parent = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl);
/* subsurface require that the parent is mapped */
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 GdkWindow *
-get_popup_parent (GdkWindow *window)
+static GdkSurface *
+get_popup_parent (GdkSurface *surface)
{
- while (window)
+ while (surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_map (GdkWindow *window)
+gdk_wayland_surface_map (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindow *transient_for = NULL;
+ 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_window_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,30 +2299,30 @@ gdk_wayland_window_map (GdkWindow *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_WINDOW_TYPE_HINT_POPUP_MENU)
+ 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)
{
- GdkWindow *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)
{
- GdkWindowImplWayland *attached_impl =
- GDK_WINDOW_IMPL_WAYLAND (attached_grab_window->impl);
+ GdkSurfaceImplWayland *attached_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_window_at_position (grab_device,
+ gdk_device_get_surface_at_position (grab_device,
NULL, NULL);
}
}
@@ -2330,84 +2330,84 @@ gdk_wayland_window_map (GdkWindow *window)
{
grab_device = gdk_seat_get_pointer (impl->grab_input_seat);
transient_for =
- gdk_device_get_window_at_position (grab_device, NULL, NULL);
+ gdk_device_get_surface_at_position (grab_device, NULL, NULL);
}
if (transient_for)
- transient_for = get_popup_parent (gdk_window_get_toplevel (transient_for));
+ transient_for = get_popup_parent (gdk_surface_get_toplevel (transient_for));
/* If the position was not explicitly set, start the popup at the
* position of the device that holds the grab.
*/
if (impl->position_method == POSITION_METHOD_NONE && grab_device)
- gdk_window_get_device_position (transient_for, grab_device,
- &window->x, &window->y, NULL);
+ gdk_surface_get_device_position (transient_for, grab_device,
+ &surface->x, &surface->y, NULL);
}
else
{
- transient_for = gdk_window_get_toplevel (impl->transient_for);
+ transient_for = gdk_surface_get_toplevel (impl->transient_for);
transient_for = get_popup_parent (transient_for);
}
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_window_create_xdg_popup (window,
+ gdk_wayland_surface_create_xdg_popup (surface,
transient_for,
grab_input_seat);
}
else
{
- gdk_wayland_window_create_xdg_toplevel (window);
+ gdk_wayland_surface_create_xdg_toplevel (surface);
}
}
else
{
- gdk_wayland_window_create_xdg_toplevel (window);
+ gdk_wayland_surface_create_xdg_toplevel (surface);
}
impl->mapped = TRUE;
}
static void
-gdk_wayland_window_show (GdkWindow *window,
+gdk_wayland_surface_show (GdkSurface *surface,
gboolean already_mapped)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
- gdk_wayland_window_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
- gdk_wayland_window_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_window_attach_image (window);
+ gdk_wayland_surface_attach_image (surface);
}
static void
-unmap_subsurface (GdkWindow *window)
+unmap_subsurface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowImplWayland *parent_impl;
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurfaceImplWayland *parent_impl;
g_return_if_fail (impl->display_server.wl_subsurface);
g_return_if_fail (impl->transient_for);
- parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+ parent_impl = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl);
wl_subsurface_destroy (impl->display_server.wl_subsurface);
if (impl->parent_surface_committed_handler)
{
@@ -2419,21 +2419,21 @@ unmap_subsurface (GdkWindow *window)
}
static void
-unmap_popups_for_window (GdkWindow *window)
+unmap_popups_for_surface (GdkSurface *surface)
{
GdkWaylandDisplay *display_wayland;
GList *l;
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
for (l = display_wayland->current_popups; l; l = l->next)
{
- GdkWindow *popup = l->data;
- GdkWindowImplWayland *popup_impl = GDK_WINDOW_IMPL_WAYLAND (popup->impl);
+ 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_window_hide (popup);
+ gdk_surface_hide (popup);
return;
}
@@ -2441,12 +2441,12 @@ unmap_popups_for_window (GdkWindow *window)
}
static void
-gdk_wayland_window_hide_surface (GdkWindow *window)
+gdk_wayland_surface_hide_surface (GdkSurface *surface)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window (window);
+ unmap_popups_for_surface (surface);
if (impl->display_server.wl_surface)
{
@@ -2484,27 +2484,27 @@ gdk_wayland_window_hide_surface (GdkWindow *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_window_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_window_get_frame_clock (window);
+ frame_clock = gdk_surface_get_frame_clock (surface);
if (frame_clock)
_gdk_frame_clock_thaw (frame_clock);
}
@@ -2522,89 +2522,89 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
g_slist_free (impl->display_server.outputs);
impl->display_server.outputs = NULL;
- if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG && !impl->transient_for)
+ 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_window_clear_saved_size (window);
+ _gdk_wayland_surface_clear_saved_size (surface);
impl->pending_commit = FALSE;
impl->mapped = FALSE;
}
static void
-gdk_wayland_window_hide (GdkWindow *window)
+gdk_wayland_surface_hide (GdkSurface *surface)
{
- gdk_wayland_window_hide_surface (window);
- _gdk_window_clear_update_area (window);
+ gdk_wayland_surface_hide_surface (surface);
+ _gdk_surface_clear_update_area (surface);
}
static void
-gdk_window_wayland_withdraw (GdkWindow *window)
+gdk_surface_wayland_withdraw (GdkSurface *surface)
{
- if (!window->destroyed)
+ if (!surface->destroyed)
{
- if (GDK_WINDOW_IS_MAPPED (window))
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_WITHDRAWN);
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_WITHDRAWN);
- g_assert (!GDK_WINDOW_IS_MAPPED (window));
+ g_assert (!GDK_SURFACE_IS_MAPPED (surface));
- gdk_wayland_window_hide_surface (window);
+ gdk_wayland_surface_hide_surface (surface);
}
}
static void
-gdk_window_wayland_set_events (GdkWindow *window,
+gdk_surface_wayland_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
- GDK_WINDOW (window)->event_mask = event_mask;
+ GDK_SURFACE (surface)->event_mask = event_mask;
}
static GdkEventMask
-gdk_window_wayland_get_events (GdkWindow *window)
+gdk_surface_wayland_get_events (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 0;
else
- return GDK_WINDOW (window)->event_mask;
+ return GDK_SURFACE (surface)->event_mask;
}
static void
-gdk_window_wayland_raise (GdkWindow *window)
+gdk_surface_wayland_raise (GdkSurface *surface)
{
}
static void
-gdk_window_wayland_lower (GdkWindow *window)
+gdk_surface_wayland_lower (GdkSurface *surface)
{
}
static void
-gdk_window_wayland_restack_toplevel (GdkWindow *window,
- GdkWindow *sibling,
+gdk_surface_wayland_restack_toplevel (GdkSurface *surface,
+ GdkSurface *sibling,
gboolean above)
{
}
static void
-gdk_window_request_transient_parent_commit (GdkWindow *window)
+gdk_surface_request_transient_parent_commit (GdkSurface *surface)
{
- GdkWindowImplWayland *window_impl, *impl;
+ GdkSurfaceImplWayland *surface_impl, *impl;
GdkFrameClock *frame_clock;
- window_impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ surface_impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (!window_impl->transient_for)
+ if (!surface_impl->transient_for)
return;
- impl = GDK_WINDOW_IMPL_WAYLAND (window_impl->transient_for->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface_impl->transient_for->impl);
if (!impl->display_server.wl_surface || impl->pending_commit)
return;
- frame_clock = gdk_window_get_frame_clock (window_impl->transient_for);
+ frame_clock = gdk_surface_get_frame_clock (surface_impl->transient_for);
if (!frame_clock)
return;
@@ -2615,44 +2615,44 @@ gdk_window_request_transient_parent_commit (GdkWindow *window)
}
static void
-gdk_window_wayland_move_resize (GdkWindow *window,
+gdk_surface_wayland_move_resize (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_WINDOW_TYPE (window) != GDK_WINDOW_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_window_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_window_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 (GdkWindow *window,
+sanitize_anchor_rect (GdkSurface *surface,
GdkRectangle *rect)
{
gint original_width = rect->width;
@@ -2665,21 +2665,21 @@ sanitize_anchor_rect (GdkWindow *window,
}
static void
-gdk_window_wayland_move_to_rect (GdkWindow *window,
+gdk_surface_wayland_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
- GdkGravity window_anchor,
+ GdkGravity surface_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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.window_anchor = window_anchor;
+ impl->pending_move_to_rect.surface_anchor = surface_anchor;
impl->pending_move_to_rect.anchor_hints = anchor_hints;
impl->pending_move_to_rect.rect_anchor_dx = rect_anchor_dx;
impl->pending_move_to_rect.rect_anchor_dy = rect_anchor_dy;
@@ -2688,27 +2688,27 @@ gdk_window_wayland_move_to_rect (GdkWindow *window,
}
static void
-gdk_window_wayland_get_geometry (GdkWindow *window,
+gdk_surface_wayland_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
{
- if (!GDK_WINDOW_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_window_wayland_get_root_coords (GdkWindow *window,
+gdk_surface_wayland_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
@@ -2720,31 +2720,31 @@ gdk_window_wayland_get_root_coords (GdkWindow *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_window_wayland_get_device_state (GdkWindow *window,
+gdk_surface_wayland_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
@@ -2752,15 +2752,15 @@ gdk_window_wayland_get_device_state (GdkWindow *window,
{
gboolean return_val;
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), FALSE);
return_val = TRUE;
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- GdkWindow *child;
+ 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_window_wayland_get_device_state (GdkWindow *window,
}
static void
-gdk_window_wayland_shape_combine_region (GdkWindow *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_window_wayland_shape_combine_region (GdkWindow *window,
}
static void
-gdk_window_wayland_input_shape_combine_region (GdkWindow *window,
+gdk_surface_wayland_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
g_clear_pointer (&impl->input_region, cairo_region_destroy);
@@ -2801,32 +2801,32 @@ gdk_window_wayland_input_shape_combine_region (GdkWindow *window,
}
static void
-gdk_wayland_window_destroy (GdkWindow *window,
+gdk_wayland_surface_destroy (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy)
{
- g_return_if_fail (GDK_IS_WINDOW (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_window_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_window_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_window_focus (GdkWindow *window,
+gdk_wayland_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_focus (GdkWindow *window,
}
static void
-gdk_wayland_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
+gdk_wayland_surface_set_type_hint (GdkSurface *surface,
+ GdkSurfaceTypeHint hint)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->hint = hint;
}
-static GdkWindowTypeHint
-gdk_wayland_window_get_type_hint (GdkWindow *window)
+static GdkSurfaceTypeHint
+gdk_wayland_surface_get_type_hint (GdkSurface *surface)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- if (GDK_WINDOW_DESTROYED (window))
- return GDK_WINDOW_TYPE_HINT_NORMAL;
+ if (GDK_SURFACE_DESTROYED (surface))
+ return GDK_SURFACE_TYPE_HINT_NORMAL;
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
return impl->hint;
}
@@ -2873,9 +2873,9 @@ gtk_surface_configure (void *data,
struct gtk_surface1 *gtk_surface,
struct wl_array *states)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowState new_state = 0;
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurfaceState new_state = 0;
uint32_t *p;
wl_array_for_each (p, states)
@@ -2885,21 +2885,21 @@ gtk_surface_configure (void *data,
switch (state)
{
case GTK_SURFACE1_STATE_TILED:
- new_state |= GDK_WINDOW_STATE_TILED;
+ new_state |= GDK_SURFACE_STATE_TILED;
break;
/* Since v2 */
case GTK_SURFACE1_STATE_TILED_TOP:
- new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_TOP_TILED);
+ new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_TOP_TILED);
break;
case GTK_SURFACE1_STATE_TILED_RIGHT:
- new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_RIGHT_TILED);
+ new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_RIGHT_TILED);
break;
case GTK_SURFACE1_STATE_TILED_BOTTOM:
- new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_BOTTOM_TILED);
+ new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_BOTTOM_TILED);
break;
case GTK_SURFACE1_STATE_TILED_LEFT:
- new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_LEFT_TILED);
+ new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_LEFT_TILED);
break;
default:
/* Unknown state */
@@ -2915,9 +2915,9 @@ gtk_surface_configure_edges (void *data,
struct gtk_surface1 *gtk_surface,
struct wl_array *edge_constraints)
{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWindowState new_state = 0;
+ GdkSurface *surface = GDK_SURFACE (data);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
+ GdkSurfaceState new_state = 0;
uint32_t *p;
wl_array_for_each (p, edge_constraints)
@@ -2927,16 +2927,16 @@ gtk_surface_configure_edges (void *data,
switch (constraint)
{
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_TOP:
- new_state |= GDK_WINDOW_STATE_TOP_RESIZABLE;
+ new_state |= GDK_SURFACE_STATE_TOP_RESIZABLE;
break;
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_RIGHT:
- new_state |= GDK_WINDOW_STATE_RIGHT_RESIZABLE;
+ new_state |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
break;
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_BOTTOM:
- new_state |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
+ new_state |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
break;
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_LEFT:
- new_state |= GDK_WINDOW_STATE_LEFT_RESIZABLE;
+ new_state |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
break;
default:
/* Unknown state */
@@ -2953,11 +2953,11 @@ static const struct gtk_surface1_listener gtk_surface_listener = {
};
static void
-gdk_wayland_window_init_gtk_surface (GdkWindow *window)
+gdk_wayland_surface_init_gtk_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display =
- GDK_WAYLAND_DISPLAY (gdk_window_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_window_init_gtk_surface (GdkWindow *window)
impl->display_server.gtk_surface =
gtk_shell1_get_gtk_surface (display->gtk_shell,
impl->display_server.wl_surface);
- gdk_window_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 (GdkWindow *window)
+maybe_set_gtk_surface_modal (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- gdk_wayland_window_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 (GdkWindow *window)
}
static void
-gdk_wayland_window_set_modal_hint (GdkWindow *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_window_set_skip_taskbar_hint (GdkWindow *window,
+gdk_wayland_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
{
}
static void
-gdk_wayland_window_set_skip_pager_hint (GdkWindow *window,
+gdk_wayland_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
{
}
static void
-gdk_wayland_window_set_urgency_hint (GdkWindow *window,
+gdk_wayland_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
{
}
static void
-gdk_wayland_window_set_geometry_hints (GdkWindow *window,
+gdk_wayland_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
+ GdkSurfaceHints geom_mask)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
int width, height;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->geometry_hints = *geometry;
impl->geometry_mask = geom_mask;
@@ -3067,19 +3067,19 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
}
static void
-gdk_wayland_window_set_title (GdkWindow *window,
+gdk_wayland_surface_set_title (GdkSurface *surface,
const gchar *title)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
const char *end;
gsize title_length;
g_return_if_fail (title != NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (g_strcmp0 (impl->title, title) == 0)
return;
@@ -3096,37 +3096,37 @@ gdk_wayland_window_set_title (GdkWindow *window,
else
{
impl->title = g_utf8_make_valid (title, title_length);
- g_warning ("Invalid utf8 passed to gdk_window_set_title: '%s'", title);
+ g_warning ("Invalid utf8 passed to gdk_surface_set_title: '%s'", title);
}
- gdk_wayland_window_sync_title (window);
+ gdk_wayland_surface_sync_title (surface);
}
static void
-gdk_wayland_window_set_role (GdkWindow *window,
+gdk_wayland_surface_set_role (GdkSurface *surface,
const gchar *role)
{
}
static void
-gdk_wayland_window_set_startup_id (GdkWindow *window,
+gdk_wayland_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
}
static gboolean
-check_transient_for_loop (GdkWindow *window,
- GdkWindow *parent)
+check_transient_for_loop (GdkSurface *surface,
+ GdkSurface *parent)
{
while (parent)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- if (!GDK_IS_WINDOW_IMPL_WAYLAND(parent->impl))
+ if (!GDK_IS_SURFACE_IMPL_WAYLAND(parent->impl))
return FALSE;
- impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl);
- if (impl->transient_for == window)
+ impl = GDK_SURFACE_IMPL_WAYLAND (parent->impl);
+ if (impl->transient_for == surface)
return TRUE;
parent = impl->transient_for;
}
@@ -3134,90 +3134,90 @@ check_transient_for_loop (GdkWindow *window,
}
static void
-gdk_wayland_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
+gdk_wayland_surface_set_transient_for (GdkSurface *surface,
+ GdkSurface *parent)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindow *previous_parent;
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurface *previous_parent;
g_assert (parent == NULL ||
- gdk_window_get_display (window) == gdk_window_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;
- if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG)
+ 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_window_sync_parent (window, NULL);
- if (should_map_as_subsurface (window) &&
- parent && gdk_window_is_visible (window))
- gdk_wayland_window_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_window_get_frame_extents (GdkWindow *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_window_set_accept_focus (GdkWindow *window,
+gdk_wayland_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
{
}
static void
-gdk_wayland_window_set_focus_on_map (GdkWindow *window,
+gdk_wayland_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
{
}
static void
-gdk_wayland_window_set_icon_list (GdkWindow *window,
+gdk_wayland_surface_set_icon_list (GdkSurface *surface,
GList *surfaces)
{
}
static void
-gdk_wayland_window_set_icon_name (GdkWindow *window,
+gdk_wayland_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
}
static void
-gdk_wayland_window_iconify (GdkWindow *window)
+gdk_wayland_surface_iconify (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_window_iconify (GdkWindow *window)
}
static void
-gdk_wayland_window_deiconify (GdkWindow *window)
+gdk_wayland_surface_deiconify (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- if (GDK_WINDOW_IS_MAPPED (window))
- gdk_window_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_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_ICONIFIED, 0);
}
static void
-gdk_wayland_window_stick (GdkWindow *window)
+gdk_wayland_surface_stick (GdkSurface *surface)
{
}
static void
-gdk_wayland_window_unstick (GdkWindow *window)
+gdk_wayland_surface_unstick (GdkSurface *surface)
{
}
static void
-gdk_wayland_window_maximize (GdkWindow *window)
+gdk_wayland_surface_maximize (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- _gdk_wayland_window_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_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MAXIMIZED);
}
static void
-gdk_wayland_window_unmaximize (GdkWindow *window)
+gdk_wayland_surface_unmaximize (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_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_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MAXIMIZED, 0);
}
static void
-gdk_wayland_window_fullscreen_on_monitor (GdkWindow *window,
+gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_output *output = ((GdkWaylandMonitor *)monitor)->output;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- _gdk_wayland_window_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_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
impl->initial_fullscreen_output = output;
}
}
static void
-gdk_wayland_window_fullscreen (GdkWindow *window)
+gdk_wayland_surface_fullscreen (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->initial_fullscreen_output = NULL;
- _gdk_wayland_window_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_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
}
static void
-gdk_wayland_window_unfullscreen (GdkWindow *window)
+gdk_wayland_surface_unfullscreen (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl->initial_fullscreen_output = NULL;
@@ -3331,107 +3331,107 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
if (impl->display_server.xdg_toplevel)
zxdg_toplevel_v6_unset_fullscreen (impl->display_server.xdg_toplevel);
else
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
+ gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_FULLSCREEN, 0);
}
static void
-gdk_wayland_window_set_keep_above (GdkWindow *window, gboolean setting)
+gdk_wayland_surface_set_keep_above (GdkSurface *surface, gboolean setting)
{
}
static void
-gdk_wayland_window_set_keep_below (GdkWindow *window, gboolean setting)
+gdk_wayland_surface_set_keep_below (GdkSurface *surface, gboolean setting)
{
}
-static GdkWindow *
-gdk_wayland_window_get_group (GdkWindow *window)
+static GdkSurface *
+gdk_wayland_surface_get_group (GdkSurface *surface)
{
return NULL;
}
static void
-gdk_wayland_window_set_group (GdkWindow *window,
- GdkWindow *leader)
+gdk_wayland_surface_set_group (GdkSurface *surface,
+ GdkSurface *leader)
{
}
static void
-gdk_wayland_window_set_decorations (GdkWindow *window,
+gdk_wayland_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
}
static gboolean
-gdk_wayland_window_get_decorations (GdkWindow *window,
+gdk_wayland_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations)
{
return FALSE;
}
static void
-gdk_wayland_window_set_functions (GdkWindow *window,
+gdk_wayland_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
}
static void
-gdk_wayland_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
GdkEventSequence *sequence;
uint32_t resize_edges, serial;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
switch (edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT;
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT;
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT;
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM;
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT;
break;
default:
- g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!", edge);
+ g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!", edge);
return;
}
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.xdg_toplevel)
return;
@@ -3453,22 +3453,22 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window,
}
static void
-gdk_wayland_window_begin_move_drag (GdkWindow *window,
+gdk_wayland_surface_begin_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
GdkEventSequence *sequence;
uint32_t serial;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.xdg_toplevel)
return;
@@ -3488,41 +3488,41 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window,
}
static void
-gdk_wayland_window_set_opacity (GdkWindow *window,
+gdk_wayland_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
{
}
static void
-gdk_wayland_window_destroy_notify (GdkWindow *window)
+gdk_wayland_surface_destroy_notify (GdkSurface *surface)
{
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- g_warning ("GdkWindow %p unexpectedly destroyed", window);
- _gdk_window_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_window_get_scale_factor (GdkWindow *window)
+gdk_wayland_surface_get_scale_factor (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 1;
return impl->scale;
}
static void
-gdk_wayland_window_set_opaque_region (GdkWindow *window,
+gdk_wayland_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
g_clear_pointer (&impl->opaque_region, cairo_region_destroy);
@@ -3531,24 +3531,24 @@ gdk_wayland_window_set_opaque_region (GdkWindow *window,
}
static void
-gdk_wayland_window_set_shadow_width (GdkWindow *window,
+gdk_wayland_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
gint new_width, new_height;
- if (GDK_WINDOW_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_window_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_window_set_shadow_width (GdkWindow *window,
}
static gboolean
-gdk_wayland_window_show_window_menu (GdkWindow *window,
+gdk_wayland_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_show_window_menu (GdkWindow *window,
}
static gboolean
-gdk_wayland_window_supports_edge_constraints (GdkWindow *window)
+gdk_wayland_surface_supports_edge_constraints (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
@@ -3603,80 +3603,80 @@ gdk_wayland_window_supports_edge_constraints (GdkWindow *window)
}
static void
-_gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
+_gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
-
- object_class->finalize = gdk_window_impl_wayland_finalize;
-
- impl_class->ref_cairo_surface = gdk_wayland_window_ref_cairo_surface;
- impl_class->create_similar_image_surface = gdk_wayland_window_create_similar_image_surface;
- impl_class->show = gdk_wayland_window_show;
- impl_class->hide = gdk_wayland_window_hide;
- impl_class->withdraw = gdk_window_wayland_withdraw;
- impl_class->set_events = gdk_window_wayland_set_events;
- impl_class->get_events = gdk_window_wayland_get_events;
- impl_class->raise = gdk_window_wayland_raise;
- impl_class->lower = gdk_window_wayland_lower;
- impl_class->restack_toplevel = gdk_window_wayland_restack_toplevel;
- impl_class->move_resize = gdk_window_wayland_move_resize;
- impl_class->move_to_rect = gdk_window_wayland_move_to_rect;
- impl_class->get_geometry = gdk_window_wayland_get_geometry;
- impl_class->get_root_coords = gdk_window_wayland_get_root_coords;
- impl_class->get_device_state = gdk_window_wayland_get_device_state;
- impl_class->shape_combine_region = gdk_window_wayland_shape_combine_region;
- impl_class->input_shape_combine_region = gdk_window_wayland_input_shape_combine_region;
- impl_class->destroy = gdk_wayland_window_destroy;
- impl_class->begin_paint = gdk_window_impl_wayland_begin_paint;
- impl_class->end_paint = gdk_window_impl_wayland_end_paint;
- impl_class->beep = gdk_window_impl_wayland_beep;
-
- impl_class->focus = gdk_wayland_window_focus;
- impl_class->set_type_hint = gdk_wayland_window_set_type_hint;
- impl_class->get_type_hint = gdk_wayland_window_get_type_hint;
- impl_class->set_modal_hint = gdk_wayland_window_set_modal_hint;
- impl_class->set_skip_taskbar_hint = gdk_wayland_window_set_skip_taskbar_hint;
- impl_class->set_skip_pager_hint = gdk_wayland_window_set_skip_pager_hint;
- impl_class->set_urgency_hint = gdk_wayland_window_set_urgency_hint;
- impl_class->set_geometry_hints = gdk_wayland_window_set_geometry_hints;
- impl_class->set_title = gdk_wayland_window_set_title;
- impl_class->set_role = gdk_wayland_window_set_role;
- impl_class->set_startup_id = gdk_wayland_window_set_startup_id;
- impl_class->set_transient_for = gdk_wayland_window_set_transient_for;
- impl_class->get_frame_extents = gdk_wayland_window_get_frame_extents;
- impl_class->set_accept_focus = gdk_wayland_window_set_accept_focus;
- impl_class->set_focus_on_map = gdk_wayland_window_set_focus_on_map;
- impl_class->set_icon_list = gdk_wayland_window_set_icon_list;
- impl_class->set_icon_name = gdk_wayland_window_set_icon_name;
- impl_class->iconify = gdk_wayland_window_iconify;
- impl_class->deiconify = gdk_wayland_window_deiconify;
- impl_class->stick = gdk_wayland_window_stick;
- impl_class->unstick = gdk_wayland_window_unstick;
- impl_class->maximize = gdk_wayland_window_maximize;
- impl_class->unmaximize = gdk_wayland_window_unmaximize;
- impl_class->fullscreen = gdk_wayland_window_fullscreen;
- impl_class->fullscreen_on_monitor = gdk_wayland_window_fullscreen_on_monitor;
- impl_class->unfullscreen = gdk_wayland_window_unfullscreen;
- impl_class->set_keep_above = gdk_wayland_window_set_keep_above;
- impl_class->set_keep_below = gdk_wayland_window_set_keep_below;
- impl_class->get_group = gdk_wayland_window_get_group;
- impl_class->set_group = gdk_wayland_window_set_group;
- impl_class->set_decorations = gdk_wayland_window_set_decorations;
- impl_class->get_decorations = gdk_wayland_window_get_decorations;
- impl_class->set_functions = gdk_wayland_window_set_functions;
- impl_class->begin_resize_drag = gdk_wayland_window_begin_resize_drag;
- impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag;
- impl_class->set_opacity = gdk_wayland_window_set_opacity;
- impl_class->destroy_notify = gdk_wayland_window_destroy_notify;
- impl_class->register_dnd = _gdk_wayland_window_register_dnd;
- impl_class->drag_begin = _gdk_wayland_window_drag_begin;
- impl_class->get_scale_factor = gdk_wayland_window_get_scale_factor;
- impl_class->set_opaque_region = gdk_wayland_window_set_opaque_region;
- impl_class->set_shadow_width = gdk_wayland_window_set_shadow_width;
- impl_class->show_window_menu = gdk_wayland_window_show_window_menu;
- impl_class->create_gl_context = gdk_wayland_window_create_gl_context;
- impl_class->supports_edge_constraints = gdk_wayland_window_supports_edge_constraints;
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
+
+ object_class->finalize = gdk_surface_impl_wayland_finalize;
+
+ impl_class->ref_cairo_surface = gdk_wayland_surface_ref_cairo_surface;
+ impl_class->create_similar_image_surface = gdk_wayland_surface_create_similar_image_surface;
+ impl_class->show = gdk_wayland_surface_show;
+ impl_class->hide = gdk_wayland_surface_hide;
+ impl_class->withdraw = gdk_surface_wayland_withdraw;
+ impl_class->set_events = gdk_surface_wayland_set_events;
+ impl_class->get_events = gdk_surface_wayland_get_events;
+ impl_class->raise = gdk_surface_wayland_raise;
+ impl_class->lower = gdk_surface_wayland_lower;
+ impl_class->restack_toplevel = gdk_surface_wayland_restack_toplevel;
+ impl_class->move_resize = gdk_surface_wayland_move_resize;
+ impl_class->move_to_rect = gdk_surface_wayland_move_to_rect;
+ impl_class->get_geometry = gdk_surface_wayland_get_geometry;
+ impl_class->get_root_coords = gdk_surface_wayland_get_root_coords;
+ impl_class->get_device_state = gdk_surface_wayland_get_device_state;
+ impl_class->shape_combine_region = gdk_surface_wayland_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_surface_wayland_input_shape_combine_region;
+ impl_class->destroy = gdk_wayland_surface_destroy;
+ impl_class->begin_paint = gdk_surface_impl_wayland_begin_paint;
+ impl_class->end_paint = gdk_surface_impl_wayland_end_paint;
+ impl_class->beep = gdk_surface_impl_wayland_beep;
+
+ impl_class->focus = gdk_wayland_surface_focus;
+ impl_class->set_type_hint = gdk_wayland_surface_set_type_hint;
+ impl_class->get_type_hint = gdk_wayland_surface_get_type_hint;
+ impl_class->set_modal_hint = gdk_wayland_surface_set_modal_hint;
+ impl_class->set_skip_taskbar_hint = gdk_wayland_surface_set_skip_taskbar_hint;
+ impl_class->set_skip_pager_hint = gdk_wayland_surface_set_skip_pager_hint;
+ impl_class->set_urgency_hint = gdk_wayland_surface_set_urgency_hint;
+ impl_class->set_geometry_hints = gdk_wayland_surface_set_geometry_hints;
+ impl_class->set_title = gdk_wayland_surface_set_title;
+ impl_class->set_role = gdk_wayland_surface_set_role;
+ impl_class->set_startup_id = gdk_wayland_surface_set_startup_id;
+ impl_class->set_transient_for = gdk_wayland_surface_set_transient_for;
+ impl_class->get_frame_extents = gdk_wayland_surface_get_frame_extents;
+ impl_class->set_accept_focus = gdk_wayland_surface_set_accept_focus;
+ impl_class->set_focus_on_map = gdk_wayland_surface_set_focus_on_map;
+ impl_class->set_icon_list = gdk_wayland_surface_set_icon_list;
+ impl_class->set_icon_name = gdk_wayland_surface_set_icon_name;
+ impl_class->iconify = gdk_wayland_surface_iconify;
+ impl_class->deiconify = gdk_wayland_surface_deiconify;
+ impl_class->stick = gdk_wayland_surface_stick;
+ impl_class->unstick = gdk_wayland_surface_unstick;
+ impl_class->maximize = gdk_wayland_surface_maximize;
+ impl_class->unmaximize = gdk_wayland_surface_unmaximize;
+ impl_class->fullscreen = gdk_wayland_surface_fullscreen;
+ impl_class->fullscreen_on_monitor = gdk_wayland_surface_fullscreen_on_monitor;
+ impl_class->unfullscreen = gdk_wayland_surface_unfullscreen;
+ impl_class->set_keep_above = gdk_wayland_surface_set_keep_above;
+ impl_class->set_keep_below = gdk_wayland_surface_set_keep_below;
+ impl_class->get_group = gdk_wayland_surface_get_group;
+ impl_class->set_group = gdk_wayland_surface_set_group;
+ impl_class->set_decorations = gdk_wayland_surface_set_decorations;
+ impl_class->get_decorations = gdk_wayland_surface_get_decorations;
+ impl_class->set_functions = gdk_wayland_surface_set_functions;
+ impl_class->begin_resize_drag = gdk_wayland_surface_begin_resize_drag;
+ impl_class->begin_move_drag = gdk_wayland_surface_begin_move_drag;
+ impl_class->set_opacity = gdk_wayland_surface_set_opacity;
+ impl_class->destroy_notify = gdk_wayland_surface_destroy_notify;
+ impl_class->register_dnd = _gdk_wayland_surface_register_dnd;
+ impl_class->drag_begin = _gdk_wayland_surface_drag_begin;
+ impl_class->get_scale_factor = gdk_wayland_surface_get_scale_factor;
+ impl_class->set_opaque_region = gdk_wayland_surface_set_opaque_region;
+ impl_class->set_shadow_width = gdk_wayland_surface_set_shadow_width;
+ impl_class->show_window_menu = gdk_wayland_surface_show_window_menu;
+ impl_class->create_gl_context = gdk_wayland_surface_create_gl_context;
+ impl_class->supports_edge_constraints = gdk_wayland_surface_supports_edge_constraints;
signals[COMMITTED] = g_signal_new (g_intern_static_string ("committed"),
G_TYPE_FROM_CLASS (object_class),
@@ -3687,31 +3687,31 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
}
void
-_gdk_wayland_window_set_grab_seat (GdkWindow *window,
+_gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
GdkSeat *seat)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (window != NULL);
+ g_return_if_fail (surface != NULL);
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
impl->grab_input_seat = seat;
}
/**
- * gdk_wayland_window_new_subsurface: (constructor)
- * @display: the display to create the window on
- * @position: position relative to the transient window
+ * gdk_wayland_surface_new_subsurface: (constructor)
+ * @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 #GdkWindow
+ * Returns: (transfer full): the new #GdkSurface
**/
-GdkWindow *
-gdk_wayland_window_new_subsurface (GdkDisplay *display,
+GdkSurface *
+gdk_wayland_surface_new_subsurface (GdkDisplay *display,
const GdkRectangle *position)
{
- GdkWindowAttr attr;
+ GdkSurfaceAttr attr;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (position != NULL, NULL);
@@ -3721,35 +3721,35 @@ gdk_wayland_window_new_subsurface (GdkDisplay *display,
attr.y = position->y;
attr.width = position->width;
attr.height = position->height;
- attr.window_type = GDK_WINDOW_SUBSURFACE;
+ attr.surface_type = GDK_SURFACE_SUBSURFACE;
- return gdk_window_new (display, NULL, &attr);
+ return gdk_surface_new (display, NULL, &attr);
}
/**
- * gdk_wayland_window_get_wl_surface:
- * @window: (type GdkWaylandWindow): a #GdkWindow
+ * gdk_wayland_surface_get_wl_surface:
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
*
- * Returns the Wayland surface of a #GdkWindow.
+ * Returns the Wayland surface of a #GdkSurface.
*
* Returns: (transfer none): a Wayland wl_surface
*/
struct wl_surface *
-gdk_wayland_window_get_wl_surface (GdkWindow *window)
+gdk_wayland_surface_get_wl_surface (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- return GDK_WINDOW_IMPL_WAYLAND (window->impl)->display_server.wl_surface;
+ return GDK_SURFACE_IMPL_WAYLAND (surface->impl)->display_server.wl_surface;
}
struct wl_output *
-gdk_wayland_window_get_wl_output (GdkWindow *window)
+gdk_wayland_surface_get_wl_output (GdkSurface *surface)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_WINDOW_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_window_get_wl_output (GdkWindow *window)
}
static struct wl_egl_window *
-gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
+gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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_window_get_wl_egl_window (GdkWindow *window)
}
EGLSurface
-gdk_wayland_window_get_egl_surface (GdkWindow *window,
+gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl;
+ 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_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->egl_surface == NULL)
{
- egl_window = gdk_wayland_window_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_window_get_egl_surface (GdkWindow *window,
}
EGLSurface
-gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
+gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
EGLConfig config)
{
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
- GdkWindowImplWayland *impl;
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
+ GdkSurfaceImplWayland *impl;
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (impl->dummy_egl_surface == NULL)
{
@@ -3821,18 +3821,18 @@ gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
}
struct gtk_surface1 *
-gdk_wayland_window_get_gtk_surface (GdkWindow *window)
+gdk_wayland_surface_get_gtk_surface (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (surface), NULL);
- return GDK_WINDOW_IMPL_WAYLAND (window->impl)->display_server.gtk_surface;
+ return GDK_SURFACE_IMPL_WAYLAND (surface->impl)->display_server.gtk_surface;
}
/**
- * gdk_wayland_window_set_use_custom_surface:
- * @window: (type GdkWaylandWindow): a #GdkWindow
+ * gdk_wayland_surface_set_use_custom_surface:
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
*
- * Marks a #GdkWindow as a custom Wayland surface. The application is
+ * Marks a #GdkSurface as a custom Wayland surface. The application is
* expected to register the surface as some type of surface using
* some Wayland interface.
*
@@ -3844,21 +3844,21 @@ gdk_wayland_window_get_gtk_surface (GdkWindow *window)
* compositor will expose a private interface to the special client
* that lets the client identify the wl_surface as a panel or such.
*
- * This function should be called before a #GdkWindow is shown. This is
+ * This function should be called before a #GdkSurface is shown. This is
* best done by connecting to the #GtkWidget::realize signal:
*
* |[<!-- language="C" -->
* static void
* widget_realize_cb (GtkWidget *widget)
* {
- * GdkWindow *window;
+ * GdkSurface *surface;
* struct wl_surface *surface;
* struct input_panel_surface *ip_surface;
*
- * window = gtk_widget_get_window (widget);
- * gdk_wayland_window_set_custom_surface (window);
+ * surface = gtk_widget_get_surface (widget);
+ * gdk_wayland_surface_set_custom_surface (surface);
*
- * surface = gdk_wayland_window_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_window_get_gtk_surface (GdkWindow *window)
* ]|
*/
void
-gdk_wayland_window_set_use_custom_surface (GdkWindow *window)
+gdk_wayland_surface_set_use_custom_surface (GdkSurface *surface)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
if (!impl->display_server.wl_surface)
- gdk_wayland_window_create_surface (window);
+ gdk_wayland_surface_create_surface (surface);
impl->use_custom_surface = TRUE;
}
static void
-maybe_set_gtk_surface_dbus_properties (GdkWindow *window)
+maybe_set_gtk_surface_dbus_properties (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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 (GdkWindow *window)
impl->application.unique_bus_name == NULL)
return;
- gdk_wayland_window_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 (GdkWindow *window)
}
void
-gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
+gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
@@ -3924,11 +3924,11 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
const char *application_object_path,
const char *unique_bus_name)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_WINDOW_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_window_set_dbus_properties_libgtk_only (GdkWindow *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_window_offset_next_wl_buffer (GdkWindow *window,
+_gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface,
int x,
int y)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_WINDOW_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)
{
- GdkWindow *window = data;
- GdkWindowImplWayland *impl = GDK_WINDOW_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);
}
@@ -3974,28 +3974,28 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = {
};
/**
- * GdkWaylandWindowExported:
- * @window: the #GdkWindow that is exported
+ * GdkWaylandSurfaceExported:
+ * @surface: the #GdkSurface that is exported
* @handle: the handle
- * @user_data: user data that was passed to gdk_wayland_window_export_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_window_is_exported (GdkWindow *window)
+gdk_wayland_surface_is_exported (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
return !!impl->display_server.xdg_exported;
}
/**
- * gdk_wayland_window_export_handle:
- * @window: the #GdkWindow to obtain a handle for
+ * gdk_wayland_surface_export_handle:
+ * @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,15 +4004,15 @@ gdk_wayland_window_is_exported (GdkWindow *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_window_unexport_handle()
+ * 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
- * gdk_wayland_window_set_transient_for_exported().
+ * 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,
* and thus may require changes in the future.
@@ -4021,20 +4021,20 @@ gdk_wayland_window_is_exported (GdkWindow *window)
* an error occurred.
*/
gboolean
-gdk_wayland_window_export_handle (GdkWindow *window,
- GdkWaylandWindowExported callback,
+gdk_wayland_surface_export_handle (GdkSurface *surface,
+ GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
struct zxdg_exported_v1 *xdg_exported;
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (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_WINDOW_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_window_export_handle (GdkWindow *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;
@@ -4058,26 +4058,26 @@ gdk_wayland_window_export_handle (GdkWindow *window,
}
/**
- * gdk_wayland_window_unexport_handle:
- * @window: the #GdkWindow to unexport
+ * gdk_wayland_surface_unexport_handle:
+ * @surface: the #GdkSurface to unexport
*
* Destroys the handle that was obtained with
- * gdk_wayland_window_export_handle().
+ * 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_window_unexport_handle (GdkWindow *window)
+gdk_wayland_surface_unexport_handle (GdkSurface *surface)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
- g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
+ g_return_if_fail (GDK_IS_WAYLAND_SURFACE (surface));
- impl = GDK_WINDOW_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_window_unexport_handle (GdkWindow *window)
}
static void
-unset_transient_for_exported (GdkWindow *window)
+unset_transient_for_exported (GdkSurface *surface)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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)
{
- GdkWindow *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 = {
@@ -4109,34 +4109,34 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = {
};
/**
- * gdk_wayland_window_set_transient_for_exported:
- * @window: the #GdkWindow to make as transient
+ * gdk_wayland_surface_set_transient_for_exported:
+ * @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_window_export_handle() call in another process.
+ * 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_window_set_transient_for_exported (GdkWindow *window,
+gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
char *parent_handle_str)
{
- GdkWindowImplWayland *impl;
+ GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (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_WINDOW_IMPL_WAYLAND (window->impl);
+ impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (!display_wayland->xdg_importer)
@@ -4145,58 +4145,58 @@ gdk_wayland_window_set_transient_for_exported (GdkWindow *window,
return FALSE;
}
- gdk_window_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_window_sync_parent_of_imported (window);
+ gdk_wayland_surface_sync_parent_of_imported (surface);
return TRUE;
}
static struct zwp_keyboard_shortcuts_inhibitor_v1 *
-gdk_wayland_window_get_inhibitor (GdkWindowImplWayland *impl,
+gdk_wayland_surface_get_inhibitor (GdkSurfaceImplWayland *impl,
struct wl_seat *seat)
{
return g_hash_table_lookup (impl->shortcuts_inhibitors, seat);
}
void
-gdk_wayland_window_inhibit_shortcuts (GdkWindow *window,
+gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
{
- GdkWindowImplWayland *impl= GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_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;
if (display->keyboard_shortcuts_inhibit == NULL)
return;
- if (gdk_wayland_window_get_inhibitor (impl, seat))
+ if (gdk_wayland_surface_get_inhibitor (impl, seat))
return; /* Already inhibitted */
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_window_restore_shortcuts (GdkWindow *window,
+gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_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;
- inhibitor = gdk_wayland_window_get_inhibitor (impl, seat);
+ inhibitor = gdk_wayland_surface_get_inhibitor (impl, seat);
if (inhibitor == NULL)
return; /* Not inhibitted */
diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c
index 7aa1d1e260..4e85469741 100644
--- a/gdk/wayland/gdkvulkancontext-wayland.c
+++ b/gdk/wayland/gdkvulkancontext-wayland.c
@@ -28,19 +28,19 @@
#include "gdkinternals.h"
#include "gdkwaylanddisplay.h"
-#include "gdkwaylandwindow.h"
+#include "gdkwaylandsurface.h"
#include "gdkprivate-wayland.h"
G_DEFINE_TYPE (GdkWaylandVulkanContext, gdk_wayland_vulkan_context, GDK_TYPE_VULKAN_CONTEXT)
static VkResult
gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context,
- VkSurfaceKHR *surface)
+ VkSurfaceKHR *vr_surface)
{
- GdkWindow *window = gdk_draw_context_get_window (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_window_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)
{
- GdkWindow *window = gdk_draw_context_get_window (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_window_sync (window);
+ gdk_wayland_surface_sync (surface);
}
static void
diff --git a/gdk/wayland/gdkwayland.h b/gdk/wayland/gdkwayland.h
index 14f25d1d1d..9179d58e77 100644
--- a/gdk/wayland/gdkwayland.h
+++ b/gdk/wayland/gdkwayland.h
@@ -32,7 +32,7 @@
#include <gdk/wayland/gdkwaylanddevice.h>
#include <gdk/wayland/gdkwaylanddisplay.h>
#include <gdk/wayland/gdkwaylandmonitor.h>
-#include <gdk/wayland/gdkwaylandwindow.h>
+#include <gdk/wayland/gdkwaylandsurface.h>
#include <gdk/wayland/gdkwaylandglcontext.h>
#undef __GDKWAYLAND_H_INSIDE__
diff --git a/gdk/wayland/gdkwaylandwindow.h b/gdk/wayland/gdkwaylandsurface.h
index 1d6f5c04f7..49dafde67f 100644
--- a/gdk/wayland/gdkwaylandwindow.h
+++ b/gdk/wayland/gdkwaylandsurface.h
@@ -15,8 +15,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __GDK_WAYLAND_WINDOW_H__
-#define __GDK_WAYLAND_WINDOW_H__
+#ifndef __GDK_WAYLAND_SURFACE_H__
+#define __GDK_WAYLAND_SURFACE_H__
#if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkwayland.h> can be included directly."
@@ -29,33 +29,33 @@
G_BEGIN_DECLS
#ifdef GDK_COMPILATION
-typedef struct _GdkWaylandWindow GdkWaylandWindow;
+typedef struct _GdkWaylandSurface GdkWaylandSurface;
#else
-typedef GdkWindow GdkWaylandWindow;
+typedef GdkSurface GdkWaylandSurface;
#endif
-typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass;
+typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass;
-#define GDK_TYPE_WAYLAND_WINDOW (gdk_wayland_window_get_type())
-#define GDK_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindow))
-#define GDK_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass))
-#define GDK_IS_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_WINDOW))
-#define GDK_IS_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_WINDOW))
-#define GDK_WAYLAND_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass))
+#define GDK_TYPE_WAYLAND_SURFACE (gdk_wayland_surface_get_type())
+#define GDK_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurface))
+#define GDK_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
+#define GDK_IS_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SURFACE))
+#define GDK_IS_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_SURFACE))
+#define GDK_WAYLAND_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
GDK_AVAILABLE_IN_ALL
-GType gdk_wayland_window_get_type (void);
+GType gdk_wayland_surface_get_type (void);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_wayland_window_new_subsurface (GdkDisplay *display,
+GdkSurface * gdk_wayland_surface_new_subsurface (GdkDisplay *display,
const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL
-struct wl_surface *gdk_wayland_window_get_wl_surface (GdkWindow *window);
+struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_window_set_use_custom_surface (GdkWindow *window);
+void gdk_wayland_surface_set_use_custom_surface (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *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,25 +63,25 @@ void gdk_wayland_window_set_dbus_properties_libgtk_only (Gdk
const char *application_object_path,
const char *unique_bus_name);
-typedef void (*GdkWaylandWindowExported) (GdkWindow *window,
+typedef void (*GdkWaylandSurfaceExported) (GdkSurface *surface,
const char *handle,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_wayland_window_export_handle (GdkWindow *window,
- GdkWaylandWindowExported callback,
+gboolean gdk_wayland_surface_export_handle (GdkSurface *surface,
+ GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func);
GDK_AVAILABLE_IN_ALL
-void gdk_wayland_window_unexport_handle (GdkWindow *window);
+void gdk_wayland_surface_unexport_handle (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-gboolean gdk_wayland_window_set_transient_for_exported (GdkWindow *window,
+gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
char *parent_handle_str);
-void gdk_wayland_window_announce_csd (GdkWindow *window);
+void gdk_wayland_surface_announce_csd (GdkSurface *surface);
G_END_DECLS
-#endif /* __GDK_WAYLAND_WINDOW_H__ */
+#endif /* __GDK_WAYLAND_SURFACE_H__ */
diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build
index fec3d2c74e..6390e57c19 100644
--- a/gdk/wayland/meson.build
+++ b/gdk/wayland/meson.build
@@ -12,7 +12,7 @@ gdk_wayland_sources = files([
'gdkprimary-wayland.c',
'gdkselection-wayland.c',
'gdkvulkancontext-wayland.c',
- 'gdkwindow-wayland.c',
+ 'gdksurface-wayland.c',
'wm-button-layout-translation.c',
])
@@ -21,7 +21,7 @@ gdk_wayland_public_headers = files([
'gdkwaylanddisplay.h',
'gdkwaylandglcontext.h',
'gdkwaylandmonitor.h',
- 'gdkwaylandwindow.h'
+ 'gdkwaylandsurface.h'
])
install_headers(gdk_wayland_public_headers, subdir: 'gtk-4.0/gdk/wayland/')
diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c
index adeec0d8b0..8e83cfae30 100644
--- a/gdk/win32/gdkcursor-win32.c
+++ b/gdk/win32/gdkcursor-win32.c
@@ -934,7 +934,7 @@ _gdk_win32_display_get_maximal_cursor_size (GdkDisplay *display,
/* Convert a pixbuf to an HICON (or HCURSOR). Supports alpha under
* Windows XP, thresholds alpha otherwise. Also used from
- * gdkwindow-win32.c for creating application icons.
+ * gdksurface-win32.c for creating application icons.
*/
static HBITMAP
diff --git a/gdk/win32/gdkdevice-virtual.c b/gdk/win32/gdkdevice-virtual.c
index fb52a68446..ce1e0ab5c5 100644
--- a/gdk/win32/gdkdevice-virtual.c
+++ b/gdk/win32/gdkdevice-virtual.c
@@ -17,7 +17,7 @@
#include "config.h"
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <windowsx.h>
#include <objbase.h>
@@ -65,7 +65,7 @@ _gdk_device_virtual_set_active (GdkDevice *device,
static gboolean
gdk_device_virtual_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -77,7 +77,7 @@ gdk_device_virtual_get_history (GdkDevice *device,
static void
gdk_device_virtual_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask)
{
@@ -89,13 +89,13 @@ gdk_device_virtual_get_state (GdkDevice *device,
}
static void
-gdk_device_virtual_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_device_virtual_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor)
{
if (cursor != NULL)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
HCURSOR hcursor = NULL;
if (display != NULL)
@@ -116,8 +116,8 @@ gdk_device_virtual_warp (GdkDevice *device,
static void
gdk_device_virtual_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -135,14 +135,14 @@ gdk_device_virtual_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_device_virtual_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
@@ -160,7 +160,7 @@ gdk_device_virtual_grab (GdkDevice *device,
else
SetCursor (LoadCursor (NULL, IDC_ARROW));
- SetCapture (GDK_WINDOW_HWND (window));
+ SetCapture (GDK_SURFACE_HWND (window));
}
return GDK_GRAB_SUCCESS;
@@ -198,8 +198,8 @@ gdk_device_virtual_ungrab (GdkDevice *device,
}
static void
-gdk_device_virtual_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_device_virtual_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask)
{
}
@@ -211,13 +211,13 @@ gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass)
device_class->get_history = gdk_device_virtual_get_history;
device_class->get_state = gdk_device_virtual_get_state;
- device_class->set_window_cursor = gdk_device_virtual_set_window_cursor;
+ device_class->set_surface_cursor = gdk_device_virtual_set_surface_cursor;
device_class->warp = gdk_device_virtual_warp;
device_class->query_state = gdk_device_virtual_query_state;
device_class->grab = gdk_device_virtual_grab;
device_class->ungrab = gdk_device_virtual_ungrab;
- device_class->window_at_position = _gdk_device_win32_window_at_position;
- device_class->select_window_events = gdk_device_virtual_select_window_events;
+ device_class->surface_at_position = _gdk_device_win32_surface_at_position;
+ device_class->select_surface_events = gdk_device_virtual_select_surface_events;
}
static void
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index 110d73d4ce..7960ee173b 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -17,7 +17,7 @@
#include "config.h"
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <windowsx.h>
#include <objbase.h>
@@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWin32, gdk_device_win32, GDK_TYPE_DEVICE)
static gboolean
gdk_device_win32_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -41,13 +41,13 @@ gdk_device_win32_get_history (GdkDevice *device,
static void
gdk_device_win32_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask)
{
gint x_int, y_int;
- gdk_window_get_device_position (window, device, &x_int, &y_int, mask);
+ gdk_surface_get_device_position (window, device, &x_int, &y_int, mask);
if (axes)
{
@@ -57,8 +57,8 @@ gdk_device_win32_get_state (GdkDevice *device,
}
static void
-gdk_device_win32_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_device_win32_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor)
{
}
@@ -98,8 +98,8 @@ get_current_mask (void)
static void
gdk_device_win32_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -112,14 +112,14 @@ gdk_device_win32_query_state (GdkDevice *device,
if (window)
{
- scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale;
- hwnd = GDK_WINDOW_HWND (window);
+ scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->surface_scale;
+ hwnd = GDK_SURFACE_HWND (window);
}
else
{
GdkDisplay *display = gdk_device_get_display (device);
- scale = GDK_WIN32_DISPLAY (display)->window_scale;
+ scale = GDK_WIN32_DISPLAY (display)->surface_scale;
hwnd = NULL;
}
@@ -171,10 +171,10 @@ gdk_device_win32_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_device_win32_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -195,15 +195,15 @@ screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
ScreenToClient (hwnd, client_pt);
}
-GdkWindow *
-_gdk_device_win32_window_at_position (GdkDevice *device,
+GdkSurface *
+_gdk_device_win32_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- GdkWindow *window = NULL;
- GdkWindowImplWin32 *impl = NULL;
+ GdkSurface *window = NULL;
+ GdkSurfaceImplWin32 *impl = NULL;
POINT screen_pt, client_pt;
HWND hwnd, hwndc;
RECT rect;
@@ -223,7 +223,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
window = gdk_win32_handle_table_lookup (hwnd);
if (window != NULL &&
- GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+ GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
break;
screen_to_client (hwnd, screen_pt, &client_pt);
@@ -268,20 +268,20 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
if (window && (win_x || win_y))
{
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (win_x)
- *win_x = client_pt.x / impl->window_scale;
+ *win_x = client_pt.x / impl->surface_scale;
if (win_y)
- *win_y = client_pt.y / impl->window_scale;
+ *win_y = client_pt.y / impl->surface_scale;
}
return window;
}
static void
-gdk_device_win32_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_device_win32_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask)
{
}
@@ -293,13 +293,13 @@ gdk_device_win32_class_init (GdkDeviceWin32Class *klass)
device_class->get_history = gdk_device_win32_get_history;
device_class->get_state = gdk_device_win32_get_state;
- device_class->set_window_cursor = gdk_device_win32_set_window_cursor;
+ device_class->set_surface_cursor = gdk_device_win32_set_surface_cursor;
device_class->warp = gdk_device_win32_warp;
device_class->query_state = gdk_device_win32_query_state;
device_class->grab = gdk_device_win32_grab;
device_class->ungrab = gdk_device_win32_ungrab;
- device_class->window_at_position = _gdk_device_win32_window_at_position;
- device_class->select_window_events = gdk_device_win32_select_window_events;
+ device_class->surface_at_position = _gdk_device_win32_surface_at_position;
+ device_class->select_surface_events = gdk_device_win32_select_surface_events;
}
static void
diff --git a/gdk/win32/gdkdevice-win32.h b/gdk/win32/gdkdevice-win32.h
index b1dd80db9f..ff2c94ce5b 100644
--- a/gdk/win32/gdkdevice-win32.h
+++ b/gdk/win32/gdkdevice-win32.h
@@ -44,7 +44,7 @@ struct _GdkDeviceWin32Class
GType gdk_device_win32_get_type (void) G_GNUC_CONST;
-GdkWindow *_gdk_device_win32_window_at_position (GdkDevice *device,
+GdkSurface *_gdk_device_win32_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c
index 0de1ecb879..553d2a3a62 100644
--- a/gdk/win32/gdkdevice-wintab.c
+++ b/gdk/win32/gdkdevice-wintab.c
@@ -17,7 +17,7 @@
#include "config.h"
-#include <gdk/gdkwindow.h>
+#include <gdk/gdksurface.h>
#include <windowsx.h>
#include <objbase.h>
@@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWintab, gdk_device_wintab, GDK_TYPE_DEVICE)
static gboolean
gdk_device_wintab_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -67,7 +67,7 @@ get_current_mask (void)
static void
gdk_device_wintab_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
GdkModifierType *mask)
{
@@ -93,8 +93,8 @@ gdk_device_wintab_get_state (GdkDevice *device,
}
static void
-gdk_device_wintab_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_device_wintab_set_surface_cursor (GdkDevice *device,
+ GdkSurface *window,
GdkCursor *cursor)
{
}
@@ -108,8 +108,8 @@ gdk_device_wintab_warp (GdkDevice *device,
static void
gdk_device_wintab_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *window,
+ GdkSurface **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -119,20 +119,20 @@ gdk_device_wintab_query_state (GdkDevice *device,
GdkDeviceWintab *device_wintab;
POINT point;
HWND hwnd, hwndc;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
int scale;
device_wintab = GDK_DEVICE_WINTAB (device);
if (window)
{
- scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale;
- hwnd = GDK_WINDOW_HWND (window);
+ scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->surface_scale;
+ hwnd = GDK_SURFACE_HWND (window);
}
else
{
GdkDisplay *display = gdk_device_get_display (device);
- scale = GDK_WIN32_DISPLAY (display)->window_scale;
+ scale = GDK_WIN32_DISPLAY (display)->surface_scale;
hwnd = NULL;
}
@@ -186,10 +186,10 @@ gdk_device_wintab_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_device_wintab_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *window,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -202,8 +202,8 @@ gdk_device_wintab_ungrab (GdkDevice *device,
{
}
-static GdkWindow *
-gdk_device_wintab_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_device_wintab_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
@@ -213,31 +213,31 @@ gdk_device_wintab_window_at_position (GdkDevice *device,
}
static void
-gdk_device_wintab_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_device_wintab_select_surface_events (GdkDevice *device,
+ GdkSurface *window,
GdkEventMask event_mask)
{
}
void
_gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
gdouble *x,
gdouble *y)
{
GdkDevice *device;
- GdkWindow *impl_window;
+ GdkSurface *impl_surface;
gint root_x, root_y;
gdouble temp_x, temp_y;
gint i;
GdkDisplay *display;
device = GDK_DEVICE (device_wintab);
- impl_window = _gdk_window_get_impl_window (window);
+ impl_surface = _gdk_surface_get_impl_surface (window);
temp_x = temp_y = 0;
- gdk_window_get_origin (impl_window, &root_x, &root_y);
+ gdk_surface_get_origin (impl_surface, &root_x, &root_y);
display = gdk_device_get_display (device);
@@ -251,8 +251,8 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
{
case GDK_AXIS_X:
case GDK_AXIS_Y:
- if (gdk_device_get_mode (device) == GDK_MODE_WINDOW)
- _gdk_device_translate_window_coord (device, window, i,
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
+ _gdk_device_translate_surface_coord (device, window, i,
device_wintab->last_axis_data[i],
&axes[i]);
else
@@ -260,7 +260,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
HMONITOR hmonitor;
MONITORINFO minfo = {sizeof (MONITORINFO),};
- hmonitor = MonitorFromWindow (GDK_WINDOW_HWND (window),
+ hmonitor = MonitorFromWindow (GDK_SURFACE_HWND (window),
MONITOR_DEFAULTTONEAREST);
GetMonitorInfo (hmonitor, &minfo);
@@ -301,13 +301,13 @@ gdk_device_wintab_class_init (GdkDeviceWintabClass *klass)
device_class->get_history = gdk_device_wintab_get_history;
device_class->get_state = gdk_device_wintab_get_state;
- device_class->set_window_cursor = gdk_device_wintab_set_window_cursor;
+ device_class->set_surface_cursor = gdk_device_wintab_set_surface_cursor;
device_class->warp = gdk_device_wintab_warp;
device_class->query_state = gdk_device_wintab_query_state;
device_class->grab = gdk_device_wintab_grab;
device_class->ungrab = gdk_device_wintab_ungrab;
- device_class->window_at_position = gdk_device_wintab_window_at_position;
- device_class->select_window_events = gdk_device_wintab_select_window_events;
+ device_class->surface_at_position = gdk_device_wintab_surface_at_position;
+ device_class->select_surface_events = gdk_device_wintab_select_surface_events;
}
static void
diff --git a/gdk/win32/gdkdevice-wintab.h b/gdk/win32/gdkdevice-wintab.h
index bba08ff125..f706dd91df 100644
--- a/gdk/win32/gdkdevice-wintab.h
+++ b/gdk/win32/gdkdevice-wintab.h
@@ -61,7 +61,7 @@ struct _GdkDeviceWintabClass
GType gdk_device_wintab_get_type (void) G_GNUC_CONST;
void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device,
- GdkWindow *window,
+ GdkSurface *window,
gdouble *axes,
gdouble *x,
gdouble *y);
diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c
index 28507fba38..52b3059252 100644
--- a/gdk/win32/gdkdevicemanager-win32.c
+++ b/gdk/win32/gdkdevicemanager-win32.c
@@ -43,7 +43,7 @@
#define TWOPI (2 * G_PI)
static GList *wintab_contexts = NULL;
-static GdkWindow *wintab_window = NULL;
+static GdkSurface *wintab_window = NULL;
extern gint _gdk_input_ignore_core;
typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c);
@@ -432,7 +432,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
ndevices, ncursors));
#endif
/* Create a dummy window to receive wintab events */
- wintab_window = gdk_window_new_popup (display, &(GdkRectangle) { -100, -100, 2, 2 });
+ wintab_window = gdk_surface_new_popup (display, &(GdkRectangle) { -100, -100, 2, 2 });
g_object_ref (wintab_window);
for (devix = 0; devix < ndevices; devix++)
@@ -496,7 +496,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
print_lc(&lc)));
#endif
hctx = g_new (HCTX, 1);
- if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL)
+ if ((*hctx = (*p_WTOpenA) (GDK_SURFACE_HWND (wintab_window), &lc, TRUE)) == NULL)
{
g_warning ("gdk_input_wintab_init: WTOpen failed");
return;
@@ -831,7 +831,7 @@ decode_tilt (gint *axis_data,
/*
* Get the currently active keyboard modifiers (ignoring the mouse buttons)
- * We could use gdk_window_get_pointer but that function does a lot of other
+ * We could use gdk_surface_get_pointer but that function does a lot of other
* expensive things besides getting the modifiers. This code is somewhat based
* on build_pointer_event_state from gdkevents-win32.c
*/
@@ -878,7 +878,7 @@ gboolean
gdk_input_other_event (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
- GdkWindow *window)
+ GdkSurface *window)
{
GdkDeviceManagerWin32 *device_manager;
GdkDeviceWintab *source_device = NULL;
@@ -886,7 +886,7 @@ gdk_input_other_event (GdkDisplay *display,
GdkEventMask masktest;
guint key_state;
POINT pt;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
PACKET packet;
gint root_x, root_y;
@@ -898,21 +898,21 @@ gdk_input_other_event (GdkDisplay *display,
*/
static guint button_map[8] = {0, 1, 4, 5, 2, 3, 6, 7};
- if (event->any.window != wintab_window)
+ if (event->any.surface != wintab_window)
{
g_warning ("gdk_input_other_event: not wintab_window?");
return FALSE;
}
device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager);
- window = gdk_device_get_window_at_position (device_manager->core_pointer, &x, &y);
+ window = gdk_device_get_surface_at_position (device_manager->core_pointer, &x, &y);
if (window)
g_object_ref (window);
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("gdk_input_other_event: window=%p %+d%+d\n",
- window ? GDK_WINDOW_HWND (window) : NULL, x, y));
+ window ? GDK_SURFACE_HWND (window) : NULL, x, y));
if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE)
{
@@ -1060,31 +1060,31 @@ gdk_input_other_event (GdkDisplay *display,
/* Now we can check if the window wants the event, and
* propagate if necessary.
*/
- while ((gdk_window_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 &&
+ while ((gdk_surface_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 &&
(gdk_device_get_device_type (GDK_DEVICE (source_device)) == GDK_DEVICE_TYPE_SLAVE &&
- (gdk_window_get_events (window) & masktest) == 0))
+ (gdk_surface_get_events (window) & masktest) == 0))
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n"));
if (window->parent == NULL)
return FALSE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- pt.x = x * impl->window_scale;
- pt.y = y * impl->window_scale;
- ClientToScreen (GDK_WINDOW_HWND (window), &pt);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ pt.x = x * impl->surface_scale;
+ pt.y = y * impl->surface_scale;
+ ClientToScreen (GDK_SURFACE_HWND (window), &pt);
g_object_unref (window);
window = window->parent;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
g_object_ref (window);
- ScreenToClient (GDK_WINDOW_HWND (window), &pt);
- x = pt.x / impl->window_scale;
- y = pt.y / impl->window_scale;
+ ScreenToClient (GDK_SURFACE_HWND (window), &pt);
+ x = pt.x / impl->surface_scale;
+ y = pt.y / impl->surface_scale;
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n",
- GDK_WINDOW_HWND (window), x, y));
+ GDK_SURFACE_HWND (window), x, y));
}
- event->any.window = window;
+ event->any.surface = window;
key_state = get_modifier_key_state ();
if (event->any.type == GDK_BUTTON_PRESS ||
event->any.type == GDK_BUTTON_RELEASE)
@@ -1096,7 +1096,7 @@ gdk_input_other_event (GdkDisplay *display,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
event->button.axes = g_new (gdouble, num_axes);
- gdk_window_get_origin (window, &root_x, &root_y);
+ gdk_surface_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (source_device,
window,
@@ -1128,7 +1128,7 @@ gdk_input_other_event (GdkDisplay *display,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
event->motion.axes = g_new (gdouble, num_axes);
- gdk_window_get_origin (window, &root_x, &root_y);
+ gdk_surface_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (source_device,
window,
diff --git a/gdk/win32/gdkdevicemanager-win32.h b/gdk/win32/gdkdevicemanager-win32.h
index 8f71335ba8..fc8ead5a10 100644
--- a/gdk/win32/gdkdevicemanager-win32.h
+++ b/gdk/win32/gdkdevicemanager-win32.h
@@ -60,7 +60,7 @@ void _gdk_input_set_tablet_active (void);
gboolean gdk_input_other_event (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
- GdkWindow *window);
+ GdkSurface *window);
G_END_DECLS
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 5bc2cb6ec1..c0358ab119 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -28,7 +28,7 @@
#include "gdkglcontext-win32.h"
#include "gdkwin32display.h"
#include "gdkwin32screen.h"
-#include "gdkwin32window.h"
+#include "gdkwin32surface.h"
#include "gdkmonitor-win32.h"
#include "gdkwin32.h"
#include "gdkvulkancontext-win32.h"
@@ -492,7 +492,7 @@ gdk_win32_display_get_name (GdkDisplay *display)
return display_name_cache;
}
-static GdkWindow *
+static GdkSurface *
gdk_win32_display_get_default_group (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@@ -964,15 +964,15 @@ gdk_win32_display_init (GdkWin32Display *display)
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE &&
scale_str != NULL)
{
- display->window_scale = atol (scale_str);
+ display->surface_scale = atol (scale_str);
- if (display->window_scale == 0)
- display->window_scale = 1;
+ if (display->surface_scale == 0)
+ display->surface_scale = 1;
display->has_fixed_scale = TRUE;
}
else
- display->window_scale = 1;
+ display->surface_scale = 1;
_gdk_win32_display_init_cursors (display);
gdk_win32_display_check_composited (display);
@@ -1107,7 +1107,7 @@ _gdk_win32_display_get_monitor_scale_factor (GdkWin32Display *win32_display,
*dpi = dpix;
if (win32_display->has_fixed_scale)
- return win32_display->window_scale;
+ return win32_display->surface_scale;
else
return dpix / USER_DEFAULT_SCREEN_DPI > 1 ? dpix / USER_DEFAULT_SCREEN_DPI : 1;
}
@@ -1143,7 +1143,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
object_class->dispose = gdk_win32_display_dispose;
object_class->finalize = gdk_win32_display_finalize;
- display_class->window_type = GDK_TYPE_WIN32_WINDOW;
+ display_class->surface_type = GDK_TYPE_WIN32_SURFACE;
display_class->get_name = gdk_win32_display_get_name;
display_class->beep = gdk_win32_display_beep;
@@ -1164,7 +1164,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->get_next_serial = gdk_win32_display_get_next_serial;
display_class->notify_startup_complete = gdk_win32_display_notify_startup_complete;
- display_class->create_window_impl = _gdk_win32_display_create_window_impl;
+ display_class->create_surface_impl = _gdk_win32_display_create_surface_impl;
display_class->get_keymap = _gdk_win32_display_get_keymap;
display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list;
@@ -1184,5 +1184,5 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->get_last_seen_time = gdk_win32_display_get_last_seen_time;
display_class->set_cursor_theme = gdk_win32_display_set_cursor_theme;
- _gdk_win32_windowing_init ();
+ _gdk_win32_surfaceing_init ();
}
diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h
index 05239c665b..71bb5e0499 100644
--- a/gdk/win32/gdkdisplay-win32.h
+++ b/gdk/win32/gdkdisplay-win32.h
@@ -85,7 +85,7 @@ struct _GdkWin32Display
guint have_at_least_win81 : 1;
GdkWin32ProcessDpiAwareness dpi_aware_type;
guint has_fixed_scale : 1;
- guint window_scale;
+ guint surface_scale;
GdkWin32ShcoreFuncs shcore_funcs;
GdkWin32User32DPIFuncs user32_dpi_funcs;
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 1d844a8185..e2d48e3ecf 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -48,7 +48,7 @@
* To account for it the data is transmuted back and forth. There are two
* main points of transmutation:
* * GDK convert selection: transmute W32 data to GTK+ data
- * * GDK window property change: transmute GTK+ data to W32 data
+ * * GDK surface property change: transmute GTK+ data to W32 data
*
* There are also two points where data formats are considered:
* * When source drag context is created, it gets a list of GTK+ targets
@@ -173,16 +173,16 @@ static gboolean drag_context_grab (GdkDragContext *context);
G_DEFINE_TYPE (GdkWin32DragContext, gdk_win32_drag_context, GDK_TYPE_DRAG_CONTEXT)
static void
-move_drag_window (GdkDragContext *context,
+move_drag_surface (GdkDragContext *context,
guint x_root,
guint y_root)
{
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
- gdk_window_move (context_win32->drag_window,
+ gdk_surface_move (context_win32->drag_surface,
x_root - context_win32->hot_x,
y_root - context_win32->hot_y);
- gdk_window_raise (context_win32->drag_window);
+ gdk_surface_raise (context_win32->drag_surface);
}
static void
@@ -204,7 +204,7 @@ gdk_win32_drag_context_finalize (GObject *object)
{
GdkDragContext *context;
GdkWin32DragContext *context_win32;
- GdkWindow *drag_window;
+ GdkSurface *drag_surface;
GDK_NOTE (DND, g_print ("gdk_drag_context_finalize %p\n", object));
@@ -222,14 +222,14 @@ gdk_win32_drag_context_finalize (GObject *object)
}
g_set_object (&context_win32->ipc_window, NULL);
- drag_window = context_win32->drag_window;
+ drag_surface = context_win32->drag_surface;
g_array_unref (context_win32->droptarget_format_target_map);
G_OBJECT_CLASS (gdk_win32_drag_context_parent_class)->finalize (object);
- if (drag_window)
- gdk_window_destroy (drag_window);
+ if (drag_surface)
+ gdk_surface_destroy (drag_surface);
}
/* Drag Contexts */
@@ -237,8 +237,8 @@ gdk_win32_drag_context_finalize (GObject *object)
static GdkDragContext *
gdk_drag_context_new (GdkDisplay *display,
gboolean is_source,
- GdkWindow *source_window,
- GdkWindow *dest_window,
+ GdkSurface *source_surface,
+ GdkSurface *dest_surface,
GdkDragAction actions,
GdkDevice *device,
GdkDragProtocol protocol)
@@ -255,15 +255,15 @@ gdk_drag_context_new (GdkDisplay *display,
gdk_drag_context_set_device (context, device ? device : gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
if (win32_display->has_fixed_scale)
- context_win32->scale = win32_display->window_scale;
+ context_win32->scale = win32_display->surface_scale;
else
context_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL);
context_win32->droptarget_format_target_map = g_array_new (FALSE, FALSE, sizeof (GdkSelTargetFormat));
context->is_source = is_source;
- g_set_object (&context->source_window, source_window);
- g_set_object (&context->dest_window, dest_window);
+ g_set_object (&context->source_surface, source_surface);
+ g_set_object (&context->dest_surface, dest_surface);
context->actions = actions;
context->protocol = protocol;
@@ -272,8 +272,8 @@ gdk_drag_context_new (GdkDisplay *display,
static GdkDragContext *
gdk_drag_context_find (gboolean is_source,
- GdkWindow *source,
- GdkWindow *dest)
+ GdkSurface *source,
+ GdkSurface *dest)
{
GList *tmp_list = contexts;
GdkDragContext *context;
@@ -283,8 +283,8 @@ gdk_drag_context_find (gboolean is_source,
context = (GdkDragContext *)tmp_list->data;
if ((!context->is_source == !is_source) &&
- ((source == NULL) || (context->source_window && (context->source_window == source))) &&
- ((dest == NULL) || (context->dest_window && (context->dest_window == dest))))
+ ((source == NULL) || (context->source_surface && (context->source_surface == source))) &&
+ ((dest == NULL) || (context->dest_surface && (context->dest_surface == dest))))
return context;
tmp_list = tmp_list->next;
@@ -312,7 +312,7 @@ typedef struct {
GdkDragContext *context;
gint ref_count;
- GdkWindow *dest_window;
+ GdkSurface *dest_surface;
} target_drag_context;
@@ -345,7 +345,7 @@ static enum_formats *enum_formats_new (data_object *dataobj);
/* map windows -> target drag contexts. The table
* owns a ref to both objects.
*/
-static GHashTable* target_ctx_for_window = NULL;
+static GHashTable* target_ctx_for_surface = NULL;
static ULONG STDMETHODCALLTYPE
idroptarget_addref (LPDROPTARGET This)
@@ -404,7 +404,7 @@ idroptarget_release (LPDROPTARGET This)
if (ref_count == 0)
{
g_object_unref (ctx->context);
- g_clear_object (&ctx->dest_window);
+ g_clear_object (&ctx->dest_surface);
g_free (This);
}
@@ -482,16 +482,16 @@ dnd_event_put (GdkEventType type,
GdkDragContext *context,
gint pt_x,
gint pt_y,
- gboolean to_dest_window)
+ gboolean to_dest_surface)
{
GdkEvent *e;
e = gdk_event_new (type);
- if (to_dest_window)
- g_set_object (&e->dnd.window, context->dest_window);
+ if (to_dest_surface)
+ g_set_object (&e->dnd.window, context->dest_surface);
else
- g_set_object (&e->dnd.window, context->source_window);
+ g_set_object (&e->dnd.window, context->source_surface);
e->dnd.send_event = FALSE;
g_set_object (&e->dnd.context, context);
e->dnd.time = GDK_CURRENT_TIME;
@@ -584,19 +584,19 @@ idroptarget_dragenter (LPDROPTARGET This,
gint pt_x;
gint pt_y;
- GDK_NOTE (DND, g_print ("idroptarget_dragenter %p @ %ld : %ld for dest window 0x%p S_OK\n", This, pt.x, pt.y, ctx->dest_window));
+ GDK_NOTE (DND, g_print ("idroptarget_dragenter %p @ %ld : %ld for dest window 0x%p S_OK\n", This, pt.x, pt.y, ctx->dest_surface));
g_clear_object (&ctx->context);
- context = gdk_drag_context_new (gdk_window_get_display (ctx->dest_window),
+ context = gdk_drag_context_new (gdk_surface_get_display (ctx->dest_surface),
FALSE,
/* OLE2 DnD does not allow us to get the source window,
* but we *can* find it if it's ours. This is needed to
* support DnD within the same widget, for example.
*/
/* FIXME: Root window used to be here instead of NULL. Find a substitute? */
- (current_src_context && current_src_context->context) ? current_src_context->context->source_window : NULL,
- ctx->dest_window,
+ (current_src_context && current_src_context->context) ? current_src_context->context->source_surface : NULL,
+ ctx->dest_surface,
GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE,
NULL,
GDK_DRAG_PROTO_OLE2);
@@ -800,7 +800,7 @@ send_change_events (GdkDragContext *context,
POINT pt;
POINT pt_client;
gboolean changed = FALSE;
- HWND hwnd = GDK_WINDOW_HWND (context->source_window);
+ HWND hwnd = GDK_SURFACE_HWND (context->source_surface);
LPARAM lparam;
WPARAM wparam;
gint pt_x;
@@ -930,16 +930,16 @@ idropsource_givefeedback (LPDROPSOURCE This,
ctx->context->action = suggested_action;
if (dwEffect == DROPEFFECT_NONE)
- g_clear_object (&ctx->context->dest_window);
- else if (ctx->context->dest_window == NULL)
- ctx->context->dest_window = NULL; /* FIXME: Root window was here originally. Find a substitute? */
+ g_clear_object (&ctx->context->dest_surface);
+ else if (ctx->context->dest_surface == NULL)
+ ctx->context->dest_surface = NULL; /* FIXME: Root window was here originally. Find a substitute? */
context_win32->last_x = pt.x / context_win32->scale + _gdk_offset_x;
context_win32->last_y = pt.y / context_win32->scale + _gdk_offset_y;
e = gdk_event_new (GDK_DRAG_STATUS);
- g_set_object (&e->dnd.window, ctx->context->source_window);
+ g_set_object (&e->dnd.window, ctx->context->source_surface);
e->dnd.send_event = FALSE;
g_set_object (&e->dnd.context, ctx->context);
e->dnd.time = GDK_CURRENT_TIME;
@@ -1103,7 +1103,7 @@ idataobject_getdata (LPDATAOBJECT This,
memset (&e, 0, sizeof (GdkEvent));
e.type = GDK_SELECTION_REQUEST;
- g_set_object (&e.selection.window, ctx->context->source_window);
+ g_set_object (&e.selection.window, ctx->context->source_surface);
e.selection.send_event = FALSE; /* ??? */
/* Both selection and property are OLE2_DND, because change_property()
* will only get the property and not the selection. Theoretically we
@@ -1113,7 +1113,7 @@ idataobject_getdata (LPDATAOBJECT This,
e.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
e.selection.target = target;
/* Requestor here is fake, just to allow the event to be processed */
- g_set_object (&e.selection.requestor, ctx->context->source_window);
+ g_set_object (&e.selection.requestor, ctx->context->source_surface);
e.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
e.selection.time = GDK_CURRENT_TIME;
@@ -1440,7 +1440,7 @@ static IEnumFORMATETCVtbl ief_vtbl = {
static target_drag_context *
-target_context_new (GdkWindow *window)
+target_context_new (GdkSurface *window)
{
target_drag_context *result;
@@ -1448,18 +1448,18 @@ target_context_new (GdkWindow *window)
result->idt.lpVtbl = &idt_vtbl;
result->ref_count = 0;
- result->dest_window = g_object_ref (window);
+ result->dest_surface = g_object_ref (window);
idroptarget_addref (&result->idt);
- GDK_NOTE (DND, g_print ("target_context_new: %p (window %p)\n", result, result->dest_window));
+ GDK_NOTE (DND, g_print ("target_context_new: %p (window %p)\n", result, result->dest_surface));
return result;
}
static source_drag_context *
source_context_new (GdkDragContext *context,
- GdkWindow *window,
+ GdkSurface *window,
GdkContentFormats *formats)
{
GdkWin32DragContext *context_win32;
@@ -1669,10 +1669,10 @@ gdk_dropfiles_filter (GdkXEvent *xev,
{
GDK_NOTE (DND, g_print ("WM_DROPFILES: %p\n", msg->hwnd));
- context = gdk_drag_context_new (gdk_window_get_display (event->any.window),
+ context = gdk_drag_context_new (gdk_surface_get_display (event->any.surface),
FALSE,
NULL,
- event->any.window,
+ event->any.surface,
GDK_ACTION_COPY,
NULL,
GDK_DRAG_PROTO_WIN32_DROPFILES);
@@ -1800,7 +1800,7 @@ _gdk_dnd_init (void)
if (! SUCCEEDED (hr))
g_error ("OleInitialize failed");
- target_ctx_for_window = g_hash_table_new (g_direct_hash, g_direct_equal);
+ target_ctx_for_surface = g_hash_table_new (g_direct_hash, g_direct_equal);
}
}
@@ -1829,11 +1829,11 @@ local_send_leave (GdkDragContext *context,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) &&
- (current_dest_drag->source_window == context->source_window))
+ (current_dest_drag->source_surface == context->source_surface))
{
tmp_event = gdk_event_new (GDK_DRAG_LEAVE);
- g_set_object (&tmp_event->dnd.window, context->dest_window);
+ g_set_object (&tmp_event->dnd.window, context->dest_surface);
/* Pass ownership of context to the event */
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, current_dest_drag);
@@ -1866,21 +1866,21 @@ local_send_enter (GdkDragContext *context,
current_dest_drag = NULL;
}
- new_context = gdk_drag_context_new (gdk_window_get_display (context->source_window),
+ new_context = gdk_drag_context_new (gdk_surface_get_display (context->source_surface),
FALSE,
- context->source_window,
- context->dest_window,
+ context->source_surface,
+ context->dest_surface,
context->actions,
NULL,
GDK_DRAG_PROTO_LOCAL);
new_context->formats = gdk_content_formats_ref (context->formats);
- gdk_window_set_events (new_context->source_window,
- gdk_window_get_events (new_context->source_window) |
+ gdk_surface_set_events (new_context->source_surface,
+ gdk_surface_get_events (new_context->source_surface) |
GDK_PROPERTY_CHANGE_MASK);
tmp_event = gdk_event_new (GDK_DRAG_ENTER);
- g_set_object (&tmp_event->dnd.window, context->dest_window);
+ g_set_object (&tmp_event->dnd.window, context->dest_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, new_context);
tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */
@@ -1910,12 +1910,12 @@ local_send_motion (GdkDragContext *context,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) &&
- (current_dest_drag->source_window == context->source_window))
+ (current_dest_drag->source_surface == context->source_surface))
{
GdkWin32DragContext *current_dest_drag_win32;
tmp_event = gdk_event_new (GDK_DRAG_MOTION);
- g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_window);
+ g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, current_dest_drag);
tmp_event->dnd.time = time;
@@ -1951,13 +1951,13 @@ local_send_drop (GdkDragContext *context,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) &&
- (current_dest_drag->source_window == context->source_window))
+ (current_dest_drag->source_surface == context->source_surface))
{
GdkWin32DragContext *context_win32;
/* Pass ownership of context to the event */
tmp_event = gdk_event_new (GDK_DROP_START);
- g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_window);
+ g_set_object (&tmp_event->dnd.window, current_dest_drag->dest_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, current_dest_drag);
tmp_event->dnd.time = GDK_CURRENT_TIME;
@@ -1981,7 +1981,7 @@ static void
gdk_drag_do_leave (GdkDragContext *context,
guint32 time)
{
- if (context->dest_window)
+ if (context->dest_surface)
{
GDK_NOTE (DND, g_print ("gdk_drag_do_leave\n"));
@@ -1991,24 +1991,24 @@ gdk_drag_do_leave (GdkDragContext *context,
local_send_leave (context, time);
}
- g_clear_object (&context->dest_window);
+ g_clear_object (&context->dest_surface);
}
}
-static GdkWindow *
-create_drag_window (GdkDisplay *display)
+static GdkSurface *
+create_drag_surface (GdkDisplay *display)
{
- GdkWindow *window;
+ GdkSurface *window;
- window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ window = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+ gdk_surface_set_type_hint (window, GDK_SURFACE_TYPE_HINT_DND);
return window;
}
GdkDragContext *
-_gdk_win32_window_drag_begin (GdkWindow *window,
+_gdk_win32_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GdkContentFormats *formats,
GdkDragAction actions,
@@ -2026,7 +2026,7 @@ _gdk_win32_window_drag_begin (GdkWindow *window,
if (use_ole2_dnd)
g_assert (pending_src_context == NULL);
- context = gdk_drag_context_new (gdk_window_get_display (window),
+ context = gdk_drag_context_new (gdk_surface_get_display (window),
TRUE,
window,
NULL,
@@ -2064,7 +2064,7 @@ _gdk_win32_window_drag_begin (GdkWindow *window,
if (kbd_state[VK_RBUTTON] & 0x80)
context_win32->last_key_state |= MK_RBUTTON;
- context_win32->drag_window = create_drag_window (gdk_window_get_display (window));
+ context_win32->drag_surface = create_drag_surface (gdk_surface_get_display (window));
if (!drag_context_grab (context))
{
@@ -2079,7 +2079,7 @@ _gdk_win32_window_drag_begin (GdkWindow *window,
sel_win32->dnd_source_state = GDK_WIN32_DND_PENDING;
}
- move_drag_window (context, x_root, y_root);
+ move_drag_surface (context, x_root, y_root);
return context;
}
@@ -2127,13 +2127,13 @@ _gdk_win32_dnd_do_dragdrop (void)
memset (&tmp_event, 0, sizeof (tmp_event));
tmp_event.type = GDK_SELECTION_REQUEST;
- g_set_object (&tmp_event.selection.window, drag_ctx->source_window);
+ g_set_object (&tmp_event.selection.window, drag_ctx->source_surface);
tmp_event.selection.send_event = FALSE;
tmp_event.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
tmp_event.selection.target = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE);
win32_sel->property_change_target_atom = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE);
tmp_event.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
- g_set_object (&tmp_event.selection.requestor, drag_ctx->source_window);
+ g_set_object (&tmp_event.selection.requestor, drag_ctx->source_surface);
tmp_event.selection.time = GDK_CURRENT_TIME; /* ??? */
GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event));
@@ -2143,7 +2143,7 @@ _gdk_win32_dnd_do_dragdrop (void)
{
GdkEvent *tmp_event;
tmp_event = gdk_event_new (GDK_DROP_FINISHED);
- g_set_object (&tmp_event->dnd.window, drag_ctx->source_window);
+ g_set_object (&tmp_event->dnd.window, drag_ctx->source_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, drag_ctx);
gdk_event_set_device (tmp_event, gdk_drag_context_get_device (drag_ctx));
@@ -2200,45 +2200,45 @@ find_window_enum_proc (HWND hwnd,
return TRUE;
}
-static GdkWindow *
+static GdkSurface *
gdk_win32_drag_context_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
+ GdkSurface *drag_surface,
gint x_root,
gint y_root,
GdkDragProtocol *protocol)
{
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
- GdkWindow *dest_window, *dw;
+ GdkSurface *dest_surface, *dw;
find_window_enum_arg a;
a.x = x_root * context_win32->scale - _gdk_offset_x;
a.y = y_root * context_win32->scale - _gdk_offset_y;
- a.ignore = drag_window ? GDK_WINDOW_HWND (drag_window) : NULL;
+ a.ignore = drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL;
a.result = NULL;
GDK_NOTE (DND,
g_print ("gdk_drag_find_window_real: %p %+d%+d\n",
- (drag_window ? GDK_WINDOW_HWND (drag_window) : NULL),
+ (drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL),
a.x, a.y));
EnumWindows (find_window_enum_proc, (LPARAM) &a);
if (a.result == NULL)
- dest_window = NULL;
+ dest_surface = NULL;
else
{
dw = gdk_win32_handle_table_lookup (a.result);
if (dw)
{
- dest_window = gdk_window_get_toplevel (dw);
- g_object_ref (dest_window);
+ dest_surface = gdk_surface_get_toplevel (dw);
+ g_object_ref (dest_surface);
}
else
- dest_window = gdk_win32_window_foreign_new_for_display (context->display, a.result);
+ dest_surface = gdk_win32_surface_foreign_new_for_display (context->display, a.result);
if (use_ole2_dnd)
*protocol = GDK_DRAG_PROTO_OLE2;
- else if (context->source_window)
+ else if (context->source_surface)
*protocol = GDK_DRAG_PROTO_LOCAL;
else
*protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
@@ -2246,18 +2246,18 @@ gdk_win32_drag_context_find_window (GdkDragContext *context,
GDK_NOTE (DND,
g_print ("gdk_drag_find_window: %p %+d%+d: %p: %p %s\n",
- (drag_window ? GDK_WINDOW_HWND (drag_window) : NULL),
+ (drag_surface ? GDK_SURFACE_HWND (drag_surface) : NULL),
x_root, y_root,
a.result,
- (dest_window ? GDK_WINDOW_HWND (dest_window) : NULL),
+ (dest_surface ? GDK_SURFACE_HWND (dest_surface) : NULL),
_gdk_win32_drag_protocol_to_string (*protocol)));
- return dest_window;
+ return dest_surface;
}
static gboolean
gdk_win32_drag_context_drag_motion (GdkDragContext *context,
- GdkWindow *dest_window,
+ GdkSurface *dest_surface,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
@@ -2284,18 +2284,18 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context,
context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
- if (context_win32->drag_window)
- move_drag_window (context, x_root, y_root);
+ if (context_win32->drag_surface)
+ move_drag_surface (context, x_root, y_root);
if (!use_ole2_dnd)
{
- if (context->dest_window == dest_window)
+ if (context->dest_surface == dest_surface)
{
GdkDragContext *dest_context;
dest_context = gdk_drag_context_find (FALSE,
- context->source_window,
- dest_window);
+ context->source_surface,
+ dest_surface);
if (dest_context)
dest_context->actions = context->actions;
@@ -2311,9 +2311,9 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context,
context_win32->drag_status = GDK_DRAG_STATUS_DRAG;
/* Check if new destination accepts drags, and which protocol */
- if (dest_window)
+ if (dest_surface)
{
- g_set_object (&context->dest_window, dest_window);
+ g_set_object (&context->dest_surface, dest_surface);
context->protocol = protocol;
switch (protocol)
@@ -2329,7 +2329,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context,
}
else
{
- context->dest_window = NULL;
+ context->dest_surface = NULL;
context->action = 0;
}
@@ -2337,7 +2337,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context,
* the drag changed
*/
tmp_event = gdk_event_new (GDK_DRAG_STATUS);
- g_set_object (&tmp_event->dnd.window, context->source_window);
+ g_set_object (&tmp_event->dnd.window, context->source_surface);
/* We use this to signal a synthetic status. Perhaps
* we should use an extra field...
*/
@@ -2358,7 +2358,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context,
context_win32->last_x = x_root;
context_win32->last_y = y_root;
- if (context->dest_window)
+ if (context->dest_surface)
{
if (context_win32->drag_status == GDK_DRAG_STATUS_DRAG)
{
@@ -2410,7 +2410,7 @@ gdk_win32_drag_context_drag_drop (GdkDragContext *context,
if (!use_ole2_dnd)
{
- if (context->dest_window &&
+ if (context->dest_surface &&
context->protocol == GDK_DRAG_PROTO_LOCAL)
local_send_drop (context, time);
}
@@ -2459,8 +2459,8 @@ gdk_win32_drag_context_drag_status (GdkDragContext *context,
if (!use_ole2_dnd)
{
src_context = gdk_drag_context_find (TRUE,
- context->source_window,
- context->dest_window);
+ context->source_surface,
+ context->dest_surface);
if (src_context)
{
@@ -2470,7 +2470,7 @@ gdk_win32_drag_context_drag_status (GdkDragContext *context,
src_context_win32->drag_status = GDK_DRAG_STATUS_DRAG;
tmp_event = gdk_event_new (GDK_DRAG_STATUS);
- g_set_object (&tmp_event->dnd.window, context->source_window);
+ g_set_object (&tmp_event->dnd.window, context->source_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, src_context);
tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */
@@ -2499,7 +2499,7 @@ gdk_win32_drag_context_drop_reply (GdkDragContext *context,
GDK_NOTE (DND, g_print ("gdk_drop_reply\n"));
if (!use_ole2_dnd)
- if (context->dest_window)
+ if (context->dest_surface)
{
if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES)
_gdk_dropfiles_store (NULL);
@@ -2522,12 +2522,12 @@ gdk_win32_drag_context_drop_finish (GdkDragContext *context,
if (!use_ole2_dnd)
{
src_context = gdk_drag_context_find (TRUE,
- context->source_window,
- context->dest_window);
+ context->source_surface,
+ context->dest_surface);
if (src_context)
{
tmp_event = gdk_event_new (GDK_DROP_FINISHED);
- g_set_object (&tmp_event->dnd.window, src_context->source_window);
+ g_set_object (&tmp_event->dnd.window, src_context->source_surface);
tmp_event->dnd.send_event = FALSE;
g_set_object (&tmp_event->dnd.context, src_context);
gdk_event_set_device (tmp_event, gdk_drag_context_get_device (src_context));
@@ -2575,7 +2575,7 @@ gdk_destroy_filter (GdkXEvent *xev,
#endif
void
-_gdk_win32_window_register_dnd (GdkWindow *window)
+_gdk_win32_surface_register_dnd (GdkSurface *window)
{
target_drag_context *ctx;
HRESULT hr;
@@ -2587,7 +2587,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window)
else
g_object_set_data (G_OBJECT (window), "gdk-dnd-registered", GINT_TO_POINTER (TRUE));
- GDK_NOTE (DND, g_print ("gdk_window_register_dnd: %p\n", GDK_WINDOW_HWND (window)));
+ GDK_NOTE (DND, g_print ("gdk_surface_register_dnd: %p\n", GDK_SURFACE_HWND (window)));
if (!use_ole2_dnd)
{
@@ -2596,13 +2596,13 @@ _gdk_win32_window_register_dnd (GdkWindow *window)
* whether the window (widget) in question actually accepts files
* (in gtk, data of type text/uri-list) or not.
*/
- gdk_window_add_filter (window, gdk_dropfiles_filter, NULL);
- DragAcceptFiles (GDK_WINDOW_HWND (window), TRUE);
+ gdk_surface_add_filter (window, gdk_dropfiles_filter, NULL);
+ DragAcceptFiles (GDK_SURFACE_HWND (window), TRUE);
}
else
{
/* Return if window is already setup for DND. */
- if (g_hash_table_lookup (target_ctx_for_window, GDK_WINDOW_HWND (window)) != NULL)
+ if (g_hash_table_lookup (target_ctx_for_surface, GDK_SURFACE_HWND (window)) != NULL)
return;
ctx = target_context_new (window);
@@ -2612,7 +2612,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window)
OTHER_API_FAILED ("CoLockObjectExternal");
else
{
- hr = RegisterDragDrop (GDK_WINDOW_HWND (window), &ctx->idt);
+ hr = RegisterDragDrop (GDK_SURFACE_HWND (window), &ctx->idt);
if (hr == DRAGDROP_E_ALREADYREGISTERED)
{
g_print ("DRAGDROP_E_ALREADYREGISTERED\n");
@@ -2623,7 +2623,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window)
else
{
g_object_ref (window);
- g_hash_table_insert (target_ctx_for_window, GDK_WINDOW_HWND (window), ctx);
+ g_hash_table_insert (target_ctx_for_surface, GDK_SURFACE_HWND (window), ctx);
}
}
}
@@ -2721,11 +2721,11 @@ gdk_drag_anim_timeout (gpointer data)
t = ease_out_cubic (f);
- gdk_window_show (context->drag_window);
- gdk_window_move (context->drag_window,
+ gdk_surface_show (context->drag_surface);
+ gdk_surface_move (context->drag_surface,
context->last_x + (context->start_x - context->last_x) * t - context->hot_x,
context->last_y + (context->start_y - context->last_y) * t - context->hot_y);
- gdk_window_set_opacity (context->drag_window, 1.0 - f);
+ gdk_surface_set_opacity (context->drag_surface, 1.0 - f);
return G_SOURCE_CONTINUE;
}
@@ -2760,15 +2760,15 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context,
if (success)
{
- gdk_window_hide (win32_context->drag_window);
+ gdk_surface_hide (win32_context->drag_surface);
return;
}
- win_surface = _gdk_window_ref_cairo_surface (win32_context->drag_window);
- surface = gdk_window_create_similar_surface (win32_context->drag_window,
+ win_surface = _gdk_surface_ref_cairo_surface (win32_context->drag_surface);
+ surface = gdk_surface_create_similar_surface (win32_context->drag_surface,
cairo_surface_get_content (win_surface),
- gdk_window_get_width (win32_context->drag_window),
- gdk_window_get_height (win32_context->drag_window));
+ gdk_surface_get_width (win32_context->drag_surface),
+ gdk_surface_get_height (win32_context->drag_surface));
cr = cairo_create (surface);
cairo_set_source_surface (cr, win_surface, 0, 0);
cairo_paint (cr);
@@ -2778,7 +2778,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context,
/*
pattern = cairo_pattern_create_for_surface (surface);
- gdk_window_set_background_pattern (win32_context->drag_window, pattern);
+ gdk_surface_set_background_pattern (win32_context->drag_surface, pattern);
cairo_pattern_destroy (pattern);
*/
@@ -2786,7 +2786,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context,
anim = g_slice_new0 (GdkDragAnim);
g_set_object (&anim->context, win32_context);
- anim->frame_clock = gdk_window_get_frame_clock (win32_context->drag_window);
+ anim->frame_clock = gdk_surface_get_frame_clock (win32_context->drag_surface);
anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
@@ -2948,17 +2948,17 @@ gdk_drag_update (GdkDragContext *context,
{
GdkWin32DragContext *win32_context = GDK_WIN32_DRAG_CONTEXT (context);
GdkDragAction action, possible_actions;
- GdkWindow *dest_window;
+ GdkSurface *dest_surface;
GdkDragProtocol protocol;
gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, win32_context->actions,
&action, &possible_actions);
gdk_drag_find_window (context,
- win32_context->drag_window,
- x_root, y_root, &dest_window, &protocol);
+ win32_context->drag_surface,
+ x_root, y_root, &dest_surface, &protocol);
- gdk_drag_motion (context, dest_window, protocol, x_root, y_root,
+ gdk_drag_motion (context, dest_surface, protocol, x_root, y_root,
action, possible_actions, evtime);
}
@@ -2985,7 +2985,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context,
{
GdkWin32DragContext *win32_context = GDK_WIN32_DRAG_CONTEXT (context);
GdkModifierType state;
- GdkWindow *root_window;
+ GdkSurface *root_window;
GdkDevice *pointer;
gint dx, dy;
@@ -3010,7 +3010,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context,
case GDK_KEY_KP_Enter:
case GDK_KEY_KP_Space:
if ((gdk_drag_context_get_selected_action (context) != 0) &&
- (gdk_drag_context_get_dest_window (context) != NULL))
+ (gdk_drag_context_get_dest_surface (context) != NULL))
{
g_signal_emit_by_name (context, "drop-performed",
gdk_event_get_time ((GdkEvent *) event));
@@ -3074,7 +3074,7 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context,
* example, when changing the drag cursor.
*/
if (event->implicit ||
- event->grab_window == win32_context->drag_window ||
+ event->grab_window == win32_context->drag_surface ||
event->grab_window == win32_context->ipc_window)
return FALSE;
@@ -3100,7 +3100,7 @@ gdk_dnd_handle_button_event (GdkDragContext *context,
#endif
if ((gdk_drag_context_get_selected_action (context) != 0) &&
- (gdk_drag_context_get_dest_window (context) != NULL))
+ (gdk_drag_context_get_dest_surface (context) != NULL))
{
g_signal_emit_by_name (context, "drop-performed",
gdk_event_get_time ((GdkEvent *) event));
@@ -3198,10 +3198,10 @@ gdk_win32_drag_context_action_changed (GdkDragContext *context,
gdk_drag_context_set_cursor (context, cursor);
}
-static GdkWindow *
-gdk_win32_drag_context_get_drag_window (GdkDragContext *context)
+static GdkSurface *
+gdk_win32_drag_context_get_drag_surface (GdkDragContext *context)
{
- return GDK_WIN32_DRAG_CONTEXT (context)->drag_window;
+ return GDK_WIN32_DRAG_CONTEXT (context)->drag_surface;
}
static void
@@ -3221,7 +3221,7 @@ gdk_win32_drag_context_set_hotspot (GdkDragContext *context,
if (win32_context->grab_seat)
{
/* DnD is managed, update current position */
- move_drag_window (context, win32_context->last_x, win32_context->last_y);
+ move_drag_surface (context, win32_context->last_x, win32_context->last_y);
}
}
@@ -3242,7 +3242,7 @@ gdk_win32_drag_context_class_init (GdkWin32DragContextClass *klass)
context_class->drop_finish = gdk_win32_drag_context_drop_finish;
context_class->drop_status = gdk_win32_drag_context_drop_status;
- context_class->get_drag_window = gdk_win32_drag_context_get_drag_window;
+ context_class->get_drag_surface = gdk_win32_drag_context_get_drag_surface;
context_class->set_hotspot = gdk_win32_drag_context_set_hotspot;
context_class->drop_done = gdk_win32_drag_context_drop_done;
context_class->set_cursor = gdk_win32_drag_context_set_cursor;
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 83102adc97..326d582ff2 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -125,8 +125,8 @@ static GSourceFuncs event_funcs = {
NULL
};
-static GdkWindow *mouse_window = NULL;
-static GdkWindow *mouse_window_ignored_leave = NULL;
+static GdkSurface *mouse_window = NULL;
+static GdkSurface *mouse_window_ignored_leave = NULL;
static gint current_x, current_y;
static gint current_root_x, current_root_y;
static UINT client_message;
@@ -186,7 +186,7 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
static void
generate_focus_event (GdkDeviceManagerWin32 *device_manager,
- GdkWindow *window,
+ GdkSurface *window,
gboolean in)
{
GdkDevice *device;
@@ -208,9 +208,9 @@ generate_focus_event (GdkDeviceManagerWin32 *device_manager,
static void
generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager,
- GdkWindow *window,
+ GdkSurface *window,
gboolean keyboard,
- GdkWindow *grab_window)
+ GdkSurface *grab_window)
{
GdkEvent *event = gdk_event_new (GDK_GRAB_BROKEN);
GdkDevice *device;
@@ -277,7 +277,7 @@ inner_window_procedure (HWND hwnd,
}
LRESULT CALLBACK
-_gdk_win32_window_procedure (HWND hwnd,
+_gdk_win32_surface_procedure (HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam)
@@ -301,14 +301,14 @@ _gdk_win32_window_procedure (HWND hwnd,
static LRESULT
low_level_keystroke_handler (WPARAM message,
KBDLLHOOKSTRUCT *kbdhook,
- GdkWindow *window)
+ GdkSurface *window)
{
- GdkWindow *toplevel = gdk_window_get_toplevel (window);
+ GdkSurface *toplevel = gdk_surface_get_toplevel (window);
static DWORD last_keydown = 0;
if (message == WM_KEYDOWN &&
- !GDK_WINDOW_DESTROYED (toplevel) &&
- _gdk_win32_window_lacks_wm_decorations (toplevel) && /* For CSD only */
+ !GDK_SURFACE_DESTROYED (toplevel) &&
+ _gdk_win32_surface_lacks_wm_decorations (toplevel) && /* For CSD only */
last_keydown != kbdhook->vkCode &&
((GetKeyState (VK_LWIN) & 0x8000) ||
(GetKeyState (VK_RWIN) & 0x8000)))
@@ -317,7 +317,7 @@ low_level_keystroke_handler (WPARAM message,
gboolean lshiftdown = GetKeyState (VK_LSHIFT) & 0x8000;
gboolean rshiftdown = GetKeyState (VK_RSHIFT) & 0x8000;
gboolean oneshiftdown = (lshiftdown || rshiftdown) && !(lshiftdown && rshiftdown);
- gboolean maximized = gdk_window_get_state (toplevel) & GDK_WINDOW_STATE_MAXIMIZED;
+ gboolean maximized = gdk_surface_get_state (toplevel) & GDK_SURFACE_STATE_MAXIMIZED;
switch (kbdhook->vkCode)
{
@@ -349,7 +349,7 @@ low_level_keystroke_handler (WPARAM message,
combo = GDK_WIN32_AEROSNAP_COMBO_NOTHING;
if (combo != GDK_WIN32_AEROSNAP_COMBO_NOTHING)
- PostMessage (GDK_WINDOW_HWND (toplevel), aerosnap_message, (WPARAM) combo, 0);
+ PostMessage (GDK_SURFACE_HWND (toplevel), aerosnap_message, (WPARAM) combo, 0);
}
if (message == WM_KEYDOWN)
@@ -367,7 +367,7 @@ low_level_keyboard_proc (int code,
{
KBDLLHOOKSTRUCT *kbdhook;
HWND kbd_focus_owner;
- GdkWindow *gdk_kbd_focus_owner;
+ GdkSurface *gdk_kbd_focus_owner;
LRESULT chain;
do
@@ -578,14 +578,14 @@ event_mask_string (GdkEventMask mask)
#endif
-static GdkWindow *
-find_window_for_mouse_event (GdkWindow* reported_window,
+static GdkSurface *
+find_window_for_mouse_event (GdkSurface* reported_window,
MSG* msg)
{
POINT pt;
GdkDisplay *display;
GdkDeviceManagerWin32 *device_manager;
- GdkWindow *event_window;
+ GdkSurface *event_surface;
HWND hwnd;
RECT rect;
GdkDeviceGrabInfo *grab;
@@ -600,10 +600,10 @@ find_window_for_mouse_event (GdkWindow* reported_window,
pt = msg->pt;
if (!grab->owner_events)
- event_window = grab->native_window;
+ event_surface = grab->native_surface;
else
{
- event_window = NULL;
+ event_surface = NULL;
hwnd = WindowFromPoint (pt);
if (hwnd != NULL)
{
@@ -612,19 +612,19 @@ find_window_for_mouse_event (GdkWindow* reported_window,
ScreenToClient (hwnd, &client_pt);
GetClientRect (hwnd, &rect);
if (PtInRect (&rect, client_pt))
- event_window = gdk_win32_handle_table_lookup (hwnd);
+ event_surface = gdk_win32_handle_table_lookup (hwnd);
}
- if (event_window == NULL)
- event_window = grab->native_window;
+ if (event_surface == NULL)
+ event_surface = grab->native_surface;
}
/* need to also adjust the coordinates to the new window */
- ScreenToClient (GDK_WINDOW_HWND (event_window), &pt);
+ ScreenToClient (GDK_SURFACE_HWND (event_surface), &pt);
/* ATTENTION: need to update client coords */
msg->lParam = MAKELPARAM (pt.x, pt.y);
- return event_window;
+ return event_surface;
}
static void
@@ -797,14 +797,14 @@ _gdk_win32_print_event (const GdkEvent *event)
CASE (GDK_DROP_START);
CASE (GDK_DROP_FINISHED);
CASE (GDK_SCROLL);
- CASE (GDK_WINDOW_STATE);
+ CASE (GDK_SURFACE_STATE);
CASE (GDK_GRAB_BROKEN);
#undef CASE
default: g_assert_not_reached ();
}
g_print (" %p @ %ums ",
- event->any.window ? GDK_WINDOW_HWND (event->any.window) : NULL,
+ event->any.surface ? GDK_SURFACE_HWND (event->any.surface) : NULL,
gdk_event_get_time (event));
switch (event->any.type)
@@ -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_WINDOW_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" :
@@ -891,8 +891,8 @@ _gdk_win32_print_event (const GdkEvent *event)
event->dnd.context,
_gdk_win32_drag_protocol_to_string (event->dnd.context->protocol),
event->dnd.context->is_source ? "SOURCE" : "DEST",
- event->dnd.context->source_window == NULL ? NULL : GDK_WINDOW_HWND (event->dnd.context->source_window),
- event->dnd.context->dest_window == NULL ? NULL : GDK_WINDOW_HWND (event->dnd.context->dest_window));
+ event->dnd.context->source_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->source_surface),
+ event->dnd.context->dest_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->dest_surface));
break;
case GDK_SCROLL:
g_print ("(%.4g,%.4g) (%.4g,%.4g) %s ",
@@ -905,15 +905,15 @@ _gdk_win32_print_event (const GdkEvent *event)
"???")))));
print_event_state (event->scroll.state);
break;
- case GDK_WINDOW_STATE:
+ case GDK_SURFACE_STATE:
g_print ("%s: %s",
- _gdk_win32_window_state_to_string (event->window_state.changed_mask),
- _gdk_win32_window_state_to_string (event->window_state.new_window_state));
+ _gdk_win32_surface_state_to_string (event->surface_state.changed_mask),
+ _gdk_win32_surface_state_to_string (event->surface_state.new_surface_state));
case GDK_GRAB_BROKEN:
g_print ("%s %s %p",
(event->grab_broken.keyboard ? "KEYBOARD" : "POINTER"),
(event->grab_broken.implicit ? "IMPLICIT" : "EXPLICIT"),
- (event->grab_broken.grab_window ? GDK_WINDOW_HWND (event->grab_broken.grab_window) : 0));
+ (event->grab_broken.grab_window ? GDK_SURFACE_HWND (event->grab_broken.grab_window) : 0));
default:
/* Nothing */
break;
@@ -945,12 +945,12 @@ decode_key_lparam (LPARAM lParam)
static void
fixup_event (GdkEvent *event)
{
- 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_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)) &&
@@ -1047,7 +1047,7 @@ fill_key_event_string (GdkEvent *event)
}
static GdkFilterReturn
-apply_event_filters (GdkWindow *window,
+apply_event_filters (GdkSurface *window,
MSG *msg,
GList **filters)
{
@@ -1058,7 +1058,7 @@ apply_event_filters (GdkWindow *window,
GList *tmp_list;
event = gdk_event_new (GDK_NOTHING);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (window);
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
display = gdk_display_get_default ();
@@ -1131,11 +1131,11 @@ apply_event_filters (GdkWindow *window,
* from.
*/
static void
-show_window_recurse (GdkWindow *window, gboolean hide_window)
+show_window_recurse (GdkSurface *window, gboolean hide_window)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GSList *children = impl->transient_children;
- GdkWindow *child = NULL;
+ GdkSurface *child = NULL;
if (!impl->changing_state)
{
@@ -1152,13 +1152,13 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
}
}
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
if (!hide_window)
{
- if (gdk_window_get_state (window) & GDK_WINDOW_STATE_ICONIFIED)
+ if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_ICONIFIED)
{
- if (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED)
+ if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED)
{
GtkShowWindow (window, SW_SHOWMAXIMIZED);
}
@@ -1179,10 +1179,10 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
}
static void
-do_show_window (GdkWindow *window, gboolean hide_window)
+do_show_window (GdkSurface *window, gboolean hide_window)
{
- GdkWindow *tmp_window = NULL;
- GdkWindowImplWin32 *tmp_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurface *tmp_window = NULL;
+ GdkSurfaceImplWin32 *tmp_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (!tmp_impl->changing_state)
{
@@ -1190,7 +1190,7 @@ do_show_window (GdkWindow *window, gboolean hide_window)
while (tmp_impl->transient_owner != NULL)
{
tmp_window = tmp_impl->transient_owner;
- tmp_impl = GDK_WINDOW_IMPL_WIN32 (tmp_window->impl);
+ tmp_impl = GDK_SURFACE_IMPL_WIN32 (tmp_window->impl);
}
/* If we couldn't find one, use the window provided. */
@@ -1209,11 +1209,11 @@ do_show_window (GdkWindow *window, gboolean hide_window)
static void
send_crossing_event (GdkDisplay *display,
- GdkWindow *window,
+ GdkSurface *window,
GdkEventType type,
GdkCrossingMode mode,
GdkNotifyType notify_type,
- GdkWindow *subwindow,
+ GdkSurface *subwindow,
POINT *screen_pt,
GdkModifierType mask,
guint32 time_)
@@ -1222,7 +1222,7 @@ send_crossing_event (GdkDisplay *display,
GdkDeviceGrabInfo *grab;
GdkDeviceManagerWin32 *device_manager;
POINT pt;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
device_manager = _gdk_device_manager;
@@ -1233,21 +1233,21 @@ send_crossing_event (GdkDisplay *display,
mode != GDK_CROSSING_UNGRAB)
{
/* !owner_event => only report events wrt grab window, ignore rest */
- if ((GdkWindow *)window != grab->native_window)
+ if ((GdkSurface *)window != grab->native_surface)
return;
}
pt = *screen_pt;
- ScreenToClient (GDK_WINDOW_HWND (window), &pt);
+ ScreenToClient (GDK_SURFACE_HWND (window), &pt);
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->window_scale;
- event->crossing.y = pt.y / impl->window_scale;
- event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->window_scale;
- event->crossing.y_root = (screen_pt->y + _gdk_offset_y) / impl->window_scale;
+ event->crossing.x = pt.x / impl->surface_scale;
+ event->crossing.y = pt.y / impl->surface_scale;
+ event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->surface_scale;
+ event->crossing.y_root = (screen_pt->y + _gdk_offset_y) / impl->surface_scale;
event->crossing.mode = mode;
event->crossing.detail = notify_type;
event->crossing.mode = mode;
@@ -1261,19 +1261,19 @@ send_crossing_event (GdkDisplay *display,
_gdk_win32_append_event (event);
}
-static GdkWindow *
-get_native_parent (GdkWindow *window)
+static GdkSurface *
+get_native_parent (GdkSurface *window)
{
if (window->parent != NULL)
- return window->parent->impl_window;
+ return window->parent->impl_surface;
return NULL;
}
-static GdkWindow *
-find_common_ancestor (GdkWindow *win1,
- GdkWindow *win2)
+static GdkSurface *
+find_common_ancestor (GdkSurface *win1,
+ GdkSurface *win2)
{
- GdkWindow *tmp;
+ GdkSurface *tmp;
GList *path1 = NULL, *path2 = NULL;
GList *list1, *list2;
@@ -1296,7 +1296,7 @@ find_common_ancestor (GdkWindow *win1,
tmp = NULL;
while (list1 && list2 && (list1->data == list2->data))
{
- tmp = (GdkWindow *)list1->data;
+ tmp = (GdkSurface *)list1->data;
list1 = list1->next;
list2 = list2->next;
}
@@ -1308,19 +1308,19 @@ find_common_ancestor (GdkWindow *win1,
void
synthesize_crossing_events (GdkDisplay *display,
- GdkWindow *src,
- GdkWindow *dest,
+ GdkSurface *src,
+ GdkSurface *dest,
GdkCrossingMode mode,
POINT *screen_pt,
GdkModifierType mask,
guint32 time_,
gboolean non_linear)
{
- GdkWindow *c;
- GdkWindow *win, *last, *next;
+ GdkSurface *c;
+ GdkSurface *win, *last, *next;
GList *path, *list;
- GdkWindow *a;
- GdkWindow *b;
+ GdkSurface *a;
+ GdkSurface *b;
GdkNotifyType notify_type;
a = src;
@@ -1364,7 +1364,7 @@ synthesize_crossing_events (GdkDisplay *display,
win, GDK_LEAVE_NOTIFY,
mode,
notify_type,
- (GdkWindow *)last,
+ (GdkSurface *)last,
screen_pt,
mask, time_);
@@ -1395,10 +1395,10 @@ synthesize_crossing_events (GdkDisplay *display,
list = path;
while (list)
{
- win = (GdkWindow *)list->data;
+ win = (GdkSurface *)list->data;
list = list->next;
if (list)
- next = (GdkWindow *)list->data;
+ next = (GdkSurface *)list->data;
else
next = b;
@@ -1436,9 +1436,9 @@ synthesize_crossing_events (GdkDisplay *display,
* because an extended input device is active
*/
static gboolean
-propagate (GdkWindow **window,
+propagate (GdkSurface **window,
MSG *msg,
- GdkWindow *grab_window,
+ GdkSurface *grab_window,
gboolean grab_owner_events,
gint grab_mask,
gboolean (*doesnt_want_it) (gint mask,
@@ -1469,7 +1469,7 @@ propagate (GdkWindow **window,
if ((*doesnt_want_it) ((*window)->event_mask, msg))
{
/* Owner doesn't want it, propagate to parent. */
- GdkWindow *parent = gdk_window_get_parent (*window);
+ GdkSurface *parent = gdk_surface_get_parent (*window);
if (parent == NULL)
{
/* No parent; check if grabbed */
@@ -1531,28 +1531,28 @@ doesnt_want_char (gint mask,
* TRUE otherwise.
*/
gboolean
-_gdk_win32_get_window_rect (GdkWindow *window,
+_gdk_win32_get_window_rect (GdkSurface *window,
RECT *rect)
{
- GdkWindowImplWin32 *window_impl;
+ GdkSurfaceImplWin32 *surface_impl;
RECT client_rect;
POINT point;
HWND hwnd;
- window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- hwnd = GDK_WINDOW_HWND (window);
+ hwnd = GDK_SURFACE_HWND (window);
GetClientRect (hwnd, &client_rect);
point.x = client_rect.left; /* always 0 */
point.y = client_rect.top;
/* top level windows need screen coords */
- if (gdk_window_get_parent (window) == NULL)
+ if (gdk_surface_get_parent (window) == NULL)
{
ClientToScreen (hwnd, &point);
- point.x += _gdk_offset_x * window_impl->window_scale;
- point.y += _gdk_offset_y * window_impl->window_scale;
+ point.x += _gdk_offset_x * surface_impl->surface_scale;
+ point.y += _gdk_offset_y * surface_impl->surface_scale;
}
rect->left = point.x;
@@ -1560,23 +1560,23 @@ _gdk_win32_get_window_rect (GdkWindow *window,
rect->right = point.x + client_rect.right - client_rect.left;
rect->bottom = point.y + client_rect.bottom - client_rect.top;
- return !window_impl->inhibit_configure;
+ return !surface_impl->inhibit_configure;
}
void
-_gdk_win32_do_emit_configure_event (GdkWindow *window,
+_gdk_win32_do_emit_configure_event (GdkSurface *window,
RECT rect)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->unscaled_width = rect.right - rect.left;
impl->unscaled_height = rect.bottom - rect.top;
- window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale;
- window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale;
- window->x = rect.left / impl->window_scale;
- window->y = rect.top / impl->window_scale;
+ window->width = (impl->unscaled_width + impl->surface_scale - 1) / impl->surface_scale;
+ window->height = (impl->unscaled_height + impl->surface_scale - 1) / impl->surface_scale;
+ window->x = rect.left / impl->surface_scale;
+ window->y = rect.top / impl->surface_scale;
- _gdk_window_update_size (window);
+ _gdk_surface_update_size (window);
if (window->event_mask & GDK_STRUCTURE_MASK)
{
@@ -1595,7 +1595,7 @@ _gdk_win32_do_emit_configure_event (GdkWindow *window,
}
void
-_gdk_win32_emit_configure_event (GdkWindow *window)
+_gdk_win32_emit_configure_event (GdkSurface *window)
{
RECT rect;
@@ -1662,13 +1662,13 @@ adjust_drag (LONG *drag,
static void
handle_wm_paint (MSG *msg,
- GdkWindow *window)
+ GdkSurface *window)
{
HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
HDC hdc;
PAINTSTRUCT paintstruct;
cairo_region_t *update_region;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR)
{
@@ -1694,9 +1694,9 @@ handle_wm_paint (MSG *msg,
return;
}
- update_region = _gdk_win32_hrgn_to_region (hrgn, impl->window_scale);
+ update_region = _gdk_win32_hrgn_to_region (hrgn, impl->surface_scale);
if (!cairo_region_is_empty (update_region))
- _gdk_window_invalidate_for_expose (window, update_region);
+ _gdk_surface_invalidate_for_expose (window, update_region);
cairo_region_destroy (update_region);
DeleteObject (hrgn);
@@ -1767,13 +1767,13 @@ sync_timer_proc (HWND hwnd,
static gboolean
handle_nchittest (HWND hwnd,
- GdkWindow *window,
+ GdkSurface *window,
gint16 screen_x,
gint16 screen_y,
gint *ret_valp)
{
RECT rect;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
if (window == NULL || window->input_shape == NULL)
return FALSE;
@@ -1781,20 +1781,20 @@ handle_nchittest (HWND hwnd,
/* If the window has decorations, DefWindowProc() will take
* care of NCHITTEST.
*/
- if (!_gdk_win32_window_lacks_wm_decorations (window))
+ if (!_gdk_win32_surface_lacks_wm_decorations (window))
return FALSE;
if (!GetWindowRect (hwnd, &rect))
return FALSE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
rect.left = screen_x - rect.left;
rect.top = screen_y - rect.top;
/* If it's inside the rect, return FALSE and let DefWindowProc() handle it */
if (cairo_region_contains_point (window->input_shape,
- rect.left / impl->window_scale,
- rect.top / impl->window_scale))
+ rect.left / impl->surface_scale,
+ rect.top / impl->surface_scale))
return FALSE;
/* Otherwise override DefWindowProc() and tell WM that the point is not
@@ -1805,17 +1805,17 @@ handle_nchittest (HWND hwnd,
}
static void
-handle_dpi_changed (GdkWindow *window,
+handle_dpi_changed (GdkSurface *window,
MSG *msg)
{
- HWND hwnd = GDK_WINDOW_HWND (window);
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ HWND hwnd = GDK_SURFACE_HWND (window);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GdkDisplay *display = gdk_display_get_default ();
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
GdkDevice *device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
RECT *rect = (RECT *)msg->lParam;
GdkEvent *event;
- guint old_scale = impl->window_scale;
+ guint old_scale = impl->surface_scale;
/* MSDN for WM_DPICHANGED: dpi_x == dpi_y here, so LOWORD (msg->wParam) == HIWORD (msg->wParam) */
guint dpi = LOWORD (msg->wParam);
@@ -1824,52 +1824,52 @@ handle_dpi_changed (GdkWindow *window,
if (win32_display->has_fixed_scale)
return;
- impl->window_scale = dpi / USER_DEFAULT_SCREEN_DPI;
+ impl->surface_scale = dpi / USER_DEFAULT_SCREEN_DPI;
/* Don't bother if scales did not change in the end */
- if (old_scale == impl->window_scale)
+ if (old_scale == impl->surface_scale)
return;
if (!IsIconic (msg->hwnd) &&
- !GDK_WINDOW_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (window))
{
GdkMonitor *monitor;
- monitor = gdk_display_get_monitor_at_window (display, window);
- gdk_monitor_set_scale_factor (monitor, impl->window_scale);
+ monitor = gdk_display_get_monitor_at_surface (display, window);
+ gdk_monitor_set_scale_factor (monitor, impl->surface_scale);
if (impl->layered)
{
/* We only need to set the cairo surface device scale here ourselves for layered windows */
if (impl->cache_surface != NULL)
cairo_surface_set_device_scale (impl->cache_surface,
- impl->window_scale,
- impl->window_scale);
+ impl->surface_scale,
+ impl->surface_scale);
if (impl->cairo_surface != NULL)
cairo_surface_set_device_scale (impl->cairo_surface,
- impl->window_scale,
- impl->window_scale);
+ impl->surface_scale,
+ impl->surface_scale);
}
}
_gdk_win32_adjust_client_rect (window, rect);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
- gdk_window_move_resize (window, window->x, window->y, window->width, window->height);
+ gdk_surface_move_resize (window, window->x, window->y, window->width, window->height);
else
- gdk_window_resize (window, window->width, window->height);
+ gdk_surface_resize (window, window->width, window->height);
}
static void
generate_button_event (GdkEventType type,
gint button,
- GdkWindow *window,
+ GdkSurface *window,
MSG *msg)
{
GdkEvent *event = gdk_event_new (type);
GdkDeviceManagerWin32 *device_manager;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (_gdk_input_ignore_core > 0)
return;
@@ -1878,10 +1878,10 @@ generate_button_event (GdkEventType type,
event->button.window = window;
event->button.time = _gdk_win32_get_next_tick (msg->time);
- event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale;
- event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->window_scale;
- event->button.x_root = (msg->pt.x + _gdk_offset_x) / impl->window_scale;
- event->button.y_root = (msg->pt.y + _gdk_offset_y) / impl->window_scale;
+ event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
+ event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
+ event->button.x_root = (msg->pt.x + _gdk_offset_x) / impl->surface_scale;
+ event->button.y_root = (msg->pt.y + _gdk_offset_y) / impl->surface_scale;
event->button.axes = NULL;
event->button.state = build_pointer_event_state (msg);
event->button.button = button;
@@ -1899,15 +1899,15 @@ generate_button_event (GdkEventType type,
* or not ontop.
*/
static gboolean
-should_window_be_always_on_top (GdkWindow *window)
+should_window_be_always_on_top (GdkSurface *window)
{
DWORD exstyle;
- if ((GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) ||
- (window->state & GDK_WINDOW_STATE_ABOVE))
+ if ((GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) ||
+ (window->state & GDK_SURFACE_STATE_ABOVE))
return TRUE;
- exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
+ exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
if (exstyle & WS_EX_TOPMOST)
return TRUE;
@@ -1920,7 +1920,7 @@ ensure_stacking_on_unminimize (MSG *msg)
{
HWND rover;
HWND lowest_transient = NULL;
- GdkWindow *msg_window;
+ GdkSurface *msg_window;
gboolean window_ontop = FALSE;
msg_window = gdk_win32_handle_table_lookup (msg->hwnd);
@@ -1932,8 +1932,8 @@ ensure_stacking_on_unminimize (MSG *msg)
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
- GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
- GdkWindowImplWin32 *rover_impl;
+ GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover);
+ GdkSurfaceImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
@@ -1941,11 +1941,11 @@ ensure_stacking_on_unminimize (MSG *msg)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
- rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
+ rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl);
- if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
- (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
- rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+ if (GDK_SURFACE_IS_MAPPED (rover_gdkw) &&
+ (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY ||
+ rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
@@ -1965,17 +1965,17 @@ ensure_stacking_on_unminimize (MSG *msg)
static gboolean
ensure_stacking_on_window_pos_changing (MSG *msg,
- GdkWindow *window)
+ GdkSurface *window)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
WINDOWPOS *windowpos = (WINDOWPOS *) msg->lParam;
HWND rover;
gboolean restacking;
gboolean window_ontop;
if (GetActiveWindow () != msg->hwnd ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
return FALSE;
@@ -1993,8 +1993,8 @@ ensure_stacking_on_window_pos_changing (MSG *msg,
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
- GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
- GdkWindowImplWin32 *rover_impl;
+ GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover);
+ GdkSurfaceImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
@@ -2003,11 +2003,11 @@ ensure_stacking_on_window_pos_changing (MSG *msg,
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
- rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
+ rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl);
- if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
- (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
- rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+ if (GDK_SURFACE_IS_MAPPED (rover_gdkw) &&
+ (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY ||
+ rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
@@ -2029,14 +2029,14 @@ ensure_stacking_on_window_pos_changing (MSG *msg,
static void
ensure_stacking_on_activate_app (MSG *msg,
- GdkWindow *window)
+ GdkSurface *window)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
HWND rover;
gboolean window_ontop;
- if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+ if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
{
SetWindowPos (msg->hwnd, HWND_TOP, 0, 0, 0, 0,
@@ -2061,8 +2061,8 @@ ensure_stacking_on_activate_app (MSG *msg,
rover;
rover = GetNextWindow (rover, GW_HWNDPREV))
{
- GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
- GdkWindowImplWin32 *rover_impl;
+ GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover);
+ GdkSurfaceImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
@@ -2070,11 +2070,11 @@ ensure_stacking_on_activate_app (MSG *msg,
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
- rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
+ rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl);
- if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
- (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
- rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
+ if (GDK_SURFACE_IS_MAPPED (rover_gdkw) &&
+ (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY ||
+ rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
@@ -2089,14 +2089,14 @@ ensure_stacking_on_activate_app (MSG *msg,
}
static gboolean
-handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
+handle_wm_sysmenu (GdkSurface *window, MSG *msg, gint *ret_valp)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
LONG_PTR style, tmp_style;
gboolean maximized, minimized;
LONG_PTR additional_styles;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
style = GetWindowLongPtr (msg->hwnd, GWL_STYLE);
@@ -2136,7 +2136,7 @@ handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
* changing hints or properties.
*
* If doing this for non-CSD windows is not desired,
- * do a _gdk_win32_window_lacks_wm_decorations() check and return FALSE
+ * do a _gdk_win32_surface_lacks_wm_decorations() check and return FALSE
* if it doesn't pass.
*
* If doing this for CSD windows with disabled decorations is not desired,
@@ -2166,22 +2166,22 @@ handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
}
gboolean
-_gdk_win32_window_fill_min_max_info (GdkWindow *window,
+_gdk_win32_surface_fill_min_max_info (GdkSurface *window,
MINMAXINFO *mmi)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
RECT rect;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return FALSE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->hint_flags & GDK_HINT_MIN_SIZE)
{
rect.left = rect.top = 0;
- rect.right = impl->hints.min_width * impl->window_scale;
- rect.bottom = impl->hints.min_height * impl->window_scale;
+ rect.right = impl->hints.min_width * impl->surface_scale;
+ rect.bottom = impl->hints.min_height * impl->surface_scale;
_gdk_win32_adjust_client_rect (window, &rect);
@@ -2194,8 +2194,8 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window,
int maxw, maxh;
rect.left = rect.top = 0;
- rect.right = impl->hints.max_width * impl->window_scale;
- rect.bottom = impl->hints.max_height * impl->window_scale;
+ rect.right = impl->hints.max_width * impl->surface_scale;
+ rect.bottom = impl->hints.max_height * impl->surface_scale;
_gdk_win32_adjust_client_rect (window, &rect);
@@ -2229,7 +2229,7 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window,
HMONITOR nearest_monitor;
MONITORINFO nearest_info;
- nearest_monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ nearest_monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST);
nearest_info.cbSize = sizeof (nearest_info);
if (GetMonitorInfoA (nearest_monitor, &nearest_info))
@@ -2254,7 +2254,7 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window,
mmi->ptMaxPosition.x = 0;
mmi->ptMaxPosition.y = 0;
- if (_gdk_win32_window_lacks_wm_decorations (window))
+ if (_gdk_win32_surface_lacks_wm_decorations (window))
{
mmi->ptMaxPosition.x += (nearest_info.rcWork.left - nearest_info.rcMonitor.left);
mmi->ptMaxPosition.y += (nearest_info.rcWork.top - nearest_info.rcMonitor.top);
@@ -2264,8 +2264,8 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window,
mmi->ptMaxSize.y = nearest_info.rcWork.bottom - nearest_info.rcWork.top;
}
- mmi->ptMaxTrackSize.x = GetSystemMetrics (SM_CXVIRTUALSCREEN) + impl->margins_x * impl->window_scale;
- mmi->ptMaxTrackSize.y = GetSystemMetrics (SM_CYVIRTUALSCREEN) + impl->margins_y * impl->window_scale;
+ mmi->ptMaxTrackSize.x = GetSystemMetrics (SM_CXVIRTUALSCREEN) + impl->margins_x * impl->surface_scale;
+ mmi->ptMaxTrackSize.y = GetSystemMetrics (SM_CYVIRTUALSCREEN) + impl->margins_y * impl->surface_scale;
}
return TRUE;
@@ -2297,17 +2297,17 @@ gdk_event_translate (MSG *msg,
gint ccount;
GdkDisplay *display;
- GdkWindow *window = NULL;
- GdkWindowImplWin32 *impl;
+ GdkSurface *window = NULL;
+ GdkSurfaceImplWin32 *impl;
GdkWin32Display *win32_display;
- GdkWindow *new_window;
+ GdkSurface *new_window;
GdkDeviceManagerWin32 *device_manager_win32;
GdkDeviceGrabInfo *keyboard_grab = NULL;
GdkDeviceGrabInfo *pointer_grab = NULL;
- GdkWindow *grab_window = NULL;
+ GdkSurface *grab_window = NULL;
gint button;
GdkAtom target;
@@ -2348,12 +2348,12 @@ gdk_event_translate (MSG *msg,
}
else if (msg->message == WM_CREATE)
{
- window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCTW) msg->lParam)->lpCreateParams);
- GDK_WINDOW_HWND (window) = msg->hwnd;
+ window = (UNALIGNED GdkSurface*) (((LPCREATESTRUCTW) msg->lParam)->lpCreateParams);
+ GDK_SURFACE_HWND (window) = msg->hwnd;
}
else
{
- GDK_NOTE (EVENTS, g_print (" (no GdkWindow)"));
+ GDK_NOTE (EVENTS, g_print (" (no GdkSurface)"));
}
return FALSE;
}
@@ -2374,7 +2374,7 @@ gdk_event_translate (MSG *msg,
*/
#define return GOTO_DONE_INSTEAD
- if (!GDK_WINDOW_DESTROYED (window) && window->filters)
+ if (!GDK_SURFACE_DESTROYED (window) && window->filters)
{
/* Apply per-window filters */
@@ -2424,7 +2424,7 @@ gdk_event_translate (MSG *msg,
}
if (msg->message == aerosnap_message)
- _gdk_win32_window_handle_aerosnap (gdk_window_get_toplevel (window),
+ _gdk_win32_surface_handle_aerosnap (gdk_surface_get_toplevel (window),
(GdkWin32AeroSnapCombo) msg->wParam);
switch (msg->message)
@@ -2501,10 +2501,10 @@ gdk_event_translate (MSG *msg,
doesnt_want_key))
break;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
API_CALL (GetKeyboardState, (key_state));
@@ -2703,7 +2703,7 @@ gdk_event_translate (MSG *msg,
doesnt_want_char))
break;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
himc = ImmGetContext (msg->hwnd);
@@ -2771,12 +2771,12 @@ gdk_event_translate (MSG *msg,
g_set_object (&window, find_window_for_mouse_event (window, msg));
/* TODO_CSW?: there used to some synthesize and propagate */
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
if (pointer_grab == NULL)
{
- SetCapture (GDK_WINDOW_HWND (window));
+ SetCapture (GDK_SURFACE_HWND (window));
}
generate_button_event (GDK_BUTTON_PRESS, button,
@@ -2817,7 +2817,7 @@ gdk_event_translate (MSG *msg,
/* We keep the implicit grab until no buttons at all are held down */
if ((state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (button - 1))) == 0)
{
- GdkWindow *native_window = pointer_grab->native_window;
+ GdkSurface *native_surface = pointer_grab->native_surface;
ReleaseCapture ();
@@ -2834,7 +2834,7 @@ gdk_event_translate (MSG *msg,
}
synthesize_crossing_events (display,
- native_window, new_window,
+ native_surface, new_window,
GDK_CROSSING_UNGRAB,
&msg->pt,
0, /* TODO: Set right mask */
@@ -2848,12 +2848,12 @@ gdk_event_translate (MSG *msg,
generate_button_event (GDK_BUTTON_RELEASE, button,
window, msg);
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* End a drag op when the same button that started it is released */
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE &&
impl->drag_move_resize_context.button == button)
- gdk_win32_window_end_move_resize_drag (window);
+ gdk_win32_surface_end_move_resize_drag (window);
return_val = TRUE;
break;
@@ -2885,15 +2885,15 @@ gdk_event_translate (MSG *msg,
if (!pointer_grab->owner_events &&
new_window != NULL &&
- new_window != pointer_grab->native_window)
+ new_window != pointer_grab->native_surface)
new_window = NULL;
}
if (mouse_window != new_window)
{
GDK_NOTE (EVENTS, g_print (" mouse_sinwod %p -> %p",
- mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
- new_window ? GDK_WINDOW_HWND (new_window) : NULL));
+ mouse_window ? GDK_SURFACE_HWND (mouse_window) : NULL,
+ new_window ? GDK_SURFACE_HWND (new_window) : NULL));
synthesize_crossing_events (display,
mouse_window, new_window,
GDK_CROSSING_NORMAL,
@@ -2904,7 +2904,7 @@ gdk_event_translate (MSG *msg,
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = NULL;
if (new_window != NULL)
- track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (new_window));
+ track_mouse_event (TME_LEAVE, GDK_SURFACE_HWND (new_window));
}
else if (new_window != NULL &&
new_window == mouse_window_ignored_leave)
@@ -2913,35 +2913,35 @@ gdk_event_translate (MSG *msg,
input again we need to re-arm the mouse tracking, as that was
cancelled by the mouseleave. */
mouse_window_ignored_leave = NULL;
- track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (new_window));
+ track_mouse_event (TME_LEAVE, GDK_SURFACE_HWND (new_window));
}
g_set_object (&window, find_window_for_mouse_event (window, msg));
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* If we haven't moved, don't create any GDK event. Windows
* sends WM_MOUSEMOVE messages after a new window is shows under
* the mouse, even if the mouse hasn't moved. This disturbs gtk.
*/
- if ((msg->pt.x + _gdk_offset_x) / impl->window_scale == current_root_x &&
- (msg->pt.y + _gdk_offset_y) / impl->window_scale == current_root_y)
+ if ((msg->pt.x + _gdk_offset_x) / impl->surface_scale == current_root_x &&
+ (msg->pt.y + _gdk_offset_y) / impl->surface_scale == current_root_y)
break;
- current_root_x = (msg->pt.x + _gdk_offset_x) / impl->window_scale;
- current_root_y = (msg->pt.y + _gdk_offset_y) / impl->window_scale;
+ current_root_x = (msg->pt.x + _gdk_offset_x) / impl->surface_scale;
+ current_root_y = (msg->pt.y + _gdk_offset_y) / impl->surface_scale;
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
- gdk_win32_window_do_move_resize_drag (window, current_root_x, current_root_y);
+ gdk_win32_surface_do_move_resize_drag (window, current_root_x, current_root_y);
}
else if (_gdk_input_ignore_core == 0)
{
event = gdk_event_new (GDK_MOTION_NOTIFY);
event->motion.window = window;
event->motion.time = _gdk_win32_get_next_tick (msg->time);
- event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale;
- event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->window_scale;
+ event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
+ event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
event->motion.x_root = current_root_x;
event->motion.y_root = current_root_y;
event->motion.axes = NULL;
@@ -3052,7 +3052,7 @@ gdk_event_translate (MSG *msg,
g_set_object (&window, new_window);
}
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
ScreenToClient (msg->hwnd, &point);
event = gdk_event_new (GDK_SCROLL);
@@ -3065,10 +3065,10 @@ gdk_event_translate (MSG *msg,
event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
GDK_SCROLL_RIGHT : GDK_SCROLL_LEFT;
event->scroll.time = _gdk_win32_get_next_tick (msg->time);
- event->scroll.x = (gint16) point.x / impl->window_scale;
- event->scroll.y = (gint16) point.y / impl->window_scale;
- event->scroll.x_root = ((gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x) / impl->window_scale;
- event->scroll.y_root = ((gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y) / impl->window_scale;
+ event->scroll.x = (gint16) point.x / impl->surface_scale;
+ event->scroll.y = (gint16) point.y / impl->surface_scale;
+ event->scroll.x_root = ((gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x) / impl->surface_scale;
+ event->scroll.y_root = ((gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y) / impl->surface_scale;
event->scroll.state = build_pointer_event_state (msg);
gdk_event_set_device (event, device_manager_win32->core_pointer);
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
@@ -3119,14 +3119,14 @@ gdk_event_translate (MSG *msg,
case WM_MOUSEACTIVATE:
{
- if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
+ if (gdk_surface_get_surface_type (window) == GDK_SURFACE_TEMP
|| !window->accept_focus)
{
*ret_valp = MA_NOACTIVATE;
return_val = TRUE;
}
- if (_gdk_modal_blocked (gdk_window_get_toplevel (window)))
+ if (_gdk_modal_blocked (gdk_surface_get_toplevel (window)))
{
*ret_valp = MA_NOACTIVATEANDEAT;
return_val = TRUE;
@@ -3137,7 +3137,7 @@ gdk_event_translate (MSG *msg,
case WM_KILLFOCUS:
if (keyboard_grab != NULL &&
- !GDK_WINDOW_DESTROYED (keyboard_grab->window) &&
+ !GDK_SURFACE_DESTROYED (keyboard_grab->window) &&
(_modal_operation_in_progress & GDK_WIN32_MODAL_OP_DND) == 0)
{
generate_grab_broken_event (_gdk_device_manager, keyboard_grab->window, TRUE, NULL);
@@ -3152,7 +3152,7 @@ gdk_event_translate (MSG *msg,
if (!(window->event_mask & GDK_FOCUS_CHANGE_MASK))
break;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
generate_focus_event (_gdk_device_manager, window, (msg->message == WM_SETFOCUS));
@@ -3162,7 +3162,7 @@ gdk_event_translate (MSG *msg,
case WM_ERASEBKGND:
GDK_NOTE (EVENTS, g_print (" %p", (HANDLE) msg->wParam));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
return_val = TRUE;
@@ -3170,7 +3170,7 @@ gdk_event_translate (MSG *msg,
break;
case WM_SYNCPAINT:
- sync_timer = SetTimer (GDK_WINDOW_HWND (window),
+ sync_timer = SetTimer (GDK_SURFACE_HWND (window),
1,
200, sync_timer_proc);
break;
@@ -3191,7 +3191,7 @@ gdk_event_translate (MSG *msg,
if (grab_window != NULL)
{
- win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (grab_window));
+ win32_display = GDK_WIN32_DISPLAY (gdk_surface_get_display (grab_window));
if (win32_display->grab_cursor != NULL)
cursor = win32_display->grab_cursor;
@@ -3213,19 +3213,19 @@ gdk_event_translate (MSG *msg,
break;
case WM_INITMENU:
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->have_temp_styles)
{
LONG_PTR window_style;
- window_style = GetWindowLongPtr (GDK_WINDOW_HWND (window),
+ window_style = GetWindowLongPtr (GDK_SURFACE_HWND (window),
GWL_STYLE);
/* Handling WM_SYSMENU added extra styles to this window,
* remove them now.
*/
window_style &= ~impl->temp_styles;
- SetWindowLongPtr (GDK_WINDOW_HWND (window),
+ SetWindowLongPtr (GDK_SURFACE_HWND (window),
GWL_STYLE,
window_style);
}
@@ -3240,7 +3240,7 @@ gdk_event_translate (MSG *msg,
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
break;
case SC_MAXIMIZE:
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->maximizing = TRUE;
break;
}
@@ -3298,16 +3298,16 @@ gdk_event_translate (MSG *msg,
_gdk_win32_end_modal_call (GDK_WIN32_MODAL_OP_SIZEMOVE_MASK);
}
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
- gdk_win32_window_end_move_resize_drag (window);
+ gdk_win32_surface_end_move_resize_drag (window);
break;
case WM_WINDOWPOSCHANGING:
GDK_NOTE (EVENTS, (windowpos = (WINDOWPOS *) msg->lParam,
g_print (" %s %s %dx%d@%+d%+d now below %p",
- _gdk_win32_window_pos_bits_to_string (windowpos->flags),
+ _gdk_win32_surface_pos_bits_to_string (windowpos->flags),
(windowpos->hwndInsertAfter == HWND_BOTTOM ? "BOTTOM" :
(windowpos->hwndInsertAfter == HWND_NOTOPMOST ? "NOTOPMOST" :
(windowpos->hwndInsertAfter == HWND_TOP ? "TOP" :
@@ -3317,17 +3317,17 @@ gdk_event_translate (MSG *msg,
windowpos->cx, windowpos->cy, windowpos->x, windowpos->y,
GetNextWindow (msg->hwnd, GW_HWNDPREV))));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
return_val = ensure_stacking_on_window_pos_changing (msg, window);
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->maximizing)
{
MINMAXINFO our_mmi;
- if (_gdk_win32_window_fill_min_max_info (window, &our_mmi))
+ if (_gdk_win32_surface_fill_min_max_info (window, &our_mmi))
{
windowpos = (WINDOWPOS *) msg->lParam;
windowpos->cx = our_mmi.ptMaxSize.x;
@@ -3343,7 +3343,7 @@ gdk_event_translate (MSG *msg,
case WM_WINDOWPOSCHANGED:
windowpos = (WINDOWPOS *) msg->lParam;
GDK_NOTE (EVENTS, g_print (" %s %s %dx%d@%+d%+d",
- _gdk_win32_window_pos_bits_to_string (windowpos->flags),
+ _gdk_win32_surface_pos_bits_to_string (windowpos->flags),
(windowpos->hwndInsertAfter == HWND_BOTTOM ? "BOTTOM" :
(windowpos->hwndInsertAfter == HWND_NOTOPMOST ? "NOTOPMOST" :
(windowpos->hwndInsertAfter == HWND_TOP ? "TOP" :
@@ -3365,17 +3365,17 @@ gdk_event_translate (MSG *msg,
/* Send MAP events */
if ((windowpos->flags & SWP_SHOWWINDOW) &&
- !GDK_WINDOW_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (window))
{
event = gdk_event_new (GDK_MAP);
- event->any.window = window;
+ event->any.surface = window;
_gdk_win32_append_event (event);
}
/* Update window state */
if (windowpos->flags & (SWP_STATECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW))
{
- GdkWindowState set_bits, unset_bits, old_state, new_state;
+ GdkSurfaceState set_bits, unset_bits, old_state, new_state;
old_state = window->state;
@@ -3383,21 +3383,21 @@ gdk_event_translate (MSG *msg,
unset_bits = 0;
if (IsWindowVisible (msg->hwnd))
- unset_bits |= GDK_WINDOW_STATE_WITHDRAWN;
+ unset_bits |= GDK_SURFACE_STATE_WITHDRAWN;
else
- set_bits |= GDK_WINDOW_STATE_WITHDRAWN;
+ set_bits |= GDK_SURFACE_STATE_WITHDRAWN;
if (IsIconic (msg->hwnd))
- set_bits |= GDK_WINDOW_STATE_ICONIFIED;
+ set_bits |= GDK_SURFACE_STATE_ICONIFIED;
else
- unset_bits |= GDK_WINDOW_STATE_ICONIFIED;
+ unset_bits |= GDK_SURFACE_STATE_ICONIFIED;
if (IsZoomed (msg->hwnd))
- set_bits |= GDK_WINDOW_STATE_MAXIMIZED;
+ set_bits |= GDK_SURFACE_STATE_MAXIMIZED;
else
- unset_bits |= GDK_WINDOW_STATE_MAXIMIZED;
+ unset_bits |= GDK_SURFACE_STATE_MAXIMIZED;
- gdk_synthesize_window_state (window, unset_bits, set_bits);
+ gdk_synthesize_surface_state (window, unset_bits, set_bits);
new_state = window->state;
@@ -3405,15 +3405,15 @@ gdk_event_translate (MSG *msg,
* change the iconified state in all transient related windows,
* as windows doesn't give icons for transient childrens.
*/
- if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
- (new_state & GDK_WINDOW_STATE_ICONIFIED))
- do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED));
+ if ((old_state & GDK_SURFACE_STATE_ICONIFIED) !=
+ (new_state & GDK_SURFACE_STATE_ICONIFIED))
+ do_show_window (window, (new_state & GDK_SURFACE_STATE_ICONIFIED));
/* When un-minimizing, make sure we're stacked under any
transient-type windows. */
- if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) &&
- (new_state & GDK_WINDOW_STATE_ICONIFIED))
+ if (!(old_state & GDK_SURFACE_STATE_ICONIFIED) &&
+ (new_state & GDK_SURFACE_STATE_ICONIFIED))
ensure_stacking_on_unminimize (msg);
}
@@ -3423,24 +3423,24 @@ gdk_event_translate (MSG *msg,
(windowpos->flags & SWP_SHOWWINDOW))
{
if (!IsIconic (msg->hwnd) &&
- !GDK_WINDOW_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (window))
_gdk_win32_emit_configure_event (window);
}
if ((windowpos->flags & SWP_HIDEWINDOW) &&
- !GDK_WINDOW_DESTROYED (window))
+ !GDK_SURFACE_DESTROYED (window))
{
/* Send UNMAP events */
event = gdk_event_new (GDK_UNMAP);
- event->any.window = window;
+ event->any.surface = window;
_gdk_win32_append_event (event);
/* Make transient parent the forground window when window unmaps */
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->transient_owner &&
- GetForegroundWindow () == GDK_WINDOW_HWND (window))
- SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner));
+ GetForegroundWindow () == GDK_SURFACE_HWND (window))
+ SetForegroundWindow (GDK_SURFACE_HWND (impl->transient_owner));
}
if (!(windowpos->flags & SWP_NOCLIENTSIZE))
@@ -3459,7 +3459,7 @@ gdk_event_translate (MSG *msg,
break;
case WM_SIZING:
- GetWindowRect (GDK_WINDOW_HWND (window), &rect);
+ GetWindowRect (GDK_SURFACE_HWND (window), &rect);
drag = (RECT *) msg->lParam;
GDK_NOTE (EVENTS, g_print (" %s curr:%s drag:%s",
(msg->wParam == WMSZ_BOTTOM ? "BOTTOM" :
@@ -3475,7 +3475,7 @@ gdk_event_translate (MSG *msg,
_gdk_win32_rect_to_string (&rect),
_gdk_win32_rect_to_string (drag)));
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
orig_drag = *drag;
if (impl->hint_flags & GDK_HINT_RESIZE_INC)
{
@@ -3484,17 +3484,17 @@ gdk_event_translate (MSG *msg,
{
/* Resize in increments relative to the base size */
rect.left = rect.top = 0;
- rect.right = impl->hints.base_width * impl->window_scale;
- rect.bottom = impl->hints.base_height * impl->window_scale;
+ rect.right = impl->hints.base_width * impl->surface_scale;
+ rect.bottom = impl->hints.base_height * impl->surface_scale;
_gdk_win32_adjust_client_rect (window, &rect);
point.x = rect.left;
point.y = rect.top;
- ClientToScreen (GDK_WINDOW_HWND (window), &point);
+ ClientToScreen (GDK_SURFACE_HWND (window), &point);
rect.left = point.x;
rect.top = point.y;
point.x = rect.right;
point.y = rect.bottom;
- ClientToScreen (GDK_WINDOW_HWND (window), &point);
+ ClientToScreen (GDK_SURFACE_HWND (window), &point);
rect.right = point.x;
rect.bottom = point.y;
@@ -3507,53 +3507,53 @@ gdk_event_translate (MSG *msg,
case WMSZ_BOTTOM:
if (drag->bottom == rect.bottom)
break;
- adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale);
+ adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale);
break;
case WMSZ_BOTTOMLEFT:
if (drag->bottom == rect.bottom && drag->left == rect.left)
break;
- adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale);
- adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale);
+ adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale);
break;
case WMSZ_LEFT:
if (drag->left == rect.left)
break;
- adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale);
break;
case WMSZ_TOPLEFT:
if (drag->top == rect.top && drag->left == rect.left)
break;
- adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale);
- adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale);
+ adjust_drag (&drag->left, rect.left, impl->hints.width_inc * impl->surface_scale);
break;
case WMSZ_TOP:
if (drag->top == rect.top)
break;
- adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale);
+ adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale);
break;
case WMSZ_TOPRIGHT:
if (drag->top == rect.top && drag->right == rect.right)
break;
- adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->window_scale);
- adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->top, rect.top, impl->hints.height_inc * impl->surface_scale);
+ adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale);
break;
case WMSZ_RIGHT:
if (drag->right == rect.right)
break;
- adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale);
break;
case WMSZ_BOTTOMRIGHT:
if (drag->bottom == rect.bottom && drag->right == rect.right)
break;
- adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->window_scale);
- adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->window_scale);
+ adjust_drag (&drag->bottom, rect.bottom, impl->hints.height_inc * impl->surface_scale);
+ adjust_drag (&drag->right, rect.right, impl->hints.width_inc * impl->surface_scale);
break;
}
@@ -3577,7 +3577,7 @@ gdk_event_translate (MSG *msg,
gdouble drag_aspect;
int drag_width, drag_height, new_width, new_height;
- GetClientRect (GDK_WINDOW_HWND (window), &rect);
+ GetClientRect (GDK_SURFACE_HWND (window), &rect);
decorated_rect = rect;
_gdk_win32_adjust_client_rect (window, &decorated_rect);
@@ -3684,7 +3684,7 @@ gdk_event_translate (MSG *msg,
mmi->ptMaxPosition.x, mmi->ptMaxPosition.y,
mmi->ptMaxSize.x, mmi->ptMaxSize.y));
- if (_gdk_win32_window_fill_min_max_info (window, mmi))
+ if (_gdk_win32_surface_fill_min_max_info (window, mmi))
{
/* Don't call DefWindowProcW() */
GDK_NOTE (EVENTS,
@@ -3701,19 +3701,19 @@ gdk_event_translate (MSG *msg,
break;
case WM_CLOSE:
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
break;
event = gdk_event_new (GDK_DELETE);
- event->any.window = window;
+ event->any.surface = window;
_gdk_win32_append_event (event);
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- if (impl->transient_owner && GetForegroundWindow() == GDK_WINDOW_HWND (window))
+ if (impl->transient_owner && GetForegroundWindow() == GDK_SURFACE_HWND (window))
{
- SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner));
+ SetForegroundWindow (GDK_SURFACE_HWND (impl->transient_owner));
}
return_val = TRUE;
@@ -3734,13 +3734,13 @@ gdk_event_translate (MSG *msg,
}
if ((window != NULL) && (msg->hwnd != GetDesktopWindow ()))
- gdk_window_destroy_notify (window);
+ gdk_surface_destroy_notify (window);
- if (window == NULL || GDK_WINDOW_DESTROYED (window))
+ if (window == NULL || GDK_SURFACE_DESTROYED (window))
break;
event = gdk_event_new (GDK_DESTROY);
- event->any.window = window;
+ event->any.surface = window;
_gdk_win32_append_event (event);
@@ -3749,7 +3749,7 @@ gdk_event_translate (MSG *msg,
case WM_DWMCOMPOSITIONCHANGED:
gdk_win32_display_check_composited (GDK_WIN32_DISPLAY (display));
- _gdk_win32_window_enable_transparency (window);
+ _gdk_win32_surface_enable_transparency (window);
break;
case WM_DESTROYCLIPBOARD:
@@ -3877,17 +3877,17 @@ gdk_event_translate (MSG *msg,
*/
if (_gdk_modal_blocked (window) && LOWORD (msg->wParam) == WA_ACTIVE)
{
- GdkWindow *modal_current = _gdk_modal_current ();
- SetActiveWindow (GDK_WINDOW_HWND (modal_current));
+ GdkSurface *modal_current = _gdk_modal_current ();
+ SetActiveWindow (GDK_SURFACE_HWND (modal_current));
*ret_valp = 0;
return_val = TRUE;
break;
}
if (LOWORD (msg->wParam) == WA_INACTIVE)
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0);
else
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED);
/* Bring any tablet contexts to the top of the overlap order when
* one of our windows is activated.
@@ -3902,7 +3902,7 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
msg->wParam ? "YES" : "NO",
(gint64) msg->lParam));
- if (msg->wParam && GDK_WINDOW_IS_MAPPED (window))
+ if (msg->wParam && GDK_SURFACE_IS_MAPPED (window))
ensure_stacking_on_activate_app (msg, window);
break;
case WM_NCHITTEST:
@@ -3935,7 +3935,7 @@ gdk_event_translate (MSG *msg,
wintab:
event = gdk_event_new (GDK_NOTHING);
- event->any.window = window;
+ event->any.surface = window;
g_object_ref (window);
if (gdk_input_other_event (display, event, msg, window))
diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c
index d748523bac..d3119d4b49 100644
--- a/gdk/win32/gdkgeometry-win32.c
+++ b/gdk/win32/gdkgeometry-win32.c
@@ -25,8 +25,8 @@
* Bits are always scrolled correctly by ScrollWindowEx(), but
* some big children may hit the coordinate boundary (i.e.
* win32_x/win32_y < -16383) after scrolling. They needed to be moved
- * back to the real position determined by gdk_window_compute_position().
- * This is handled in gdk_window_postmove().
+ * back to the real position determined by gdk_surface_compute_position().
+ * This is handled in gdk_surface_postmove().
*
* The X11 version by Owen Taylor <otaylor@redhat.com>
* Copyright Red Hat, Inc. 2000
@@ -44,95 +44,95 @@
#define SIZE_LIMIT 32767
-typedef struct _GdkWindowParentPos GdkWindowParentPos;
+typedef struct _GdkSurfaceParentPos GdkSurfaceParentPos;
static void
-tmp_unset_bg (GdkWindow *window)
+tmp_unset_bg (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->no_bg = TRUE;
}
static void
-tmp_reset_bg (GdkWindow *window)
+tmp_reset_bg (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->no_bg = FALSE;
}
void
-_gdk_window_move_resize_child (GdkWindow *window,
+_gdk_surface_move_resize_child (GdkSurface *window,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
g_return_if_fail (window != NULL);
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
- _gdk_win32_window_description (window),
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ GDK_NOTE (MISC, g_print ("_gdk_surface_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
+ _gdk_win32_surface_description (window),
window->x, window->y, width, height, x, y));
- if (width * impl->window_scale > 65535 || height * impl->window_scale > 65535)
+ if (width * impl->surface_scale > 65535 || height * impl->surface_scale > 65535)
{
g_warning ("Native children wider or taller than 65535 pixels are not supported.");
- if (width * impl->window_scale > 65535)
- width = 65535 / impl->window_scale;
- if (height * impl->window_scale > 65535)
- height = 65535 /impl->window_scale;
+ if (width * impl->surface_scale > 65535)
+ width = 65535 / impl->surface_scale;
+ if (height * impl->surface_scale > 65535)
+ height = 65535 /impl->surface_scale;
}
window->x = x;
window->y = y;
window->width = width;
window->height = height;
- impl->unscaled_width = width * impl->window_scale;
- impl->unscaled_height = height * impl->window_scale;
+ impl->unscaled_width = width * impl->surface_scale;
+ impl->unscaled_height = height * impl->surface_scale;
- _gdk_win32_window_tmp_unset_parent_bg (window);
- _gdk_win32_window_tmp_unset_bg (window, TRUE);
+ _gdk_win32_surface_tmp_unset_parent_bg (window);
+ _gdk_win32_surface_tmp_unset_bg (window, TRUE);
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER)\n",
- GDK_WINDOW_HWND (window),
- (window->x + window->parent->abs_x) * impl->window_scale,
- (window->y + window->parent->abs_y) * impl->window_scale,
+ GDK_SURFACE_HWND (window),
+ (window->x + window->parent->abs_x) * impl->surface_scale,
+ (window->y + window->parent->abs_y) * impl->surface_scale,
impl->unscaled_width,
impl->unscaled_height));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
- (window->x + window->parent->abs_x) * impl->window_scale,
- (window->y + window->parent->abs_y) * impl->window_scale,
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), NULL,
+ (window->x + window->parent->abs_x) * impl->surface_scale,
+ (window->y + window->parent->abs_y) * impl->surface_scale,
impl->unscaled_width,
impl->unscaled_height,
SWP_NOACTIVATE | SWP_NOZORDER));
- _gdk_win32_window_tmp_reset_bg (window, TRUE);
+ _gdk_win32_surface_tmp_reset_bg (window, TRUE);
}
void
-_gdk_win32_window_tmp_unset_bg (GdkWindow *window,
+_gdk_win32_surface_tmp_unset_bg (GdkSurface *window,
gboolean recurse)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (window->input_only || window->destroyed || !GDK_WINDOW_IS_MAPPED (window))
+ if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
return;
- if (_gdk_window_has_impl (window) &&
- GDK_WINDOW_IS_WIN32 (window) &&
- window->window_type != GDK_WINDOW_FOREIGN)
+ if (_gdk_surface_has_impl (window) &&
+ GDK_SURFACE_IS_WIN32 (window) &&
+ window->surface_type != GDK_SURFACE_FOREIGN)
tmp_unset_bg (window);
if (recurse)
@@ -140,32 +140,32 @@ _gdk_win32_window_tmp_unset_bg (GdkWindow *window,
GList *l;
for (l = window->children; l != NULL; l = l->next)
- _gdk_win32_window_tmp_unset_bg (l->data, TRUE);
+ _gdk_win32_surface_tmp_unset_bg (l->data, TRUE);
}
}
void
-_gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window)
+_gdk_win32_surface_tmp_unset_parent_bg (GdkSurface *window)
{
if (window->parent == NULL)
return;
- window = _gdk_window_get_impl_window (window->parent);
- _gdk_win32_window_tmp_unset_bg (window, FALSE);
+ window = _gdk_surface_get_impl_surface (window->parent);
+ _gdk_win32_surface_tmp_unset_bg (window, FALSE);
}
void
-_gdk_win32_window_tmp_reset_bg (GdkWindow *window,
+_gdk_win32_surface_tmp_reset_bg (GdkSurface *window,
gboolean recurse)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (window->input_only || window->destroyed || !GDK_WINDOW_IS_MAPPED (window))
+ if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
return;
- if (_gdk_window_has_impl (window) &&
- GDK_WINDOW_IS_WIN32 (window) &&
- window->window_type != GDK_WINDOW_FOREIGN)
+ if (_gdk_surface_has_impl (window) &&
+ GDK_SURFACE_IS_WIN32 (window) &&
+ window->surface_type != GDK_SURFACE_FOREIGN)
{
tmp_reset_bg (window);
}
@@ -175,6 +175,6 @@ _gdk_win32_window_tmp_reset_bg (GdkWindow *window,
GList *l;
for (l = window->children; l != NULL; l = l->next)
- _gdk_win32_window_tmp_reset_bg (l->data, TRUE);
+ _gdk_win32_surface_tmp_reset_bg (l->data, TRUE);
}
}
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c
index c8fad5ce1e..3cf24488ab 100644
--- a/gdk/win32/gdkglcontext-win32.c
+++ b/gdk/win32/gdkglcontext-win32.c
@@ -23,7 +23,7 @@
#include "config.h"
#include "gdkprivate-win32.h"
-#include "gdkwindow-win32.h"
+#include "gdksurface-win32.h"
#include "gdkglcontext-win32.h"
#include "gdkdisplay-win32.h"
@@ -31,10 +31,10 @@
#include "gdkwin32glcontext.h"
#include "gdkwin32misc.h"
#include "gdkwin32screen.h"
-#include "gdkwin32window.h"
+#include "gdkwin32surface.h"
#include "gdkglcontext.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
#include "gdkintl.h"
@@ -49,7 +49,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (gobject);
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context));
- GdkWindow *window = gdk_gl_context_get_window (context);
+ GdkSurface *window = gdk_gl_context_get_surface (context);
if (context_win32->hglrc != NULL)
{
@@ -66,7 +66,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
if (window != NULL && window->impl != NULL)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->suppress_layered > 0)
impl->suppress_layered--;
@@ -75,18 +75,18 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
* trigger update_style_bits() to enable layered windows again
*/
if (impl->suppress_layered == 0)
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
}
G_OBJECT_CLASS (gdk_win32_gl_context_parent_class)->dispose (gobject);
}
static void
-gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region)
+gdk_gl_blit_region (GdkSurface *window, cairo_region_t *region)
{
int n_rects, i;
- int scale = gdk_window_get_scale_factor (window);
- int wh = gdk_window_get_height (window);
+ int scale = gdk_surface_get_scale_factor (window);
+ int wh = gdk_surface_get_height (window);
cairo_rectangle_int_t rect;
n_rects = cairo_region_num_rectangles (region);
@@ -107,7 +107,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context,
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context);
- GdkWindow *window = gdk_gl_context_get_window (context);
+ GdkSurface *window = gdk_gl_context_get_surface (context);
GdkWin32Display *display = (GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context)));
gboolean can_wait = display->hasWglOMLSyncControl;
cairo_rectangle_int_t whole_window;
@@ -138,7 +138,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context,
}
}
- whole_window = (GdkRectangle) { 0, 0, gdk_window_get_width (window), gdk_window_get_height (window) };
+ whole_window = (GdkRectangle) { 0, 0, gdk_surface_get_width (window), gdk_surface_get_height (window) };
if (cairo_region_contains_rectangle (painted, &whole_window) == CAIRO_REGION_OVERLAP_IN)
{
SwapBuffers (context_win32->gl_hdc);
@@ -166,7 +166,7 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context,
cairo_region_t *update_area)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
- GdkWindow *window;
+ GdkSurface *window;
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->begin_frame (draw_context, update_area);
if (gdk_gl_context_get_shared_context (context))
@@ -177,11 +177,11 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context,
/* If nothing else is known, repaint everything so that the back
buffer is fully up-to-date for the swapbuffer */
- window = gdk_gl_context_get_window (context);
+ window = gdk_gl_context_get_surface (context);
cairo_region_union_rectangle (update_area, &(GdkRectangle) {
0, 0,
- gdk_window_get_width (window),
- gdk_window_get_height (window) });
+ gdk_surface_get_width (window),
+ gdk_surface_get_height (window) });
}
typedef struct
@@ -647,9 +647,9 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
gint glver_major = 0;
gint glver_minor = 0;
- GdkWindow *window = gdk_gl_context_get_window (context);
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
+ GdkSurface *window = gdk_gl_context_get_surface (context);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_surface_get_display (window));
if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
&pixel_format,
@@ -723,7 +723,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context,
* disable layered windows by triggering update_style_bits()
*/
if (impl->suppress_layered == 1)
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
@@ -752,13 +752,13 @@ gdk_win32_gl_context_init (GdkWin32GLContext *self)
}
GdkGLContext *
-_gdk_win32_window_create_gl_context (GdkWindow *window,
+_gdk_win32_surface_create_gl_context (GdkSurface *window,
gboolean attached,
GdkGLContext *share,
GError **error)
{
- GdkDisplay *display = gdk_window_get_display (window);
- GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
+ GdkDisplay *display = gdk_surface_get_display (window);
+ GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_surface_get_display (window));
GdkWin32GLContext *context = NULL;
/* Acquire and store up the Windows-specific HWND and HDC */
@@ -773,7 +773,7 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
return NULL;
}
- hwnd = GDK_WINDOW_HWND (window);
+ hwnd = GDK_SURFACE_HWND (window);
hdc = GetDC (hwnd);
display_win32->gl_hwnd = hwnd;
@@ -795,7 +795,7 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display,
{
GdkWin32GLContext *context_win32;
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
- GdkWindow *window;
+ GdkSurface *window;
gboolean do_frame_sync = FALSE;
@@ -816,13 +816,13 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display,
if (context_win32->is_attached && display_win32->hasWglEXTSwapControl)
{
- window = gdk_gl_context_get_window (context);
+ window = gdk_gl_context_get_surface (context);
/* If there is compositing there is no particular need to delay
* the swap when drawing on the offscreen, rendering to the screen
* happens later anyway, and its up to the compositor to sync that
* to the vblank. */
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
do_frame_sync = ! gdk_display_is_composited (display);
if (do_frame_sync != context_win32->do_frame_sync)
diff --git a/gdk/win32/gdkglcontext-win32.h b/gdk/win32/gdkglcontext-win32.h
index 88bc970a95..8549679559 100644
--- a/gdk/win32/gdkglcontext-win32.h
+++ b/gdk/win32/gdkglcontext-win32.h
@@ -26,7 +26,7 @@
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
@@ -51,7 +51,7 @@ struct _GdkWin32GLContextClass
};
GdkGLContext *
-_gdk_win32_window_create_gl_context (GdkWindow *window,
+_gdk_win32_surface_create_gl_context (GdkSurface *window,
gboolean attached,
GdkGLContext *share,
GError **error);
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 078b0dc0dd..49d30a3096 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -67,7 +67,7 @@ const GOptionEntry _gdk_windowing_args[] = {
};
void
-_gdk_win32_windowing_init (void)
+_gdk_win32_surfaceing_init (void)
{
gchar buf[10];
@@ -283,7 +283,7 @@ _gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol)
}
gchar *
-_gdk_win32_window_state_to_string (GdkWindowState state)
+_gdk_win32_surface_state_to_string (GdkSurfaceState state)
{
gchar buf[100];
gchar *bufp = buf;
@@ -292,11 +292,11 @@ _gdk_win32_window_state_to_string (GdkWindowState state)
buf[0] = '\0';
#define BIT(x) \
- if (state & GDK_WINDOW_STATE_ ## x) \
+ if (state & GDK_SURFACE_STATE_ ## x) \
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
/* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */
- if (!(state & GDK_WINDOW_STATE_WITHDRAWN))
+ if (!(state & GDK_SURFACE_STATE_WITHDRAWN))
(bufp += sprintf (bufp, "MAPPED"), s = "|");
BIT (WITHDRAWN);
@@ -309,7 +309,7 @@ _gdk_win32_window_state_to_string (GdkWindowState state)
}
gchar *
-_gdk_win32_window_style_to_string (LONG style)
+_gdk_win32_surface_style_to_string (LONG style)
{
gchar buf[1000];
gchar *bufp = buf;
@@ -351,7 +351,7 @@ _gdk_win32_window_style_to_string (LONG style)
}
gchar *
-_gdk_win32_window_exstyle_to_string (LONG style)
+_gdk_win32_surface_exstyle_to_string (LONG style)
{
gchar buf[1000];
gchar *bufp = buf;
@@ -397,7 +397,7 @@ _gdk_win32_window_exstyle_to_string (LONG style)
}
gchar *
-_gdk_win32_window_pos_bits_to_string (UINT flags)
+_gdk_win32_surface_pos_bits_to_string (UINT flags)
{
gchar buf[1000];
gchar *bufp = buf;
@@ -914,15 +914,15 @@ _gdk_win32_cairo_region_to_string (const cairo_region_t *rgn)
}
gchar *
-_gdk_win32_window_description (GdkWindow *d)
+_gdk_win32_surface_description (GdkSurface *d)
{
- g_return_val_if_fail (GDK_IS_WINDOW (d), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (d), NULL);
return static_printf ("%s:%p:%dx%d",
G_OBJECT_TYPE_NAME (d),
- GDK_WINDOW_HWND (d),
- gdk_window_get_width (GDK_WINDOW (d)),
- gdk_window_get_height (GDK_WINDOW (d)));
+ GDK_SURFACE_HWND (d),
+ gdk_surface_get_width (GDK_SURFACE (d)),
+ gdk_surface_get_height (GDK_SURFACE (d)));
}
#endif /* G_ENABLE_DEBUG */
diff --git a/gdk/win32/gdkmonitor-win32.c b/gdk/win32/gdkmonitor-win32.c
index 2f7afd3a74..108e5083ed 100644
--- a/gdk/win32/gdkmonitor-win32.c
+++ b/gdk/win32/gdkmonitor-win32.c
@@ -691,7 +691,7 @@ enum_monitor (HMONITOR hmonitor,
w32mon->work_rect = rect;
if (data->display->has_fixed_scale)
- scale = data->display->window_scale;
+ scale = data->display->surface_scale;
else
{
/* First acquire the scale using the current screen */
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index d74a720461..6e51091ff5 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -35,7 +35,7 @@
#endif
#include <gdk/gdkcursorprivate.h>
-#include <gdk/win32/gdkwindow-win32.h>
+#include <gdk/win32/gdksurface-win32.h>
#include <gdk/win32/gdkwin32display.h>
#include <gdk/win32/gdkwin32screen.h>
#include <gdk/win32/gdkwin32keys.h>
@@ -123,9 +123,9 @@
#define GDK_DEBUG_EVENTS_OR_INPUT (GDK_DEBUG_EVENTS|GDK_DEBUG_INPUT)
#define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS)
-GdkWin32Screen *GDK_WINDOW_SCREEN(GObject *win);
+GdkWin32Screen *GDK_SURFACE_SCREEN(GObject *win);
-#define GDK_WINDOW_IS_WIN32(win) (GDK_IS_WINDOW_IMPL_WIN32 (win->impl))
+#define GDK_SURFACE_IS_WIN32(win) (GDK_IS_SURFACE_IMPL_WIN32 (win->impl))
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;
@@ -154,21 +154,21 @@ GType _gdk_gc_win32_get_type (void);
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
-void _gdk_window_init_position (GdkWindow *window);
-void _gdk_window_move_resize_child (GdkWindow *window,
+void _gdk_surface_init_position (GdkSurface *window);
+void _gdk_surface_move_resize_child (GdkSurface *window,
gint x,
gint y,
gint width,
gint height);
-gboolean _gdk_win32_window_enable_transparency (GdkWindow *window);
+gboolean _gdk_win32_surface_enable_transparency (GdkSurface *window);
-/* GdkWindowImpl methods */
-void _gdk_win32_window_scroll (GdkWindow *window,
+/* GdkSurfaceImpl methods */
+void _gdk_win32_surface_scroll (GdkSurface *window,
gint dx,
gint dy);
-void _gdk_win32_window_move_region (GdkWindow *window,
+void _gdk_win32_surface_move_region (GdkSurface *window,
const cairo_region_t *region,
gint dx,
gint dy);
@@ -188,17 +188,17 @@ HRGN _gdk_win32_cairo_region_to_hrgn (const cairo_region_t *region,
cairo_region_t *_gdk_win32_hrgn_to_region (HRGN hrgn,
guint scale);
-void _gdk_win32_adjust_client_rect (GdkWindow *window,
+void _gdk_win32_adjust_client_rect (GdkSurface *window,
RECT *RECT);
-void _gdk_selection_property_delete (GdkWindow *);
+void _gdk_selection_property_delete (GdkSurface *);
void _gdk_dropfiles_store (gchar *data);
-void _gdk_push_modal_window (GdkWindow *window);
-void _gdk_remove_modal_window (GdkWindow *window);
-GdkWindow *_gdk_modal_current (void);
-gboolean _gdk_modal_blocked (GdkWindow *window);
+void _gdk_push_modal_window (GdkSurface *window);
+void _gdk_remove_modal_window (GdkSurface *window);
+GdkSurface *_gdk_modal_current (void);
+gboolean _gdk_modal_blocked (GdkSurface *window);
#ifdef G_ENABLE_DEBUG
void _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
@@ -208,12 +208,12 @@ void _gdk_win32_print_hpalette (HPALETTE hpal);
void _gdk_win32_print_dc (HDC hdc);
gchar *_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol);
-gchar *_gdk_win32_window_state_to_string (GdkWindowState state);
-gchar *_gdk_win32_window_style_to_string (LONG style);
-gchar *_gdk_win32_window_exstyle_to_string (LONG style);
-gchar *_gdk_win32_window_pos_bits_to_string (UINT flags);
+gchar *_gdk_win32_surface_state_to_string (GdkSurfaceState state);
+gchar *_gdk_win32_surface_style_to_string (LONG style);
+gchar *_gdk_win32_surface_exstyle_to_string (LONG style);
+gchar *_gdk_win32_surface_pos_bits_to_string (UINT flags);
gchar *_gdk_win32_drag_action_to_string (GdkDragAction actions);
-gchar *_gdk_win32_window_description (GdkWindow *d);
+gchar *_gdk_win32_surface_description (GdkSurface *d);
gchar *_gdk_win32_rop2_to_string (int rop2);
gchar *_gdk_win32_lbstyle_to_string (UINT brush_style);
@@ -254,7 +254,7 @@ void _gdk_other_api_failed (const gchar *where,
#define GDI_CALL(api, arglist) (api arglist ? 1 : (WIN32_GDI_FAILED (#api), 0))
#define API_CALL(api, arglist) (api arglist ? 1 : (WIN32_API_FAILED (#api), 0))
-extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM);
+extern LRESULT CALLBACK _gdk_win32_surface_procedure (HWND, UINT, WPARAM, LPARAM);
extern GdkDisplay *_gdk_display;
@@ -375,23 +375,23 @@ gboolean _gdk_win32_display_has_pending (GdkDisplay *display);
void _gdk_win32_display_queue_events (GdkDisplay *display);
gboolean _gdk_win32_selection_owner_set_for_display (GdkDisplay *display,
- GdkWindow *owner,
+ GdkSurface *owner,
GdkAtom selection,
guint32 time,
gboolean send_event);
void _gdk_win32_display_send_selection_notify (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time);
gint _gdk_win32_display_get_selection_property (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
guchar **data,
GdkAtom *ret_type,
gint *ret_format);
void _gdk_win32_display_convert_selection (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
@@ -412,15 +412,15 @@ void _gdk_win32_keymap_set_active_layout (GdkWin32Keymap *keymap,
GdkKeymap *_gdk_win32_display_get_keymap (GdkDisplay *display);
-void _gdk_win32_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_win32_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
-/* stray GdkWindowImplWin32 members */
-void _gdk_win32_window_register_dnd (GdkWindow *window);
-GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window,
+/* stray GdkSurfaceImplWin32 members */
+void _gdk_win32_surface_register_dnd (GdkSurface *window);
+GdkDragContext *_gdk_win32_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GdkContentFormats *formats,
GdkDragAction actions,
@@ -430,8 +430,8 @@ GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window,
/* Stray GdkWin32Screen members */
gboolean _gdk_win32_get_setting (const gchar *name, GValue *value);
void _gdk_win32_screen_on_displaychange_event (GdkWin32Screen *screen);
-GdkWindow *gdk_win32_screen_get_root_window (GdkWin32Screen *screen);
-GdkWindow *gdk_win32_display_get_root_window (GdkDisplay *display);
+GdkSurface *gdk_win32_screen_get_root_window (GdkWin32Screen *screen);
+GdkSurface *gdk_win32_display_get_root_window (GdkDisplay *display);
/* Distributed display manager implementation */
GdkDisplay *_gdk_win32_display_open (const gchar *display_name);
@@ -441,32 +441,32 @@ GdkAtom _gdk_win32_display_manager_atom_intern (GdkDisplayManager *manager,
gchar *_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom);
void _gdk_win32_append_event (GdkEvent *event);
-void _gdk_win32_emit_configure_event (GdkWindow *window);
+void _gdk_win32_emit_configure_event (GdkSurface *window);
guint32 _gdk_win32_keymap_get_decimal_mark (GdkWin32Keymap *keymap);
-void _gdk_win32_window_handle_aerosnap (GdkWindow *window,
+void _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
GdkWin32AeroSnapCombo combo);
-gboolean _gdk_win32_get_window_rect (GdkWindow *window,
+gboolean _gdk_win32_get_window_rect (GdkSurface *window,
RECT *rect);
-void _gdk_win32_do_emit_configure_event (GdkWindow *window,
+void _gdk_win32_do_emit_configure_event (GdkSurface *window,
RECT rect);
-void gdk_win32_window_do_move_resize_drag (GdkWindow *window,
+void gdk_win32_surface_do_move_resize_drag (GdkSurface *window,
gint x,
gint y);
-void gdk_win32_window_end_move_resize_drag (GdkWindow *window);
-gboolean _gdk_win32_window_fill_min_max_info (GdkWindow *window,
+void gdk_win32_surface_end_move_resize_drag (GdkSurface *window);
+gboolean _gdk_win32_surface_fill_min_max_info (GdkSurface *window,
MINMAXINFO *mmi);
-gboolean _gdk_win32_window_lacks_wm_decorations (GdkWindow *window);
+gboolean _gdk_win32_surface_lacks_wm_decorations (GdkSurface *window);
-BOOL WINAPI GtkShowWindow (GdkWindow *window,
+BOOL WINAPI GtkShowWindow (GdkSurface *window,
int cmd_show);
/* Initialization */
-void _gdk_win32_windowing_init (void);
+void _gdk_win32_surfaceing_init (void);
void _gdk_dnd_init (void);
void _gdk_events_init (GdkDisplay *display);
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index 9e8b21b665..56e7886803 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -33,7 +33,7 @@ struct _GdkWin32Screen
GObject parent_instance;
int width, height;
- int window_scale;
+ int surface_scale;
};
struct _GdkWin32ScreenClass
@@ -51,7 +51,7 @@ init_root_window_size (GdkWin32Screen *screen)
GdkDisplay *display = _gdk_display;
int monitor_count;
GdkMonitor *monitor;
- GdkWindowImplWin32 *root_impl;
+ GdkSurfaceImplWin32 *root_impl;
monitor_count = gdk_display_get_n_monitors (display);
monitor = gdk_display_get_monitor (display, 0);
@@ -80,12 +80,12 @@ init_root_window (GdkWin32Screen *screen_win32)
win32_display = GDK_WIN32_DISPLAY (_gdk_display);
if (win32_display->dpi_aware_type != PROCESS_DPI_UNAWARE)
- screen_win32->window_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display,
+ screen_win32->surface_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display,
NULL,
NULL,
NULL);
else
- screen_win32->window_scale = 1;
+ screen_win32->surface_scale = 1;
}
static void
diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c
index d3b0948b73..3750eca629 100644
--- a/gdk/win32/gdkselection-win32.c
+++ b/gdk/win32/gdkselection-win32.c
@@ -76,7 +76,7 @@ S:_gtk_selection_request()
event handler, which calls
S:gtk_selection_invoke_handler()
to get the data, and then calls
-S:gdk_property_change() (_gdk_x11_window_change_property())
+S:gdk_property_change() (_gdk_x11_surface_change_property())
to submit the data, by setting the property given by the message sender
(GDK_SELECTION) on the requestor window (our client clipboard window).
@@ -194,7 +194,7 @@ S:_gtk_selection_request()
event handler, which calls
S:gtk_selection_invoke_handler()
to get the data, and then calls
-S:gdk_property_change() (_gdk_win32_window_change_property())
+S:gdk_property_change() (_gdk_win32_surface_change_property())
to submit the data, by first transmuting it to the format actually requested
by the sender of WM_RENDERFORMAT, and then by returning thedata back up the stack,
to the WM_RENDERFORMAT handler, which then calls
@@ -253,7 +253,7 @@ DND:
GDK-Win32:
S:idataobject_getdata()
sends a GDK_SELECTION_REQUEST event, which results in a call to
-S:_gdk_win32_window_change_property()
+S:_gdk_win32_surface_change_property()
which passes clipboard data back via the selection singleton.
GDK-Win32 uses delayed rendering for all formats, even text.
@@ -304,7 +304,7 @@ enum _GdkWin32ClipboardQueueAction
struct _GdkWin32ClipboardQueueInfo
{
GdkDisplay *display;
- GdkWindow *requestor;
+ GdkSurface *requestor;
GdkAtom selection;
GdkAtom target;
guint32 time;
@@ -747,7 +747,7 @@ _gdk_utf8_to_string_target_internal (const gchar *str,
}
static void
-selection_property_store (GdkWindow *owner,
+selection_property_store (GdkSurface *owner,
GdkAtom type,
gint format,
guchar *data,
@@ -756,13 +756,13 @@ selection_property_store (GdkWindow *owner,
GdkSelProp *prop;
GdkWin32Selection *win32_sel = _gdk_win32_selection_get ();
- prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner));
+ prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner));
if (prop != NULL)
{
g_free (prop->data);
g_free (prop);
- g_hash_table_remove (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner));
+ g_hash_table_remove (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner));
}
prop = g_new (GdkSelProp, 1);
@@ -772,7 +772,7 @@ selection_property_store (GdkWindow *owner,
prop->bitness = format;
prop->target = type;
- g_hash_table_insert (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner), prop);
+ g_hash_table_insert (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner), prop);
}
void
@@ -802,7 +802,7 @@ _gdk_dropfiles_store (gchar *data)
}
static void
-generate_selection_notify (GdkWindow *requestor,
+generate_selection_notify (GdkSurface *requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
@@ -860,7 +860,7 @@ _gdk_win32_clear_clipboard_queue ()
static void
send_targets_request (guint time)
{
- GdkWindow *owner;
+ GdkSurface *owner;
GdkEvent tmp_event;
GdkWin32Selection *win32_sel = _gdk_win32_selection_get ();
@@ -875,9 +875,9 @@ send_targets_request (guint time)
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE)
{
- if (OpenClipboard (GDK_WINDOW_HWND (owner)))
+ if (OpenClipboard (GDK_SURFACE_HWND (owner)))
{
- win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (owner);
+ win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (owner);
GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__));
}
}
@@ -1687,7 +1687,7 @@ transmute_selection_target (GdkAtom from_target,
}
static GdkAtom
-convert_clipboard_selection_to_targets_target (GdkWindow *requestor)
+convert_clipboard_selection_to_targets_target (GdkSurface *requestor)
{
gint fmt;
int i;
@@ -1732,7 +1732,7 @@ convert_clipboard_selection_to_targets_target (GdkWindow *requestor)
}
static GdkAtom
-convert_clipboard_selection_to_target (GdkWindow *requestor,
+convert_clipboard_selection_to_target (GdkSurface *requestor,
GdkAtom target)
{
UINT format;
@@ -1814,7 +1814,7 @@ convert_clipboard_selection_to_target (GdkWindow *requestor,
static GdkAtom
convert_selection_with_opened_clipboard (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom target,
guint32 time)
{
@@ -1860,7 +1860,7 @@ open_clipboard_timeout (gpointer data)
info = (GdkWin32ClipboardQueueInfo *) tmp_list->data;
next = g_list_next (tmp_list);
- if (GDK_WINDOW_DESTROYED (info->requestor) ||
+ if (GDK_SURFACE_DESTROYED (info->requestor) ||
info->idle_time >= CLIPBOARD_IDLE_ABORT_TIME)
{
clipboard_queue = g_list_remove_link (clipboard_queue, tmp_list);
@@ -1913,12 +1913,12 @@ open_clipboard_timeout (gpointer data)
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE)
{
- if (!OpenClipboard (GDK_WINDOW_HWND (info->requestor)))
+ if (!OpenClipboard (GDK_SURFACE_HWND (info->requestor)))
{
info->idle_time += 1;
continue;
}
- win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (info->requestor);
+ win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (info->requestor);
GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__));
}
@@ -1967,7 +1967,7 @@ open_clipboard_timeout (gpointer data)
static void
queue_open_clipboard (GdkWin32ClipboardQueueAction action,
GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom target,
guint32 time)
{
@@ -2011,7 +2011,7 @@ queue_open_clipboard (GdkWin32ClipboardQueueAction action,
gboolean
_gdk_win32_display_set_selection_owner (GdkDisplay *display,
- GdkWindow *owner,
+ GdkSurface *owner,
GdkAtom selection,
guint32 time,
gboolean send_event)
@@ -2025,14 +2025,14 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display,
const char *sel_name = (const char *)selection;
g_print ("gdk_selection_owner_set_for_display: %p %s\n",
- (owner ? GDK_WINDOW_HWND (owner) : NULL),
+ (owner ? GDK_SURFACE_HWND (owner) : NULL),
sel_name);
});
if (selection != GDK_SELECTION_CLIPBOARD)
{
if (owner != NULL)
- g_hash_table_insert (win32_sel->sel_owner_table, selection, GDK_WINDOW_HWND (owner));
+ g_hash_table_insert (win32_sel->sel_owner_table, selection, GDK_SURFACE_HWND (owner));
else
g_hash_table_remove (win32_sel->sel_owner_table, selection);
@@ -2042,10 +2042,10 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display,
/* Rest of this function handles the CLIPBOARD selection */
if (owner != NULL)
{
- if (GDK_WINDOW_DESTROYED (owner))
+ if (GDK_SURFACE_DESTROYED (owner))
return FALSE;
- hwnd = GDK_WINDOW_HWND (owner);
+ hwnd = GDK_SURFACE_HWND (owner);
}
else
hwnd = NULL;
@@ -2102,11 +2102,11 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display,
return TRUE;
}
-GdkWindow*
+GdkSurface*
_gdk_win32_display_get_selection_owner (GdkDisplay *display,
GdkAtom selection)
{
- GdkWindow *window;
+ GdkSurface *window;
HWND selection_owner;
GdkWin32Selection *win32_sel = _gdk_win32_selection_get ();
@@ -2118,7 +2118,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display,
selection_owner = g_hash_table_lookup (win32_sel->sel_owner_table, selection);
if (selection_owner)
- window = gdk_win32_window_lookup_for_display (display,
+ window = gdk_win32_surface_lookup_for_display (display,
selection_owner);
else
window = NULL;
@@ -2128,7 +2128,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display,
g_print ("gdk_selection_owner_get: %s = %p\n",
sel_name,
- (window ? GDK_WINDOW_HWND (window) : NULL));
+ (window ? GDK_SURFACE_HWND (window) : NULL));
});
return window;
@@ -2136,7 +2136,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display,
static GdkAtom
convert_dnd_selection_to_target (GdkAtom target,
- GdkWindow *requestor)
+ GdkSurface *requestor)
{
GdkWin32Selection *win32_sel = _gdk_win32_selection_get ();
UINT format;
@@ -2243,7 +2243,7 @@ convert_dnd_selection_to_target (GdkAtom target,
void
_gdk_win32_display_convert_selection (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time)
@@ -2254,7 +2254,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
g_return_if_fail (selection != NULL);
g_return_if_fail (requestor != NULL);
- if (GDK_WINDOW_DESTROYED (requestor))
+ if (GDK_SURFACE_DESTROYED (requestor))
return;
GDK_NOTE (DND, {
@@ -2262,18 +2262,18 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
const char *tgt_name = (const char *)target;
g_print ("gdk_selection_convert: %p %s %s\n",
- GDK_WINDOW_HWND (requestor),
+ GDK_SURFACE_HWND (requestor),
sel_name, tgt_name);
});
if (selection == GDK_SELECTION_CLIPBOARD)
{
if (win32_sel->clipboard_opened_for != INVALID_HANDLE_VALUE ||
- OpenClipboard (GDK_WINDOW_HWND (requestor)))
+ OpenClipboard (GDK_SURFACE_HWND (requestor)))
{
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE)
{
- win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (requestor);
+ win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (requestor);
GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__));
}
@@ -2317,7 +2317,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
void
_gdk_win32_selection_property_change (GdkWin32Selection *win32_sel,
- GdkWindow *window,
+ GdkSurface *window,
GdkAtom property,
GdkAtom type,
gint format,
@@ -2331,9 +2331,9 @@ _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel,
win32_sel->property_change_target_atom = 0;
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE &&
- OpenClipboard (GDK_WINDOW_HWND (window)))
+ OpenClipboard (GDK_SURFACE_HWND (window)))
{
- win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (window);
+ win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (window);
GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__));
}
@@ -2435,7 +2435,7 @@ _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel,
gint
_gdk_win32_display_get_selection_property (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
guchar **data,
GdkAtom *ret_type,
gint *ret_format)
@@ -2444,15 +2444,15 @@ _gdk_win32_display_get_selection_property (GdkDisplay *display,
GdkSelProp *prop;
g_return_val_if_fail (requestor != NULL, 0);
- g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
+ g_return_val_if_fail (GDK_IS_SURFACE (requestor), 0);
- if (GDK_WINDOW_DESTROYED (requestor))
+ if (GDK_SURFACE_DESTROYED (requestor))
return 0;
GDK_NOTE (DND, g_print ("gdk_selection_property_get: %p",
- GDK_WINDOW_HWND (requestor)));
+ GDK_SURFACE_HWND (requestor)));
- prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_WINDOW_HWND (requestor));
+ prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_SURFACE_HWND (requestor));
if (prop == NULL)
{
@@ -2484,25 +2484,25 @@ _gdk_win32_display_get_selection_property (GdkDisplay *display,
}
void
-_gdk_selection_property_delete (GdkWindow *window)
+_gdk_selection_property_delete (GdkSurface *window)
{
GDK_NOTE (DND, g_print ("_gdk_selection_property_delete: %p (no-op)\n",
- GDK_WINDOW_HWND (window)));
+ GDK_SURFACE_HWND (window)));
#if 0
- prop = g_hash_table_lookup (sel_prop_table, GDK_WINDOW_HWND (window));
+ prop = g_hash_table_lookup (sel_prop_table, GDK_SURFACE_HWND (window));
if (prop != NULL)
{
g_free (prop->data);
g_free (prop);
- g_hash_table_remove (sel_prop_table, GDK_WINDOW_HWND (window));
+ g_hash_table_remove (sel_prop_table, GDK_SURFACE_HWND (window));
}
#endif
}
void
_gdk_win32_display_send_selection_notify (GdkDisplay *display,
- GdkWindow *requestor,
+ GdkSurface *requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
@@ -2794,7 +2794,7 @@ _gdk_win32_add_target_to_selformats (GdkAtom target,
* delayed rendering (that is, all formats, as we use delayed rendering
* for everything). This function only registers the formats, but does
* not announce them as supported. That is handled as a special case
- * in gdk_window_property_change().
+ * in gdk_surface_property_change().
*
* Implementation detail:
* This function will be called repeatedly, every time the PRIMARY selection changes.
@@ -2806,7 +2806,7 @@ _gdk_win32_add_target_to_selformats (GdkAtom target,
*/
void
gdk_win32_display_add_selection_targets (GdkDisplay *display,
- GdkWindow *owner,
+ GdkSurface *owner,
GdkAtom selection,
GdkAtom *targets,
guint ntargets)
@@ -2818,7 +2818,7 @@ gdk_win32_display_add_selection_targets (GdkDisplay *display,
const char *sel_name = (const char *)selection;
g_print ("gdk_win32_selection_add_targets: %p: %s: ",
- owner ? GDK_WINDOW_HWND (owner) : NULL,
+ owner ? GDK_SURFACE_HWND (owner) : NULL,
sel_name);
for (i = 0; i < ntargets; i++)
diff --git a/gdk/win32/gdkselection-win32.h b/gdk/win32/gdkselection-win32.h
index a71655460c..bbd3a7cd85 100644
--- a/gdk/win32/gdkselection-win32.h
+++ b/gdk/win32/gdkselection-win32.h
@@ -219,7 +219,7 @@ void _gdk_win32_add_format_to_targets (UINT
gint _gdk_win32_add_target_to_selformats (GdkAtom target,
GArray *array);
void _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel,
- GdkWindow *window,
+ GdkSurface *window,
GdkAtom property,
GdkAtom type,
gint format,
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdksurface-win32.c
index 12b8aa623c..12e754325f 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include "gdk.h"
-#include "gdkwindowimpl.h"
+#include "gdksurfaceimpl.h"
#include "gdkprivate-win32.h"
#include "gdkdeviceprivate.h"
#include "gdkdevicemanager-win32.h"
@@ -37,7 +37,7 @@
#include "gdkwin32.h"
#include "gdkdisplayprivate.h"
#include "gdkmonitorprivate.h"
-#include "gdkwin32window.h"
+#include "gdkwin32surface.h"
#include "gdkglcontext-win32.h"
#include "gdkdisplay-win32.h"
@@ -46,9 +46,9 @@
#include <math.h>
#include "fallback-c89.c"
-static void gdk_window_impl_win32_init (GdkWindowImplWin32 *window);
-static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
-static void gdk_window_impl_win32_finalize (GObject *object);
+static void gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *window);
+static void gdk_surface_impl_win32_class_init (GdkSurfaceImplWin32Class *klass);
+static void gdk_surface_impl_win32_finalize (GObject *object);
static gpointer parent_class = NULL;
static GSList *modal_window_stack = NULL;
@@ -126,39 +126,39 @@ typedef struct _AeroSnapEdgeRegion AeroSnapEdgeRegion;
*/
#define AEROSNAP_INDICATOR_ANIMATION_TICK (16)
-static gboolean _gdk_window_get_functions (GdkWindow *window,
+static gboolean _gdk_surface_get_functions (GdkSurface *window,
GdkWMFunction *functions);
-static HDC _gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl);
-static void _gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl);
+static HDC _gdk_win32_impl_acquire_dc (GdkSurfaceImplWin32 *impl);
+static void _gdk_win32_impl_release_dc (GdkSurfaceImplWin32 *impl);
-#define WINDOW_IS_TOPLEVEL(window) \
- (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+#define SURFACE_IS_TOPLEVEL(window) \
+ (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
-struct _GdkWin32Window {
- GdkWindow parent;
+struct _GdkWin32Surface {
+ GdkSurface parent;
};
-struct _GdkWin32WindowClass {
- GdkWindowClass parent_class;
+struct _GdkWin32SurfaceClass {
+ GdkSurfaceClass parent_class;
};
-G_DEFINE_TYPE (GdkWin32Window, gdk_win32_window, GDK_TYPE_WINDOW)
+G_DEFINE_TYPE (GdkWin32Surface, gdk_win32_surface, GDK_TYPE_SURFACE)
static void
-gdk_win32_window_class_init (GdkWin32WindowClass *window_class)
+gdk_win32_surface_class_init (GdkWin32SurfaceClass *window_class)
{
}
static void
-gdk_win32_window_init (GdkWin32Window *window)
+gdk_win32_surface_init (GdkWin32Surface *window)
{
}
-G_DEFINE_TYPE (GdkWindowImplWin32, gdk_window_impl_win32, GDK_TYPE_WINDOW_IMPL)
+G_DEFINE_TYPE (GdkSurfaceImplWin32, gdk_surface_impl_win32, GDK_TYPE_SURFACE_IMPL)
GType
-_gdk_window_impl_win32_get_type (void)
+_gdk_surface_impl_win32_get_type (void)
{
static GType object_type = 0;
@@ -166,19 +166,19 @@ _gdk_window_impl_win32_get_type (void)
{
const GTypeInfo object_info =
{
- sizeof (GdkWindowImplWin32Class),
+ sizeof (GdkSurfaceImplWin32Class),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_window_impl_win32_class_init,
+ (GClassInitFunc) gdk_surface_impl_win32_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
- sizeof (GdkWindowImplWin32),
+ sizeof (GdkSurfaceImplWin32),
0, /* n_preallocs */
- (GInstanceInitFunc) gdk_window_impl_win32_init,
+ (GInstanceInitFunc) gdk_surface_impl_win32_init,
};
- object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL,
- "GdkWindowImplWin32",
+ object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL,
+ "GdkSurfaceImplWin32",
&object_info, 0);
}
@@ -186,84 +186,84 @@ _gdk_window_impl_win32_get_type (void)
}
static void
-gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
+gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *impl)
{
GdkDisplay *display = gdk_display_get_default ();
- impl->toplevel_window_type = -1;
+ impl->toplevel_surface_type = -1;
impl->hicon_big = NULL;
impl->hicon_small = NULL;
impl->hint_flags = 0;
- impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
+ impl->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL;
impl->transient_owner = NULL;
impl->transient_children = NULL;
impl->num_transients = 0;
impl->changing_state = FALSE;
- impl->window_scale = 1;
+ impl->surface_scale = 1;
}
static void
-gdk_window_impl_win32_finalize (GObject *object)
+gdk_surface_impl_win32_finalize (GObject *object)
{
- GdkWindow *wrapper;
- GdkWindowImplWin32 *window_impl;
+ GdkSurface *wrapper;
+ GdkSurfaceImplWin32 *surface_impl;
- g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (object));
+ g_return_if_fail (GDK_IS_SURFACE_IMPL_WIN32 (object));
- window_impl = GDK_WINDOW_IMPL_WIN32 (object);
+ surface_impl = GDK_SURFACE_IMPL_WIN32 (object);
- wrapper = window_impl->wrapper;
+ wrapper = surface_impl->wrapper;
- if (!GDK_WINDOW_DESTROYED (wrapper))
+ if (!GDK_SURFACE_DESTROYED (wrapper))
{
- gdk_win32_handle_table_remove (window_impl->handle);
+ gdk_win32_handle_table_remove (surface_impl->handle);
}
- g_clear_pointer (&window_impl->snap_stash, g_free);
- g_clear_pointer (&window_impl->snap_stash_int, g_free);
+ g_clear_pointer (&surface_impl->snap_stash, g_free);
+ g_clear_pointer (&surface_impl->snap_stash_int, g_free);
- if (window_impl->hicon_big != NULL)
+ if (surface_impl->hicon_big != NULL)
{
- GDI_CALL (DestroyIcon, (window_impl->hicon_big));
- window_impl->hicon_big = NULL;
+ GDI_CALL (DestroyIcon, (surface_impl->hicon_big));
+ surface_impl->hicon_big = NULL;
}
- if (window_impl->hicon_small != NULL)
+ if (surface_impl->hicon_small != NULL)
{
- GDI_CALL (DestroyIcon, (window_impl->hicon_small));
- window_impl->hicon_small = NULL;
+ GDI_CALL (DestroyIcon, (surface_impl->hicon_small));
+ surface_impl->hicon_small = NULL;
}
- g_free (window_impl->decorations);
+ g_free (surface_impl->decorations);
- if (window_impl->cache_surface)
+ if (surface_impl->cache_surface)
{
- cairo_surface_destroy (window_impl->cache_surface);
- window_impl->cache_surface = NULL;
+ cairo_surface_destroy (surface_impl->cache_surface);
+ surface_impl->cache_surface = NULL;
}
- if (window_impl->cairo_surface)
+ if (surface_impl->cairo_surface)
{
- cairo_surface_destroy (window_impl->cairo_surface);
- window_impl->cairo_surface = NULL;
+ cairo_surface_destroy (surface_impl->cairo_surface);
+ surface_impl->cairo_surface = NULL;
}
- g_assert (window_impl->transient_owner == NULL);
- g_assert (window_impl->transient_children == NULL);
+ g_assert (surface_impl->transient_owner == NULL);
+ g_assert (surface_impl->transient_children == NULL);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
-gdk_win32_get_window_client_area_rect (GdkWindow *window,
+gdk_win32_get_window_client_area_rect (GdkSurface *window,
gint scale,
RECT *rect)
{
gint x, y, width, height;
- gdk_window_get_position (window, &x, &y);
- width = gdk_window_get_width (window);
- height = gdk_window_get_height (window);
+ gdk_surface_get_position (window, &x, &y);
+ width = gdk_surface_get_width (window);
+ height = gdk_surface_get_height (window);
rect->left = x * scale;
rect->top = y * scale;
rect->right = rect->left + width * scale;
@@ -271,36 +271,36 @@ gdk_win32_get_window_client_area_rect (GdkWindow *window,
}
static void
-gdk_win32_window_get_queued_window_rect (GdkWindow *window,
+gdk_win32_surface_get_queued_window_rect (GdkSurface *window,
RECT *return_window_rect)
{
RECT window_rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect);
+ gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect);
/* Turn client area into window area */
_gdk_win32_adjust_client_rect (window, &window_rect);
/* Convert GDK screen coordinates to W32 desktop coordinates */
- window_rect.left -= _gdk_offset_x * impl->window_scale;
- window_rect.right -= _gdk_offset_x * impl->window_scale;
- window_rect.top -= _gdk_offset_y * impl->window_scale;
- window_rect.bottom -= _gdk_offset_y * impl->window_scale;
+ window_rect.left -= _gdk_offset_x * impl->surface_scale;
+ window_rect.right -= _gdk_offset_x * impl->surface_scale;
+ window_rect.top -= _gdk_offset_y * impl->surface_scale;
+ window_rect.bottom -= _gdk_offset_y * impl->surface_scale;
*return_window_rect = window_rect;
}
static void
-gdk_win32_window_apply_queued_move_resize (GdkWindow *window,
+gdk_win32_surface_apply_queued_move_resize (GdkSurface *window,
RECT window_rect)
{
- if (!IsIconic (GDK_WINDOW_HWND (window)))
+ if (!IsIconic (GDK_SURFACE_HWND (window)))
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GDK_NOTE (EVENTS, g_print ("Setting window position ... "));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
window_rect.left, window_rect.top,
window_rect.right - window_rect.left,
@@ -317,15 +317,15 @@ gdk_win32_window_apply_queued_move_resize (GdkWindow *window,
}
static gboolean
-gdk_win32_window_begin_paint (GdkWindow *window)
+gdk_win32_surface_begin_paint (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
RECT window_rect;
- if (window == NULL || GDK_WINDOW_DESTROYED (window))
+ if (window == NULL || GDK_SURFACE_DESTROYED (window))
return TRUE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* Layered windows are moved *after* repaint.
* We supply our own surface, return FALSE to make GDK use it.
@@ -360,23 +360,23 @@ gdk_win32_window_begin_paint (GdkWindow *window)
/* Get the position/size of the window that GDK wants,
* apply it.
*/
- gdk_win32_window_get_queued_window_rect (window, &window_rect);
- gdk_win32_window_apply_queued_move_resize (window, window_rect);
+ gdk_win32_surface_get_queued_window_rect (window, &window_rect);
+ gdk_win32_surface_apply_queued_move_resize (window, window_rect);
return TRUE;
}
static void
-gdk_win32_window_end_paint (GdkWindow *window)
+gdk_win32_surface_end_paint (GdkSurface *window)
{
- /* FIXME: Possibly make gdk_win32_window_end_paint() a
+ /* FIXME: Possibly make gdk_win32_surface_end_paint() a
* no-op stub, like what is done in Wayland, as
* the items here rely on layered window usage,
* when we transition to full GL drawing, as
* layered windows do not support enough GL
* for our needs here
*/
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
RECT window_rect;
HDC hdc;
POINT window_position;
@@ -385,10 +385,10 @@ gdk_win32_window_end_paint (GdkWindow *window)
BLENDFUNCTION blender;
cairo_t *cr;
- if (window == NULL || GDK_WINDOW_DESTROYED (window))
+ if (window == NULL || GDK_SURFACE_DESTROYED (window))
return;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* GL windows are moved *before* repaint */
/*if (window->current_paint.use_gl)
@@ -404,11 +404,11 @@ gdk_win32_window_end_paint (GdkWindow *window)
impl->drag_move_resize_context.native_move_resize_pending = FALSE;
/* Get the position/size of the window that GDK wants. */
- gdk_win32_window_get_queued_window_rect (window, &window_rect);
+ gdk_win32_surface_get_queued_window_rect (window, &window_rect);
if (!impl->layered)
{
- gdk_win32_window_apply_queued_move_resize (window, window_rect);
+ gdk_win32_surface_apply_queued_move_resize (window, window_rect);
return;
}
@@ -445,53 +445,53 @@ gdk_win32_window_end_paint (GdkWindow *window)
hdc = cairo_win32_surface_get_dc (impl->cache_surface);
/* Don't use UpdateLayeredWindow on minimized windows */
- if (IsIconic (GDK_WINDOW_HWND (window)))
+ if (IsIconic (GDK_SURFACE_HWND (window)))
{
- gdk_win32_window_apply_queued_move_resize (window, window_rect);
+ gdk_win32_surface_apply_queued_move_resize (window, window_rect);
return;
}
/* Move, resize and redraw layered window in one call */
- API_CALL (UpdateLayeredWindow, (GDK_WINDOW_HWND (window), NULL,
+ API_CALL (UpdateLayeredWindow, (GDK_SURFACE_HWND (window), NULL,
&window_position, &window_size,
hdc, &source_point,
0, &blender, ULW_ALPHA));
}
void
-_gdk_win32_adjust_client_rect (GdkWindow *window,
+_gdk_win32_adjust_client_rect (GdkSurface *window,
RECT *rect)
{
LONG style, exstyle;
- style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
- exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
+ style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
+ exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
API_CALL (AdjustWindowRectEx, (rect, style, FALSE, exstyle));
}
gboolean
-_gdk_win32_window_enable_transparency (GdkWindow *window)
+_gdk_win32_surface_enable_transparency (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
DWM_BLURBEHIND blur_behind;
HRGN empty_region;
HRESULT call_result;
HWND parent, thiswindow;
- if (window == NULL || GDK_WINDOW_HWND (window) == NULL)
+ if (window == NULL || GDK_SURFACE_HWND (window) == NULL)
return FALSE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* layered windows don't need blurbehind for transparency */
if (impl->layered)
return TRUE;
- if (!gdk_display_is_composited (gdk_window_get_display (window)))
+ if (!gdk_display_is_composited (gdk_surface_get_display (window)))
return FALSE;
- thiswindow = GDK_WINDOW_HWND (window);
+ thiswindow = GDK_SURFACE_HWND (window);
/* Blurbehind only works on toplevel windows */
parent = GetAncestor (thiswindow, GA_PARENT);
@@ -533,12 +533,12 @@ get_default_title (void)
/* RegisterGdkClass
* is a wrapper function for RegisterWindowClassEx.
* It creates at least one unique class for every
- * GdkWindowType. If support for single window-specific icons
+ * GdkSurfaceType. If support for single window-specific icons
* is ever needed (e.g Dialog specific), every such window should
* get its own class
*/
static ATOM
-RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
+RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint)
{
static ATOM klassTOPLEVEL = 0;
static ATOM klassCHILD = 0;
@@ -553,7 +553,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
wcl.style = 0; /* DON'T set CS_<H,V>REDRAW. It causes total redraw
* on WM_SIZE and WM_MOVE. Flicker, Performance!
*/
- wcl.lpfnWndProc = _gdk_win32_window_procedure;
+ wcl.lpfnWndProc = _gdk_win32_surface_procedure;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hInstance = _gdk_app_hmodule;
@@ -610,7 +610,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
switch (wtype)
{
- case GDK_WINDOW_TOPLEVEL:
+ case GDK_SURFACE_TOPLEVEL:
/* MSDN: CS_OWNDC is needed for OpenGL contexts */
wcl.style |= CS_OWNDC;
if (0 == klassTOPLEVEL)
@@ -623,10 +623,10 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
klass = klassTOPLEVEL;
break;
- case GDK_WINDOW_TEMP:
- if ((wtype_hint == GDK_WINDOW_TYPE_HINT_MENU) ||
- (wtype_hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU) ||
- (wtype_hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU))
+ case GDK_SURFACE_TEMP:
+ if ((wtype_hint == GDK_SURFACE_TYPE_HINT_MENU) ||
+ (wtype_hint == GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU) ||
+ (wtype_hint == GDK_SURFACE_TYPE_HINT_POPUP_MENU))
{
if (klassTEMPSHADOW == 0)
{
@@ -654,7 +654,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
}
break;
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
default:
g_assert_not_reached ();
break;
@@ -685,18 +685,18 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
* [1] http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00214.html
*/
void
-_gdk_win32_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_win32_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
HWND hwndNew;
HANDLE hparent;
ATOM klass = 0;
DWORD dwStyle = 0, dwExStyle;
RECT rect;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GdkWin32Display *display_win32;
const gchar *title;
wchar_t *wtitle;
@@ -707,23 +707,23 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
g_return_if_fail (display == _gdk_display);
GDK_NOTE (MISC,
- g_print ("_gdk_window_impl_new: %s %s\n", (window->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
- (window->window_type == GDK_WINDOW_TEMP ? "TEMP" : "???")),
+ g_print ("_gdk_surface_impl_new: %s %s\n", (window->surface_type == GDK_SURFACE_TOPLEVEL ? "TOPLEVEL" :
+ (window->surface_type == GDK_SURFACE_TEMP ? "TEMP" : "???")),
(attributes->wclass == GDK_INPUT_OUTPUT ? "" : "input-only")));
- hparent = (real_parent != NULL) ? GDK_WINDOW_HWND (real_parent) : NULL;
+ hparent = (real_parent != NULL) ? GDK_SURFACE_HWND (real_parent) : NULL;
- impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
- impl->wrapper = GDK_WINDOW (window);
- window->impl = GDK_WINDOW_IMPL (impl);
+ impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WIN32, NULL);
+ impl->wrapper = GDK_SURFACE (window);
+ window->impl = GDK_SURFACE_IMPL (impl);
impl->layered = FALSE;
impl->layered_opacity = 1.0;
display_win32 = GDK_WIN32_DISPLAY (display);
- impl->window_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL);
- impl->unscaled_width = window->width * impl->window_scale;
- impl->unscaled_height = window->height * impl->window_scale;
+ impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL);
+ impl->unscaled_width = window->width * impl->surface_scale;
+ impl->unscaled_height = window->height * impl->surface_scale;
if (!window->input_only)
{
@@ -739,23 +739,23 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
GDK_NOTE (MISC, g_print ("... GDK_INPUT_ONLY\n"));
}
- switch (window->window_type)
+ switch (window->surface_type)
{
- case GDK_WINDOW_TOPLEVEL:
+ case GDK_SURFACE_TOPLEVEL:
if (window->parent)
{
/* The common code warns for this case. */
hparent = GetDesktopWindow ();
}
/* Children of foreign windows aren't toplevel windows */
- if (real_parent != NULL && GDK_WINDOW_TYPE (real_parent) == GDK_WINDOW_FOREIGN)
+ if (real_parent != NULL && GDK_SURFACE_TYPE (real_parent) == GDK_SURFACE_FOREIGN)
{
dwStyle = WS_CHILDWINDOW | WS_CLIPCHILDREN;
}
else
{
/* MSDN: We need WS_CLIPCHILDREN and WS_CLIPSIBLINGS for GL Context Creation */
- if (window->window_type == GDK_WINDOW_TOPLEVEL)
+ if (window->surface_type == GDK_SURFACE_TOPLEVEL)
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
else
dwStyle = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_CLIPCHILDREN;
@@ -765,7 +765,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
}
break;
- case GDK_WINDOW_TEMP:
+ case GDK_SURFACE_TEMP:
/* A temp window is not necessarily a top level window */
dwStyle = real_parent == NULL ? WS_POPUP : WS_CHILDWINDOW;
dwStyle |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
@@ -775,22 +775,22 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
break;
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
default:
g_assert_not_reached ();
}
- rect.left = window->x * impl->window_scale;
- rect.top = window->y * impl->window_scale;
- rect.right = rect.left + window->width * impl->window_scale;
- rect.bottom = rect.top + window->height * impl->window_scale;
+ rect.left = window->x * impl->surface_scale;
+ rect.top = window->y * impl->surface_scale;
+ rect.right = rect.left + window->width * impl->surface_scale;
+ rect.bottom = rect.top + window->height * impl->surface_scale;
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
- real_x = (window->x - offset_x) * impl->window_scale;
- real_y = (window->y - offset_y) * impl->window_scale;
+ real_x = (window->x - offset_x) * impl->surface_scale;
+ real_y = (window->y - offset_y) * impl->surface_scale;
- if (window->window_type == GDK_WINDOW_TOPLEVEL)
+ if (window->surface_type == GDK_SURFACE_TOPLEVEL)
{
/* We initially place it at default so that we can get the
default window positioning if we want */
@@ -812,7 +812,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask;
- if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
+ if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY)
dwExStyle |= WS_EX_TOOLWINDOW;
/* WS_EX_TRANSPARENT means "try draw this window last, and ignore input".
@@ -820,10 +820,10 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
* input, because that will make it a potential drop target, and if it's
* under the mouse cursor, this will kill any DND.
*/
- if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DND)
+ if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DND)
dwExStyle |= WS_EX_TRANSPARENT;
- klass = RegisterGdkClass (window->window_type, impl->type_hint);
+ klass = RegisterGdkClass (window->surface_type, impl->type_hint);
wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
@@ -838,10 +838,10 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
NULL,
_gdk_app_hmodule,
window);
- if (GDK_WINDOW_HWND (window) != hwndNew)
+ if (GDK_SURFACE_HWND (window) != hwndNew)
{
- g_warning ("gdk_window_new: gdk_event_translate::WM_CREATE (%p, %p) HWND mismatch.",
- GDK_WINDOW_HWND (window),
+ g_warning ("gdk_surface_new: gdk_event_translate::WM_CREATE (%p, %p) HWND mismatch.",
+ GDK_SURFACE_HWND (window),
hwndNew);
/* HB: IHMO due to a race condition the handle was increased by
@@ -850,9 +850,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
* To reproduce: compile with MSVC 5, DEBUG=1
*/
# if 0
- gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
- GDK_WINDOW_HWND (window) = hwndNew;
- gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+ gdk_win32_handle_table_remove (GDK_SURFACE_HWND (window));
+ GDK_SURFACE_HWND (window) = hwndNew;
+ gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window);
# else
/* the old behaviour, but with warning */
impl->handle = hwndNew;
@@ -860,21 +860,21 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
}
- GetWindowRect (GDK_WINDOW_HWND (window), &rect);
+ GetWindowRect (GDK_SURFACE_HWND (window), &rect);
impl->initial_x = rect.left;
impl->initial_y = rect.top;
/* Now we know the initial position, move to actually specified position */
if (real_x != x || real_y != y)
{
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
real_x, real_y, 0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER));
}
g_object_ref (window);
- gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+ gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window);
GDK_NOTE (MISC, g_print ("... \"%s\" %dx%d@%+d%+d %p = %p\n",
title,
@@ -882,10 +882,10 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
window->x - offset_x,
window->y - offset_y,
hparent,
- GDK_WINDOW_HWND (window)));
+ GDK_SURFACE_HWND (window)));
/* Add window handle to title */
- GDK_NOTE (MISC_OR_EVENTS, gdk_window_set_title (window, title));
+ GDK_NOTE (MISC_OR_EVENTS, gdk_surface_set_title (window, title));
g_free (wtitle);
@@ -896,30 +896,30 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
return;
}
-// if (!from_set_skip_taskbar_hint && window->window_type == GDK_WINDOW_TEMP)
-// gdk_window_set_skip_taskbar_hint (window, TRUE);
+// if (!from_set_skip_taskbar_hint && window->surface_type == GDK_SURFACE_TEMP)
+// gdk_surface_set_skip_taskbar_hint (window, TRUE);
- _gdk_win32_window_enable_transparency (window);
+ _gdk_win32_surface_enable_transparency (window);
}
-GdkWindow *
-gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
+GdkSurface *
+gdk_win32_surface_foreign_new_for_display (GdkDisplay *display,
HWND anid)
{
- GdkWindow *window;
- GdkWindowImplWin32 *impl;
+ GdkSurface *window;
+ GdkSurfaceImplWin32 *impl;
HANDLE parent;
RECT rect;
POINT point;
- if ((window = gdk_win32_window_lookup_for_display (display, anid)) != NULL)
+ if ((window = gdk_win32_surface_lookup_for_display (display, anid)) != NULL)
return g_object_ref (window);
window = _gdk_display_create_window (display);
- window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
- window->impl_window = window;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ window->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WIN32, NULL);
+ window->impl_surface = window;
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->wrapper = window;
parent = GetParent (anid);
@@ -932,128 +932,128 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
ClientToScreen ((HWND) anid, &point);
if (parent != GetDesktopWindow ())
ScreenToClient (parent, &point);
- window->x = point.x / impl->window_scale;
- window->y = point.y / impl->window_scale;
+ window->x = point.x / impl->surface_scale;
+ window->y = point.y / impl->surface_scale;
impl->unscaled_width = rect.right - rect.left;
impl->unscaled_height = rect.bottom - rect.top;
- window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale;
- window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale;
- window->window_type = GDK_WINDOW_FOREIGN;
+ window->width = (impl->unscaled_width + impl->surface_scale - 1) / impl->surface_scale;
+ window->height = (impl->unscaled_height + impl->surface_scale - 1) / impl->surface_scale;
+ window->surface_type = GDK_SURFACE_FOREIGN;
window->destroyed = FALSE;
window->event_mask = GDK_ALL_EVENTS_MASK; /* XXX */
if (IsWindowVisible ((HWND) anid))
- window->state &= (~GDK_WINDOW_STATE_WITHDRAWN);
+ window->state &= (~GDK_SURFACE_STATE_WITHDRAWN);
else
- window->state |= GDK_WINDOW_STATE_WITHDRAWN;
+ window->state |= GDK_SURFACE_STATE_WITHDRAWN;
if (GetWindowLong ((HWND)anid, GWL_EXSTYLE) & WS_EX_TOPMOST)
- window->state |= GDK_WINDOW_STATE_ABOVE;
+ window->state |= GDK_SURFACE_STATE_ABOVE;
else
- window->state &= (~GDK_WINDOW_STATE_ABOVE);
- window->state &= (~GDK_WINDOW_STATE_BELOW);
+ window->state &= (~GDK_SURFACE_STATE_ABOVE);
+ window->state &= (~GDK_SURFACE_STATE_BELOW);
window->viewable = TRUE;
- GDK_WINDOW_HWND (window) = anid;
+ GDK_SURFACE_HWND (window) = anid;
g_object_ref (window);
- gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+ gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window);
- GDK_NOTE (MISC, g_print ("gdk_win32_window_foreign_new_for_display: %p: %s@%+d%+d\n",
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_foreign_new_for_display: %p: %s@%+d%+d\n",
(HWND) anid,
- _gdk_win32_window_description (window),
+ _gdk_win32_surface_description (window),
window->x, window->y));
return window;
}
static void
-gdk_win32_window_destroy (GdkWindow *window,
+gdk_win32_surface_destroy (GdkSurface *window,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GSList *tmp;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- GDK_NOTE (MISC, g_print ("gdk_win32_window_destroy: %p\n",
- GDK_WINDOW_HWND (window)));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_destroy: %p\n",
+ GDK_SURFACE_HWND (window)));
/* Remove ourself from the modal stack */
_gdk_remove_modal_window (window);
/* Remove all our transient children */
- tmp = window_impl->transient_children;
+ tmp = surface_impl->transient_children;
while (tmp != NULL)
{
- GdkWindow *child = tmp->data;
- GdkWindowImplWin32 *child_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW (child)->impl);
+ GdkSurface *child = tmp->data;
+ GdkSurfaceImplWin32 *child_impl = GDK_SURFACE_IMPL_WIN32 (GDK_SURFACE (child)->impl);
child_impl->transient_owner = NULL;
tmp = tmp->next;
}
- g_slist_free (window_impl->transient_children);
- window_impl->transient_children = NULL;
+ g_slist_free (surface_impl->transient_children);
+ surface_impl->transient_children = NULL;
/* Remove ourself from our transient owner */
- if (window_impl->transient_owner != NULL)
+ if (surface_impl->transient_owner != NULL)
{
- gdk_window_set_transient_for (window, NULL);
+ gdk_surface_set_transient_for (window, NULL);
}
if (!recursing && !foreign_destroy)
{
window->destroyed = TRUE;
- DestroyWindow (GDK_WINDOW_HWND (window));
+ DestroyWindow (GDK_SURFACE_HWND (window));
}
}
/* This function is called when the window really gone.
*/
static void
-gdk_win32_window_destroy_notify (GdkWindow *window)
+gdk_win32_surface_destroy_notify (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
GDK_NOTE (EVENTS,
- g_print ("gdk_window_destroy_notify: %p%s\n",
- GDK_WINDOW_HWND (window),
- (GDK_WINDOW_DESTROYED (window) ? " (destroyed)" : "")));
+ g_print ("gdk_surface_destroy_notify: %p%s\n",
+ GDK_SURFACE_HWND (window),
+ (GDK_SURFACE_DESTROYED (window) ? " (destroyed)" : "")));
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (window))
{
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+ if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
g_warning ("window %p unexpectedly destroyed",
- GDK_WINDOW_HWND (window));
+ GDK_SURFACE_HWND (window));
- _gdk_window_destroy (window, TRUE);
+ _gdk_surface_destroy (window, TRUE);
}
- gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
+ gdk_win32_handle_table_remove (GDK_SURFACE_HWND (window));
g_object_unref (window);
}
static void
-get_outer_rect (GdkWindow *window,
+get_outer_rect (GdkSurface *window,
gint width,
gint height,
RECT *rect)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
rect->left = rect->top = 0;
- rect->right = width * impl->window_scale;
- rect->bottom = height * impl->window_scale;
+ rect->right = width * impl->surface_scale;
+ rect->bottom = height * impl->surface_scale;
_gdk_win32_adjust_client_rect (window, rect);
}
static void
-adjust_for_gravity_hints (GdkWindow *window,
+adjust_for_gravity_hints (GdkSurface *window,
RECT *outer_rect,
gint *x,
gint *y)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->hint_flags & GDK_HINT_WIN_GRAVITY)
{
@@ -1066,19 +1066,19 @@ adjust_for_gravity_hints (GdkWindow *window,
case GDK_GRAVITY_NORTH:
case GDK_GRAVITY_CENTER:
case GDK_GRAVITY_SOUTH:
- *x -= (outer_rect->right - outer_rect->left / 2) / impl->window_scale;
+ *x -= (outer_rect->right - outer_rect->left / 2) / impl->surface_scale;
*x += window->width / 2;
break;
case GDK_GRAVITY_SOUTH_EAST:
case GDK_GRAVITY_EAST:
case GDK_GRAVITY_NORTH_EAST:
- *x -= (outer_rect->right - outer_rect->left) / impl->window_scale;
+ *x -= (outer_rect->right - outer_rect->left) / impl->surface_scale;
*x += window->width;
break;
case GDK_GRAVITY_STATIC:
- *x += outer_rect->left / impl->window_scale;
+ *x += outer_rect->left / impl->surface_scale;
break;
default:
@@ -1090,19 +1090,19 @@ adjust_for_gravity_hints (GdkWindow *window,
case GDK_GRAVITY_WEST:
case GDK_GRAVITY_CENTER:
case GDK_GRAVITY_EAST:
- *y -= ((outer_rect->bottom - outer_rect->top) / 2) / impl->window_scale;
+ *y -= ((outer_rect->bottom - outer_rect->top) / 2) / impl->surface_scale;
*y += window->height / 2;
break;
case GDK_GRAVITY_SOUTH_WEST:
case GDK_GRAVITY_SOUTH:
case GDK_GRAVITY_SOUTH_EAST:
- *y -= (outer_rect->bottom - outer_rect->top) / impl->window_scale;
+ *y -= (outer_rect->bottom - outer_rect->top) / impl->surface_scale;
*y += window->height;
break;
case GDK_GRAVITY_STATIC:
- *y += outer_rect->top * impl->window_scale;
+ *y += outer_rect->top * impl->surface_scale;
break;
default:
@@ -1117,11 +1117,11 @@ adjust_for_gravity_hints (GdkWindow *window,
}
static void
-show_window_internal (GdkWindow *window,
+show_window_internal (GdkSurface *window,
gboolean already_mapped,
gboolean deiconify)
{
- GdkWindowImplWin32 *window_impl;
+ GdkSurfaceImplWin32 *surface_impl;
gboolean focus_on_map = FALSE;
DWORD exstyle;
@@ -1129,8 +1129,8 @@ show_window_internal (GdkWindow *window,
return;
GDK_NOTE (MISC, g_print ("show_window_internal: %p: %s%s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state),
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state),
(deiconify ? " deiconify" : "")));
/* If asked to show (not deiconify) an withdrawn and iconified
@@ -1138,27 +1138,27 @@ show_window_internal (GdkWindow *window,
*/
if (!deiconify &&
!already_mapped &&
- (window->state & GDK_WINDOW_STATE_ICONIFIED))
+ (window->state & GDK_SURFACE_STATE_ICONIFIED))
{
GtkShowWindow (window, SW_SHOWMINNOACTIVE);
return;
}
/* If asked to just show an iconified window, do nothing. */
- if (!deiconify && (window->state & GDK_WINDOW_STATE_ICONIFIED))
+ if (!deiconify && (window->state & GDK_SURFACE_STATE_ICONIFIED))
return;
/* If asked to deiconify an already noniconified window, do
* nothing. (Especially, don't cause the window to rise and
* activate. There are different calls for that.)
*/
- if (deiconify && !(window->state & GDK_WINDOW_STATE_ICONIFIED))
+ if (deiconify && !(window->state & GDK_SURFACE_STATE_ICONIFIED))
return;
/* If asked to show (but not raise) a window that is already
* visible, do nothing.
*/
- if (!deiconify && !already_mapped && IsWindowVisible (GDK_WINDOW_HWND (window)))
+ if (!deiconify && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window)))
return;
/* Other cases */
@@ -1166,7 +1166,7 @@ show_window_internal (GdkWindow *window,
if (!already_mapped)
focus_on_map = window->focus_on_map;
- exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
+ exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
/* Use SetWindowPos to show transparent windows so automatic redraws
* in other windows can be suppressed.
@@ -1175,10 +1175,10 @@ show_window_internal (GdkWindow *window,
{
UINT flags = SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
- if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
+ if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || !focus_on_map)
flags |= SWP_NOACTIVATE;
- SetWindowPos (GDK_WINDOW_HWND (window),
+ SetWindowPos (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED, 0, 0, 0, 0, flags);
return;
@@ -1193,24 +1193,24 @@ show_window_internal (GdkWindow *window,
* + Certain window types and hints have more elaborate positioning
* schemes.
*/
- window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (!already_mapped &&
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL &&
- (window_impl->hint_flags & (GDK_HINT_POS | GDK_HINT_USER_POS)) == 0)
+ GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL &&
+ (surface_impl->hint_flags & (GDK_HINT_POS | GDK_HINT_USER_POS)) == 0)
{
gboolean center = FALSE;
RECT window_rect, center_on_rect;
int x, y;
- x = window_impl->initial_x;
- y = window_impl->initial_y;
+ x = surface_impl->initial_x;
+ y = surface_impl->initial_y;
- if (window_impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
+ if (surface_impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN)
{
HMONITOR monitor;
MONITORINFO mi;
- monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST);
mi.cbSize = sizeof (mi);
if (monitor && GetMonitorInfo (monitor, &mi))
center_on_rect = mi.rcMonitor;
@@ -1223,17 +1223,17 @@ show_window_internal (GdkWindow *window,
}
center = TRUE;
}
- else if (window_impl->transient_owner != NULL &&
- GDK_WINDOW_IS_MAPPED (window_impl->transient_owner))
+ else if (surface_impl->transient_owner != NULL &&
+ GDK_SURFACE_IS_MAPPED (surface_impl->transient_owner))
{
- GdkWindow *owner = window_impl->transient_owner;
+ GdkSurface *owner = surface_impl->transient_owner;
/* Center on transient parent */
- center_on_rect.left = (owner->x - _gdk_offset_x) * window_impl->window_scale;
- center_on_rect.top = (owner->y - _gdk_offset_y) * window_impl->window_scale;
- center_on_rect.right = center_on_rect.left + owner->width * window_impl->window_scale;
- center_on_rect.bottom = center_on_rect.top + owner->height * window_impl->window_scale;
+ center_on_rect.left = (owner->x - _gdk_offset_x) * surface_impl->surface_scale;
+ center_on_rect.top = (owner->y - _gdk_offset_y) * surface_impl->surface_scale;
+ center_on_rect.right = center_on_rect.left + owner->width * surface_impl->surface_scale;
+ center_on_rect.bottom = center_on_rect.top + owner->height * surface_impl->surface_scale;
- _gdk_win32_adjust_client_rect (GDK_WINDOW (owner), &center_on_rect);
+ _gdk_win32_adjust_client_rect (GDK_SURFACE (owner), &center_on_rect);
center = TRUE;
}
@@ -1241,22 +1241,22 @@ show_window_internal (GdkWindow *window,
{
window_rect.left = 0;
window_rect.top = 0;
- window_rect.right = window->width * window_impl->window_scale;
- window_rect.bottom = window->height * window_impl->window_scale;
+ window_rect.right = window->width * surface_impl->surface_scale;
+ window_rect.bottom = window->height * surface_impl->surface_scale;
_gdk_win32_adjust_client_rect (window, &window_rect);
x = center_on_rect.left + ((center_on_rect.right - center_on_rect.left) - (window_rect.right - window_rect.left)) / 2;
y = center_on_rect.top + ((center_on_rect.bottom - center_on_rect.top) - (window_rect.bottom - window_rect.top)) / 2;
}
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
x, y, 0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER));
}
if (!already_mapped &&
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
+ GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL)
{
/* Ensure new windows are fully onscreen */
RECT window_rect;
@@ -1264,9 +1264,9 @@ show_window_internal (GdkWindow *window,
MONITORINFO mi;
int x, y;
- GetWindowRect (GDK_WINDOW_HWND (window), &window_rect);
+ GetWindowRect (GDK_SURFACE_HWND (window), &window_rect);
- monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST);
mi.cbSize = sizeof (mi);
if (monitor && GetMonitorInfo (monitor, &mi))
{
@@ -1298,7 +1298,7 @@ show_window_internal (GdkWindow *window,
}
if (x != window_rect.left || y != window_rect.top)
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
window_rect.left, window_rect.top, 0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER));
@@ -1306,29 +1306,29 @@ show_window_internal (GdkWindow *window,
}
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
{
- gdk_window_fullscreen (window);
+ gdk_surface_fullscreen (window);
}
- else if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
+ else if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
{
GtkShowWindow (window, SW_MAXIMIZE);
}
- else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
+ else if (window->state & GDK_SURFACE_STATE_ICONIFIED)
{
if (focus_on_map)
GtkShowWindow (window, SW_RESTORE);
else
GtkShowWindow (window, SW_SHOWNOACTIVATE);
}
- else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
+ else if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || !focus_on_map)
{
- if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
+ if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
GtkShowWindow (window, SW_SHOWNOACTIVATE);
else
GtkShowWindow (window, SW_SHOWNA);
}
- else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
+ else if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
{
GtkShowWindow (window, SW_SHOWNORMAL);
}
@@ -1338,52 +1338,52 @@ show_window_internal (GdkWindow *window,
}
/* Sync STATE_ABOVE to TOPMOST */
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP &&
- (((window->state & GDK_WINDOW_STATE_ABOVE) &&
+ if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TEMP &&
+ (((window->state & GDK_SURFACE_STATE_ABOVE) &&
!(exstyle & WS_EX_TOPMOST)) ||
- (!(window->state & GDK_WINDOW_STATE_ABOVE) &&
+ (!(window->state & GDK_SURFACE_STATE_ABOVE) &&
(exstyle & WS_EX_TOPMOST))))
{
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
- (window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
+ (window->state & GDK_SURFACE_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
}
static void
-gdk_win32_window_show (GdkWindow *window,
+gdk_win32_surface_show (GdkSurface *window,
gboolean already_mapped)
{
show_window_internal (window, FALSE, FALSE);
}
static void
-gdk_win32_window_hide (GdkWindow *window)
+gdk_win32_surface_hide (GdkSurface *window)
{
if (window->destroyed)
return;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_hide: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_hide: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (GDK_WINDOW_IS_MAPPED (window))
- gdk_synthesize_window_state (window,
+ if (GDK_SURFACE_IS_MAPPED (window))
+ gdk_synthesize_surface_state (window,
0,
- GDK_WINDOW_STATE_WITHDRAWN);
+ GDK_SURFACE_STATE_WITHDRAWN);
- _gdk_window_clear_update_area (window);
+ _gdk_surface_clear_update_area (window);
- if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
- ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE);
+ if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL)
+ ShowOwnedPopups (GDK_SURFACE_HWND (window), FALSE);
/* Use SetWindowPos to hide transparent windows so automatic redraws
* in other windows can be suppressed.
*/
- if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
+ if (GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
{
- SetWindowPos (GDK_WINDOW_HWND (window), SWP_NOZORDER_SPECIFIED,
+ SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED,
0, 0, 0, 0,
SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
}
@@ -1394,45 +1394,45 @@ gdk_win32_window_hide (GdkWindow *window)
}
static void
-gdk_win32_window_withdraw (GdkWindow *window)
+gdk_win32_surface_withdraw (GdkSurface *window)
{
if (window->destroyed)
return;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_withdraw: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_withdraw: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- gdk_window_hide (window); /* ??? */
+ gdk_surface_hide (window); /* ??? */
}
static void
-gdk_win32_window_move (GdkWindow *window,
+gdk_win32_surface_move (GdkSurface *window,
gint x, gint y)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_move: %p: %+d%+d\n",
- GDK_WINDOW_HWND (window), x, y));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_move: %p: %+d%+d\n",
+ GDK_SURFACE_HWND (window), x, y));
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
- /* Don't check GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD.
+ /* Don't check GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD.
* Foreign windows (another app's windows) might be children of our
* windows! Especially in the case of gtkplug/socket.
*/
- if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ())
+ if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ())
{
- _gdk_window_move_resize_child (window, x, y, window->width, window->height);
+ _gdk_surface_move_resize_child (window, x, y, window->width, window->height);
}
else
{
RECT outer_rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
get_outer_rect (window, window->width, window->height, &outer_rect);
@@ -1440,26 +1440,26 @@ gdk_win32_window_move (GdkWindow *window,
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,0,0,"
"NOACTIVATE|NOSIZE|NOZORDER)\n",
- GDK_WINDOW_HWND (window),
- (x - _gdk_offset_x) * impl->window_scale,
- (y - _gdk_offset_y) * impl->window_scale));
+ GDK_SURFACE_HWND (window),
+ (x - _gdk_offset_x) * impl->surface_scale,
+ (y - _gdk_offset_y) * impl->surface_scale));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
- (x - _gdk_offset_x) * impl->window_scale,
- (y - _gdk_offset_y) * impl->window_scale,
+ (x - _gdk_offset_x) * impl->surface_scale,
+ (y - _gdk_offset_y) * impl->surface_scale,
0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER));
}
}
static void
-gdk_win32_window_resize (GdkWindow *window,
+gdk_win32_surface_resize (GdkSurface *window,
gint width, gint height)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
if (width < 1)
@@ -1467,30 +1467,30 @@ gdk_win32_window_resize (GdkWindow *window,
if (height < 1)
height = 1;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_resize: %p: %dx%d\n",
- GDK_WINDOW_HWND (window), width, height));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_resize: %p: %dx%d\n",
+ GDK_SURFACE_HWND (window), width, height));
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
- if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ())
+ if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ())
{
- _gdk_window_move_resize_child (window, window->x, window->y, width, height);
+ _gdk_surface_move_resize_child (window, window->x, window->y, width, height);
}
else
{
RECT outer_rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
get_outer_rect (window, width, height, &outer_rect);
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,0,0,%ld,%ld,"
"NOACTIVATE|NOMOVE|NOZORDER)\n",
- GDK_WINDOW_HWND (window),
+ GDK_SURFACE_HWND (window),
outer_rect.right - outer_rect.left,
outer_rect.bottom - outer_rect.top));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
0, 0,
outer_rect.right - outer_rect.left,
@@ -1501,15 +1501,15 @@ gdk_win32_window_resize (GdkWindow *window,
}
static void
-gdk_win32_window_move_resize_internal (GdkWindow *window,
+gdk_win32_surface_move_resize_internal (GdkSurface *window,
gint x,
gint y,
gint width,
gint height)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
if (width < 1)
@@ -1517,21 +1517,21 @@ gdk_win32_window_move_resize_internal (GdkWindow *window,
if (height < 1)
height = 1;
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_move_resize: %p: %dx%d@%+d%+d\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_move_resize: %p: %dx%d@%+d%+d\n",
+ GDK_SURFACE_HWND (window),
width, height, x, y));
- if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ())
+ if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ())
{
- _gdk_window_move_resize_child (window, x, y, width, height);
+ _gdk_surface_move_resize_child (window, x, y, width, height);
}
else
{
RECT outer_rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
get_outer_rect (window, width, height, &outer_rect);
@@ -1539,16 +1539,16 @@ gdk_win32_window_move_resize_internal (GdkWindow *window,
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%ld,%ld,"
"NOACTIVATE|NOZORDER)\n",
- GDK_WINDOW_HWND (window),
- (x - _gdk_offset_x) * impl->window_scale,
- (y - _gdk_offset_y) * impl->window_scale,
+ GDK_SURFACE_HWND (window),
+ (x - _gdk_offset_x) * impl->surface_scale,
+ (y - _gdk_offset_y) * impl->surface_scale,
outer_rect.right - outer_rect.left,
outer_rect.bottom - outer_rect.top));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
- (x - _gdk_offset_x) * impl->window_scale,
- (y - _gdk_offset_y) * impl->window_scale,
+ (x - _gdk_offset_x) * impl->surface_scale,
+ (y - _gdk_offset_y) * impl->surface_scale,
outer_rect.right - outer_rect.left,
outer_rect.bottom - outer_rect.top,
SWP_NOACTIVATE | SWP_NOZORDER));
@@ -1556,56 +1556,56 @@ gdk_win32_window_move_resize_internal (GdkWindow *window,
}
static void
-gdk_win32_window_move_resize (GdkWindow *window,
+gdk_win32_surface_move_resize (GdkSurface *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplWin32 *window_impl;
+ GdkSurfaceImplWin32 *surface_impl;
- window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- window_impl->inhibit_configure = TRUE;
+ surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ surface_impl->inhibit_configure = TRUE;
/* We ignore changes to the window being moved or resized by the
user, as we don't want to fight the user */
- if (GDK_WINDOW_HWND (window) == _modal_move_resize_window)
+ if (GDK_SURFACE_HWND (window) == _modal_move_resize_window)
goto out;
if (with_move && (width < 0 && height < 0))
{
- gdk_win32_window_move (window, x, y);
+ gdk_win32_surface_move (window, x, y);
}
else
{
if (with_move)
{
- gdk_win32_window_move_resize_internal (window, x, y, width, height);
+ gdk_win32_surface_move_resize_internal (window, x, y, width, height);
}
else
{
- gdk_win32_window_resize (window, width, height);
+ gdk_win32_surface_resize (window, width, height);
}
}
out:
- window_impl->inhibit_configure = FALSE;
+ surface_impl->inhibit_configure = FALSE;
- if (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (window))
_gdk_win32_emit_configure_event (window);
}
static void
-gdk_win32_window_raise (GdkWindow *window)
+gdk_win32_surface_raise (GdkSurface *window)
{
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_win32_window_raise: %p\n",
- GDK_WINDOW_HWND (window)));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_raise: %p\n",
+ GDK_SURFACE_HWND (window)));
- if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOPMOST,
+ if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP)
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOPMOST,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
else if (window->accept_focus)
@@ -1613,42 +1613,42 @@ gdk_win32_window_raise (GdkWindow *window)
* fail when for example dragging a window belonging to a different
* application at the time of a gtk_window_present() call due to focus
* stealing prevention. */
- SetForegroundWindow (GDK_WINDOW_HWND (window));
+ SetForegroundWindow (GDK_SURFACE_HWND (window));
else
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOP,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
static void
-gdk_win32_window_lower (GdkWindow *window)
+gdk_win32_surface_lower (GdkSurface *window)
{
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_win32_window_lower: %p\n"
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_lower: %p\n"
"... SetWindowPos(%p,HWND_BOTTOM,0,0,0,0,"
"NOACTIVATE|NOMOVE|NOSIZE)\n",
- GDK_WINDOW_HWND (window),
- GDK_WINDOW_HWND (window)));
+ GDK_SURFACE_HWND (window),
+ GDK_SURFACE_HWND (window)));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_BOTTOM,
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_BOTTOM,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
static void
-gdk_win32_window_set_urgency_hint (GdkWindow *window,
+gdk_win32_surface_set_urgency_hint (GdkSurface *window,
gboolean urgent)
{
FLASHWINFO flashwinfo;
typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
PFN_FlashWindowEx flashWindowEx = NULL;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
flashWindowEx = (PFN_FlashWindowEx) GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx");
@@ -1656,7 +1656,7 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window,
if (flashWindowEx)
{
flashwinfo.cbSize = sizeof (flashwinfo);
- flashwinfo.hwnd = GDK_WINDOW_HWND (window);
+ flashwinfo.hwnd = GDK_SURFACE_HWND (window);
if (urgent)
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
else
@@ -1668,22 +1668,22 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window,
}
else
{
- FlashWindow (GDK_WINDOW_HWND (window), urgent);
+ FlashWindow (GDK_SURFACE_HWND (window), urgent);
}
}
static gboolean
-get_effective_window_decorations (GdkWindow *window,
+get_effective_window_decorations (GdkSurface *window,
GdkWMDecoration *decoration)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = (GdkWindowImplWin32 *)window->impl;
+ impl = (GdkSurfaceImplWin32 *)window->impl;
- if (gdk_window_get_decorations (window, decoration))
+ if (gdk_surface_get_decorations (window, decoration))
return TRUE;
- if (window->window_type != GDK_WINDOW_TOPLEVEL)
+ if (window->surface_type != GDK_SURFACE_TOPLEVEL)
{
return FALSE;
}
@@ -1695,13 +1695,13 @@ get_effective_window_decorations (GdkWindow *window,
{
*decoration = GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MAXIMIZE;
- if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR)
+ if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_MENU ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_TOOLBAR)
{
*decoration |= GDK_DECOR_MINIMIZE;
}
- else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
+ else if (impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN)
{
*decoration |= GDK_DECOR_MENU | GDK_DECOR_MINIMIZE;
}
@@ -1711,9 +1711,9 @@ get_effective_window_decorations (GdkWindow *window,
else if (impl->hint_flags & GDK_HINT_MAX_SIZE)
{
*decoration = GDK_DECOR_ALL | GDK_DECOR_MAXIMIZE;
- if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU ||
- impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR)
+ if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_MENU ||
+ impl->type_hint == GDK_SURFACE_TYPE_HINT_TOOLBAR)
{
*decoration |= GDK_DECOR_MINIMIZE;
}
@@ -1724,35 +1724,35 @@ get_effective_window_decorations (GdkWindow *window,
{
switch (impl->type_hint)
{
- case GDK_WINDOW_TYPE_HINT_DIALOG:
+ case GDK_SURFACE_TYPE_HINT_DIALOG:
*decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
return TRUE;
- case GDK_WINDOW_TYPE_HINT_MENU:
+ case GDK_SURFACE_TYPE_HINT_MENU:
*decoration = (GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
return TRUE;
- case GDK_WINDOW_TYPE_HINT_TOOLBAR:
- case GDK_WINDOW_TYPE_HINT_UTILITY:
- gdk_window_set_skip_taskbar_hint (window, TRUE);
- gdk_window_set_skip_pager_hint (window, TRUE);
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
+ gdk_surface_set_skip_taskbar_hint (window, TRUE);
+ gdk_surface_set_skip_pager_hint (window, TRUE);
*decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
return TRUE;
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
*decoration = (GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MENU |
GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
return TRUE;
- case GDK_WINDOW_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_DOCK:
return FALSE;
- case GDK_WINDOW_TYPE_HINT_DESKTOP:
+ case GDK_SURFACE_TYPE_HINT_DESKTOP:
return FALSE;
default:
/* Fall thru */
- case GDK_WINDOW_TYPE_HINT_NORMAL:
+ case GDK_SURFACE_TYPE_HINT_NORMAL:
*decoration = GDK_DECOR_ALL;
return TRUE;
}
@@ -1762,22 +1762,22 @@ get_effective_window_decorations (GdkWindow *window,
}
static void
-gdk_win32_window_set_geometry_hints (GdkWindow *window,
+gdk_win32_surface_set_geometry_hints (GdkSurface *window,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
+ GdkSurfaceHints geom_mask)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
FullscreenInfo *fi;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_set_geometry_hints: %p\n",
- GDK_WINDOW_HWND (window)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_geometry_hints: %p\n",
+ GDK_SURFACE_HWND (window)));
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
fi = g_object_get_data (G_OBJECT (window), "fullscreen-info");
if (fi)
@@ -1826,70 +1826,70 @@ gdk_win32_window_set_geometry_hints (GdkWindow *window,
GDK_NOTE (MISC, g_print ("... GRAVITY: %d\n", geometry->win_gravity));
}
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
}
static void
-gdk_win32_window_set_title (GdkWindow *window,
+gdk_win32_surface_set_title (GdkSurface *window,
const gchar *title)
{
wchar_t *wtitle;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
g_return_if_fail (title != NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
/* Empty window titles not allowed, so set it to just a period. */
if (!title[0])
title = ".";
- GDK_NOTE (MISC, g_print ("gdk_window_set_title: %p: %s\n",
- GDK_WINDOW_HWND (window), title));
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_title: %p: %s\n",
+ GDK_SURFACE_HWND (window), title));
- GDK_NOTE (MISC_OR_EVENTS, title = g_strdup_printf ("%p %s", GDK_WINDOW_HWND (window), title));
+ GDK_NOTE (MISC_OR_EVENTS, title = g_strdup_printf ("%p %s", GDK_SURFACE_HWND (window), title));
wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
- API_CALL (SetWindowTextW, (GDK_WINDOW_HWND (window), wtitle));
+ API_CALL (SetWindowTextW, (GDK_SURFACE_HWND (window), wtitle));
g_free (wtitle);
GDK_NOTE (MISC_OR_EVENTS, g_free ((char *) title));
}
static void
-gdk_win32_window_set_role (GdkWindow *window,
+gdk_win32_surface_set_role (GdkSurface *window,
const gchar *role)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- GDK_NOTE (MISC, g_print ("gdk_window_set_role: %p: %s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_role: %p: %s\n",
+ GDK_SURFACE_HWND (window),
(role ? role : "NULL")));
/* XXX */
}
static void
-gdk_win32_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
+gdk_win32_surface_set_transient_for (GdkSurface *window,
+ GdkSurface *parent)
{
HWND window_id, parent_id;
LONG_PTR old_ptr;
DWORD w32_error;
- GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- GdkWindowImplWin32 *parent_impl = NULL;
+ GdkSurfaceImplWin32 *surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *parent_impl = NULL;
GSList *item;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- window_id = GDK_WINDOW_HWND (window);
- parent_id = parent != NULL ? GDK_WINDOW_HWND (parent) : NULL;
+ window_id = GDK_SURFACE_HWND (window);
+ parent_id = parent != NULL ? GDK_SURFACE_HWND (parent) : NULL;
- GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %p: %p\n", window_id, parent_id));
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_transient_for: %p: %p\n", window_id, parent_id));
- if (GDK_WINDOW_DESTROYED (window) || (parent && GDK_WINDOW_DESTROYED (parent)))
+ if (GDK_SURFACE_DESTROYED (window) || (parent && GDK_SURFACE_DESTROYED (parent)))
{
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
GDK_NOTE (MISC, g_print ("... destroyed!\n"));
else
GDK_NOTE (MISC, g_print ("... owner destroyed!\n"));
@@ -1899,7 +1899,7 @@ gdk_win32_window_set_transient_for (GdkWindow *window,
if (parent == NULL)
{
- GdkWindowImplWin32 *trans_impl = GDK_WINDOW_IMPL_WIN32 (window_impl->transient_owner->impl);
+ GdkSurfaceImplWin32 *trans_impl = GDK_SURFACE_IMPL_WIN32 (surface_impl->transient_owner->impl);
if (trans_impl->transient_children != NULL)
{
item = g_slist_find (trans_impl->transient_children, window);
@@ -1912,19 +1912,19 @@ gdk_win32_window_set_transient_for (GdkWindow *window,
trans_impl->transient_children = NULL;
}
}
- g_object_unref (G_OBJECT (window_impl->transient_owner));
+ g_object_unref (G_OBJECT (surface_impl->transient_owner));
g_object_unref (G_OBJECT (window));
- window_impl->transient_owner = NULL;
+ surface_impl->transient_owner = NULL;
}
else
{
- parent_impl = GDK_WINDOW_IMPL_WIN32 (parent->impl);
+ parent_impl = GDK_SURFACE_IMPL_WIN32 (parent->impl);
parent_impl->transient_children = g_slist_append (parent_impl->transient_children, window);
g_object_ref (G_OBJECT (window));
parent_impl->num_transients++;
- window_impl->transient_owner = parent;
+ surface_impl->transient_owner = parent;
g_object_ref (G_OBJECT (parent));
}
@@ -1954,14 +1954,14 @@ gdk_win32_window_set_transient_for (GdkWindow *window,
}
void
-_gdk_push_modal_window (GdkWindow *window)
+_gdk_push_modal_window (GdkSurface *window)
{
modal_window_stack = g_slist_prepend (modal_window_stack,
window);
}
void
-_gdk_remove_modal_window (GdkWindow *window)
+_gdk_remove_modal_window (GdkSurface *window)
{
GSList *tmp;
@@ -1982,35 +1982,35 @@ _gdk_remove_modal_window (GdkWindow *window)
}
gboolean
-_gdk_modal_blocked (GdkWindow *window)
+_gdk_modal_blocked (GdkSurface *window)
{
GSList *l;
gboolean found_any = FALSE;
for (l = modal_window_stack; l != NULL; l = l->next)
{
- GdkWindow *modal = l->data;
+ GdkSurface *modal = l->data;
if (modal == window)
return FALSE;
- if (GDK_WINDOW_IS_MAPPED (modal))
+ if (GDK_SURFACE_IS_MAPPED (modal))
found_any = TRUE;
}
return found_any;
}
-GdkWindow *
+GdkSurface *
_gdk_modal_current (void)
{
GSList *l;
for (l = modal_window_stack; l != NULL; l = l->next)
{
- GdkWindow *modal = l->data;
+ GdkSurface *modal = l->data;
- if (GDK_WINDOW_IS_MAPPED (modal))
+ if (GDK_SURFACE_IS_MAPPED (modal))
return modal;
}
@@ -2018,7 +2018,7 @@ _gdk_modal_current (void)
}
static void
-gdk_win32_window_get_geometry (GdkWindow *window,
+gdk_win32_surface_get_geometry (GdkSurface *window,
gint *x,
gint *y,
gint *width,
@@ -2027,61 +2027,61 @@ gdk_win32_window_get_geometry (GdkWindow *window,
GdkDisplay *display;
gboolean window_is_root;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (window))
{
RECT rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- API_CALL (GetClientRect, (GDK_WINDOW_HWND (window), &rect));
+ API_CALL (GetClientRect, (GDK_SURFACE_HWND (window), &rect));
POINT pt;
- GdkWindow *parent = gdk_window_get_parent (window);
+ GdkSurface *parent = gdk_surface_get_parent (window);
pt.x = rect.left;
pt.y = rect.top;
- ClientToScreen (GDK_WINDOW_HWND (window), &pt);
+ ClientToScreen (GDK_SURFACE_HWND (window), &pt);
if (parent)
- ScreenToClient (GDK_WINDOW_HWND (parent), &pt);
+ ScreenToClient (GDK_SURFACE_HWND (parent), &pt);
rect.left = pt.x;
rect.top = pt.y;
pt.x = rect.right;
pt.y = rect.bottom;
- ClientToScreen (GDK_WINDOW_HWND (window), &pt);
+ ClientToScreen (GDK_SURFACE_HWND (window), &pt);
if (parent)
- ScreenToClient (GDK_WINDOW_HWND (parent), &pt);
+ ScreenToClient (GDK_SURFACE_HWND (parent), &pt);
rect.right = pt.x;
rect.bottom = pt.y;
if (parent == NULL)
{
- rect.left += _gdk_offset_x * impl->window_scale;
- rect.top += _gdk_offset_y * impl->window_scale;
- rect.right += _gdk_offset_x * impl->window_scale;
- rect.bottom += _gdk_offset_y * impl->window_scale;
+ rect.left += _gdk_offset_x * impl->surface_scale;
+ rect.top += _gdk_offset_y * impl->surface_scale;
+ rect.right += _gdk_offset_x * impl->surface_scale;
+ rect.bottom += _gdk_offset_y * impl->surface_scale;
}
if (x)
- *x = rect.left / impl->window_scale;
+ *x = rect.left / impl->surface_scale;
if (y)
- *y = rect.top / impl->window_scale;
+ *y = rect.top / impl->surface_scale;
if (width)
- *width = (rect.right - rect.left) / impl->window_scale;
+ *width = (rect.right - rect.left) / impl->surface_scale;
if (height)
- *height = (rect.bottom - rect.top) / impl->window_scale;
+ *height = (rect.bottom - rect.top) / impl->surface_scale;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ld@%+ld%\n",
- GDK_WINDOW_HWND (window),
- (rect.right - rect.left) / impl->window_scale,
- (rect.bottom - rect.top) / impl->window_scale,
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_geometry: %p: %ldx%ld@%+ld%\n",
+ GDK_SURFACE_HWND (window),
+ (rect.right - rect.left) / impl->surface_scale,
+ (rect.bottom - rect.top) / impl->surface_scale,
rect.left, rect.top));
}
}
static void
-gdk_win32_window_get_root_coords (GdkWindow *window,
+gdk_win32_surface_get_root_coords (GdkSurface *window,
gint x,
gint y,
gint *root_x,
@@ -2090,44 +2090,44 @@ gdk_win32_window_get_root_coords (GdkWindow *window,
gint tx;
gint ty;
POINT pt;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- pt.x = x * impl->window_scale;
- pt.y = y * impl->window_scale;
- ClientToScreen (GDK_WINDOW_HWND (window), &pt);
+ pt.x = x * impl->surface_scale;
+ pt.y = y * impl->surface_scale;
+ ClientToScreen (GDK_SURFACE_HWND (window), &pt);
tx = pt.x;
ty = pt.y;
if (root_x)
- *root_x = (tx + _gdk_offset_x) / impl->window_scale;
+ *root_x = (tx + _gdk_offset_x) / impl->surface_scale;
if (root_y)
- *root_y = (ty + _gdk_offset_y) / impl->window_scale;
+ *root_y = (ty + _gdk_offset_y) / impl->surface_scale;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_get_root_coords: %p: %+d%+d %+d%+d\n",
- GDK_WINDOW_HWND (window),
- x * impl->window_scale,
- y * impl->window_scale,
- (tx + _gdk_offset_x) / impl->window_scale,
- (ty + _gdk_offset_y) / impl->window_scale));
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_root_coords: %p: %+d%+d %+d%+d\n",
+ GDK_SURFACE_HWND (window),
+ x * impl->surface_scale,
+ y * impl->surface_scale,
+ (tx + _gdk_offset_x) / impl->surface_scale,
+ (ty + _gdk_offset_y) / impl->surface_scale));
}
static void
-gdk_win32_window_restack_toplevel (GdkWindow *window,
- GdkWindow *sibling,
+gdk_win32_surface_restack_toplevel (GdkSurface *window,
+ GdkSurface *sibling,
gboolean above)
{
// ### TODO
}
static void
-gdk_win32_window_get_frame_extents (GdkWindow *window,
+gdk_win32_surface_get_frame_extents (GdkSurface *window,
GdkRectangle *rect)
{
HWND hwnd;
RECT r;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
g_return_if_fail (rect != NULL);
rect->x = 0;
@@ -2135,50 +2135,50 @@ gdk_win32_window_get_frame_extents (GdkWindow *window,
rect->width = 1;
rect->height = 1;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- /* FIXME: window is documented to be a toplevel GdkWindow, so is it really
+ /* FIXME: window is documented to be a toplevel GdkSurface, so is it really
* necessary to walk its parent chain?
*/
while (window->parent && window->parent->parent)
window = window->parent;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- hwnd = GDK_WINDOW_HWND (window);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ hwnd = GDK_SURFACE_HWND (window);
API_CALL (GetWindowRect, (hwnd, &r));
/* Initialize to real, unscaled size */
- rect->x = r.left + _gdk_offset_x * impl->window_scale;
- rect->y = r.top + _gdk_offset_y * impl->window_scale;
+ rect->x = r.left + _gdk_offset_x * impl->surface_scale;
+ rect->y = r.top + _gdk_offset_y * impl->surface_scale;
rect->width = (r.right - r.left);
rect->height = (r.bottom - r.top);
/* Extend width and height to ensure that they cover the real size when de-scaled,
* and replace everyting with scaled values
*/
- rect->width = (rect->width + rect->x % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
- rect->height = (rect->height + rect->y % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
- rect->x = r.left / impl->window_scale + _gdk_offset_x;
- rect->y = r.top / impl->window_scale + _gdk_offset_y;
+ rect->width = (rect->width + rect->x % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale;
+ rect->height = (rect->height + rect->y % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale;
+ rect->x = r.left / impl->surface_scale + _gdk_offset_x;
+ rect->y = r.top / impl->surface_scale + _gdk_offset_y;
- GDK_NOTE (MISC, g_print ("gdk_window_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n",
+ GDK_SURFACE_HWND (window),
rect->width,
rect->height,
rect->x, rect->y));
}
static gboolean
-gdk_window_win32_get_device_state (GdkWindow *window,
+gdk_surface_win32_get_device_state (GdkSurface *window,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
- GdkWindow *child;
+ GdkSurface *child;
- g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE);
GDK_DEVICE_GET_CLASS (device)->query_state (device, window,
&child,
@@ -2201,27 +2201,27 @@ gdk_display_warp_device (GdkDisplay *display,
}
static GdkEventMask
-gdk_win32_window_get_events (GdkWindow *window)
+gdk_win32_surface_get_events (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return 0;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
return impl->native_event_mask;
}
static void
-gdk_win32_window_set_events (GdkWindow *window,
+gdk_win32_surface_set_events (GdkSurface *window,
GdkEventMask event_mask)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- /* gdk_window_new() always sets the GDK_STRUCTURE_MASK, so better
+ /* gdk_surface_new() always sets the GDK_STRUCTURE_MASK, so better
* set it here, too. Not that I know or remember why it is
* necessary, will have to test some day.
*/
@@ -2229,14 +2229,14 @@ gdk_win32_window_set_events (GdkWindow *window,
}
static void
-do_shape_combine_region (GdkWindow *window,
+do_shape_combine_region (GdkSurface *window,
HRGN hrgn,
gint x, gint y)
{
RECT rect;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- GetClientRect (GDK_WINDOW_HWND (window), &rect);
+ GetClientRect (GDK_SURFACE_HWND (window), &rect);
_gdk_win32_adjust_client_rect (window, &rect);
@@ -2244,21 +2244,21 @@ do_shape_combine_region (GdkWindow *window,
OffsetRgn (hrgn, x, y);
/* If this is a top-level window, add the title bar to the region */
- if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
+ if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL)
{
HRGN tmp = CreateRectRgn (0, 0, rect.right - rect.left, -rect.top);
CombineRgn (hrgn, hrgn, tmp, RGN_OR);
DeleteObject (tmp);
}
- SetWindowRgn (GDK_WINDOW_HWND (window), hrgn, TRUE);
+ SetWindowRgn (GDK_SURFACE_HWND (window), hrgn, TRUE);
}
static void
-gdk_win32_window_set_accept_focus (GdkWindow *window,
+gdk_win32_surface_set_accept_focus (GdkSurface *window,
gboolean accept_focus)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
accept_focus = accept_focus != FALSE;
@@ -2267,10 +2267,10 @@ gdk_win32_window_set_accept_focus (GdkWindow *window,
}
static void
-gdk_win32_window_set_focus_on_map (GdkWindow *window,
+gdk_win32_surface_set_focus_on_map (GdkSurface *window,
gboolean focus_on_map)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
focus_on_map = focus_on_map != FALSE;
@@ -2279,7 +2279,7 @@ gdk_win32_window_set_focus_on_map (GdkWindow *window,
}
static void
-gdk_win32_window_set_icon_list (GdkWindow *window,
+gdk_win32_surface_set_icon_list (GdkSurface *window,
GList *textures)
{
GdkTexture *big_texture, *small_texture;
@@ -2288,14 +2288,14 @@ gdk_win32_window_set_icon_list (GdkWindow *window,
gint w, h;
gint dw, dh, diff;
HICON small_hicon, big_hicon;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) || textures == NULL)
+ if (GDK_SURFACE_DESTROYED (window) || textures == NULL)
return;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* ideal sizes for small and large icons */
big_w = GetSystemMetrics (SM_CXICON);
@@ -2343,9 +2343,9 @@ gdk_win32_window_set_icon_list (GdkWindow *window,
g_object_unref (small_texture);
/* Set the icons */
- SendMessageW (GDK_WINDOW_HWND (window), WM_SETICON, ICON_BIG,
+ SendMessageW (GDK_SURFACE_HWND (window), WM_SETICON, ICON_BIG,
(LPARAM)big_hicon);
- SendMessageW (GDK_WINDOW_HWND (window), WM_SETICON, ICON_SMALL,
+ SendMessageW (GDK_SURFACE_HWND (window), WM_SETICON, ICON_SMALL,
(LPARAM)small_hicon);
/* Store the icons, destroying any previous icons */
@@ -2358,7 +2358,7 @@ gdk_win32_window_set_icon_list (GdkWindow *window,
}
static void
-gdk_win32_window_set_icon_name (GdkWindow *window,
+gdk_win32_surface_set_icon_name (GdkSurface *window,
const gchar *name)
{
/* In case I manage to confuse this again (or somebody else does):
@@ -2368,9 +2368,9 @@ gdk_win32_window_set_icon_name (GdkWindow *window,
* naming stuff.
*/
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
#if 0
@@ -2382,34 +2382,34 @@ gdk_win32_window_set_icon_name (GdkWindow *window,
* chars or system codepage, and use either the W or A version of
* SetWindowText(), depending on Windows version.
*/
- API_CALL (SetWindowText, (GDK_WINDOW_HWND (window), name));
+ API_CALL (SetWindowText, (GDK_SURFACE_HWND (window), name));
#endif
}
-static GdkWindow *
-gdk_win32_window_get_group (GdkWindow *window)
+static GdkSurface *
+gdk_win32_surface_get_group (GdkSurface *window)
{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return NULL;
- g_warning ("gdk_window_get_group not yet implemented");
+ g_warning ("gdk_surface_get_group not yet implemented");
return NULL;
}
static void
-gdk_win32_window_set_group (GdkWindow *window,
- GdkWindow *leader)
+gdk_win32_surface_set_group (GdkSurface *window,
+ GdkSurface *leader)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
+ g_return_if_fail (GDK_IS_SURFACE (window));
+ g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader));
- if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (leader))
+ if (GDK_SURFACE_DESTROYED (window) || GDK_SURFACE_DESTROYED (leader))
return;
- g_warning ("gdk_window_set_group not implemented");
+ g_warning ("gdk_surface_set_group not implemented");
}
static void
@@ -2431,7 +2431,7 @@ update_single_bit (LONG *style,
/*
* Returns TRUE if window has no decorations.
* Usually it means CSD windows, because GTK
- * calls gdk_window_set_decorations (window, 0);
+ * calls gdk_surface_set_decorations (window, 0);
* This is used to decide whether a toplevel should
* be made layered, thus it
* only returns TRUE for toplevels (until GTK minimal
@@ -2439,22 +2439,22 @@ update_single_bit (LONG *style,
* because only toplevels can be layered).
*/
gboolean
-_gdk_win32_window_lacks_wm_decorations (GdkWindow *window)
+_gdk_win32_surface_lacks_wm_decorations (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
LONG style;
gboolean has_any_decorations;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return FALSE;
/* only toplevels can be layered */
- if (!WINDOW_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (window))
return FALSE;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- /* This is because GTK calls gdk_window_set_decorations (window, 0),
+ /* This is because GTK calls gdk_surface_set_decorations (window, 0),
* even though GdkWMDecoration docs indicate that 0 does NOT mean
* "no decorations".
*/
@@ -2462,21 +2462,21 @@ _gdk_win32_window_lacks_wm_decorations (GdkWindow *window)
*impl->decorations == 0)
return TRUE;
- if (GDK_WINDOW_HWND (window) == 0)
+ if (GDK_SURFACE_HWND (window) == 0)
return FALSE;
- style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
+ style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
if (style == 0)
{
DWORD w32_error = GetLastError ();
GDK_NOTE (MISC, g_print ("Failed to get style of window %p (handle %p): %lu\n",
- window, GDK_WINDOW_HWND (window), w32_error));
+ window, GDK_SURFACE_HWND (window), w32_error));
return FALSE;
}
- /* Keep this in sync with _gdk_win32_window_update_style_bits() */
+ /* Keep this in sync with _gdk_win32_surface_update_style_bits() */
/* We don't check what get_effective_window_decorations()
* has to say, because it gives suggestions based on
* various hints, while we want *actual* decorations,
@@ -2489,15 +2489,15 @@ _gdk_win32_window_lacks_wm_decorations (GdkWindow *window)
has_any_decorations = TRUE;
else
GDK_NOTE (MISC, g_print ("Window %p (handle %p): has no decorations (style %lx)\n",
- window, GDK_WINDOW_HWND (window), style));
+ window, GDK_SURFACE_HWND (window), style));
return !has_any_decorations;
}
void
-_gdk_win32_window_update_style_bits (GdkWindow *window)
+_gdk_win32_surface_update_style_bits (GdkSurface *window)
{
- GdkWindowImplWin32 *impl = (GdkWindowImplWin32 *)window->impl;
+ GdkSurfaceImplWin32 *impl = (GdkSurfaceImplWin32 *)window->impl;
GdkWMDecoration decorations;
LONG old_style, new_style, old_exstyle, new_exstyle;
gboolean all;
@@ -2507,13 +2507,13 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
HWND insert_after;
UINT flags;
- if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
return;
- old_style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
- old_exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
+ old_style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
+ old_exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
- GetClientRect (GDK_WINDOW_HWND (window), &before);
+ GetClientRect (GDK_SURFACE_HWND (window), &before);
after = before;
AdjustWindowRectEx (&before, old_style, FALSE, old_exstyle);
@@ -2525,12 +2525,12 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
new_style = old_style;
new_exstyle = old_exstyle;
- if (window->window_type == GDK_WINDOW_TEMP)
+ if (window->surface_type == GDK_SURFACE_TEMP)
{
new_exstyle |= WS_EX_TOOLWINDOW;
will_be_topmost = TRUE;
}
- else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
+ else if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY)
{
new_exstyle |= WS_EX_TOOLWINDOW;
}
@@ -2549,7 +2549,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
*/
if (impl->suppress_layered == 0)
{
- if (_gdk_win32_window_lacks_wm_decorations (window))
+ if (_gdk_win32_surface_lacks_wm_decorations (window))
impl->layered = g_strcmp0 (g_getenv ("GDK_WIN32_LAYERED"), "0") != 0;
}
else
@@ -2563,7 +2563,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
if (get_effective_window_decorations (window, &decorations))
{
all = (decorations & GDK_DECOR_ALL);
- /* Keep this in sync with the test in _gdk_win32_window_lacks_wm_decorations() */
+ /* Keep this in sync with the test in _gdk_win32_surface_lacks_wm_decorations() */
update_single_bit (&new_style, all, decorations & GDK_DECOR_BORDER, WS_BORDER);
update_single_bit (&new_style, all, decorations & GDK_DECOR_RESIZEH, WS_THICKFRAME);
update_single_bit (&new_style, all, decorations & GDK_DECOR_TITLE, WS_CAPTION);
@@ -2574,34 +2574,34 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
if (old_style == new_style && old_exstyle == new_exstyle )
{
- GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: no change\n",
- GDK_WINDOW_HWND (window)));
+ GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: no change\n",
+ GDK_SURFACE_HWND (window)));
return;
}
if (old_style != new_style)
{
- GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: STYLE: %s => %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_style_to_string (old_style),
- _gdk_win32_window_style_to_string (new_style)));
+ GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: STYLE: %s => %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_style_to_string (old_style),
+ _gdk_win32_surface_style_to_string (new_style)));
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, new_style);
+ SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, new_style);
}
if (old_exstyle != new_exstyle)
{
- GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: EXSTYLE: %s => %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_exstyle_to_string (old_exstyle),
- _gdk_win32_window_exstyle_to_string (new_exstyle)));
+ GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: EXSTYLE: %s => %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_exstyle_to_string (old_exstyle),
+ _gdk_win32_surface_exstyle_to_string (new_exstyle)));
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE, new_exstyle);
+ SetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE, new_exstyle);
}
AdjustWindowRectEx (&after, new_style, FALSE, new_exstyle);
- GetWindowRect (GDK_WINDOW_HWND (window), &rect);
+ GetWindowRect (GDK_SURFACE_HWND (window), &rect);
rect.left += after.left - before.left;
rect.top += after.top - before.top;
rect.right += after.right - before.right;
@@ -2623,7 +2623,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
insert_after = SWP_NOZORDER_SPECIFIED;
}
- SetWindowPos (GDK_WINDOW_HWND (window), insert_after,
+ SetWindowPos (GDK_SURFACE_HWND (window), insert_after,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
flags);
@@ -2646,14 +2646,14 @@ update_single_system_menu_entry (HMENU hmenu,
}
static void
-update_system_menu (GdkWindow *window)
+update_system_menu (GdkSurface *window)
{
GdkWMFunction functions;
BOOL all;
- if (_gdk_window_get_functions (window, &functions))
+ if (_gdk_surface_get_functions (window, &functions))
{
- HMENU hmenu = GetSystemMenu (GDK_WINDOW_HWND (window), FALSE);
+ HMENU hmenu = GetSystemMenu (GDK_SURFACE_HWND (window), FALSE);
all = (functions & GDK_FUNC_ALL);
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_RESIZE, SC_SIZE);
@@ -2665,17 +2665,17 @@ update_system_menu (GdkWindow *window)
}
static void
-gdk_win32_window_set_decorations (GdkWindow *window,
+gdk_win32_surface_set_decorations (GdkSurface *window,
GdkWMDecoration decorations)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- GDK_NOTE (MISC, g_print ("gdk_window_set_decorations: %p: %s %s%s%s%s%s%s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_decorations: %p: %s %s%s%s%s%s%s\n",
+ GDK_SURFACE_HWND (window),
(decorations & GDK_DECOR_ALL ? "clearing" : "setting"),
(decorations & GDK_DECOR_BORDER ? "BORDER " : ""),
(decorations & GDK_DECOR_RESIZEH ? "RESIZEH " : ""),
@@ -2689,18 +2689,18 @@ gdk_win32_window_set_decorations (GdkWindow *window,
*impl->decorations = decorations;
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
}
static gboolean
-gdk_win32_window_get_decorations (GdkWindow *window,
+gdk_win32_surface_get_decorations (GdkSurface *window,
GdkWMDecoration *decorations)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->decorations == NULL)
return FALSE;
@@ -2722,15 +2722,15 @@ get_functions_quark ()
}
static void
-gdk_win32_window_set_functions (GdkWindow *window,
+gdk_win32_surface_set_functions (GdkSurface *window,
GdkWMFunction functions)
{
GdkWMFunction* functions_copy;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- GDK_NOTE (MISC, g_print ("gdk_window_set_functions: %p: %s %s%s%s%s%s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_functions: %p: %s %s%s%s%s%s\n",
+ GDK_SURFACE_HWND (window),
(functions & GDK_FUNC_ALL ? "clearing" : "setting"),
(functions & GDK_FUNC_RESIZE ? "RESIZE " : ""),
(functions & GDK_FUNC_MOVE ? "MOVE " : ""),
@@ -2746,7 +2746,7 @@ gdk_win32_window_set_functions (GdkWindow *window,
}
gboolean
-_gdk_window_get_functions (GdkWindow *window,
+_gdk_surface_get_functions (GdkSurface *window,
GdkWMFunction *functions)
{
GdkWMFunction* functions_set;
@@ -2782,7 +2782,7 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context)
{
GdkDisplay *display;
gint n_monitors, monitor_idx, other_monitor_idx;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl);
#if defined(MORE_AEROSNAP_DEBUGGING)
gint i;
#endif
@@ -2851,8 +2851,8 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context)
}
}
- thickness = AEROSNAP_REGION_THICKNESS * impl->window_scale;
- trigger_thickness = AEROSNAP_REGION_TRIGGER_THICKNESS * impl->window_scale;
+ thickness = AEROSNAP_REGION_THICKNESS * impl->surface_scale;
+ trigger_thickness = AEROSNAP_REGION_TRIGGER_THICKNESS * impl->surface_scale;
snap_region.edge = wa;
snap_region.trigger = wa;
@@ -2938,11 +2938,11 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context)
}
static void
-discard_snapinfo (GdkWindow *window)
+discard_snapinfo (GdkSurface *window)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->snap_state = GDK_WIN32_AEROSNAP_STATE_UNDETERMINED;
@@ -2954,13 +2954,13 @@ discard_snapinfo (GdkWindow *window)
}
static void
-unsnap (GdkWindow *window,
+unsnap (GdkSurface *window,
GdkMonitor *monitor)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GdkRectangle rect;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->snap_state = GDK_WIN32_AEROSNAP_STATE_UNDETERMINED;
@@ -3023,7 +3023,7 @@ unsnap (GdkWindow *window,
GDK_NOTE (MISC, g_print ("Unsnapped window size %d x %d @ %d : %d\n", rect.width, rect.height, rect.x, rect.y));
- gdk_window_move_resize (window, rect.x, rect.y,
+ gdk_surface_move_resize (window, rect.x, rect.y,
rect.width, rect.height);
g_clear_pointer (&impl->snap_stash, g_free);
@@ -3031,8 +3031,8 @@ unsnap (GdkWindow *window,
}
static void
-stash_window (GdkWindow *window,
- GdkWindowImplWin32 *impl)
+stash_window (GdkSurface *window,
+ GdkSurfaceImplWin32 *impl)
{
gint x, y;
gint width, wwidth;
@@ -3044,7 +3044,7 @@ stash_window (GdkWindow *window,
placement.length = sizeof(WINDOWPLACEMENT);
/* Use W32 API to get unmaximized window size, which GDK doesn't remember */
- if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &placement))
+ if (!GetWindowPlacement (GDK_SURFACE_HWND (window), &placement))
return;
/* MSDN is very vague, but in practice rcNormalPosition is the same as GetWindowRect(),
@@ -3052,7 +3052,7 @@ stash_window (GdkWindow *window,
* We need to get monitor info and apply workarea vs monitorarea diff to turn
* these into screen coordinates proper.
*/
- hmonitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ hmonitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST);
hmonitor_info.cbSize = sizeof (hmonitor_info);
if (!GetMonitorInfoA (hmonitor, &hmonitor_info))
@@ -3065,28 +3065,28 @@ stash_window (GdkWindow *window,
impl->snap_stash_int = g_new0 (GdkRectangle, 1);
GDK_NOTE (MISC, g_print ("monitor work area %ld x %ld @ %ld : %ld\n",
- (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->window_scale,
- (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->window_scale,
+ (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->surface_scale,
+ (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->surface_scale,
hmonitor_info.rcWork.left,
hmonitor_info.rcWork.top));
GDK_NOTE (MISC, g_print ("monitor area %ld x %ld @ %ld : %ld\n",
- (hmonitor_info.rcMonitor.right - hmonitor_info.rcMonitor.left) / impl->window_scale,
- (hmonitor_info.rcMonitor.bottom - hmonitor_info.rcMonitor.top) / impl->window_scale,
+ (hmonitor_info.rcMonitor.right - hmonitor_info.rcMonitor.left) / impl->surface_scale,
+ (hmonitor_info.rcMonitor.bottom - hmonitor_info.rcMonitor.top) / impl->surface_scale,
hmonitor_info.rcMonitor.left,
hmonitor_info.rcMonitor.top));
GDK_NOTE (MISC, g_print ("window work place %ld x %ld @ %ld : %ld\n",
- (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->window_scale,
- (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->window_scale,
+ (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->surface_scale,
+ (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->surface_scale,
placement.rcNormalPosition.left,
placement.rcNormalPosition.top));
- width = (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->window_scale;
- height = (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->window_scale;
- x = (placement.rcNormalPosition.left - hmonitor_info.rcMonitor.left) / impl->window_scale;
- y = (placement.rcNormalPosition.top - hmonitor_info.rcMonitor.top) / impl->window_scale;
+ width = (placement.rcNormalPosition.right - placement.rcNormalPosition.left) / impl->surface_scale;
+ height = (placement.rcNormalPosition.bottom - placement.rcNormalPosition.top) / impl->surface_scale;
+ x = (placement.rcNormalPosition.left - hmonitor_info.rcMonitor.left) / impl->surface_scale;
+ y = (placement.rcNormalPosition.top - hmonitor_info.rcMonitor.top) / impl->surface_scale;
- wwidth = (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->window_scale;
- wheight = (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->window_scale;
+ wwidth = (hmonitor_info.rcWork.right - hmonitor_info.rcWork.left) / impl->surface_scale;
+ wheight = (hmonitor_info.rcWork.bottom - hmonitor_info.rcWork.top) / impl->surface_scale;
impl->snap_stash->x = (gdouble) (x) / (gdouble) (wwidth);
impl->snap_stash->y = (gdouble) (y) / (gdouble) (wheight);
@@ -3104,22 +3104,22 @@ stash_window (GdkWindow *window,
}
static void
-snap_up (GdkWindow *window)
+snap_up (GdkSurface *window)
{
SHORT maxysize;
gint x, y;
gint width, height;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->snap_state = GDK_WIN32_AEROSNAP_STATE_FULLUP;
stash_window (window, impl);
- maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale;
- gdk_window_get_position (window, &x, &y);
- width = gdk_window_get_width (window);
+ maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->surface_scale;
+ gdk_surface_get_position (window, &x, &y);
+ width = gdk_surface_get_width (window);
y = 0;
height = maxysize;
@@ -3129,18 +3129,18 @@ snap_up (GdkWindow *window)
width += impl->margins_x;
height += impl->margins_y;
- gdk_window_move_resize (window, x, y, width, height);
+ gdk_surface_move_resize (window, x, y, width, height);
}
static void
-snap_left (GdkWindow *window,
+snap_left (GdkSurface *window,
GdkMonitor *monitor,
GdkMonitor *snap_monitor)
{
GdkRectangle rect;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->snap_state = GDK_WIN32_AEROSNAP_STATE_HALFLEFT;
@@ -3155,18 +3155,18 @@ snap_left (GdkWindow *window,
rect.width = rect.width + impl->margins_x;
rect.height = rect.height + impl->margins_y;
- gdk_window_move_resize (window, rect.x, rect.y, rect.width, rect.height);
+ gdk_surface_move_resize (window, rect.x, rect.y, rect.width, rect.height);
}
static void
-snap_right (GdkWindow *window,
+snap_right (GdkSurface *window,
GdkMonitor *monitor,
GdkMonitor *snap_monitor)
{
GdkRectangle rect;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
impl->snap_state = GDK_WIN32_AEROSNAP_STATE_HALFRIGHT;
@@ -3182,26 +3182,26 @@ snap_right (GdkWindow *window,
rect.width = rect.width + impl->margins_x;
rect.height = rect.height + impl->margins_y;
- gdk_window_move_resize (window, rect.x, rect.y, rect.width, rect.height);
+ gdk_surface_move_resize (window, rect.x, rect.y, rect.width, rect.height);
}
void
-_gdk_win32_window_handle_aerosnap (GdkWindow *window,
+_gdk_win32_surface_handle_aerosnap (GdkSurface *window,
GdkWin32AeroSnapCombo combo)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GdkDisplay *display;
gint n_monitors;
- GdkWindowState window_state = gdk_window_get_state (window);
- gboolean minimized = window_state & GDK_WINDOW_STATE_ICONIFIED;
- gboolean maximized = window_state & GDK_WINDOW_STATE_MAXIMIZED;
+ GdkSurfaceState surface_state = gdk_surface_get_state (window);
+ gboolean minimized = surface_state & GDK_SURFACE_STATE_ICONIFIED;
+ gboolean maximized = surface_state & GDK_SURFACE_STATE_MAXIMIZED;
gboolean halfsnapped;
GdkMonitor *monitor;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- display = gdk_window_get_display (window);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
+ display = gdk_surface_get_display (window);
n_monitors = gdk_display_get_n_monitors (display);
- monitor = gdk_display_get_monitor_at_window (display, window);
+ monitor = gdk_display_get_monitor_at_surface (display, window);
if (minimized && maximized)
minimized = FALSE;
@@ -3219,24 +3219,24 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window,
if (!maximized)
{
unsnap (window, monitor);
- gdk_window_maximize (window);
+ gdk_surface_maximize (window);
}
break;
case GDK_WIN32_AEROSNAP_COMBO_DOWN:
case GDK_WIN32_AEROSNAP_COMBO_SHIFTDOWN:
if (maximized)
{
- gdk_window_unmaximize (window);
+ gdk_surface_unmaximize (window);
unsnap (window, monitor);
}
else if (halfsnapped)
unsnap (window, monitor);
else if (!minimized)
- gdk_window_iconify (window);
+ gdk_surface_iconify (window);
break;
case GDK_WIN32_AEROSNAP_COMBO_LEFT:
if (maximized)
- gdk_window_unmaximize (window);
+ gdk_surface_unmaximize (window);
if (impl->snap_state == GDK_WIN32_AEROSNAP_STATE_UNDETERMINED ||
impl->snap_state == GDK_WIN32_AEROSNAP_STATE_FULLUP)
@@ -3258,7 +3258,7 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window,
break;
case GDK_WIN32_AEROSNAP_COMBO_RIGHT:
if (maximized)
- gdk_window_unmaximize (window);
+ gdk_surface_unmaximize (window);
if (impl->snap_state == GDK_WIN32_AEROSNAP_STATE_UNDETERMINED ||
impl->snap_state == GDK_WIN32_AEROSNAP_STATE_FULLUP)
@@ -3307,14 +3307,14 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window,
}
static void
-apply_snap (GdkWindow *window,
+apply_snap (GdkSurface *window,
GdkWin32AeroSnapState snap)
{
GdkMonitor *monitor;
GdkDisplay *display;
- display = gdk_window_get_display (window);
- monitor = gdk_display_get_monitor_at_window (display, window);
+ display = gdk_surface_get_display (window);
+ monitor = gdk_display_get_monitor_at_surface (display, window);
switch (snap)
{
@@ -3322,7 +3322,7 @@ apply_snap (GdkWindow *window,
break;
case GDK_WIN32_AEROSNAP_STATE_MAXIMIZE:
unsnap (window, monitor);
- gdk_window_maximize (window);
+ gdk_surface_maximize (window);
break;
case GDK_WIN32_AEROSNAP_STATE_HALFLEFT:
unsnap (window, monitor);
@@ -3340,7 +3340,7 @@ apply_snap (GdkWindow *window,
/* Registers a dumb window class. This window
* has DefWindowProc() for a window procedure and
- * does not do anything that GdkWindow-bound HWNDs do.
+ * does not do anything that GdkSurface-bound HWNDs do.
*/
static ATOM
RegisterGdkDumbClass ()
@@ -3532,9 +3532,9 @@ draw_indicator (GdkW32DragMoveResizeContext *context,
gdouble line_width;
gdouble corner_radius;
gint64 animation_duration;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl);
- line_width = AEROSNAP_INDICATOR_LINE_WIDTH * impl->window_scale;
+ line_width = AEROSNAP_INDICATOR_LINE_WIDTH * impl->surface_scale;
corner_radius = AEROSNAP_INDICATOR_CORNER_RADIUS;
animation_duration = AEROSNAP_INDICATOR_ANIMATION_DURATION;
last_draw = FALSE;
@@ -3569,32 +3569,32 @@ draw_indicator (GdkW32DragMoveResizeContext *context,
{
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width);
current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height);
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height);
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width);
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width);
current_rect.y = context->indicator_target.y;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
current_rect.x = context->indicator_target.x;
current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height);
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
current_rect.x = context->indicator_target.x;
current_rect.y = context->indicator_target.y;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
current_rect.y = context->indicator_target.y;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
current_rect.x = context->indicator_target.x;
break;
}
@@ -3602,10 +3602,10 @@ draw_indicator (GdkW32DragMoveResizeContext *context,
cr = cairo_create (context->indicator_surface);
rounded_rectangle (cr,
- (current_rect.x - context->indicator_window_rect.x) * impl->window_scale,
- (current_rect.y - context->indicator_window_rect.y) * impl->window_scale,
- current_rect.width * impl->window_scale,
- current_rect.height * impl->window_scale,
+ (current_rect.x - context->indicator_window_rect.x) * impl->surface_scale,
+ (current_rect.y - context->indicator_window_rect.y) * impl->surface_scale,
+ current_rect.width * impl->surface_scale,
+ current_rect.height * impl->surface_scale,
corner_radius,
line_width,
&fill, &outline);
@@ -3633,23 +3633,23 @@ redraw_indicator (gpointer user_data)
POINT source_point = { 0, 0 };
gboolean last_draw;
gdouble indicator_opacity;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
gboolean do_source_remove = FALSE;
indicator_opacity = AEROSNAP_INDICATOR_OPACITY;
- if (GDK_WINDOW_DESTROYED (context->window) ||
+ if (GDK_SURFACE_DESTROYED (context->window) ||
!ensure_snap_indicator_exists (context))
{
do_source_remove = TRUE;
}
- impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl);
if (!ensure_snap_indicator_surface (context,
context->indicator_window_rect.width,
context->indicator_window_rect.height,
- impl->window_scale))
+ impl->surface_scale))
{
do_source_remove = TRUE;
}
@@ -3662,10 +3662,10 @@ redraw_indicator (gpointer user_data)
last_draw = draw_indicator (context, context->draw_timestamp);
- window_position.x = (context->indicator_window_rect.x - _gdk_offset_x) * impl->window_scale;
- window_position.y = (context->indicator_window_rect.y - _gdk_offset_y) * impl->window_scale;
- window_size.cx = context->indicator_window_rect.width * impl->window_scale;
- window_size.cy = context->indicator_window_rect.height * impl->window_scale;
+ window_position.x = (context->indicator_window_rect.x - _gdk_offset_x) * impl->surface_scale;
+ window_position.y = (context->indicator_window_rect.y - _gdk_offset_y) * impl->surface_scale;
+ window_size.cx = context->indicator_window_rect.width * impl->surface_scale;
+ window_size.cy = context->indicator_window_rect.height * impl->surface_scale;
blender.BlendOp = AC_SRC_OVER;
blender.BlendFlags = 0;
@@ -3675,7 +3675,7 @@ redraw_indicator (gpointer user_data)
hdc = cairo_win32_surface_get_dc (context->indicator_surface);
API_CALL (SetWindowPos, (context->shape_indicator,
- GDK_WINDOW_HWND (context->window),
+ GDK_SURFACE_HWND (context->window),
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_SHOWWINDOW | SWP_NOACTIVATE));
@@ -3740,7 +3740,7 @@ start_indicator_drawing (GdkW32DragMoveResizeContext *context,
GDK_NOTE (MISC, g_print ("Start drawing snap indicator %d x %d @ %d : %d -> %d x %d @ %d : %d\n",
from.width * scale, from.height * scale, from.x, from.y, to.width * scale, to.height * scale, to.x, to.y));
- if (GDK_WINDOW_DESTROYED (context->window))
+ if (GDK_SURFACE_DESTROYED (context->window))
return;
if (!ensure_snap_indicator_exists (context))
@@ -3777,27 +3777,27 @@ start_indicator_drawing (GdkW32DragMoveResizeContext *context,
}
static void
-update_fullup_indicator (GdkWindow *window,
+update_fullup_indicator (GdkSurface *window,
GdkW32DragMoveResizeContext *context)
{
SHORT maxysize;
GdkRectangle from, to;
GdkRectangle to_adjusted, from_adjusted, from_or_to;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GDK_NOTE (MISC, g_print ("Update fullup indicator\n"));
- if (GDK_WINDOW_DESTROYED (context->window))
+ if (GDK_SURFACE_DESTROYED (context->window))
return;
if (context->shape_indicator == NULL)
return;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN);
- gdk_window_get_position (window, &to.x, &to.y);
- to.width = gdk_window_get_width (window);
- to.height = gdk_window_get_height (window);
+ gdk_surface_get_position (window, &to.x, &to.y);
+ to.width = gdk_surface_get_width (window);
+ to.height = gdk_surface_get_height (window);
to.y = 0;
to.height = maxysize;
@@ -3812,7 +3812,7 @@ update_fullup_indicator (GdkWindow *window,
context->indicator_target.width, context->indicator_target.height,
context->indicator_target.x, context->indicator_target.y,
to.width, to.height, to.x, to.y));
- start_indicator_drawing (context, from_adjusted, to, impl->window_scale);
+ start_indicator_drawing (context, from_adjusted, to, impl->surface_scale);
return;
}
@@ -3830,11 +3830,11 @@ update_fullup_indicator (GdkWindow *window,
context->indicator_target = to_adjusted;
context->indicator_window_rect = from_or_to;
- ensure_snap_indicator_surface (context, from_or_to.width, from_or_to.height, impl->window_scale);
+ ensure_snap_indicator_surface (context, from_or_to.width, from_or_to.height, impl->surface_scale);
}
static void
-start_indicator (GdkWindow *window,
+start_indicator (GdkSurface *window,
GdkW32DragMoveResizeContext *context,
gint x,
gint y,
@@ -3845,16 +3845,16 @@ start_indicator (GdkWindow *window,
SHORT maxysize;
GdkRectangle start_size, end_size;
GdkDisplay *display;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
monitor = gdk_display_get_monitor_at_point (display, x, y);
gdk_monitor_get_workarea (monitor, &workarea);
- maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale;
- gdk_window_get_position (window, &start_size.x, &start_size.y);
- start_size.width = gdk_window_get_width (window);
- start_size.height = gdk_window_get_height (window);
+ maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->surface_scale;
+ gdk_surface_get_position (window, &start_size.x, &start_size.y);
+ start_size.width = gdk_surface_get_width (window);
+ start_size.height = gdk_surface_get_height (window);
end_size = start_size;
@@ -3886,11 +3886,11 @@ start_indicator (GdkWindow *window,
break;
}
- start_indicator_drawing (context, start_size, end_size, impl->window_scale);
+ start_indicator_drawing (context, start_size, end_size, impl->surface_scale);
}
static void
-stop_indicator (GdkWindow *window,
+stop_indicator (GdkSurface *window,
GdkW32DragMoveResizeContext *context)
{
GDK_NOTE (MISC, g_print ("Stop drawing snap indicator\n"));
@@ -3927,7 +3927,7 @@ point_in_aerosnap_region (gint x,
}
static void
-handle_aerosnap_move_resize (GdkWindow *window,
+handle_aerosnap_move_resize (GdkSurface *window,
GdkW32DragMoveResizeContext *context,
gint x,
gint y)
@@ -3939,20 +3939,20 @@ handle_aerosnap_move_resize (GdkWindow *window,
gint halfright = 0;
gint fullup = 0;
gboolean fullup_edge = FALSE;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- case GDK_WINDOW_EDGE_NORTH_EAST:
- case GDK_WINDOW_EDGE_WEST:
- case GDK_WINDOW_EDGE_EAST:
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_WEST:
+ case GDK_SURFACE_EDGE_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
break;
- case GDK_WINDOW_EDGE_SOUTH:
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_NORTH:
fullup_edge = TRUE;
break;
}
@@ -4101,7 +4101,7 @@ handle_aerosnap_move_resize (GdkWindow *window,
static const gchar *
get_cursor_name_from_op (GdkW32WindowDragOp op,
- GdkWindowEdge edge)
+ GdkSurfaceEdge edge)
{
switch (op)
{
@@ -4110,21 +4110,21 @@ get_cursor_name_from_op (GdkW32WindowDragOp op,
case GDK_WIN32_DRAGOP_RESIZE:
switch (edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
return "nw-resize";
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
return "n-resize";
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
return "ne-resize";
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
return "w-resize";
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
return "e-resize";
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
return "sw-resize";
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
return "s-resize";
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
return "se-resize";
}
/* default: warn about unhandled enum values,
@@ -4143,7 +4143,7 @@ get_cursor_name_from_op (GdkW32WindowDragOp op,
}
static gboolean
-point_in_window (GdkWindow *window,
+point_in_window (GdkSurface *window,
gdouble x,
gdouble y)
{
@@ -4155,8 +4155,8 @@ point_in_window (GdkWindow *window,
cairo_region_contains_point (window->input_shape, x, y));
}
-static GdkWindow *
-child_window_at_coordinates (GdkWindow *window,
+static GdkSurface *
+child_window_at_coordinates (GdkSurface *window,
gint root_x,
gint root_y)
{
@@ -4164,14 +4164,14 @@ child_window_at_coordinates (GdkWindow *window,
GList *l;
GList *children;
- children = gdk_window_peek_children (window);
- gdk_window_get_root_origin (window, &x, &y);
+ children = gdk_surface_peek_children (window);
+ gdk_surface_get_root_origin (window, &x, &y);
x = root_x - x;
y = root_y - y;
for (l = children; l; l = g_list_next (l))
{
- GdkWindow *child = GDK_WINDOW (l->data);
+ GdkSurface *child = GDK_SURFACE (l->data);
if (point_in_window (child, x, y))
return child;
@@ -4181,10 +4181,10 @@ child_window_at_coordinates (GdkWindow *window,
}
static void
-setup_drag_move_resize_context (GdkWindow *window,
+setup_drag_move_resize_context (GdkSurface *window,
GdkW32DragMoveResizeContext *context,
GdkW32WindowDragOp op,
- GdkWindowEdge edge,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
@@ -4193,10 +4193,10 @@ setup_drag_move_resize_context (GdkWindow *window,
{
RECT rect;
const gchar *cursor_name;
- GdkWindow *pointer_window;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurface *pointer_window;
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GdkDisplay *display = gdk_device_get_display (device);
- gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED;
+ gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
/* Before we drag, we need to undo any maximization or snapping.
* AeroSnap behaviour:
@@ -4257,9 +4257,9 @@ setup_drag_move_resize_context (GdkWindow *window,
gboolean left_half;
GdkDisplay *display;
- display = gdk_window_get_display (window);
- monitor = gdk_display_get_monitor_at_window (display, window);
- gdk_window_get_geometry (window, &wx, &wy, &wwidth, &wheight);
+ display = gdk_surface_get_display (window);
+ monitor = gdk_display_get_monitor_at_surface (display, window);
+ gdk_surface_get_geometry (window, &wx, &wy, &wwidth, &wheight);
swx = wx;
swy = wy;
@@ -4273,8 +4273,8 @@ setup_drag_move_resize_context (GdkWindow *window,
*/
if (op == GDK_WIN32_DRAGOP_MOVE && !maximized)
{
- swx += impl->margins.left / impl->window_scale;
- swy += impl->margins.top / impl->window_scale;
+ swx += impl->margins.left / impl->surface_scale;
+ swy += impl->margins.top / impl->surface_scale;
swwidth -= impl->margins_x;
swheight -= impl->margins_y;
}
@@ -4315,59 +4315,59 @@ setup_drag_move_resize_context (GdkWindow *window,
gint shadow_unmax_width, shadow_unmax_height;
placement.length = sizeof (placement);
- API_CALL (GetWindowPlacement, (GDK_WINDOW_HWND (window), &placement));
+ API_CALL (GetWindowPlacement, (GDK_SURFACE_HWND (window), &placement));
GDK_NOTE (MISC, g_print ("W32 WM unmaximized window placement is %ld x %ld @ %ld : %ld\n",
placement.rcNormalPosition.right - placement.rcNormalPosition.left,
placement.rcNormalPosition.bottom - placement.rcNormalPosition.top,
- placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale,
- placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale));
+ placement.rcNormalPosition.left + _gdk_offset_x * impl->surface_scale,
+ placement.rcNormalPosition.top + _gdk_offset_y * impl->surface_scale));
unmax_width = placement.rcNormalPosition.right - placement.rcNormalPosition.left;
unmax_height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top;
- shadow_unmax_width = unmax_width - impl->margins_x * impl->window_scale;
- shadow_unmax_height = unmax_height - impl->margins_y * impl->window_scale;
+ shadow_unmax_width = unmax_width - impl->margins_x * impl->surface_scale;
+ shadow_unmax_height = unmax_height - impl->margins_y * impl->surface_scale;
- if (offsetx * impl->window_scale < (shadow_unmax_width / 2) &&
- offsety * impl->window_scale < (shadow_unmax_height / 2))
+ if (offsetx * impl->surface_scale < (shadow_unmax_width / 2) &&
+ offsety * impl->surface_scale < (shadow_unmax_height / 2))
{
- placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale;
+ placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->surface_scale;
placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height;
if (left_half)
{
- placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left - _gdk_offset_x) * impl->window_scale;
+ placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left - _gdk_offset_x) * impl->surface_scale;
placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width;
}
else
{
- placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right - _gdk_offset_x) * impl->window_scale;
+ placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right - _gdk_offset_x) * impl->surface_scale;
placement.rcNormalPosition.left = placement.rcNormalPosition.right - unmax_width;
}
}
else
{
- placement.rcNormalPosition.left = (root_x * impl->window_scale) -
+ placement.rcNormalPosition.left = (root_x * impl->surface_scale) -
(unmax_width / 2) -
- (_gdk_offset_x * impl->window_scale);
+ (_gdk_offset_x * impl->surface_scale);
- if (offsety * impl->window_scale < shadow_unmax_height / 2)
- placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale;
+ if (offsety * impl->surface_scale < shadow_unmax_height / 2)
+ placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->surface_scale;
else
- placement.rcNormalPosition.top = (root_y * impl->window_scale) -
+ placement.rcNormalPosition.top = (root_y * impl->surface_scale) -
(unmax_height / 2) -
- (_gdk_offset_y * impl->window_scale);
+ (_gdk_offset_y * impl->surface_scale);
placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width;
placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height;
}
GDK_NOTE (MISC, g_print ("Unmaximized window will be at %ld : %ld\n",
- placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale,
- placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale));
+ placement.rcNormalPosition.left + _gdk_offset_x * impl->surface_scale,
+ placement.rcNormalPosition.top + _gdk_offset_y * impl->surface_scale));
- API_CALL (SetWindowPlacement, (GDK_WINDOW_HWND (window), &placement));
+ API_CALL (SetWindowPlacement, (GDK_SURFACE_HWND (window), &placement));
}
else if (!pointer_outside_of_window && impl->snap_stash_int)
{
@@ -4386,12 +4386,12 @@ setup_drag_move_resize_context (GdkWindow *window,
if (offsetx < snew_pos.width / 2 && offsety < snew_pos.height / 2)
{
- new_pos.y = root_y - offsety + impl->margins.top / impl->window_scale;
+ new_pos.y = root_y - offsety + impl->margins.top / impl->surface_scale;
if (left_half)
- new_pos.x = root_x - offsetx + impl->margins.left / impl->window_scale;
+ new_pos.x = root_x - offsetx + impl->margins.left / impl->surface_scale;
else
- new_pos.x = root_x + offsetx + impl->margins.left / impl->window_scale - new_pos.width;
+ new_pos.x = root_x + offsetx + impl->margins.left / impl->surface_scale - new_pos.width;
}
else
{
@@ -4402,13 +4402,13 @@ setup_drag_move_resize_context (GdkWindow *window,
GDK_NOTE (MISC, g_print ("Unsnapped window to %d : %d\n",
new_pos.x, new_pos.y));
discard_snapinfo (window);
- gdk_window_move_resize (window, new_pos.x, new_pos.y,
+ gdk_surface_move_resize (window, new_pos.x, new_pos.y,
new_pos.width, new_pos.height);
}
if (maximized)
- gdk_window_unmaximize (window);
+ gdk_surface_unmaximize (window);
else
unsnap (window, monitor);
@@ -4436,7 +4436,7 @@ setup_drag_move_resize_context (GdkWindow *window,
pointer_window = child_window_at_coordinates (window, root_x, root_y);
/* Note: This triggers a WM_CAPTURECHANGED, which will trigger
- * gdk_win32_window_end_move_resize_drag(), which will end
+ * gdk_win32_surface_end_move_resize_drag(), which will end
* our op before it even begins, but only if context->op is not NONE.
* This is why we first do the grab, *then* set the op.
*/
@@ -4469,16 +4469,16 @@ setup_drag_move_resize_context (GdkWindow *window,
g_print ("begin drag moveresize: window %p, toplevel %p, "
"op %u, edge %d, device %p, "
"button %d, coord %d:%d, time %u\n",
- pointer_window, gdk_window_get_toplevel (window),
+ pointer_window, gdk_surface_get_toplevel (window),
context->op, context->edge, context->device,
context->button, context->start_root_x,
context->start_root_y, context->timestamp));
}
void
-gdk_win32_window_end_move_resize_drag (GdkWindow *window)
+gdk_win32_surface_end_move_resize_drag (GdkSurface *window)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context;
context->op = GDK_WIN32_DRAGOP_NONE;
@@ -4519,7 +4519,7 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
g_print ("end drag moveresize: window %p, toplevel %p,"
"op %u, edge %d, device %p, "
"button %d, coord %d:%d, time %u\n",
- window, gdk_window_get_toplevel (window),
+ window, gdk_surface_get_toplevel (window),
context->op, context->edge, context->device,
context->button, context->start_root_x,
context->start_root_y, context->timestamp));
@@ -4531,23 +4531,23 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
}
static void
-gdk_win32_get_window_size_and_position_from_client_rect (GdkWindow *window,
+gdk_win32_get_window_size_and_position_from_client_rect (GdkSurface *window,
RECT *window_rect,
SIZE *window_size,
POINT *window_position)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
/* Turn client area into window area */
_gdk_win32_adjust_client_rect (window, window_rect);
/* Convert GDK screen coordinates to W32 desktop coordinates */
- window_rect->left -= _gdk_offset_x * impl->window_scale;
- window_rect->right -= _gdk_offset_x * impl->window_scale;
- window_rect->top -= _gdk_offset_y * impl->window_scale;
- window_rect->bottom -= _gdk_offset_y * impl->window_scale;
+ window_rect->left -= _gdk_offset_x * impl->surface_scale;
+ window_rect->right -= _gdk_offset_x * impl->surface_scale;
+ window_rect->top -= _gdk_offset_y * impl->surface_scale;
+ window_rect->bottom -= _gdk_offset_y * impl->surface_scale;
window_position->x = window_rect->left;
window_position->y = window_rect->top;
@@ -4556,7 +4556,7 @@ gdk_win32_get_window_size_and_position_from_client_rect (GdkWindow *window,
}
static void
-gdk_win32_update_layered_window_from_cache (GdkWindow *window,
+gdk_win32_update_layered_window_from_cache (GdkSurface *window,
RECT *client_rect)
{
POINT window_position;
@@ -4566,9 +4566,9 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window,
SIZE *window_size_ptr;
POINT source_point = { 0, 0 };
POINT *source_point_ptr;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
gdk_win32_get_window_size_and_position_from_client_rect (window,
client_rect,
@@ -4588,7 +4588,7 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window,
* source_point. window_size is here to avoid the function
* inexplicably failing with error 317.
*/
- if (gdk_display_is_composited (gdk_window_get_display (window)))
+ if (gdk_display_is_composited (gdk_surface_get_display (window)))
{
hdc = NULL;
window_size_ptr = NULL;
@@ -4601,14 +4601,14 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window,
source_point_ptr = &source_point;
}
- API_CALL (UpdateLayeredWindow, (GDK_WINDOW_HWND (window), NULL,
+ API_CALL (UpdateLayeredWindow, (GDK_SURFACE_HWND (window), NULL,
&window_position, window_size_ptr,
hdc, source_point_ptr,
0, &blender, ULW_ALPHA));
}
void
-gdk_win32_window_do_move_resize_drag (GdkWindow *window,
+gdk_win32_surface_do_move_resize_drag (GdkSurface *window,
gint x,
gint y)
{
@@ -4616,20 +4616,20 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
RECT new_rect;
gint diffy, diffx;
MINMAXINFO mmi;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GdkW32DragMoveResizeContext *context;
gint width;
gint height;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
context = &impl->drag_move_resize_context;
if (!_gdk_win32_get_window_rect (window, &rect))
return;
new_rect = context->start_rect;
- diffx = (x - context->start_root_x) * impl->window_scale;
- diffy = (y - context->start_root_y) * impl->window_scale;
+ diffx = (x - context->start_root_x) * impl->surface_scale;
+ diffy = (y - context->start_root_y) * impl->surface_scale;
switch (context->op)
{
@@ -4637,38 +4637,38 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
new_rect.left += diffx;
new_rect.top += diffy;
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
new_rect.top += diffy;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
new_rect.right += diffx;
new_rect.top += diffy;
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
new_rect.left += diffx;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
new_rect.right += diffx;
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
new_rect.left += diffx;
new_rect.bottom += diffy;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
new_rect.bottom += diffy;
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
default:
new_rect.right += diffx;
new_rect.bottom += diffy;
@@ -4681,7 +4681,7 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
*/
memset (&mmi, 0, sizeof (mmi));
- if (!_gdk_win32_window_fill_min_max_info (window, &mmi))
+ if (!_gdk_win32_surface_fill_min_max_info (window, &mmi))
break;
width = new_rect.right - new_rect.left;
@@ -4691,15 +4691,15 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
{
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- case GDK_WINDOW_EDGE_WEST:
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
new_rect.left = new_rect.right - mmi.ptMaxTrackSize.x;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
- case GDK_WINDOW_EDGE_EAST:
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
default:
new_rect.right = new_rect.left + mmi.ptMaxTrackSize.x;
break;
@@ -4709,15 +4709,15 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
{
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- case GDK_WINDOW_EDGE_WEST:
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
new_rect.left = new_rect.right - mmi.ptMinTrackSize.x;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
- case GDK_WINDOW_EDGE_EAST:
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
default:
new_rect.right = new_rect.left + mmi.ptMinTrackSize.x;
break;
@@ -4728,14 +4728,14 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
{
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- case GDK_WINDOW_EDGE_NORTH:
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
new_rect.top = new_rect.bottom - mmi.ptMaxTrackSize.y;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- case GDK_WINDOW_EDGE_SOUTH:
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
default:
new_rect.bottom = new_rect.top + mmi.ptMaxTrackSize.y;
break;
@@ -4745,14 +4745,14 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
{
switch (context->edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- case GDK_WINDOW_EDGE_NORTH:
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
new_rect.top = new_rect.bottom - mmi.ptMinTrackSize.y;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- case GDK_WINDOW_EDGE_SOUTH:
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
default:
new_rect.bottom = new_rect.top + mmi.ptMinTrackSize.y;
break;
@@ -4801,7 +4801,7 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
&window_size,
&window_position);
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED,
window_position.x, window_position.y,
0, 0,
@@ -4815,20 +4815,20 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window,
}
static void
-gdk_win32_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+gdk_win32_surface_begin_resize_drag (GdkSurface *window,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- IsIconic (GDK_WINDOW_HWND (window)))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ IsIconic (GDK_SURFACE_HWND (window)))
return;
/* Tell Windows to start interactively resizing the window by pretending that
@@ -4841,10 +4841,10 @@ gdk_win32_window_begin_resize_drag (GdkWindow *window,
if (button != 1)
return;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
- gdk_win32_window_end_move_resize_drag (window);
+ gdk_win32_surface_end_move_resize_drag (window);
setup_drag_move_resize_context (window, &impl->drag_move_resize_context,
GDK_WIN32_DRAGOP_RESIZE, edge, device,
@@ -4852,19 +4852,19 @@ gdk_win32_window_begin_resize_drag (GdkWindow *window,
}
static void
-gdk_win32_window_begin_move_drag (GdkWindow *window,
+gdk_win32_surface_begin_move_drag (GdkSurface *window,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window) ||
- IsIconic (GDK_WINDOW_HWND (window)))
+ if (GDK_SURFACE_DESTROYED (window) ||
+ IsIconic (GDK_SURFACE_HWND (window)))
return;
/* Tell Windows to start interactively moving the window by pretending that
@@ -4876,13 +4876,13 @@ gdk_win32_window_begin_move_drag (GdkWindow *window,
if (button != 1)
return;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
- gdk_win32_window_end_move_resize_drag (window);
+ gdk_win32_surface_end_move_resize_drag (window);
setup_drag_move_resize_context (window, &impl->drag_move_resize_context,
- GDK_WIN32_DRAGOP_MOVE, GDK_WINDOW_EDGE_NORTH_WEST,
+ GDK_WIN32_DRAGOP_MOVE, GDK_SURFACE_EDGE_NORTH_WEST,
device, button, root_x, root_y, timestamp);
}
@@ -4891,140 +4891,140 @@ gdk_win32_window_begin_move_drag (GdkWindow *window,
* Setting window states
*/
static void
-gdk_win32_window_iconify (GdkWindow *window)
+gdk_win32_surface_iconify (GdkSurface *window)
{
HWND old_active_window;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_iconify: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_iconify: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
old_active_window = GetActiveWindow ();
GtkShowWindow (window, SW_MINIMIZE);
- if (old_active_window != GDK_WINDOW_HWND (window))
+ if (old_active_window != GDK_SURFACE_HWND (window))
SetActiveWindow (old_active_window);
}
else
{
- gdk_synthesize_window_state (window,
+ gdk_synthesize_surface_state (window,
0,
- GDK_WINDOW_STATE_ICONIFIED);
+ GDK_SURFACE_STATE_ICONIFIED);
}
}
static void
-gdk_win32_window_deiconify (GdkWindow *window)
+gdk_win32_surface_deiconify (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_deiconify: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_deiconify: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
- show_window_internal (window, GDK_WINDOW_IS_MAPPED (window), TRUE);
+ show_window_internal (window, GDK_SURFACE_IS_MAPPED (window), TRUE);
}
else
{
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_ICONIFIED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_ICONIFIED,
0);
}
}
static void
-gdk_win32_window_stick (GdkWindow *window)
+gdk_win32_surface_stick (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
/* FIXME: Do something? */
}
static void
-gdk_win32_window_unstick (GdkWindow *window)
+gdk_win32_surface_unstick (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
/* FIXME: Do something? */
}
static void
-gdk_win32_window_maximize (GdkWindow *window)
+gdk_win32_surface_maximize (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_maximize: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_maximize: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
GtkShowWindow (window, SW_MAXIMIZE);
else
- gdk_synthesize_window_state (window,
+ gdk_synthesize_surface_state (window,
0,
- GDK_WINDOW_STATE_MAXIMIZED);
+ GDK_SURFACE_STATE_MAXIMIZED);
}
static void
-gdk_win32_window_unmaximize (GdkWindow *window)
+gdk_win32_surface_unmaximize (GdkSurface *window)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_unmaximize: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_unmaximize: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
GtkShowWindow (window, SW_RESTORE);
else
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_MAXIMIZED,
+ gdk_synthesize_surface_state (window,
+ GDK_SURFACE_STATE_MAXIMIZED,
0);
}
static void
-gdk_win32_window_fullscreen (GdkWindow *window)
+gdk_win32_surface_fullscreen (GdkSurface *window)
{
gint x, y, width, height;
FullscreenInfo *fi;
HMONITOR monitor;
MONITORINFO mi;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
fi = g_new (FullscreenInfo, 1);
- if (!GetWindowRect (GDK_WINDOW_HWND (window), &(fi->r)))
+ if (!GetWindowRect (GDK_SURFACE_HWND (window), &(fi->r)))
g_free (fi);
else
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST);
mi.cbSize = sizeof (mi);
if (monitor && GetMonitorInfo (monitor, &mi))
{
@@ -5044,135 +5044,135 @@ gdk_win32_window_fullscreen (GdkWindow *window)
fi->hint_flags = impl->hint_flags;
impl->hint_flags &= ~GDK_HINT_MAX_SIZE;
g_object_set_data (G_OBJECT (window), "fullscreen-info", fi);
- fi->style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
+ fi->style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
/* Send state change before configure event */
- gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
+ gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
+ SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE,
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOP,
x, y, width, height,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
}
}
static void
-gdk_win32_window_unfullscreen (GdkWindow *window)
+gdk_win32_surface_unfullscreen (GdkSurface *window)
{
FullscreenInfo *fi;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
fi = g_object_get_data (G_OBJECT (window), "fullscreen-info");
if (fi)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
+ gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0);
impl->hint_flags = fi->hint_flags;
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
+ SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, fi->style);
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_NOTOPMOST,
fi->r.left, fi->r.top,
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
g_free (fi);
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
}
}
static void
-gdk_win32_window_set_keep_above (GdkWindow *window,
+gdk_win32_surface_set_keep_above (GdkSurface *window,
gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_set_keep_above: %p: %s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_keep_above: %p: %s\n",
+ GDK_SURFACE_HWND (window),
setting ? "YES" : "NO"));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
setting ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
- gdk_synthesize_window_state (window,
- setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
- setting ? GDK_WINDOW_STATE_ABOVE : 0);
+ gdk_synthesize_surface_state (window,
+ setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE,
+ setting ? GDK_SURFACE_STATE_ABOVE : 0);
}
static void
-gdk_win32_window_set_keep_below (GdkWindow *window,
+gdk_win32_surface_set_keep_below (GdkSurface *window,
gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_set_keep_below: %p: %s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_keep_below: %p: %s\n",
+ GDK_SURFACE_HWND (window),
setting ? "YES" : "NO"));
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (window))
{
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
setting ? HWND_BOTTOM : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
- gdk_synthesize_window_state (window,
- setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
- setting ? GDK_WINDOW_STATE_BELOW : 0);
+ gdk_synthesize_surface_state (window,
+ setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW,
+ setting ? GDK_SURFACE_STATE_BELOW : 0);
}
static void
-gdk_win32_window_focus (GdkWindow *window,
+gdk_win32_surface_focus (GdkSurface *window,
guint32 timestamp)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_focus: %p: %s\n",
- GDK_WINDOW_HWND (window),
- _gdk_win32_window_state_to_string (window->state)));
+ GDK_NOTE (MISC, g_print ("gdk_surface_focus: %p: %s\n",
+ GDK_SURFACE_HWND (window),
+ _gdk_win32_surface_state_to_string (window->state)));
- if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
+ if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
GtkShowWindow (window, SW_SHOWMAXIMIZED);
- else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
+ else if (window->state & GDK_SURFACE_STATE_ICONIFIED)
GtkShowWindow (window, SW_RESTORE);
- else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
+ else if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
GtkShowWindow (window, SW_SHOWNORMAL);
else
GtkShowWindow (window, SW_SHOW);
- SetFocus (GDK_WINDOW_HWND (window));
+ SetFocus (GDK_SURFACE_HWND (window));
}
static void
-gdk_win32_window_set_modal_hint (GdkWindow *window,
+gdk_win32_surface_set_modal_hint (GdkSurface *window,
gboolean modal)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_window_set_modal_hint: %p: %s\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_modal_hint: %p: %s\n",
+ GDK_SURFACE_HWND (window),
modal ? "YES" : "NO"));
if (modal == window->modal_hint)
@@ -5182,8 +5182,8 @@ gdk_win32_window_set_modal_hint (GdkWindow *window,
#if 0
/* Not sure about this one.. -- Cody */
- if (GDK_WINDOW_IS_MAPPED (window))
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ if (GDK_SURFACE_IS_MAPPED (window))
+ API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
modal ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE));
@@ -5192,7 +5192,7 @@ gdk_win32_window_set_modal_hint (GdkWindow *window,
if (modal)
{
_gdk_push_modal_window (window);
- gdk_window_raise (window);
+ gdk_surface_raise (window);
}
else
{
@@ -5203,16 +5203,16 @@ gdk_win32_window_set_modal_hint (GdkWindow *window,
}
static void
-gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window,
+gdk_win32_surface_set_skip_taskbar_hint (GdkSurface *window,
gboolean skips_taskbar)
{
- static GdkWindow *owner = NULL;
- //GdkWindowAttr wa;
+ static GdkSurface *owner = NULL;
+ //GdkSurfaceAttr wa;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- GDK_NOTE (MISC, g_print ("gdk_window_set_skip_taskbar_hint: %p: %s, doing nothing\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_skip_taskbar_hint: %p: %s, doing nothing\n",
+ GDK_SURFACE_HWND (window),
skips_taskbar ? "YES" : "NO"));
// ### TODO: Need to figure out what to do here.
@@ -5223,21 +5223,21 @@ gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window,
#if 0
if (owner == NULL)
{
- wa.window_type = GDK_WINDOW_TEMP;
+ wa.surface_type = GDK_SURFACE_TEMP;
wa.wclass = GDK_INPUT_OUTPUT;
wa.width = wa.height = 1;
wa.event_mask = 0;
- owner = gdk_window_new_internal (NULL, &wa, 0, TRUE);
+ owner = gdk_surface_new_internal (NULL, &wa, 0, TRUE);
}
#endif
- SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, (LONG_PTR) GDK_WINDOW_HWND (owner));
+ SetWindowLongPtr (GDK_SURFACE_HWND (window), GWLP_HWNDPARENT, (LONG_PTR) GDK_SURFACE_HWND (owner));
#if 0 /* Should we also turn off the minimize and maximize buttons? */
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
- GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU));
+ SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE,
+ GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU));
- SetWindowPos (GDK_WINDOW_HWND (window), SWP_NOZORDER_SPECIFIED,
+ SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED,
0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
@@ -5245,54 +5245,54 @@ gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window,
}
else
{
- SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, 0);
+ SetWindowLongPtr (GDK_SURFACE_HWND (window), GWLP_HWNDPARENT, 0);
}
}
static void
-gdk_win32_window_set_skip_pager_hint (GdkWindow *window,
+gdk_win32_surface_set_skip_pager_hint (GdkSurface *window,
gboolean skips_pager)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- GDK_NOTE (MISC, g_print ("gdk_window_set_skip_pager_hint: %p: %s, doing nothing\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_surface_set_skip_pager_hint: %p: %s, doing nothing\n",
+ GDK_SURFACE_HWND (window),
skips_pager ? "YES" : "NO"));
}
static void
-gdk_win32_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
+gdk_win32_surface_set_type_hint (GdkSurface *window,
+ GdkSurfaceTypeHint hint)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
GDK_NOTE (MISC,
G_STMT_START{
static GEnumClass *class = NULL;
if (!class)
- class = g_type_class_ref (GDK_TYPE_WINDOW_TYPE_HINT);
- g_print ("gdk_window_set_type_hint: %p: %s\n",
- GDK_WINDOW_HWND (window),
+ class = g_type_class_ref (GDK_TYPE_SURFACE_TYPE_HINT);
+ g_print ("gdk_surface_set_type_hint: %p: %s\n",
+ GDK_SURFACE_HWND (window),
g_enum_get_value (class, hint)->value_name);
}G_STMT_END);
- ((GdkWindowImplWin32 *)window->impl)->type_hint = hint;
+ ((GdkSurfaceImplWin32 *)window->impl)->type_hint = hint;
- _gdk_win32_window_update_style_bits (window);
+ _gdk_win32_surface_update_style_bits (window);
}
-static GdkWindowTypeHint
-gdk_win32_window_get_type_hint (GdkWindow *window)
+static GdkSurfaceTypeHint
+gdk_win32_surface_get_type_hint (GdkSurface *window)
{
- g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_SURFACE_TYPE_HINT_NORMAL);
- if (GDK_WINDOW_DESTROYED (window))
- return GDK_WINDOW_TYPE_HINT_NORMAL;
+ if (GDK_SURFACE_DESTROYED (window))
+ return GDK_SURFACE_TYPE_HINT_NORMAL;
- return GDK_WINDOW_IMPL_WIN32 (window->impl)->type_hint;
+ return GDK_SURFACE_IMPL_WIN32 (window->impl)->type_hint;
}
static HRGN
@@ -5345,58 +5345,58 @@ cairo_region_to_hrgn (const cairo_region_t *region,
}
static void
-gdk_win32_window_shape_combine_region (GdkWindow *window,
+gdk_win32_surface_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
if (!shape_region)
{
- GDK_NOTE (MISC, g_print ("gdk_win32_window_shape_combine_region: %p: none\n",
- GDK_WINDOW_HWND (window)));
- SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE);
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: none\n",
+ GDK_SURFACE_HWND (window)));
+ SetWindowRgn (GDK_SURFACE_HWND (window), NULL, TRUE);
}
else
{
HRGN hrgn;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->window_scale);
+ hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->surface_scale);
- GDK_NOTE (MISC, g_print ("gdk_win32_window_shape_combine_region: %p: %p\n",
- GDK_WINDOW_HWND (window),
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: %p\n",
+ GDK_SURFACE_HWND (window),
hrgn));
do_shape_combine_region (window, hrgn, offset_x, offset_y);
}
}
-GdkWindow *
-gdk_win32_window_lookup_for_display (GdkDisplay *display,
+GdkSurface *
+gdk_win32_surface_lookup_for_display (GdkDisplay *display,
HWND anid)
{
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
- return (GdkWindow*) gdk_win32_handle_table_lookup (anid);
+ return (GdkSurface*) gdk_win32_handle_table_lookup (anid);
}
static void
-gdk_win32_window_set_opacity (GdkWindow *window,
+gdk_win32_surface_set_opacity (GdkSurface *window,
gdouble opacity)
{
LONG exstyle;
typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
PFN_SetLayeredWindowAttributes setLayeredWindowAttributes = NULL;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
- if (!WINDOW_IS_TOPLEVEL (window) || GDK_WINDOW_DESTROYED (window))
+ if (!SURFACE_IS_TOPLEVEL (window) || GDK_SURFACE_DESTROYED (window))
return;
if (opacity < 0)
@@ -5404,7 +5404,7 @@ gdk_win32_window_set_opacity (GdkWindow *window,
else if (opacity > 1)
opacity = 1;
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (impl->layered)
{
@@ -5414,17 +5414,17 @@ gdk_win32_window_set_opacity (GdkWindow *window,
impl->layered_opacity = opacity;
- gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect);
+ gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect);
gdk_win32_update_layered_window_from_cache (window, &window_rect);
}
return;
}
- exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
+ exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
if (!(exstyle & WS_EX_LAYERED))
- SetWindowLong (GDK_WINDOW_HWND (window),
+ SetWindowLong (GDK_SURFACE_HWND (window),
GWL_EXSTYLE,
exstyle | WS_EX_LAYERED);
@@ -5433,7 +5433,7 @@ gdk_win32_window_set_opacity (GdkWindow *window,
if (setLayeredWindowAttributes)
{
- API_CALL (setLayeredWindowAttributes, (GDK_WINDOW_HWND (window),
+ API_CALL (setLayeredWindowAttributes, (GDK_SURFACE_HWND (window),
0,
opacity * 0xff,
LWA_ALPHA));
@@ -5441,18 +5441,18 @@ gdk_win32_window_set_opacity (GdkWindow *window,
}
gboolean
-gdk_win32_window_is_win32 (GdkWindow *window)
+gdk_win32_surface_is_win32 (GdkSurface *window)
{
- return GDK_WINDOW_IS_WIN32 (window);
+ return GDK_SURFACE_IS_WIN32 (window);
}
static gboolean
-gdk_win32_window_show_window_menu (GdkWindow *window,
+gdk_win32_surface_show_window_menu (GdkSurface *window,
GdkEvent *event)
{
double event_x, event_y;
gint x, y;
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
switch (event->type)
{
@@ -5469,17 +5469,17 @@ gdk_win32_window_show_window_menu (GdkWindow *window,
x = event_x - _gdk_offset_x;
y = event_y - _gdk_offset_y;
- SendMessage (GDK_WINDOW_HWND (window),
+ SendMessage (GDK_SURFACE_HWND (window),
WM_SYSMENU,
0,
- MAKELPARAM (x * impl->window_scale, y * impl->window_scale));
+ MAKELPARAM (x * impl->surface_scale, y * impl->surface_scale));
return TRUE;
}
/**
* _gdk_win32_acquire_dc
- * @impl: a Win32 #GdkWindowImplWin32 implementation
+ * @impl: a Win32 #GdkSurfaceImplWin32 implementation
*
* Gets a DC with the given drawable selected into it.
*
@@ -5489,10 +5489,10 @@ gdk_win32_window_show_window_menu (GdkWindow *window,
* release the DC when you are done using it.
**/
static HDC
-_gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl)
+_gdk_win32_impl_acquire_dc (GdkSurfaceImplWin32 *impl)
{
- if (GDK_IS_WINDOW_IMPL_WIN32 (impl) &&
- GDK_WINDOW_DESTROYED (impl->wrapper))
+ if (GDK_IS_SURFACE_IMPL_WIN32 (impl) &&
+ GDK_SURFACE_DESTROYED (impl->wrapper))
return NULL;
/* We don't call this function for layered windows, but
@@ -5521,13 +5521,13 @@ _gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl)
/**
* _gdk_win32_impl_release_dc
- * @impl: a Win32 #GdkWindowImplWin32 implementation
+ * @impl: a Win32 #GdkSurfaceImplWin32 implementation
*
* Releases the reference count for the DC
* from _gdk_win32_impl_acquire_dc()
**/
static void
-_gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl)
+_gdk_win32_impl_release_dc (GdkSurfaceImplWin32 *impl)
{
if (impl->layered)
return;
@@ -5552,30 +5552,30 @@ _gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl)
}
HWND
-gdk_win32_window_get_impl_hwnd (GdkWindow *window)
+gdk_win32_surface_get_impl_hwnd (GdkSurface *window)
{
- if (GDK_WINDOW_IS_WIN32 (window))
- return GDK_WINDOW_HWND (window);
+ if (GDK_SURFACE_IS_WIN32 (window))
+ return GDK_SURFACE_HWND (window);
return NULL;
}
static void
gdk_win32_cairo_surface_destroy (void *data)
{
- GdkWindowImplWin32 *impl = data;
+ GdkSurfaceImplWin32 *impl = data;
_gdk_win32_impl_release_dc (impl);
impl->cairo_surface = NULL;
}
static cairo_surface_t *
-gdk_win32_ref_cairo_surface_layered (GdkWindow *window,
- GdkWindowImplWin32 *impl)
+gdk_win32_ref_cairo_surface_layered (GdkSurface *window,
+ GdkSurfaceImplWin32 *impl)
{
gint width, height;
RECT window_rect;
- gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect);
+ gdk_win32_get_window_client_area_rect (window, impl->surface_scale, &window_rect);
/* Turn client area into window area */
_gdk_win32_adjust_client_rect (window, &window_rect);
@@ -5609,8 +5609,8 @@ gdk_win32_ref_cairo_surface_layered (GdkWindow *window,
impl->cache_surface = new_cache;
cairo_surface_set_device_scale (impl->cache_surface,
- impl->window_scale,
- impl->window_scale);
+ impl->surface_scale,
+ impl->surface_scale);
if (impl->cairo_surface)
cairo_surface_destroy (impl->cairo_surface);
@@ -5631,8 +5631,8 @@ gdk_win32_ref_cairo_surface_layered (GdkWindow *window,
impl->dib_height = height;
cairo_surface_set_device_scale (impl->cairo_surface,
- impl->window_scale,
- impl->window_scale);
+ impl->surface_scale,
+ impl->surface_scale);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
impl, gdk_win32_cairo_surface_destroy);
@@ -5646,12 +5646,12 @@ gdk_win32_ref_cairo_surface_layered (GdkWindow *window,
}
static cairo_surface_t *
-gdk_win32_ref_cairo_surface (GdkWindow *window)
+gdk_win32_ref_cairo_surface (GdkSurface *window)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- if (GDK_IS_WINDOW_IMPL_WIN32 (impl) &&
- GDK_WINDOW_DESTROYED (impl->wrapper))
+ if (GDK_IS_SURFACE_IMPL_WIN32 (impl) &&
+ GDK_SURFACE_DESTROYED (impl->wrapper))
return NULL;
if (impl->layered)
@@ -5665,8 +5665,8 @@ gdk_win32_ref_cairo_surface (GdkWindow *window)
impl->cairo_surface = cairo_win32_surface_create_with_format (hdc, CAIRO_FORMAT_ARGB32);
cairo_surface_set_device_scale (impl->cairo_surface,
- impl->window_scale,
- impl->window_scale);
+ impl->surface_scale,
+ impl->surface_scale);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
impl, gdk_win32_cairo_surface_destroy);
@@ -5678,7 +5678,7 @@ gdk_win32_ref_cairo_surface (GdkWindow *window)
}
BOOL WINAPI
-GtkShowWindow (GdkWindow *window,
+GtkShowWindow (GdkSurface *window,
int cmd_show)
{
cairo_t *cr;
@@ -5690,8 +5690,8 @@ GtkShowWindow (GdkWindow *window,
POINT source_point;
BLENDFUNCTION blender;
- HWND hwnd = GDK_WINDOW_HWND (window);
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ HWND hwnd = GDK_SURFACE_HWND (window);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
switch (cmd_show)
{
@@ -5735,7 +5735,7 @@ GtkShowWindow (GdkWindow *window,
surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32,
window_size.cx,
window_size.cy);
- cairo_surface_set_device_scale (surface, impl->window_scale, impl->window_scale);
+ cairo_surface_set_device_scale (surface, impl->surface_scale, impl->surface_scale);
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
@@ -5763,18 +5763,18 @@ GtkShowWindow (GdkWindow *window,
}
static void
-gdk_win32_window_set_shadow_width (GdkWindow *window,
+gdk_win32_surface_set_shadow_width (GdkSurface *window,
gint left,
gint right,
gint top,
gint bottom)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_set_shadow_width: window %p, "
+ GDK_NOTE (MISC, g_print ("gdk_win32_surface_set_shadow_width: window %p, "
"left %d, top %d, right %d, bottom %d\n",
window, left, top, right, bottom));
@@ -5784,45 +5784,45 @@ gdk_win32_window_set_shadow_width (GdkWindow *window,
return;
impl->margins.left = left;
- impl->margins.right = right * impl->window_scale;
+ impl->margins.right = right * impl->surface_scale;
impl->margins.top = top;
- impl->margins.bottom = bottom * impl->window_scale;
+ impl->margins.bottom = bottom * impl->surface_scale;
impl->margins_x = left + right;
impl->margins_y = top + bottom;
}
gint
-_gdk_win32_window_get_scale_factor (GdkWindow *window)
+_gdk_win32_surface_get_scale_factor (GdkSurface *window)
{
GdkDisplay *display;
- GdkWindowImplWin32 *impl;
+ GdkSurfaceImplWin32 *impl;
GdkWin32Display *win32_display;
UINT dpix, dpiy;
gboolean is_scale_acquired;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (window))
return 1;
g_return_val_if_fail (window != NULL, 1);
- display = gdk_window_get_display (window);
- impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ display = gdk_surface_get_display (window);
+ impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
win32_display = GDK_WIN32_DISPLAY (display);
if (win32_display->dpi_aware_type != PROCESS_DPI_UNAWARE)
{
if (win32_display->has_fixed_scale)
- impl->window_scale = win32_display->window_scale;
+ impl->surface_scale = win32_display->surface_scale;
else
- impl->window_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display,
+ impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display,
NULL,
- GDK_WINDOW_HWND (window),
+ GDK_SURFACE_HWND (window),
NULL);
- return impl->window_scale;
+ return impl->surface_scale;
}
else
{
@@ -5843,11 +5843,11 @@ _gdk_win32_window_get_scale_factor (GdkWindow *window)
}
void
-_gdk_win32_window_get_unscaled_size (GdkWindow *window,
+_gdk_win32_surface_get_unscaled_size (GdkSurface *window,
gint *unscaled_width,
gint *unscaled_height)
{
- GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+ GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (unscaled_width)
*unscaled_width = impl->unscaled_width;
@@ -5856,7 +5856,7 @@ _gdk_win32_window_get_unscaled_size (GdkWindow *window,
}
static void
-gdk_win32_input_shape_combine_region (GdkWindow *window,
+gdk_win32_input_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
@@ -5867,93 +5867,93 @@ gdk_win32_input_shape_combine_region (GdkWindow *window,
}
static void
-gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
+gdk_surface_impl_win32_class_init (GdkSurfaceImplWin32Class *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = gdk_window_impl_win32_finalize;
+ object_class->finalize = gdk_surface_impl_win32_finalize;
impl_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
- impl_class->show = gdk_win32_window_show;
- impl_class->hide = gdk_win32_window_hide;
- impl_class->withdraw = gdk_win32_window_withdraw;
- impl_class->set_events = gdk_win32_window_set_events;
- impl_class->get_events = gdk_win32_window_get_events;
- impl_class->raise = gdk_win32_window_raise;
- impl_class->lower = gdk_win32_window_lower;
- impl_class->restack_toplevel = gdk_win32_window_restack_toplevel;
- impl_class->move_resize = gdk_win32_window_move_resize;
- impl_class->get_geometry = gdk_win32_window_get_geometry;
- impl_class->get_device_state = gdk_window_win32_get_device_state;
- impl_class->get_root_coords = gdk_win32_window_get_root_coords;
-
- impl_class->shape_combine_region = gdk_win32_window_shape_combine_region;
+ impl_class->show = gdk_win32_surface_show;
+ impl_class->hide = gdk_win32_surface_hide;
+ impl_class->withdraw = gdk_win32_surface_withdraw;
+ impl_class->set_events = gdk_win32_surface_set_events;
+ impl_class->get_events = gdk_win32_surface_get_events;
+ impl_class->raise = gdk_win32_surface_raise;
+ impl_class->lower = gdk_win32_surface_lower;
+ impl_class->restack_toplevel = gdk_win32_surface_restack_toplevel;
+ impl_class->move_resize = gdk_win32_surface_move_resize;
+ impl_class->get_geometry = gdk_win32_surface_get_geometry;
+ impl_class->get_device_state = gdk_surface_win32_get_device_state;
+ impl_class->get_root_coords = gdk_win32_surface_get_root_coords;
+
+ impl_class->shape_combine_region = gdk_win32_surface_shape_combine_region;
impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region;
- impl_class->destroy = gdk_win32_window_destroy;
- impl_class->begin_paint = gdk_win32_window_begin_paint;
- impl_class->end_paint = gdk_win32_window_end_paint;
-
- //impl_class->beep = gdk_x11_window_beep;
-
-
- impl_class->show_window_menu = gdk_win32_window_show_window_menu;
- impl_class->focus = gdk_win32_window_focus;
- impl_class->set_type_hint = gdk_win32_window_set_type_hint;
- impl_class->get_type_hint = gdk_win32_window_get_type_hint;
- impl_class->set_modal_hint = gdk_win32_window_set_modal_hint;
- impl_class->set_skip_taskbar_hint = gdk_win32_window_set_skip_taskbar_hint;
- impl_class->set_skip_pager_hint = gdk_win32_window_set_skip_pager_hint;
- impl_class->set_urgency_hint = gdk_win32_window_set_urgency_hint;
- impl_class->set_geometry_hints = gdk_win32_window_set_geometry_hints;
- impl_class->set_title = gdk_win32_window_set_title;
- impl_class->set_role = gdk_win32_window_set_role;
- //impl_class->set_startup_id = gdk_x11_window_set_startup_id;
- impl_class->set_transient_for = gdk_win32_window_set_transient_for;
- impl_class->get_frame_extents = gdk_win32_window_get_frame_extents;
- impl_class->set_accept_focus = gdk_win32_window_set_accept_focus;
- impl_class->set_focus_on_map = gdk_win32_window_set_focus_on_map;
- impl_class->set_icon_list = gdk_win32_window_set_icon_list;
- impl_class->set_icon_name = gdk_win32_window_set_icon_name;
- impl_class->iconify = gdk_win32_window_iconify;
- impl_class->deiconify = gdk_win32_window_deiconify;
- impl_class->stick = gdk_win32_window_stick;
- impl_class->unstick = gdk_win32_window_unstick;
- impl_class->maximize = gdk_win32_window_maximize;
- impl_class->unmaximize = gdk_win32_window_unmaximize;
- impl_class->fullscreen = gdk_win32_window_fullscreen;
- impl_class->unfullscreen = gdk_win32_window_unfullscreen;
- impl_class->set_keep_above = gdk_win32_window_set_keep_above;
- impl_class->set_keep_below = gdk_win32_window_set_keep_below;
- impl_class->get_group = gdk_win32_window_get_group;
- impl_class->set_group = gdk_win32_window_set_group;
- impl_class->set_decorations = gdk_win32_window_set_decorations;
- impl_class->get_decorations = gdk_win32_window_get_decorations;
- impl_class->set_functions = gdk_win32_window_set_functions;
-
- impl_class->set_shadow_width = gdk_win32_window_set_shadow_width;
- impl_class->begin_resize_drag = gdk_win32_window_begin_resize_drag;
- impl_class->begin_move_drag = gdk_win32_window_begin_move_drag;
- impl_class->set_opacity = gdk_win32_window_set_opacity;
- impl_class->destroy_notify = gdk_win32_window_destroy_notify;
- impl_class->register_dnd = _gdk_win32_window_register_dnd;
- impl_class->drag_begin = _gdk_win32_window_drag_begin;
- impl_class->create_gl_context = _gdk_win32_window_create_gl_context;
- impl_class->get_scale_factor = _gdk_win32_window_get_scale_factor;
- impl_class->get_unscaled_size = _gdk_win32_window_get_unscaled_size;
+ impl_class->destroy = gdk_win32_surface_destroy;
+ impl_class->begin_paint = gdk_win32_surface_begin_paint;
+ impl_class->end_paint = gdk_win32_surface_end_paint;
+
+ //impl_class->beep = gdk_x11_surface_beep;
+
+
+ impl_class->show_window_menu = gdk_win32_surface_show_window_menu;
+ impl_class->focus = gdk_win32_surface_focus;
+ impl_class->set_type_hint = gdk_win32_surface_set_type_hint;
+ impl_class->get_type_hint = gdk_win32_surface_get_type_hint;
+ impl_class->set_modal_hint = gdk_win32_surface_set_modal_hint;
+ impl_class->set_skip_taskbar_hint = gdk_win32_surface_set_skip_taskbar_hint;
+ impl_class->set_skip_pager_hint = gdk_win32_surface_set_skip_pager_hint;
+ impl_class->set_urgency_hint = gdk_win32_surface_set_urgency_hint;
+ impl_class->set_geometry_hints = gdk_win32_surface_set_geometry_hints;
+ impl_class->set_title = gdk_win32_surface_set_title;
+ impl_class->set_role = gdk_win32_surface_set_role;
+ //impl_class->set_startup_id = gdk_x11_surface_set_startup_id;
+ impl_class->set_transient_for = gdk_win32_surface_set_transient_for;
+ impl_class->get_frame_extents = gdk_win32_surface_get_frame_extents;
+ impl_class->set_accept_focus = gdk_win32_surface_set_accept_focus;
+ impl_class->set_focus_on_map = gdk_win32_surface_set_focus_on_map;
+ impl_class->set_icon_list = gdk_win32_surface_set_icon_list;
+ impl_class->set_icon_name = gdk_win32_surface_set_icon_name;
+ impl_class->iconify = gdk_win32_surface_iconify;
+ impl_class->deiconify = gdk_win32_surface_deiconify;
+ impl_class->stick = gdk_win32_surface_stick;
+ impl_class->unstick = gdk_win32_surface_unstick;
+ impl_class->maximize = gdk_win32_surface_maximize;
+ impl_class->unmaximize = gdk_win32_surface_unmaximize;
+ impl_class->fullscreen = gdk_win32_surface_fullscreen;
+ impl_class->unfullscreen = gdk_win32_surface_unfullscreen;
+ impl_class->set_keep_above = gdk_win32_surface_set_keep_above;
+ impl_class->set_keep_below = gdk_win32_surface_set_keep_below;
+ impl_class->get_group = gdk_win32_surface_get_group;
+ impl_class->set_group = gdk_win32_surface_set_group;
+ impl_class->set_decorations = gdk_win32_surface_set_decorations;
+ impl_class->get_decorations = gdk_win32_surface_get_decorations;
+ impl_class->set_functions = gdk_win32_surface_set_functions;
+
+ impl_class->set_shadow_width = gdk_win32_surface_set_shadow_width;
+ impl_class->begin_resize_drag = gdk_win32_surface_begin_resize_drag;
+ impl_class->begin_move_drag = gdk_win32_surface_begin_move_drag;
+ impl_class->set_opacity = gdk_win32_surface_set_opacity;
+ impl_class->destroy_notify = gdk_win32_surface_destroy_notify;
+ impl_class->register_dnd = _gdk_win32_surface_register_dnd;
+ impl_class->drag_begin = _gdk_win32_surface_drag_begin;
+ impl_class->create_gl_context = _gdk_win32_surface_create_gl_context;
+ impl_class->get_scale_factor = _gdk_win32_surface_get_scale_factor;
+ impl_class->get_unscaled_size = _gdk_win32_surface_get_unscaled_size;
}
HGDIOBJ
-gdk_win32_window_get_handle (GdkWindow *window)
+gdk_win32_surface_get_handle (GdkSurface *window)
{
- if (!GDK_WINDOW_IS_WIN32 (window))
+ if (!GDK_SURFACE_IS_WIN32 (window))
{
g_warning (G_STRLOC " window is not a native Win32 window");
return NULL;
}
- return GDK_WINDOW_HWND (window);
+ return GDK_SURFACE_HWND (window);
}
diff --git a/gdk/win32/gdkwindow-win32.h b/gdk/win32/gdksurface-win32.h
index 101b23f827..c037a33281 100644
--- a/gdk/win32/gdkwindow-win32.h
+++ b/gdk/win32/gdksurface-win32.h
@@ -22,11 +22,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_WINDOW_WIN32_H__
-#define __GDK_WINDOW_WIN32_H__
+#ifndef __GDK_SURFACE_WIN32_H__
+#define __GDK_SURFACE_WIN32_H__
#include "gdk/win32/gdkprivate-win32.h"
-#include "gdk/gdkwindowimpl.h"
+#include "gdk/gdksurfaceimpl.h"
#include "gdk/gdkcursor.h"
#include <windows.h>
@@ -36,15 +36,15 @@ G_BEGIN_DECLS
/* Window implementation for Win32
*/
-typedef struct _GdkWindowImplWin32 GdkWindowImplWin32;
-typedef struct _GdkWindowImplWin32Class GdkWindowImplWin32Class;
+typedef struct _GdkSurfaceImplWin32 GdkSurfaceImplWin32;
+typedef struct _GdkSurfaceImplWin32Class GdkSurfaceImplWin32Class;
-#define GDK_TYPE_WINDOW_IMPL_WIN32 (_gdk_window_impl_win32_get_type ())
-#define GDK_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32))
-#define GDK_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class))
-#define GDK_IS_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_WIN32))
-#define GDK_IS_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WIN32))
-#define GDK_WINDOW_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class))
+#define GDK_TYPE_SURFACE_IMPL_WIN32 (_gdk_surface_impl_win32_get_type ())
+#define GDK_SURFACE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32))
+#define GDK_SURFACE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32Class))
+#define GDK_IS_SURFACE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_WIN32))
+#define GDK_IS_SURFACE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_WIN32))
+#define GDK_SURFACE_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32Class))
enum _GdkWin32AeroSnapCombo
{
@@ -107,13 +107,13 @@ typedef enum _GdkWin32MonitorDpiType
struct _GdkW32DragMoveResizeContext
{
/* The window that is being moved/resized */
- GdkWindow *window;
+ GdkSurface *window;
/* The kind of drag-operation going on. */
GdkW32WindowDragOp op;
/* The edge that was grabbed for resizing. Not used for moving. */
- GdkWindowEdge edge;
+ GdkSurfaceEdge edge;
/* The device used to initiate the op.
* We grab it at the beginning and ungrab it at the end.
@@ -223,14 +223,14 @@ struct _GdkW32DragMoveResizeContext
typedef struct _GdkW32DragMoveResizeContext GdkW32DragMoveResizeContext;
-struct _GdkWindowImplWin32
+struct _GdkSurfaceImplWin32
{
- GdkWindowImpl parent_instance;
+ GdkSurfaceImpl parent_instance;
- GdkWindow *wrapper;
+ GdkSurface *wrapper;
HANDLE handle;
- gint8 toplevel_window_type;
+ gint8 toplevel_surface_type;
HICON hicon_big;
HICON hicon_small;
@@ -249,9 +249,9 @@ struct _GdkWindowImplWin32
GdkEventMask native_event_mask;
- GdkWindowTypeHint type_hint;
+ GdkSurfaceTypeHint type_hint;
- GdkWindow *transient_owner;
+ GdkSurface *transient_owner;
GSList *transient_children;
gint num_transients;
gboolean changing_state;
@@ -286,7 +286,7 @@ struct _GdkWindowImplWin32
guint have_temp_styles : 1;
/* If TRUE, the window is in the process of being maximized.
- * This is set by WM_SYSCOMMAND and by gdk_win32_window_maximize (),
+ * This is set by WM_SYSCOMMAND and by gdk_win32_surface_maximize (),
* and is unset when WM_WINDOWPOSCHANGING is handled.
*/
guint maximizing : 1;
@@ -334,7 +334,7 @@ struct _GdkWindowImplWin32
/* Also remember the same position, but in absolute form. */
GdkRectangle *snap_stash_int;
- /* Decorations set by gdk_window_set_decorations() or NULL if unset */
+ /* Decorations set by gdk_surface_set_decorations() or NULL if unset */
GdkWMDecoration* decorations;
/* No. of windows to force layered windows off */
@@ -347,30 +347,30 @@ struct _GdkWindowImplWin32
LONG_PTR temp_styles;
/* scale of window on HiDPI */
- gint window_scale;
+ gint surface_scale;
gint unscaled_width;
gint unscaled_height;
};
-struct _GdkWindowImplWin32Class
+struct _GdkSurfaceImplWin32Class
{
- GdkWindowImplClass parent_class;
+ GdkSurfaceImplClass parent_class;
};
-GType _gdk_window_impl_win32_get_type (void);
+GType _gdk_surface_impl_win32_get_type (void);
-void _gdk_win32_window_tmp_unset_bg (GdkWindow *window,
+void _gdk_win32_surface_tmp_unset_bg (GdkSurface *window,
gboolean recurse);
-void _gdk_win32_window_tmp_reset_bg (GdkWindow *window,
+void _gdk_win32_surface_tmp_reset_bg (GdkSurface *window,
gboolean recurse);
-void _gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window);
-void _gdk_win32_window_tmp_reset_parent_bg (GdkWindow *window);
+void _gdk_win32_surface_tmp_unset_parent_bg (GdkSurface *window);
+void _gdk_win32_surface_tmp_reset_parent_bg (GdkSurface *window);
-void _gdk_win32_window_update_style_bits (GdkWindow *window);
+void _gdk_win32_surface_update_style_bits (GdkSurface *window);
-gint _gdk_win32_window_get_scale_factor (GdkWindow *window);
+gint _gdk_win32_surface_get_scale_factor (GdkSurface *window);
G_END_DECLS
-#endif /* __GDK_WINDOW_WIN32_H__ */
+#endif /* __GDK_SURFACE_WIN32_H__ */
diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c
index edf735dd16..583d762ecb 100644
--- a/gdk/win32/gdkvulkancontext-win32.c
+++ b/gdk/win32/gdkvulkancontext-win32.c
@@ -38,7 +38,7 @@ static VkResult
gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
VkSurfaceKHR *surface)
{
- GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
+ GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
VkWin32SurfaceCreateInfoKHR info;
@@ -46,7 +46,7 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
info.pNext = NULL;
info.flags = 0;
info.hinstance = _gdk_dll_hinstance;
- info.hwnd = GDK_WINDOW_HWND (window);
+ info.hwnd = GDK_SURFACE_HWND (window);
/* This is necessary so that Vulkan sees the Window.
* Usually, vkCreateWin32SurfaceKHR() will not cause a problem to happen as
diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h
index e098366e0f..f4001dabb5 100644
--- a/gdk/win32/gdkwin32.h
+++ b/gdk/win32/gdkwin32.h
@@ -33,7 +33,7 @@
#include <gdk/win32/gdkwin32dnd.h>
#include <gdk/win32/gdkwin32keys.h>
#include <gdk/win32/gdkwin32screen.h>
-#include <gdk/win32/gdkwin32window.h>
+#include <gdk/win32/gdkwin32surface.h>
#include <gdk/win32/gdkwin32misc.h>
#include <gdk/win32/gdkwin32monitor.h>
#include <gdk/win32/gdkwin32glcontext.h>
diff --git a/gdk/win32/gdkwin32dnd-private.h b/gdk/win32/gdkwin32dnd-private.h
index 769662e5ae..a6f414a9a0 100644
--- a/gdk/win32/gdkwin32dnd-private.h
+++ b/gdk/win32/gdkwin32dnd-private.h
@@ -29,8 +29,8 @@ G_BEGIN_DECLS
struct _GdkWin32DragContext
{
GdkDragContext context;
- GdkWindow *ipc_window;
- GdkWindow *drag_window;
+ GdkSurface *ipc_window;
+ GdkSurface *drag_surface;
GdkCursor *cursor;
GdkSeat *grab_seat;
GdkDragAction actions;
diff --git a/gdk/win32/gdkwin32misc.h b/gdk/win32/gdkwin32misc.h
index 1bc11f5164..75c5fc7ca1 100644
--- a/gdk/win32/gdkwin32misc.h
+++ b/gdk/win32/gdkwin32misc.h
@@ -44,10 +44,10 @@ G_BEGIN_DECLS
#include "gdkprivate-win32.h"
-#define GDK_WINDOW_HWND(win) (GDK_WINDOW_IMPL_WIN32(win->impl)->handle)
+#define GDK_SURFACE_HWND(win) (GDK_SURFACE_IMPL_WIN32(win->impl)->handle)
#else
/* definition for exported 'internals' go here */
-#define GDK_WINDOW_HWND(d) (gdk_win32_window_get_handle (d))
+#define GDK_SURFACE_HWND(d) (gdk_win32_surface_get_handle (d))
#endif /* INSIDE_GDK_WIN32 */
@@ -68,24 +68,24 @@ G_BEGIN_DECLS
#define XBUTTON2 2
#endif
-/* Return true if the GdkWindow is a win32 implemented window */
+/* Return true if the GdkSurface is a win32 implemented window */
GDK_AVAILABLE_IN_ALL
-gboolean gdk_win32_window_is_win32 (GdkWindow *window);
+gboolean gdk_win32_surface_is_win32 (GdkSurface *window);
GDK_AVAILABLE_IN_ALL
-HWND gdk_win32_window_get_impl_hwnd (GdkWindow *window);
+HWND gdk_win32_surface_get_impl_hwnd (GdkSurface *window);
/* Return the Gdk* for a particular HANDLE */
GDK_AVAILABLE_IN_ALL
gpointer gdk_win32_handle_table_lookup (HWND handle);
/* Translate from window to Windows handle */
GDK_AVAILABLE_IN_ALL
-HGDIOBJ gdk_win32_window_get_handle (GdkWindow *window);
+HGDIOBJ gdk_win32_surface_get_handle (GdkSurface *window);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
+GdkSurface * gdk_win32_surface_foreign_new_for_display (GdkDisplay *display,
HWND anid);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gdk_win32_window_lookup_for_display (GdkDisplay *display,
+GdkSurface * gdk_win32_surface_lookup_for_display (GdkDisplay *display,
HWND anid);
#if defined (INSIDE_GDK_WIN32) || defined (GDK_COMPILATION) || defined (GTK_COMPILATION)
diff --git a/gdk/win32/gdkwin32window.h b/gdk/win32/gdkwin32surface.h
index 999ea8d2b2..9dda179353 100644
--- a/gdk/win32/gdkwin32window.h
+++ b/gdk/win32/gdkwin32surface.h
@@ -22,8 +22,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_WIN32_WINDOW_H__
-#define __GDK_WIN32_WINDOW_H__
+#ifndef __GDK_WIN32_SURFACE_H__
+#define __GDK_WIN32_SURFACE_H__
#if !defined (__GDKWIN32_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkwin32.h> can be included directly."
@@ -33,23 +33,23 @@
G_BEGIN_DECLS
-#define GDK_TYPE_WIN32_WINDOW (gdk_win32_window_get_type ())
-#define GDK_WIN32_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WIN32_WINDOW, GdkWin32Window))
-#define GDK_WIN32_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_WINDOW, GdkWin32WindowClass))
-#define GDK_IS_WIN32_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WIN32_WINDOW))
-#define GDK_IS_WIN32_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_WINDOW))
-#define GDK_WIN32_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_WINDOW, GdkWin32WindowClass))
+#define GDK_TYPE_WIN32_SURFACE (gdk_win32_surface_get_type ())
+#define GDK_WIN32_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WIN32_SURFACE, GdkWin32Surface))
+#define GDK_WIN32_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_SURFACE, GdkWin32SurfaceClass))
+#define GDK_IS_WIN32_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WIN32_SURFACE))
+#define GDK_IS_WIN32_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_SURFACE))
+#define GDK_WIN32_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_SURFACE, GdkWin32SurfaceClass))
#ifdef GDK_COMPILATION
-typedef struct _GdkWin32Window GdkWin32Window;
+typedef struct _GdkWin32Surface GdkWin32Surface;
#else
-typedef GdkWindow GdkWin32Window;
+typedef GdkSurface GdkWin32Surface;
#endif
-typedef struct _GdkWin32WindowClass GdkWin32WindowClass;
+typedef struct _GdkWin32SurfaceClass GdkWin32SurfaceClass;
GDK_AVAILABLE_IN_ALL
-GType gdk_win32_window_get_type (void);
+GType gdk_win32_surface_get_type (void);
G_END_DECLS
-#endif /* __GDK_X11_WINDOW_H__ */
+#endif /* __GDK_X11_SURFACE_H__ */
diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build
index c99f60981b..d609ca8d03 100644
--- a/gdk/win32/meson.build
+++ b/gdk/win32/meson.build
@@ -21,7 +21,7 @@ gdk_win32_sources = files([
'gdkwin32cursor.h',
'gdkwin32display.h',
'gdkwin32id.c',
- 'gdkwindow-win32.c',
+ 'gdksurface-win32.c',
])
gdk_win32_public_headers = files([
@@ -34,7 +34,7 @@ gdk_win32_public_headers = files([
'gdkwin32misc.h',
'gdkwin32monitor.h',
'gdkwin32screen.h',
- 'gdkwin32window.h',
+ 'gdkwin32surface.h',
])
install_headers(gdk_win32_public_headers, subdir: 'gtk-4.0/gdk/win32/')
diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c
index 8cd0408661..3f875422a9 100644
--- a/gdk/x11/gdkdevice-core-x11.c
+++ b/gdk/x11/gdkdevice-core-x11.c
@@ -22,7 +22,7 @@
#include "gdkdeviceprivate.h"
#include "gdkinternals.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkprivate-x11.h"
#include "gdkdisplay-x11.h"
#include "gdkasync.h"
@@ -40,45 +40,45 @@ struct _GdkX11DeviceCoreClass
};
static gboolean gdk_x11_device_core_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_x11_device_core_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
-static void gdk_x11_device_core_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+static void gdk_x11_device_core_set_surface_cursor (GdkDevice *device,
+ 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,
- GdkWindow *window,
- GdkWindow **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,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_x11_device_core_ungrab (GdkDevice *device,
guint32 time_);
-static GdkWindow * gdk_x11_device_core_window_at_position (GdkDevice *device,
+static GdkSurface * gdk_x11_device_core_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
-static void gdk_x11_device_core_select_window_events (GdkDevice *device,
- GdkWindow *window,
+static void gdk_x11_device_core_select_surface_events (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkX11DeviceCore, gdk_x11_device_core, GDK_TYPE_DEVICE)
@@ -90,13 +90,13 @@ gdk_x11_device_core_class_init (GdkX11DeviceCoreClass *klass)
device_class->get_history = gdk_x11_device_core_get_history;
device_class->get_state = gdk_x11_device_core_get_state;
- device_class->set_window_cursor = gdk_x11_device_core_set_window_cursor;
+ device_class->set_surface_cursor = gdk_x11_device_core_set_surface_cursor;
device_class->warp = gdk_x11_device_core_warp;
device_class->query_state = gdk_x11_device_core_query_state;
device_class->grab = gdk_x11_device_core_grab;
device_class->ungrab = gdk_x11_device_core_ungrab;
- device_class->window_at_position = gdk_x11_device_core_window_at_position;
- device_class->select_window_events = gdk_x11_device_core_select_window_events;
+ device_class->surface_at_position = gdk_x11_device_core_surface_at_position;
+ device_class->select_surface_events = gdk_x11_device_core_select_surface_events;
}
static void
@@ -111,16 +111,16 @@ gdk_x11_device_core_init (GdkX11DeviceCore *device_core)
}
static gboolean
-impl_coord_in_window (GdkWindow *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 (GdkWindow *window,
static gboolean
gdk_x11_device_core_get_history (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
@@ -136,15 +136,15 @@ gdk_x11_device_core_get_history (GdkDevice *device,
{
XTimeCoord *xcoords;
GdkTimeCoord **coords;
- GdkWindow *impl_window;
- GdkWindowImplX11 *impl;
+ GdkSurface *impl_surface;
+ GdkSurfaceImplX11 *impl;
int tmp_n_events;
int i, j;
- impl_window = _gdk_window_get_impl_window (window);
- impl = GDK_WINDOW_IMPL_X11 (impl_window->impl);
- xcoords = XGetMotionEvents (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (impl_window),
+ impl_surface = _gdk_surface_get_impl_surface (surface);
+ impl = GDK_SURFACE_IMPL_X11 (impl_surface->impl);
+ xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (impl_surface),
start, stop, &tmp_n_events);
if (!xcoords)
return FALSE;
@@ -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,
- xcoords[i].x / impl->window_scale,
- xcoords[i].y / impl->window_scale))
+ 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->window_scale - window->abs_x;
- coords[j]->axes[1] = (double)xcoords[i].y / impl->window_scale - window->abs_y;
+ coords[j]->axes[0] = (double)xcoords[i].x / impl->surface_scale - 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,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
gdouble x, y;
- gdk_window_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
if (axes)
{
@@ -210,8 +210,8 @@ gdk_x11_device_core_get_state (GdkDevice *device,
}
static void
-gdk_x11_device_core_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_x11_device_core_set_surface_cursor (GdkDevice *device,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkDisplay *display = gdk_device_get_display (device);
@@ -223,7 +223,7 @@ gdk_x11_device_core_set_window_cursor (GdkDevice *device,
xcursor = gdk_x11_display_get_xcursor (display, cursor);
XDefineCursor (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
xcursor);
}
@@ -243,14 +243,14 @@ gdk_x11_device_core_warp (GdkDevice *device,
dest = GDK_SCREEN_XROOTWIN (screen);
XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0,
- round (x * screen->window_scale),
- round (y * screen->window_scale));
+ round (x * screen->surface_scale),
+ round (y * screen->surface_scale));
}
static void
gdk_x11_device_core_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **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->window_scale;
+ scale = screen->surface_scale;
}
else
{
- xwindow = GDK_WINDOW_XID (window);
- scale = GDK_WINDOW_IMPL_X11 (window->impl)->window_scale;
+ xwindow = GDK_SURFACE_XID (surface);
+ scale = GDK_SURFACE_IMPL_X11 (surface->impl)->surface_scale;
}
if (!GDK_X11_DISPLAY (display)->trusted_client ||
- !XQueryPointer (GDK_WINDOW_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_window_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,10 +327,10 @@ gdk_x11_device_core_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_x11_device_core_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -340,15 +340,15 @@ gdk_x11_device_core_grab (GdkDevice *device,
display = gdk_device_get_display (device);
- xwindow = GDK_WINDOW_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (confine_to)
- confine_to = _gdk_window_get_impl_window (confine_to);
+ confine_to = _gdk_surface_get_impl_surface (confine_to);
- if (!confine_to || GDK_WINDOW_DESTROYED (confine_to))
+ if (!confine_to || GDK_SURFACE_DESTROYED (confine_to))
xconfine_to = None;
else
- xconfine_to = GDK_WINDOW_XID (confine_to);
+ xconfine_to = GDK_SURFACE_XID (confine_to);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, NOGRABS))
@@ -424,17 +424,17 @@ gdk_x11_device_core_ungrab (GdkDevice *device,
_gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial);
}
-static GdkWindow *
-gdk_x11_device_core_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_x11_device_core_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
GdkDisplay *display;
Display *xdisplay;
- GdkWindow *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_window_at_position (GdkDevice *device,
toplevels = gdk_x11_display_get_toplevel_windows (display);
for (list = toplevels; list != NULL; list = list->next)
{
- window = GDK_WINDOW (list->data);
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
- xwindow = GDK_WINDOW_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,8 +496,8 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
pointer_window = child;
break;
}
- gdk_window_get_geometry (window, NULL, NULL, &width, &height);
- if (winx >= 0 && winy >= 0 && winx < width * impl->window_scale && winy < height * impl->window_scale)
+ 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? */
XSetWindowAttributes attributes;
@@ -537,8 +537,8 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
break;
if (get_toplevel && last != root &&
- (window = gdk_x11_window_lookup_for_display (display, last)) != NULL &&
- window->window_type != GDK_WINDOW_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_window_at_position (GdkDevice *device,
gdk_x11_display_ungrab (display);
- window = gdk_x11_window_lookup_for_display (display, last);
+ surface = gdk_x11_surface_lookup_for_display (display, last);
impl = NULL;
- if (window)
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ if (surface)
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (win_x)
- *win_x = (window) ? (double)xwin_x / impl->window_scale : -1;
+ *win_x = (surface) ? (double)xwin_x / impl->surface_scale : -1;
if (win_y)
- *win_y = (window) ? (double)xwin_y / impl->window_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_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_x11_device_core_select_surface_events (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
- GdkEventMask filter_mask, window_mask;
+ GdkEventMask filter_mask, surface_mask;
guint xmask = 0;
gint i;
- window_mask = gdk_window_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_window_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_window_events (GdkDevice *device,
xmask |= _gdk_x11_event_mask_table[i];
}
- if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
+ if (GDK_SURFACE_XID (surface) != GDK_SURFACE_XROOTWIN (surface))
xmask |= StructureNotifyMask | PropertyChangeMask;
- XSelectInput (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_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 98d3ce38a5..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,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
-static void gdk_x11_device_xi2_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+static void gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
+ 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,
- GdkWindow *window,
- GdkWindow **child_window,
+ GdkSurface *surface,
+ GdkSurface **child_surface,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
@@ -90,22 +90,22 @@ static void gdk_x11_device_xi2_query_state (GdkDevice *device,
GdkModifierType *mask);
static GdkGrabStatus gdk_x11_device_xi2_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_x11_device_xi2_ungrab (GdkDevice *device,
guint32 time_);
-static GdkWindow * gdk_x11_device_xi2_window_at_position (GdkDevice *device,
+static GdkSurface * gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
-static void gdk_x11_device_xi2_select_window_events (GdkDevice *device,
- GdkWindow *window,
+static void gdk_x11_device_xi2_select_surface_events (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask);
@@ -125,13 +125,13 @@ gdk_x11_device_xi2_class_init (GdkX11DeviceXI2Class *klass)
object_class->set_property = gdk_x11_device_xi2_set_property;
device_class->get_state = gdk_x11_device_xi2_get_state;
- device_class->set_window_cursor = gdk_x11_device_xi2_set_window_cursor;
+ device_class->set_surface_cursor = gdk_x11_device_xi2_set_surface_cursor;
device_class->warp = gdk_x11_device_xi2_warp;
device_class->query_state = gdk_x11_device_xi2_query_state;
device_class->grab = gdk_x11_device_xi2_grab;
device_class->ungrab = gdk_x11_device_xi2_ungrab;
- device_class->window_at_position = gdk_x11_device_xi2_window_at_position;
- device_class->select_window_events = gdk_x11_device_xi2_select_window_events;
+ device_class->surface_at_position = gdk_x11_device_xi2_surface_at_position;
+ device_class->select_surface_events = gdk_x11_device_xi2_select_surface_events;
g_object_class_install_property (object_class,
PROP_DEVICE_ID,
@@ -200,7 +200,7 @@ gdk_x11_device_xi2_set_property (GObject *object,
static void
gdk_x11_device_xi2_get_state (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
@@ -238,15 +238,15 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
case GDK_AXIS_X:
case GDK_AXIS_Y:
case GDK_AXIS_IGNORE:
- if (gdk_device_get_mode (device) == GDK_MODE_WINDOW)
- _gdk_device_translate_window_coord (device, window, j, value, &axes[j]);
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
+ _gdk_device_translate_surface_coord (device, surface, j, value, &axes[j]);
else
{
gint root_x, root_y;
/* FIXME: Maybe root coords chaching should happen here */
- gdk_window_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,
@@ -275,8 +275,8 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
}
static void
-gdk_x11_device_xi2_set_window_cursor (GdkDevice *device,
- GdkWindow *window,
+gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
+ GdkSurface *surface,
GdkCursor *cursor)
{
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
@@ -286,14 +286,14 @@ gdk_x11_device_xi2_set_window_cursor (GdkDevice *device,
return;
if (cursor)
- XIDefineCursor (GDK_WINDOW_XDISPLAY (window),
+ XIDefineCursor (GDK_SURFACE_XDISPLAY (surface),
device_xi2->device_id,
- GDK_WINDOW_XID (window),
- gdk_x11_display_get_xcursor (GDK_WINDOW_DISPLAY (window), cursor));
+ GDK_SURFACE_XID (surface),
+ gdk_x11_display_get_xcursor (GDK_SURFACE_DISPLAY (surface), cursor));
else
- XIUndefineCursor (GDK_WINDOW_XDISPLAY (window),
+ XIUndefineCursor (GDK_SURFACE_XDISPLAY (surface),
device_xi2->device_id,
- GDK_WINDOW_XID (window));
+ GDK_SURFACE_XID (surface));
}
static void
@@ -310,14 +310,14 @@ gdk_x11_device_xi2_warp (GdkDevice *device,
device_xi2->device_id,
None, dest,
0, 0, 0, 0,
- round (x * screen->window_scale),
- round (y * screen->window_scale));
+ round (x * screen->surface_scale),
+ round (y * screen->surface_scale));
}
static void
gdk_x11_device_xi2_query_state (GdkDevice *device,
- GdkWindow *window,
- GdkWindow **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->window_scale;
+ scale = default_screen->surface_scale;
}
else
{
- xwindow = GDK_WINDOW_XID (window);
- scale = GDK_WINDOW_IMPL_X11 (window->impl)->window_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_window_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,10 +415,10 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
static GdkGrabStatus
gdk_x11_device_xi2_grab (GdkDevice *device,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
- GdkWindow *confine_to,
+ GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_)
{
@@ -435,7 +435,7 @@ gdk_x11_device_xi2_grab (GdkDevice *device,
/* FIXME: confine_to is actually unused */
- xwindow = GDK_WINDOW_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (!cursor)
xcursor = None;
@@ -486,19 +486,19 @@ gdk_x11_device_xi2_ungrab (GdkDevice *device,
_gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial);
}
-static GdkWindow *
-gdk_x11_device_xi2_window_at_position (GdkDevice *device,
+static GdkSurface *
+gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
GdkDisplay *display;
GdkX11Screen *screen;
Display *xdisplay;
- GdkWindow *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_window_at_position (GdkDevice *device,
toplevels = gdk_x11_display_get_toplevel_windows (display);
for (list = toplevels; list != NULL; list = list->next)
{
- window = GDK_WINDOW (list->data);
- xwindow = GDK_WINDOW_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_window_at_position (GdkDevice *device,
pointer_window = child;
break;
}
- gdk_window_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_window_at_position (GdkDevice *device,
break;
if (get_toplevel && last != root &&
- (window = gdk_x11_window_lookup_for_display (display, last)) != NULL &&
- GDK_WINDOW_TYPE (window) != GDK_WINDOW_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_window_at_position (GdkDevice *device,
if (gdk_x11_display_error_trap_pop (display) == 0)
{
- window = gdk_x11_window_lookup_for_display (display, last);
+ surface = gdk_x11_surface_lookup_for_display (display, last);
impl = NULL;
- if (window)
- impl = GDK_WINDOW_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_window_at_position (GdkDevice *device,
}
else
{
- window = NULL;
+ surface = NULL;
if (mask)
*mask = 0;
}
if (win_x)
- *win_x = (window) ? (xwin_x / impl->window_scale) : -1;
+ *win_x = (surface) ? (xwin_x / impl->surface_scale) : -1;
if (win_y)
- *win_y = (window) ? (xwin_y / impl->window_scale) : -1;
+ *win_y = (surface) ? (xwin_y / impl->surface_scale) : -1;
- return window;
+ return surface;
}
static void
-gdk_x11_device_xi2_select_window_events (GdkDevice *device,
- GdkWindow *window,
+gdk_x11_device_xi2_select_surface_events (GdkDevice *device,
+ GdkSurface *surface,
GdkEventMask event_mask)
{
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
@@ -686,8 +686,8 @@ gdk_x11_device_xi2_select_window_events (GdkDevice *device,
event_mask,
&evmask.mask_len);
- XISelectEvents (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_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 5606d8949d..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 (GdkWindow *window,
+set_user_time (GdkSurface *surface,
GdkEvent *event)
{
g_return_if_fail (event != NULL);
- window = gdk_window_get_toplevel (event->any.window);
- g_return_if_fail (GDK_IS_WINDOW (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_window_set_user_time (gdk_window_get_toplevel (window),
+ gdk_x11_surface_set_user_time (gdk_surface_get_toplevel (surface),
gdk_event_get_time (event));
}
@@ -316,10 +316,10 @@ translate_notify_type (int detail)
}
static gboolean
-is_parent_of (GdkWindow *parent,
- GdkWindow *child)
+is_parent_of (GdkSurface *parent,
+ GdkSurface *child)
{
- GdkWindow *w;
+ GdkSurface *w;
w = child;
while (w != NULL)
@@ -327,21 +327,21 @@ is_parent_of (GdkWindow *parent,
if (w == parent)
return TRUE;
- w = gdk_window_get_parent (w);
+ w = gdk_surface_get_parent (w);
}
return FALSE;
}
-static GdkWindow *
-get_event_window (GdkEventTranslator *translator,
+static GdkSurface *
+get_event_surface (GdkEventTranslator *translator,
const XEvent *xevent)
{
GdkDisplay *display;
- GdkWindow *window;
+ GdkSurface *surface;
display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display;
- window = gdk_x11_window_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_window (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
@@ -371,32 +371,32 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
GdkEvent *event,
const XEvent *xevent)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
GdkX11DeviceManagerCore *device_manager;
- GdkWindow *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_window (translator, xevent);
+ surface = get_event_surface (translator, xevent);
scale = 1;
- if (window)
+ if (surface)
{
- if (GDK_WINDOW_DESTROYED (window) || !GDK_IS_WINDOW (window))
+ if (GDK_SURFACE_DESTROYED (surface) || !GDK_IS_SURFACE (surface))
return FALSE;
- g_object_ref (window);
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
- scale = impl->window_scale;
+ 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_WINDOW_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 GdkWindow.
+ * lookup the corresponding GdkSurface.
*/
if (xevent->xcrossing.subwindow != None)
- event->crossing.subwindow = gdk_x11_window_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 GdkWindow.
+ * lookup the corresponding GdkSurface.
*/
if (xevent->xcrossing.subwindow != None)
- event->crossing.subwindow = gdk_x11_window_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 (GdkWindow *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 (GdkWindow *window,
GdkX11Screen *x11_screen;
gboolean had_focus;
- g_return_if_fail (GDK_IS_WINDOW (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_window_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_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
notify_details[detail],
notify_modes[mode]));
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (!toplevel)
return;
@@ -823,7 +823,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
return;
had_focus = HAS_FOCUS (toplevel);
- x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (window));
+ x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (surface));
switch (detail)
{
@@ -889,14 +889,14 @@ _gdk_device_manager_core_handle_focus (GdkWindow *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_window_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 2c12bdd203..4c873790ff 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -82,10 +82,10 @@ static gboolean gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *
GdkEvent *event,
const XEvent *xevent);
static GdkEventMask gdk_x11_device_manager_xi2_get_handled_events (GdkEventTranslator *translator);
-static void gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator,
+static void gdk_x11_device_manager_xi2_select_surface_events (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask);
-static GdkWindow * gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
+static GdkSurface * gdk_x11_device_manager_xi2_get_surface (GdkEventTranslator *translator,
const XEvent *xevent);
enum {
@@ -835,8 +835,8 @@ gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface
{
iface->translate_event = gdk_x11_device_manager_xi2_translate_event;
iface->get_handled_events = gdk_x11_device_manager_xi2_get_handled_events;
- iface->select_window_events = gdk_x11_device_manager_xi2_select_window_events;
- iface->get_window = gdk_x11_device_manager_xi2_get_window;
+ iface->select_surface_events = gdk_x11_device_manager_xi2_select_surface_events;
+ 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)
{
- GdkWindow *window;
+ GdkSurface *surface;
guint32 time;
- window = gdk_window_get_toplevel (event->any.window);
- g_return_if_fail (GDK_IS_WINDOW (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_window_set_user_time (window, time);
+ gdk_x11_surface_set_user_time (surface, time);
}
static gdouble *
translate_axes (GdkDevice *device,
gdouble x,
gdouble y,
- GdkWindow *window,
+ GdkSurface *surface,
XIValuatorState *valuators)
{
guint n_axes, i;
@@ -1110,8 +1110,8 @@ translate_axes (GdkDevice *device,
{
case GDK_AXIS_X:
case GDK_AXIS_Y:
- if (gdk_device_get_mode (device) == GDK_MODE_WINDOW)
- _gdk_device_translate_window_coord (device, window, i, val, &axes[i]);
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
+ _gdk_device_translate_surface_coord (device, surface, i, val, &axes[i]);
else
{
if (use == GDK_AXIS_X)
@@ -1132,10 +1132,10 @@ translate_axes (GdkDevice *device,
}
static gboolean
-is_parent_of (GdkWindow *parent,
- GdkWindow *child)
+is_parent_of (GdkSurface *parent,
+ GdkSurface *child)
{
- GdkWindow *w;
+ GdkSurface *w;
w = child;
while (w != NULL)
@@ -1143,19 +1143,19 @@ is_parent_of (GdkWindow *parent,
if (w == parent)
return TRUE;
- w = gdk_window_get_parent (w);
+ w = gdk_surface_get_parent (w);
}
return FALSE;
}
static gboolean
-get_event_window (GdkEventTranslator *translator,
+get_event_surface (GdkEventTranslator *translator,
XIEvent *ev,
- GdkWindow **window_p)
+ GdkSurface **surface_p)
{
GdkDisplay *display;
- GdkWindow *window = NULL;
+ GdkSurface *surface = NULL;
gboolean should_have_window = TRUE;
display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display;
@@ -1175,7 +1175,7 @@ get_event_window (GdkEventTranslator *translator,
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
- window = gdk_x11_window_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_window (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_window (GdkEventTranslator *translator,
{
XIEnterEvent *xev = (XIEnterEvent *) ev;
- window = gdk_x11_window_lookup_for_display (display, xev->event);
+ surface = gdk_x11_surface_lookup_for_display (display, xev->event);
}
break;
default:
@@ -1215,9 +1215,9 @@ get_event_window (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,8 +1349,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
const XGenericEventCookie *cookie;
GdkDevice *device, *source_device;
gboolean return_val = TRUE;
- GdkWindow *window;
- GdkWindowImplX11 *impl;
+ GdkSurface *surface;
+ GdkSurfaceImplX11 *impl;
int scale;
XIEvent *ev;
@@ -1367,17 +1367,17 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
if (!ev)
return FALSE;
- if (!get_event_window (translator, ev, &window))
+ if (!get_event_surface (translator, ev, &surface))
return FALSE;
- if (window && GDK_WINDOW_DESTROYED (window))
+ if (surface && GDK_SURFACE_DESTROYED (surface))
return FALSE;
scale = 1;
- if (window)
+ if (surface)
{
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
- scale = impl->window_scale;
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
+ scale = impl->surface_scale;
}
if (ev->evtype == XI_Motion ||
@@ -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,10 +1549,10 @@ 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_WINDOW)
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, event->button.axes, GDK_AXIS_X, &event->button.x);
@@ -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,10 +1647,10 @@ 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_WINDOW)
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_X, &event->motion.x);
@@ -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,10 +1695,10 @@ 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_WINDOW)
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, event->touch.axes, GDK_AXIS_X, &event->touch.x);
@@ -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,10 +1768,10 @@ 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_WINDOW)
+ if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, event->touch.axes, GDK_AXIS_X, &event->touch.x);
@@ -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_window_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_window_get_window_type (window) == GDK_WINDOW_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;
}
@@ -1911,7 +1911,7 @@ gdk_x11_device_manager_xi2_get_handled_events (GdkEventTranslator *translator)
}
static void
-gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator,
+gdk_x11_device_manager_xi2_select_surface_events (GdkEventTranslator *translator,
Window window,
GdkEventMask evmask)
{
@@ -1926,13 +1926,13 @@ gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator,
g_free (event_mask.mask);
}
-static GdkWindow *
-gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
- const XEvent *xevent)
+static GdkSurface *
+gdk_x11_device_manager_xi2_get_surface (GdkEventTranslator *translator,
+ const XEvent *xevent)
{
GdkX11DeviceManagerXI2 *device_manager;
XIEvent *ev;
- GdkWindow *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_window (translator, ev, &window);
- return window;
+ get_event_surface (translator, ev, &surface);
+ return surface;
}
GdkDevice *
diff --git a/gdk/x11/gdkdevicemanagerprivate-core.h b/gdk/x11/gdkdevicemanagerprivate-core.h
index 55aa45c748..47ea27dfd1 100644
--- a/gdk/x11/gdkdevicemanagerprivate-core.h
+++ b/gdk/x11/gdkdevicemanagerprivate-core.h
@@ -37,7 +37,7 @@ struct _GdkX11DeviceManagerCoreClass
GObjectClass parent_class;
};
-void _gdk_device_manager_core_handle_focus (GdkWindow *window,
+void _gdk_device_manager_core_handle_focus (GdkSurface *window,
Window original,
GdkDevice *device,
GdkDevice *source_device,
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 28a5344c24..4432a3efe4 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 *surface,
+ 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 (surface);
+ 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 (surface))
{
/* 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,91 +351,91 @@ do_edge_constraint_state_check (GdkWindow *window,
}
static void
-do_net_wm_state_changes (GdkWindow *window)
+do_net_wm_state_changes (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowState old_state, set, unset;
+ GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
+ GdkSurfaceState old_state, set, unset;
- if (GDK_WINDOW_DESTROYED (window) ||
- gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL)
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ gdk_surface_get_surface_type (surface) != GDK_SURFACE_TOPLEVEL)
return;
- old_state = gdk_window_get_state (window);
+ old_state = gdk_surface_get_state (surface);
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 */
- do_edge_constraint_state_check (window, old_state, &set, &unset);
+ do_edge_constraint_state_check (surface, old_state, &set, &unset);
- gdk_synthesize_window_state (window, unset, set);
+ gdk_synthesize_surface_state (surface, unset, set);
}
static void
-gdk_check_wm_desktop_changed (GdkWindow *window)
+gdk_check_wm_desktop_changed (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_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 (GdkWindow *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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 (GdkWindow *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 (GdkWindow *window)
+gdk_check_wm_state_changed (GdkSurface *surface)
{
- 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 (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 (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 (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 (GdkWindow *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 (GdkWindow *window)
+gdk_check_edge_constraints_changed (GdkSurface *surface)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_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 (GdkWindow *window)
type = None;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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 (GdkWindow *window)
toplevel->edge_constraints = 0;
}
- do_net_wm_state_changes (window);
+ do_net_wm_state_changes (surface);
}
static Atom
@@ -635,16 +635,16 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
const XEvent *xevent)
{
Window xwindow;
- GdkWindow *window;
+ GdkSurface *surface;
gboolean is_substructure;
- GdkWindowImplX11 *window_impl = NULL;
+ GdkSurfaceImplX11 *surface_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
- * not the same as the window that the event was sent to,
+ /* Find the GdkSurface that this event relates to. If that's
+ * 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_window_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_WINDOW (window))
+ if (!GDK_IS_SURFACE (surface))
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 (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_WINDOW_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;
@@ -739,16 +739,16 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
GdkRectangle expose_rect;
int x2, y2;
- expose_rect.x = xevent->xexpose.x / window_impl->window_scale;
- expose_rect.y = xevent->xexpose.y / window_impl->window_scale;
+ expose_rect.x = xevent->xexpose.x / surface_impl->surface_scale;
+ expose_rect.y = xevent->xexpose.y / surface_impl->surface_scale;
- x2 = (xevent->xexpose.x + xevent->xexpose.width + window_impl->window_scale -1) / window_impl->window_scale;
+ x2 = (xevent->xexpose.x + xevent->xexpose.width + surface_impl->surface_scale -1) / surface_impl->surface_scale;
expose_rect.width = x2 - expose_rect.x;
- y2 = (xevent->xexpose.y + xevent->xexpose.height + window_impl->window_scale -1) / window_impl->window_scale;
+ y2 = (xevent->xexpose.y + xevent->xexpose.height + surface_impl->surface_scale -1) / surface_impl->surface_scale;
expose_rect.height = y2 - expose_rect.y;
- _gdk_x11_window_process_expose (window, xevent->xexpose.serial, &expose_rect);
+ _gdk_x11_surface_process_expose (surface, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
@@ -763,22 +763,22 @@ 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;
}
- expose_rect.x = xevent->xgraphicsexpose.x / window_impl->window_scale;
- expose_rect.y = xevent->xgraphicsexpose.y / window_impl->window_scale;
+ expose_rect.x = xevent->xgraphicsexpose.x / surface_impl->surface_scale;
+ expose_rect.y = xevent->xgraphicsexpose.y / surface_impl->surface_scale;
- x2 = (xevent->xgraphicsexpose.x + xevent->xgraphicsexpose.width + window_impl->window_scale -1) / window_impl->window_scale;
+ x2 = (xevent->xgraphicsexpose.x + xevent->xgraphicsexpose.width + surface_impl->surface_scale -1) / surface_impl->surface_scale;
expose_rect.width = x2 - expose_rect.x;
- y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + window_impl->window_scale -1) / window_impl->window_scale;
+ y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + surface_impl->surface_scale -1) / surface_impl->surface_scale;
expose_rect.height = y2 - expose_rect.y;
- _gdk_x11_window_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_WINDOW_DESTROYED (window);
+ return_val = surface && !GDK_SURFACE_DESTROYED (surface);
- if (window && GDK_WINDOW_XID (window) != x11_screen->xroot_window)
- gdk_window_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,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))
- gdk_synthesize_window_state (window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_ICONIFIED);
+ GDK_SURFACE_STATE_ICONIFIED);
}
- if (window_impl->toplevel &&
- window_impl->toplevel->frame_pending)
+ if (surface_impl->toplevel &&
+ surface_impl->toplevel->frame_pending)
{
- window_impl->toplevel->frame_pending = FALSE;
- _gdk_frame_clock_thaw (gdk_window_get_frame_clock (event->any.window));
+ surface_impl->toplevel->frame_pending = FALSE;
+ _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.surface));
}
if (toplevel)
- gdk_window_freeze_toplevel_updates (window);
+ gdk_surface_freeze_toplevel_updates (surface);
- _gdk_x11_window_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_WINDOW_STATE_ICONIFIED)
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_ICONIFIED,
+ if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
+ gdk_synthesize_surface_state (surface,
+ GDK_SURFACE_STATE_ICONIFIED,
0);
if (toplevel)
- gdk_window_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->window_type == GDK_WINDOW_CHILD
+ : surface->surface_type == GDK_SURFACE_CHILD
? " (discarding child)"
: xevent->xconfigure.event != xevent->xconfigure.window
? " (discarding substructure)"
@@ -953,66 +953,66 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
}
#endif
- if (!window ||
+ if (!surface ||
xevent->xconfigure.event != xevent->xconfigure.window ||
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
+ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_CHILD)
return_val = FALSE;
else
{
event->any.type = GDK_CONFIGURE;
- event->any.window = window;
- event->configure.width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale;
- event->configure.height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale;
+ event->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_WINDOW_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_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
x11_screen->xroot_window,
0, 0,
&tx, &ty,
&child_window))
{
- event->configure.x = tx / window_impl->window_scale;
- event->configure.y = ty / window_impl->window_scale;
+ event->configure.x = tx / surface_impl->surface_scale;
+ event->configure.y = ty / surface_impl->surface_scale;
}
gdk_x11_display_error_trap_pop_ignored (display);
}
else
{
- event->configure.x = xevent->xconfigure.x / window_impl->window_scale;
- event->configure.y = xevent->xconfigure.y / window_impl->window_scale;
+ event->configure.x = xevent->xconfigure.x / surface_impl->surface_scale;
+ event->configure.y = xevent->xconfigure.y / surface_impl->surface_scale;
}
if (!is_substructure)
{
- window->x = event->configure.x;
- window->y = event->configure.y;
+ surface->x = event->configure.x;
+ surface->y = event->configure.y;
- if (window_impl->unscaled_width != xevent->xconfigure.width ||
- window_impl->unscaled_height != xevent->xconfigure.height)
+ if (surface_impl->unscaled_width != xevent->xconfigure.width ||
+ surface_impl->unscaled_height != xevent->xconfigure.height)
{
- window_impl->unscaled_width = xevent->xconfigure.width;
- window_impl->unscaled_height = xevent->xconfigure.height;
- window->width = event->configure.width;
- window->height = event->configure.height;
+ surface_impl->unscaled_width = xevent->xconfigure.width;
+ surface_impl->unscaled_height = xevent->xconfigure.height;
+ surface->width = event->configure.width;
+ surface->height = event->configure.height;
- _gdk_window_update_size (window);
- _gdk_x11_window_update_size (window_impl);
+ _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;
}
@@ -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,25 +1201,25 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkWindow *win = event->any.window;
+ GdkSurface *win = event->any.surface;
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);
- if (window_impl->toplevel)
+ GdkSurfaceImplX11 *surface_impl;
+ surface_impl = GDK_SURFACE_IMPL_X11 (win->impl);
+ if (surface_impl->toplevel)
{
guint32 d0 = xevent->xclient.data.l[0];
guint32 d1 = xevent->xclient.data.l[1];
@@ -1230,15 +1230,15 @@ _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)
timings->drawn_time = frame_drawn_time;
- if (window_impl->toplevel->frame_pending)
+ if (surface_impl->toplevel->frame_pending)
{
- window_impl->toplevel->frame_pending = FALSE;
+ surface_impl->toplevel->frame_pending = FALSE;
_gdk_frame_clock_thaw (clock);
}
@@ -1247,7 +1247,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
&refresh_interval,
&presentation_time);
if (presentation_time != 0)
- window_impl->toplevel->throttled_presentation_time = presentation_time + refresh_interval;
+ surface_impl->toplevel->throttled_presentation_time = presentation_time + refresh_interval;
}
return GDK_FILTER_REMOVE;
@@ -1255,9 +1255,9 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_TIMINGS"))
{
- GdkWindowImplX11 *window_impl;
- window_impl = GDK_WINDOW_IMPL_X11 (win->impl);
- if (window_impl->toplevel)
+ GdkSurfaceImplX11 *surface_impl;
+ surface_impl = GDK_SURFACE_IMPL_X11 (win->impl);
+ if (surface_impl->toplevel)
{
guint32 d0 = xevent->xclient.data.l[0];
guint32 d1 = xevent->xclient.data.l[1];
@@ -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,8 +1982,8 @@ 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 */
- g_list_free_full (display_x11->input_windows, g_free);
+ /* input GdkSurface list */
+ g_list_free_full (display_x11->input_surfaces, g_free);
/* Free all GdkX11Screens */
g_object_unref (display_x11->screen);
@@ -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
*/
@@ -2744,7 +2744,7 @@ gdk_x11_display_error_trap_pop_internal (GdkDisplay *display,
}
/**
- * gdk_x11_display_set_window_scale:
+ * gdk_x11_display_set_surface_scale:
* @display: (type GdkX11Display): the display
* @scale: The new scale value
*
@@ -2757,7 +2757,7 @@ gdk_x11_display_error_trap_pop_internal (GdkDisplay *display,
* to later user configuration changes.
*/
void
-gdk_x11_display_set_window_scale (GdkDisplay *display,
+gdk_x11_display_set_surface_scale (GdkDisplay *display,
gint scale)
{
GdkX11Screen *x11_screen;
@@ -2769,9 +2769,9 @@ gdk_x11_display_set_window_scale (GdkDisplay *display,
x11_screen = GDK_X11_SCREEN (GDK_X11_DISPLAY (display)->screen);
- if (!x11_screen->fixed_window_scale)
+ if (!x11_screen->fixed_surface_scale)
{
- x11_screen->fixed_window_scale = TRUE;
+ x11_screen->fixed_surface_scale = TRUE;
/* We treat screens with a window scale set differently when
* reading xsettings, so we need to reread
@@ -2779,7 +2779,7 @@ gdk_x11_display_set_window_scale (GdkDisplay *display,
need_reread_settings = TRUE;
}
- _gdk_x11_screen_set_window_scale (x11_screen, scale);
+ _gdk_x11_screen_set_surface_scale (x11_screen, scale);
if (need_reread_settings)
_gdk_x11_settings_force_reread (x11_screen);
@@ -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->surface_type = GDK_TYPE_X11_SURFACE;
#ifdef GDK_RENDERING_VULKAN
display_class->vk_context_type = GDK_TYPE_X11_VULKAN_CONTEXT;
display_class->vk_extension_name = VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
@@ -3054,7 +3054,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->get_next_serial = gdk_x11_display_get_next_serial;
display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete;
- display_class->create_window_impl = _gdk_x11_display_create_window_impl;
+ display_class->create_surface_impl = _gdk_x11_display_create_surface_impl;
display_class->get_keymap = gdk_x11_display_get_keymap;
display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target;
@@ -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 ();
}
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index ff000857e9..0625c7d395 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -24,7 +24,7 @@
#include "gdkdisplayprivate.h"
#include "gdkkeys.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
#include "gdkx11devicemanager.h"
#include "gdkx11display.h"
@@ -96,7 +96,7 @@ struct _GdkX11Display
/* Session Management leader window see ICCCM */
char *program_class;
Window leader_window;
- GdkWindow *leader_gdk_window;
+ GdkSurface *leader_gdk_surface;
gboolean leader_window_title_set;
/* List of functions to go from extension event => X window */
@@ -111,8 +111,8 @@ struct _GdkX11Display
/* streams reading selections */
GSList *streams;
- /* input GdkWindow list */
- GList *input_windows;
+ /* input GdkSurface list */
+ GList *input_surfaces;
/* GdkCursor => XCursor */
GHashTable *cursors;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 10b25dad51..659923fb66 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -84,7 +84,7 @@ typedef struct {
cairo_region_t *shape;
} GdkCacheChild;
-struct _GdkWindowCache {
+struct _GdkSurfaceCache {
GList *children;
GHashTable *child_hash;
guint old_event_mask;
@@ -109,11 +109,11 @@ struct _GdkX11DragContext
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
guint version; /* Xdnd protocol version */
- GdkWindowCache *cache;
+ GdkSurfaceCache *cache;
- GdkWindow *drag_window;
+ GdkSurface *drag_surface;
- GdkWindow *ipc_window;
+ GdkSurface *ipc_surface;
GdkCursor *cursor;
GdkSeat *grab_seat;
GdkDragAction actions;
@@ -167,8 +167,8 @@ static GrabKey grab_keys[] = {
/* Forward declarations */
-static GdkWindowCache *gdk_window_cache_ref (GdkWindowCache *cache);
-static void gdk_window_cache_unref (GdkWindowCache *cache);
+static GdkSurfaceCache *gdk_surface_cache_ref (GdkSurfaceCache *cache);
+static void gdk_surface_cache_unref (GdkSurfaceCache *cache);
static GdkFilterReturn xdnd_enter_filter (const XEvent *xevent,
GdkEvent *event,
@@ -190,7 +190,7 @@ static GdkFilterReturn xdnd_drop_filter (const XEvent *xevent,
gpointer data);
static void xdnd_manage_source_filter (GdkDragContext *context,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean add_filter);
gboolean gdk_x11_drag_context_handle_event (GdkDragContext *context,
@@ -223,13 +223,13 @@ gdk_x11_drag_context_init (GdkX11DragContext *context)
}
static void gdk_x11_drag_context_finalize (GObject *object);
-static GdkWindow * gdk_x11_drag_context_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
+static GdkSurface * gdk_x11_drag_context_find_surface (GdkDragContext *context,
+ GdkSurface *drag_surface,
gint x_root,
gint y_root,
GdkDragProtocol *protocol);
static gboolean gdk_x11_drag_context_drag_motion (GdkDragContext *context,
- GdkWindow *dest_window,
+ GdkSurface *dest_surface,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
@@ -250,7 +250,7 @@ static void gdk_x11_drag_context_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time_);
static gboolean gdk_x11_drag_context_drop_status (GdkDragContext *context);
-static GdkWindow * gdk_x11_drag_context_get_drag_window (GdkDragContext *context);
+static GdkSurface * gdk_x11_drag_context_get_drag_surface (GdkDragContext *context);
static void gdk_x11_drag_context_set_hotspot (GdkDragContext *context,
gint hot_x,
gint hot_y);
@@ -408,7 +408,7 @@ gdk_x11_drag_context_class_init (GdkX11DragContextClass *klass)
context_class->drop_status = gdk_x11_drag_context_drop_status;
context_class->read_async = gdk_x11_drag_context_read_async;
context_class->read_finish = gdk_x11_drag_context_read_finish;
- context_class->get_drag_window = gdk_x11_drag_context_get_drag_window;
+ context_class->get_drag_surface = gdk_x11_drag_context_get_drag_surface;
context_class->set_hotspot = gdk_x11_drag_context_set_hotspot;
context_class->drop_done = gdk_x11_drag_context_drop_done;
context_class->set_cursor = gdk_x11_drag_context_set_cursor;
@@ -423,28 +423,28 @@ gdk_x11_drag_context_finalize (GObject *object)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (object);
- GdkWindow *drag_window, *ipc_window;
+ GdkSurface *drag_surface, *ipc_surface;
- if (context->source_window)
+ if (context->source_surface)
{
if ((x11_context->protocol == GDK_DRAG_PROTO_XDND) && !context->is_source)
- xdnd_manage_source_filter (context, context->source_window, FALSE);
+ xdnd_manage_source_filter (context, context->source_surface, FALSE);
}
if (x11_context->cache)
- gdk_window_cache_unref (x11_context->cache);
+ gdk_surface_cache_unref (x11_context->cache);
contexts = g_list_remove (contexts, context);
- drag_window = context->drag_window;
- ipc_window = x11_context->ipc_window;
+ drag_surface = context->drag_surface;
+ ipc_surface = x11_context->ipc_surface;
G_OBJECT_CLASS (gdk_x11_drag_context_parent_class)->finalize (object);
- if (drag_window)
- gdk_window_destroy (drag_window);
- if (ipc_window)
- gdk_window_destroy (ipc_window);
+ if (drag_surface)
+ gdk_surface_destroy (drag_surface);
+ if (ipc_surface)
+ gdk_surface_destroy (ipc_surface);
}
/* Drag Contexts */
@@ -465,19 +465,19 @@ gdk_drag_context_find (GdkDisplay *display,
context = (GdkDragContext *)tmp_list->data;
context_x11 = (GdkX11DragContext *)context;
- if ((context->source_window && gdk_window_get_display (context->source_window) != display) ||
- (context->dest_window && gdk_window_get_display (context->dest_window) != display))
+ if ((context->source_surface && gdk_surface_get_display (context->source_surface) != display) ||
+ (context->dest_surface && gdk_surface_get_display (context->dest_surface) != display))
continue;
- context_dest_xid = context->dest_window
+ context_dest_xid = context->dest_surface
? (context_x11->drop_xid
? context_x11->drop_xid
- : GDK_WINDOW_XID (context->dest_window))
+ : GDK_SURFACE_XID (context->dest_surface))
: None;
if ((!context->is_source == !is_source) &&
- ((source_xid == None) || (context->source_window &&
- (GDK_WINDOW_XID (context->source_window) == source_xid))) &&
+ ((source_xid == None) || (context->source_surface &&
+ (GDK_SURFACE_XID (context->source_surface) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
}
@@ -521,7 +521,7 @@ free_cache_child (GdkCacheChild *child,
}
static void
-gdk_window_cache_add (GdkWindowCache *cache,
+gdk_surface_cache_add (GdkSurfaceCache *cache,
guint32 xid,
gint x,
gint y,
@@ -547,11 +547,11 @@ gdk_window_cache_add (GdkWindowCache *cache,
}
GdkFilterReturn
-gdk_window_cache_shape_filter (const XEvent *xevent,
+gdk_surface_cache_shape_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkWindowCache *cache = data;
+ GdkSurfaceCache *cache = data;
GdkX11Display *display = GDK_X11_DISPLAY (cache->display);
@@ -581,11 +581,11 @@ gdk_window_cache_shape_filter (const XEvent *xevent,
}
GdkFilterReturn
-gdk_window_cache_filter (const XEvent *xevent,
+gdk_surface_cache_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkWindowCache *cache = data;
+ GdkSurfaceCache *cache = data;
switch (xevent->type)
{
@@ -639,7 +639,7 @@ gdk_window_cache_filter (const XEvent *xevent,
if (!g_hash_table_lookup (cache->child_hash,
GUINT_TO_POINTER (xcwe->window)))
- gdk_window_cache_add (cache, xcwe->window,
+ gdk_surface_cache_add (cache, xcwe->window,
xcwe->x, xcwe->y, xcwe->width, xcwe->height,
FALSE);
break;
@@ -700,8 +700,8 @@ gdk_window_cache_filter (const XEvent *xevent,
return GDK_FILTER_REMOVE;
}
-static GdkWindowCache *
-gdk_window_cache_new (GdkDisplay *display)
+static GdkSurfaceCache *
+gdk_surface_cache_new (GdkDisplay *display)
{
XWindowAttributes xwa;
GdkX11Screen *screen = GDK_X11_DISPLAY (display)->screen;
@@ -713,7 +713,7 @@ gdk_window_cache_new (GdkDisplay *display)
Window cow;
#endif
- GdkWindowCache *result = g_new (GdkWindowCache, 1);
+ GdkSurfaceCache *result = g_new (GdkSurfaceCache, 1);
result->children = NULL;
result->child_hash = g_hash_table_new (g_direct_hash, NULL);
@@ -726,21 +726,21 @@ gdk_window_cache_new (GdkDisplay *display)
if (G_UNLIKELY (!GDK_X11_DISPLAY (display)->trusted_client))
{
GList *toplevel_windows, *list;
- GdkWindow *window;
- GdkWindowImplX11 *impl;
+ 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_WINDOW (list->data);
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
- gdk_window_get_geometry (window, &x, &y, &width, &height);
- gdk_window_cache_add (result, GDK_WINDOW_XID (window),
- x * impl->window_scale, y * impl->window_scale,
- width * impl->window_scale,
- height * impl->window_scale,
- gdk_window_is_visible (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 (surface));
}
return result;
}
@@ -755,7 +755,7 @@ gdk_window_cache_new (GdkDisplay *display)
for (i = 0; i < nchildren ; i++)
{
- gdk_window_cache_add (result, children[i].window,
+ gdk_surface_cache_add (result, children[i].window,
children[i].x, children[i].y, children[i].width, children[i].height,
children[i].is_mapped);
}
@@ -773,9 +773,9 @@ gdk_window_cache_new (GdkDisplay *display)
if (gdk_display_is_composited (display))
{
cow = XCompositeGetOverlayWindow (xdisplay, xroot_window);
- gdk_window_cache_add (result, cow, 0, 0,
- WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale,
- HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale,
+ gdk_surface_cache_add (result, cow, 0, 0,
+ WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->surface_scale,
+ HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->surface_scale,
TRUE);
XCompositeReleaseOverlayWindow (xdisplay, xroot_window);
}
@@ -785,7 +785,7 @@ gdk_window_cache_new (GdkDisplay *display)
}
static void
-gdk_window_cache_destroy (GdkWindowCache *cache)
+gdk_surface_cache_destroy (GdkSurfaceCache *cache)
{
XSelectInput (GDK_DISPLAY_XDISPLAY (cache->display),
GDK_DISPLAY_XROOTWIN (cache->display),
@@ -801,8 +801,8 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
g_free (cache);
}
-static GdkWindowCache *
-gdk_window_cache_ref (GdkWindowCache *cache)
+static GdkSurfaceCache *
+gdk_surface_cache_ref (GdkSurfaceCache *cache)
{
cache->ref_count += 1;
@@ -810,7 +810,7 @@ gdk_window_cache_ref (GdkWindowCache *cache)
}
static void
-gdk_window_cache_unref (GdkWindowCache *cache)
+gdk_surface_cache_unref (GdkSurfaceCache *cache)
{
g_assert (cache->ref_count > 0);
@@ -819,24 +819,24 @@ gdk_window_cache_unref (GdkWindowCache *cache)
if (cache->ref_count == 0)
{
window_caches = g_slist_remove (window_caches, cache);
- gdk_window_cache_destroy (cache);
+ gdk_surface_cache_destroy (cache);
}
}
-GdkWindowCache *
-gdk_window_cache_get (GdkDisplay *display)
+GdkSurfaceCache *
+gdk_surface_cache_get (GdkDisplay *display)
{
GSList *list;
- GdkWindowCache *cache;
+ GdkSurfaceCache *cache;
for (list = window_caches; list; list = list->next)
{
cache = list->data;
if (cache->display == display)
- return gdk_window_cache_ref (cache);
+ return gdk_surface_cache_ref (cache);
}
- cache = gdk_window_cache_new (display);
+ cache = gdk_surface_cache_new (display);
window_caches = g_slist_prepend (window_caches, cache);
@@ -944,7 +944,7 @@ get_client_window_at_coords_recurse (GdkDisplay *display,
}
static Window
-get_client_window_at_coords (GdkWindowCache *cache,
+get_client_window_at_coords (GdkSurfaceCache *cache,
Window ignore,
gint x_root,
gint y_root)
@@ -1064,21 +1064,21 @@ xdnd_status_filter (const XEvent *xevent,
gpointer data)
{
GdkDisplay *display;
- guint32 dest_window = xevent->xclient.data.l[0];
+ guint32 dest_surface = xevent->xclient.data.l[0];
guint32 flags = xevent->xclient.data.l[1];
Atom action = xevent->xclient.data.l[4];
GdkDragContext *context;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_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_window_get_display (event->any.window);
- context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_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,
- g_message ("XdndStatus: dest_window: %#x action: %ld",
- dest_window, action));
+ g_message ("XdndStatus: dest_surface: %#x action: %ld",
+ dest_surface, action));
if (context)
{
@@ -1111,19 +1111,19 @@ xdnd_finished_filter (const XEvent *xevent,
gpointer data)
{
GdkDisplay *display;
- guint32 dest_window = xevent->xclient.data.l[0];
+ guint32 dest_surface = xevent->xclient.data.l[0];
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_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_window_get_display (event->any.window);
- context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_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,
- g_message ("XdndFinished: dest_window: %#x", dest_window));
+ g_message ("XdndFinished: dest_surface: %#x", dest_surface));
if (context)
{
@@ -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_WINDOW_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_WINDOW_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);
@@ -1228,13 +1228,13 @@ send_client_message_async_cb (Window window,
* so we don't end up blocking for a timeout
*/
if (!success &&
- context->dest_window &&
- window == GDK_WINDOW_XID (context->dest_window))
+ context->dest_surface &&
+ window == GDK_SURFACE_XID (context->dest_surface))
{
GdkX11DragContext *context_x11 = data;
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
context->action = 0;
if (context->action != context_x11->current_action)
{
@@ -1265,7 +1265,7 @@ send_client_message_async (GdkDragContext *context,
static gboolean
xdnd_send_xevent (GdkX11DragContext *context_x11,
- GdkWindow *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_window_get_window_type (window) != GDK_WINDOW_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_WINDOW_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
if (_gdk_x11_display_is_root_window (display, xwindow))
event_mask = ButtonPressMask;
@@ -1328,8 +1328,8 @@ xdnd_send_enter (GdkX11DragContext *context_x11)
xev.xclient.format = 32;
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
- : GDK_WINDOW_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window);
+ : GDK_SURFACE_XID (context->dest_surface);
+ 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_WINDOW_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)
@@ -1354,13 +1354,13 @@ xdnd_send_enter (GdkX11DragContext *context_x11)
}
}
- if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
+ if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->dest_window)));
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ GDK_SURFACE_XID (context->dest_surface)));
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
}
}
@@ -1376,20 +1376,20 @@ xdnd_send_leave (GdkX11DragContext *context_x11)
xev.xclient.format = 32;
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
- : GDK_WINDOW_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window);
+ : GDK_SURFACE_XID (context->dest_surface);
+ 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;
xev.xclient.data.l[4] = 0;
- if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
+ if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->dest_window)));
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ GDK_SURFACE_XID (context->dest_surface)));
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
}
}
@@ -1406,20 +1406,20 @@ xdnd_send_drop (GdkX11DragContext *context_x11,
xev.xclient.format = 32;
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
- : GDK_WINDOW_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window);
+ : GDK_SURFACE_XID (context->dest_surface);
+ 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;
xev.xclient.data.l[4] = 0;
- if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
+ if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->dest_window)));
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ GDK_SURFACE_XID (context->dest_surface)));
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
}
}
@@ -1439,20 +1439,20 @@ xdnd_send_motion (GdkX11DragContext *context_x11,
xev.xclient.format = 32;
xev.xclient.window = context_x11->drop_xid
? context_x11->drop_xid
- : GDK_WINDOW_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window);
+ : GDK_SURFACE_XID (context->dest_surface);
+ 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;
xev.xclient.data.l[4] = xdnd_action_to_atom (display, action);
- if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
+ if (!xdnd_send_xevent (context_x11, context->dest_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->dest_window)));
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ GDK_SURFACE_XID (context->dest_surface)));
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
}
context_x11->drag_status = GDK_DRAG_STATUS_MOTION_WAIT;
}
@@ -1546,13 +1546,13 @@ xdnd_read_actions (GdkX11DragContext *context_x11)
context_x11->xdnd_have_actions = FALSE;
- if (gdk_window_get_window_type (context->source_window) == GDK_WINDOW_FOREIGN)
+ if (gdk_surface_get_surface_type (context->source_surface) == GDK_SURFACE_FOREIGN)
{
/* Get the XdndActionList, if set */
gdk_x11_display_error_trap_push (display);
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (context->source_window),
+ GDK_SURFACE_XID (context->source_surface),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
0, 65536,
False, XA_ATOM, &type, &format, &nitems,
@@ -1600,8 +1600,8 @@ xdnd_read_actions (GdkX11DragContext *context_x11)
GdkDragContext *source_context;
source_context = gdk_drag_context_find (display, TRUE,
- GDK_WINDOW_XID (context->source_window),
- GDK_WINDOW_XID (context->dest_window));
+ GDK_SURFACE_XID (context->source_surface),
+ GDK_SURFACE_XID (context->dest_surface));
if (source_context)
{
@@ -1618,7 +1618,7 @@ xdnd_read_actions (GdkX11DragContext *context_x11)
* and add this filter.
*/
GdkFilterReturn
-xdnd_source_window_filter (const XEvent *xevent,
+xdnd_source_surface_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
@@ -1644,11 +1644,11 @@ xdnd_source_window_filter (const XEvent *xevent,
static void
xdnd_manage_source_filter (GdkDragContext *context,
- GdkWindow *window,
+ GdkSurface *surface,
gboolean add_filter)
{
- if (!GDK_WINDOW_DESTROYED (window) &&
- gdk_window_get_window_type (window) == GDK_WINDOW_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_window_set_events (window,
- gdk_window_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).
@@ -1742,26 +1742,26 @@ xdnd_enter_filter (const XEvent *xevent,
guchar *data;
Atom *atoms;
GPtrArray *formats;
- guint32 source_window;
+ guint32 source_surface;
gboolean get_types;
gint version;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ if (!event->any.surface ||
+ gdk_surface_get_surface_type (event->any.surface) == GDK_SURFACE_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- source_window = xevent->xclient.data.l[0];
+ source_surface = xevent->xclient.data.l[0];
get_types = ((xevent->xclient.data.l[1] & 1) != 0);
version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
- display = GDK_WINDOW_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
xdnd_precache_atoms (display);
GDK_DISPLAY_NOTE (display, DND,
- g_message ("XdndEnter: source_window: %#x, version: %#x",
- source_window, version));
+ g_message ("XdndEnter: source_surface: %#x, version: %#x",
+ source_surface, version));
if (version < 3)
{
@@ -1788,21 +1788,21 @@ xdnd_enter_filter (const XEvent *xevent,
seat = gdk_display_get_default_seat (display);
gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat));
- context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window);
- if (!context->source_window)
+ context->source_surface = gdk_x11_surface_foreign_new_for_display (display, source_surface);
+ if (!context->source_surface)
{
g_object_unref (context);
return GDK_FILTER_REMOVE;
}
- context->dest_window = event->any.window;
- g_object_ref (context->dest_window);
+ context->dest_surface = event->any.surface;
+ g_object_ref (context->dest_surface);
formats = g_ptr_array_new ();
if (get_types)
{
gdk_x11_display_error_trap_push (display);
- XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
- source_window,
+ XGetWindowProperty (GDK_SURFACE_XDISPLAY (event->any.surface),
+ source_surface,
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
0, 65536,
False, XA_ATOM, &type, &format, &nitems,
@@ -1841,7 +1841,7 @@ xdnd_enter_filter (const XEvent *xevent,
print_target_list (context->formats);
#endif /* G_ENABLE_DEBUG */
- xdnd_manage_source_filter (context, context->source_window, TRUE);
+ xdnd_manage_source_filter (context, context->source_surface, TRUE);
xdnd_read_actions (context_x11);
event->any.type = GDK_DRAG_ENTER;
@@ -1859,26 +1859,26 @@ xdnd_leave_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- guint32 source_window = xevent->xclient.data.l[0];
+ guint32 source_surface = xevent->xclient.data.l[0];
GdkDisplay *display;
GdkX11Display *display_x11;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_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_WINDOW_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
- g_message ("XdndLeave: source_window: %#x",
- source_window));
+ g_message ("XdndLeave: source_surface: %#x",
+ source_surface));
xdnd_precache_atoms (display);
if ((display_x11->current_dest_drag != NULL) &&
(GDK_X11_DRAG_CONTEXT (display_x11->current_dest_drag)->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
+ (GDK_SURFACE_XID (display_x11->current_dest_drag->source_surface) == source_surface))
{
event->any.type = GDK_DRAG_LEAVE;
/* Pass ownership of context to the event */
@@ -1898,8 +1898,8 @@ xdnd_position_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- GdkWindowImplX11 *impl;
- guint32 source_window = xevent->xclient.data.l[0];
+ GdkSurfaceImplX11 *impl;
+ guint32 source_surface = xevent->xclient.data.l[0];
gint16 x_root = xevent->xclient.data.l[2] >> 16;
gint16 y_root = xevent->xclient.data.l[2] & 0xffff;
guint32 time = xevent->xclient.data.l[3];
@@ -1909,16 +1909,16 @@ xdnd_position_filter (const XEvent *xevent,
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_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_WINDOW_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
- g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
- source_window, x_root, y_root, time, action));
+ g_message ("XdndPosition: source_surface: %#x position: (%d, %d) time: %d action: %ld",
+ source_surface, x_root, y_root, time, action));
xdnd_precache_atoms (display);
@@ -1926,9 +1926,9 @@ xdnd_position_filter (const XEvent *xevent,
if ((context != NULL) &&
(GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_WINDOW_XID (context->source_window) == source_window))
+ (GDK_SURFACE_XID (context->source_surface) == source_surface))
{
- impl = GDK_WINDOW_IMPL_X11 (event->any.window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (event->any.surface->impl);
context_x11 = GDK_X11_DRAG_CONTEXT (context);
@@ -1944,11 +1944,11 @@ xdnd_position_filter (const XEvent *xevent,
if (!context_x11->xdnd_have_actions)
context->actions = context->suggested_action;
- event->dnd.x_root = x_root / impl->window_scale;
- event->dnd.y_root = y_root / impl->window_scale;
+ event->dnd.x_root = x_root / impl->surface_scale;
+ event->dnd.y_root = y_root / impl->surface_scale;
- context_x11->last_x = x_root / impl->window_scale;
- context_x11->last_y = y_root / impl->window_scale;
+ context_x11->last_x = x_root / impl->surface_scale;
+ context_x11->last_y = y_root / impl->surface_scale;
return GDK_FILTER_TRANSLATE;
}
@@ -1961,23 +1961,23 @@ xdnd_drop_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data)
{
- guint32 source_window = xevent->xclient.data.l[0];
+ guint32 source_surface = xevent->xclient.data.l[0];
guint32 time = xevent->xclient.data.l[2];
GdkDisplay *display;
GdkX11Display *display_x11;
GdkDragContext *context;
GdkX11DragContext *context_x11;
- if (!event->any.window ||
- gdk_window_get_window_type (event->any.window) == GDK_WINDOW_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_WINDOW_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
display_x11 = GDK_X11_DISPLAY (display);
GDK_DISPLAY_NOTE (display, DND,
- g_message ("XdndDrop: source_window: %#x time: %d",
- source_window, time));
+ g_message ("XdndDrop: source_surface: %#x time: %d",
+ source_surface, time));
xdnd_precache_atoms (display);
@@ -1985,7 +1985,7 @@ xdnd_drop_filter (const XEvent *xevent,
if ((context != NULL) &&
(GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_WINDOW_XID (context->source_window) == source_window))
+ (GDK_SURFACE_XID (context->source_surface) == source_surface))
{
context_x11 = GDK_X11_DRAG_CONTEXT (context);
event->any.type = GDK_DROP_START;
@@ -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_window_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_WINDOW (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_WINDOW_DISPLAY (event->any.window);
+ display = GDK_SURFACE_DISPLAY (event->any.surface);
for (i = 0; i < G_N_ELEMENTS (xdnd_filters); i++)
{
@@ -2041,7 +2041,7 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11,
{
GdkDragContext *context = GDK_DRAG_CONTEXT (context_x11);
- if (context->dest_window)
+ if (context->dest_surface)
{
switch (context_x11->protocol)
{
@@ -2054,21 +2054,21 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11,
break;
}
- g_object_unref (context->dest_window);
- context->dest_window = NULL;
+ g_object_unref (context->dest_surface);
+ context->dest_surface = NULL;
}
}
-static GdkWindow *
-create_drag_window (GdkDisplay *display)
+static GdkSurface *
+create_drag_surface (GdkDisplay *display)
{
- GdkWindow *window;
+ GdkSurface *surface;
- window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ surface = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_window_set_type_hint (window, GDK_WINDOW_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)
{
- GdkWindow *window;
+ GdkSurface *surface;
Window retval;
base_precache_atoms (display);
/* Check for a local drag */
- window = gdk_x11_window_lookup_for_display (display, xid);
- if (window && gdk_window_get_window_type (window) != GDK_WINDOW_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;
@@ -2130,39 +2130,39 @@ _gdk_x11_display_get_drag_protocol (GdkDisplay *display,
return 0; /* a.k.a. None */
}
-static GdkWindowCache *
+static GdkSurfaceCache *
drag_context_find_window_cache (GdkX11DragContext *context_x11,
GdkDisplay *display)
{
if (!context_x11->cache)
- context_x11->cache = gdk_window_cache_get (display);
+ context_x11->cache = gdk_surface_cache_get (display);
return context_x11->cache;
}
-static GdkWindow *
-gdk_x11_drag_context_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
- gint x_root,
- gint y_root,
- GdkDragProtocol *protocol)
+static GdkSurface *
+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);
- GdkWindowCache *window_cache;
+ GdkSurfaceCache *window_cache;
GdkDisplay *display;
Window dest;
- GdkWindow *dest_window;
+ GdkSurface *dest_surface;
display = gdk_drag_context_get_display (context);
window_cache = drag_context_find_window_cache (context_x11, display);
dest = get_client_window_at_coords (window_cache,
- drag_window && GDK_WINDOW_IS_X11 (drag_window) ?
- GDK_WINDOW_XID (drag_window) : None,
- x_root * screen_x11->window_scale,
- y_root * screen_x11->window_scale);
+ drag_surface && GDK_SURFACE_IS_X11 (drag_surface) ?
+ GDK_SURFACE_XID (drag_surface) : None,
+ x_root * screen_x11->surface_scale,
+ y_root * screen_x11->surface_scale);
if (context_x11->dest_xid != dest)
{
@@ -2172,7 +2172,7 @@ gdk_x11_drag_context_find_window (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
/* There is some ugliness here. We actually need to pass
- * _three_ pieces of information to drag_motion - dest_window,
+ * _three_ pieces of information to drag_motion - dest_surface,
* protocol, and the XID of the unproxied window. The first
* two are passed explicitly, the third implicitly through
* protocol->dest_xid.
@@ -2183,37 +2183,37 @@ gdk_x11_drag_context_find_window (GdkDragContext *context,
&context_x11->version);
if (recipient != None)
- dest_window = gdk_x11_window_foreign_new_for_display (display, recipient);
+ dest_surface = gdk_x11_surface_foreign_new_for_display (display, recipient);
else
- dest_window = NULL;
+ dest_surface = NULL;
}
else
{
- dest_window = context->dest_window;
- if (dest_window)
- g_object_ref (dest_window);
+ dest_surface = context->dest_surface;
+ if (dest_surface)
+ g_object_ref (dest_surface);
*protocol = context_x11->protocol;
}
- return dest_window;
+ return dest_surface;
}
static void
-move_drag_window (GdkDragContext *context,
+move_drag_surface (GdkDragContext *context,
guint x_root,
guint y_root)
{
GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context);
- gdk_window_move (context_x11->drag_window,
+ gdk_surface_move (context_x11->drag_surface,
x_root - context_x11->hot_x,
y_root - context_x11->hot_y);
- gdk_window_raise (context_x11->drag_window);
+ gdk_surface_raise (context_x11->drag_surface);
}
static gboolean
gdk_x11_drag_context_drag_motion (GdkDragContext *context,
- GdkWindow *dest_window,
+ GdkSurface *dest_surface,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
@@ -2222,10 +2222,10 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
guint32 time)
{
GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context);
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- if (context_x11->drag_window)
- move_drag_window (context, x_root, y_root);
+ if (context_x11->drag_surface)
+ move_drag_surface (context, x_root, y_root);
context_x11->old_actions = context->actions;
context->actions = possible_actions;
@@ -2243,12 +2243,12 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
* gdk_drag_find_window(). This happens, e.g.
* when GTK+ is proxying DND events to embedded windows.
*/
- if (dest_window)
+ if (dest_surface)
{
- GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_surface);
xdnd_check_dest (display,
- GDK_WINDOW_XID (dest_window),
+ GDK_SURFACE_XID (dest_surface),
&context_x11->version);
}
}
@@ -2258,18 +2258,18 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
*/
if (protocol == GDK_DRAG_PROTO_XDND && !context_x11->xdnd_actions_set)
{
- if (dest_window)
+ if (dest_surface)
{
- if (gdk_window_get_window_type (dest_window) == GDK_WINDOW_FOREIGN)
+ if (gdk_surface_get_surface_type (dest_surface) == GDK_SURFACE_FOREIGN)
xdnd_set_actions (context_x11);
- else if (context->dest_window == dest_window)
+ else if (context->dest_surface == dest_surface)
{
- GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_surface);
GdkDragContext *dest_context;
dest_context = gdk_drag_context_find (display, FALSE,
- GDK_WINDOW_XID (context->source_window),
- GDK_WINDOW_XID (dest_window));
+ GDK_SURFACE_XID (context->source_surface),
+ GDK_SURFACE_XID (dest_surface));
if (dest_context)
{
@@ -2280,7 +2280,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
}
}
- if (context->dest_window != dest_window)
+ if (context->dest_surface != dest_surface)
{
/* Send a leave to the last destination */
gdk_drag_do_leave (context_x11, time);
@@ -2288,11 +2288,11 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
- if (dest_window)
+ if (dest_surface)
{
- context->dest_window = dest_window;
+ context->dest_surface = dest_surface;
context_x11->drop_xid = context_x11->dest_xid;
- g_object_ref (context->dest_window);
+ g_object_ref (context->dest_surface);
context_x11->protocol = protocol;
switch (protocol)
@@ -2312,7 +2312,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
}
else
{
- context->dest_window = NULL;
+ context->dest_surface = NULL;
context_x11->drop_xid = None;
context->action = 0;
}
@@ -2337,16 +2337,16 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
context_x11->last_x = x_root;
context_x11->last_y = y_root;
- if (context->dest_window)
+ if (context->dest_surface)
{
- impl = GDK_WINDOW_IMPL_X11 (context->dest_window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (context->dest_surface->impl);
if (context_x11->drag_status == GDK_DRAG_STATUS_DRAG)
{
switch (context_x11->protocol)
{
case GDK_DRAG_PROTO_XDND:
- xdnd_send_motion (context_x11, x_root * impl->window_scale, y_root * impl->window_scale, suggested_action, time);
+ xdnd_send_motion (context_x11, x_root * impl->surface_scale, y_root * impl->surface_scale, suggested_action, time);
break;
case GDK_DRAG_PROTO_ROOTWIN:
@@ -2394,7 +2394,7 @@ gdk_x11_drag_context_drag_drop (GdkDragContext *context,
{
GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context);
- if (context->dest_window)
+ if (context->dest_surface)
{
switch (context_x11->protocol)
{
@@ -2435,18 +2435,18 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus");
xev.xclient.format = 32;
- xev.xclient.window = GDK_WINDOW_XID (context->source_window);
+ xev.xclient.window = GDK_SURFACE_XID (context->source_surface);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_surface);
xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = xdnd_action_to_atom (display, action);
- if (!xdnd_send_xevent (context_x11, context->source_window, FALSE, &xev))
+ if (!xdnd_send_xevent (context_x11, context->source_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->source_window)));
+ GDK_SURFACE_XID (context->source_surface)));
}
}
@@ -2476,7 +2476,7 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"),
gdk_x11_get_xatom_by_name_for_display (display, "DELETE"),
gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION"),
- GDK_WINDOW_XID (context->source_window),
+ GDK_SURFACE_XID (context->source_surface),
time);
/* XXX: Do we need to wait for a reply here before sending the next message? */
}
@@ -2484,9 +2484,9 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished");
xev.xclient.format = 32;
- xev.xclient.window = GDK_WINDOW_XID (context->source_window);
+ xev.xclient.window = GDK_SURFACE_XID (context->source_surface);
- xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_surface);
if (success)
{
xev.xclient.data.l[1] = 1;
@@ -2501,35 +2501,35 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_window, FALSE, &xev))
+ if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_surface, FALSE, &xev))
{
GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
- GDK_WINDOW_XID (context->source_window)));
+ GDK_SURFACE_XID (context->source_surface)));
}
}
}
void
-_gdk_x11_window_register_dnd (GdkWindow *window)
+_gdk_x11_surface_register_dnd (GdkSurface *surface)
{
static const gulong xdnd_version = 5;
- GdkDisplay *display = gdk_window_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_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "XdndAware"),
XA_ATOM, 32, PropModeReplace,
(guchar *)&xdnd_version, 1);
@@ -2541,10 +2541,10 @@ gdk_x11_drag_context_drop_status (GdkDragContext *context)
return ! GDK_X11_DRAG_CONTEXT (context)->drop_failed;
}
-static GdkWindow *
-gdk_x11_drag_context_get_drag_window (GdkDragContext *context)
+static GdkSurface *
+gdk_x11_drag_context_get_drag_surface (GdkDragContext *context)
{
- return GDK_X11_DRAG_CONTEXT (context)->drag_window;
+ return GDK_X11_DRAG_CONTEXT (context)->drag_surface;
}
static void
@@ -2560,7 +2560,7 @@ gdk_x11_drag_context_set_hotspot (GdkDragContext *context,
if (x11_context->grab_seat)
{
/* DnD is managed, update current position */
- move_drag_window (context, x11_context->last_x, x11_context->last_y);
+ move_drag_surface (context, x11_context->last_x, x11_context->last_y);
}
}
@@ -2603,7 +2603,7 @@ gdk_x11_drag_context_xevent (GdkDisplay *display,
Window xwindow;
Atom xselection;
- xwindow = GDK_WINDOW_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)
@@ -2713,11 +2713,11 @@ gdk_drag_anim_timeout (gpointer data)
t = ease_out_cubic (f);
- gdk_window_show (context->drag_window);
- gdk_window_move (context->drag_window,
+ gdk_surface_show (context->drag_surface);
+ gdk_surface_move (context->drag_surface,
context->last_x + (context->start_x - context->last_x) * t,
context->last_y + (context->start_y - context->last_y) * t);
- gdk_window_set_opacity (context->drag_window, 1.0 - f);
+ gdk_surface_set_opacity (context->drag_surface, 1.0 - f);
return G_SOURCE_CONTINUE;
}
@@ -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_WINDOW_XID (x11_context->ipc_window);
+ xwindow = GDK_SURFACE_XID (x11_context->ipc_surface);
if (XGetSelectionOwner (xdisplay, xselection) == xwindow)
XSetSelectionOwner (xdisplay, xselection, None, CurrentTime);
@@ -2758,15 +2758,15 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
context);
if (success)
{
- gdk_window_hide (x11_context->drag_window);
+ gdk_surface_hide (x11_context->drag_surface);
return;
}
- win_surface = _gdk_window_ref_cairo_surface (x11_context->drag_window);
- surface = gdk_window_create_similar_surface (x11_context->drag_window,
+ win_surface = _gdk_surface_ref_cairo_surface (x11_context->drag_surface);
+ surface = gdk_surface_create_similar_surface (x11_context->drag_surface,
cairo_surface_get_content (win_surface),
- gdk_window_get_width (x11_context->drag_window),
- gdk_window_get_height (x11_context->drag_window));
+ gdk_surface_get_width (x11_context->drag_surface),
+ gdk_surface_get_height (x11_context->drag_surface));
cr = cairo_create (surface);
cairo_set_source_surface (cr, win_surface, 0, 0);
cairo_paint (cr);
@@ -2776,7 +2776,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
/*
pattern = cairo_pattern_create_for_surface (surface);
- gdk_window_set_background_pattern (x11_context->drag_window, pattern);
+ gdk_surface_set_background_pattern (x11_context->drag_surface, pattern);
cairo_pattern_destroy (pattern);
*/
@@ -2784,7 +2784,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
anim = g_slice_new0 (GdkDragAnim);
anim->context = g_object_ref (x11_context);
- anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window);
+ anim->frame_clock = gdk_surface_get_frame_clock (x11_context->drag_surface);
anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
@@ -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_window_drag_begin (GdkWindow *window,
+_gdk_x11_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -2952,7 +2952,7 @@ _gdk_x11_window_drag_begin (GdkWindow *window,
int x_root, y_root;
Atom xselection;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT,
"display", display,
@@ -2978,15 +2978,15 @@ _gdk_x11_window_drag_begin (GdkWindow *window,
x11_context->protocol = GDK_DRAG_PROTO_XDND;
x11_context->actions = actions;
- x11_context->ipc_window = gdk_window_new_popup (display, &(GdkRectangle) { -99, -99, 1, 1 });
- if (gdk_window_get_group (window))
- gdk_window_set_group (x11_context->ipc_window, window);
- gdk_window_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_window = x11_context->ipc_window;
- g_object_ref (context->source_window);
+ context->source_surface = x11_context->ipc_surface;
+ g_object_ref (context->source_surface);
- x11_context->drag_window = create_drag_window (display);
+ x11_context->drag_surface = create_drag_surface (display);
if (!drag_context_grab (context))
{
@@ -2994,15 +2994,15 @@ _gdk_x11_window_drag_begin (GdkWindow *window,
return NULL;
}
- move_drag_window (context, x_root, y_root);
+ move_drag_surface (context, x_root, y_root);
x11_context->timestamp = gdk_display_get_last_seen_time (display);
xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection");
XSetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
xselection,
- GDK_WINDOW_XID (x11_context->ipc_window),
+ GDK_SURFACE_XID (x11_context->ipc_surface),
x11_context->timestamp);
- if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_WINDOW_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);
@@ -3118,17 +3118,17 @@ gdk_drag_update (GdkDragContext *context,
{
GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context);
GdkDragAction action, possible_actions;
- GdkWindow *dest_window;
+ GdkSurface *dest_surface;
GdkDragProtocol protocol;
gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_context->actions,
&action, &possible_actions);
- dest_window = gdk_x11_drag_context_find_window (context,
- x11_context->drag_window,
- 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_window, protocol, x_root, y_root,
+ gdk_x11_drag_context_drag_motion (context, dest_surface, protocol, x_root, y_root,
action, possible_actions, evtime);
}
@@ -3173,7 +3173,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context,
case GDK_KEY_KP_Enter:
case GDK_KEY_KP_Space:
if ((gdk_drag_context_get_selected_action (context) != 0) &&
- (gdk_drag_context_get_dest_window (context) != NULL))
+ (gdk_drag_context_get_dest_surface (context) != NULL))
{
g_signal_emit_by_name (context, "drop-performed",
gdk_event_get_time ((GdkEvent *) event));
@@ -3238,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_window ||
- 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) !=
@@ -3261,7 +3261,7 @@ gdk_dnd_handle_button_event (GdkDragContext *context,
#endif
if ((gdk_drag_context_get_selected_action (context) != 0) &&
- (gdk_drag_context_get_dest_window (context) != NULL))
+ (gdk_drag_context_get_dest_surface (context) != NULL))
{
g_signal_emit_by_name (context, "drop-performed",
gdk_event_get_time ((GdkEvent *) event));
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 45b5df94ad..a4bbea0079 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -20,7 +20,7 @@
#include "gdkeventsource.h"
#include "gdkinternals.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
#include "gdkprivate-x11.h"
#include "gdkdisplay-x11.h"
#include "xsettings-client.h"
@@ -55,13 +55,13 @@ static GSourceFuncs event_funcs = {
gdk_event_source_finalize
};
-static GdkWindow *
-gdk_event_source_get_filter_window (GdkEventSource *event_source,
- const XEvent *xevent,
- GdkEventTranslator **event_translator)
+static GdkSurface *
+gdk_event_source_get_filter_surface (GdkEventSource *event_source,
+ const XEvent *xevent,
+ GdkEventTranslator **event_translator)
{
GList *list = event_source->translators;
- GdkWindow *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_window_lookup_for_display (event_source->display,
+ surface = gdk_x11_surface_lookup_for_display (event_source->display,
xevent->xany.window);
- if (window && !GDK_IS_WINDOW (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_window_get_toplevel (event->any.window);
- x11_screen = GDK_X11_SCREEN (GDK_WINDOW_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_window_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;
- GdkWindow *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))
@@ -254,15 +254,15 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
xevent->xany.window == x11_screen->xsettings_manager_window)
result = gdk_xsettings_manager_window_filter (xevent, event, x11_screen);
- cache = gdk_window_cache_get (display);
+ cache = gdk_surface_cache_get (display);
if (cache)
{
if (result == GDK_FILTER_CONTINUE)
- result = gdk_window_cache_shape_filter (xevent, event, cache);
+ result = gdk_surface_cache_shape_filter (xevent, event, cache);
if (result == GDK_FILTER_CONTINUE &&
xevent->xany.window == XRootWindow (dpy, 0))
- result = gdk_window_cache_filter (xevent, event, cache);
+ result = gdk_surface_cache_filter (xevent, event, cache);
}
if (result == GDK_FILTER_CONTINUE)
@@ -271,10 +271,10 @@ 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");
- result = xdnd_source_window_filter (xevent, event, context);
+ gpointer context = g_object_get_data (G_OBJECT (filter_surface), "xdnd-source-context");
+ result = xdnd_source_surface_filter (xevent, event, context);
}
if (result != GDK_FILTER_CONTINUE)
@@ -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);
@@ -523,7 +523,7 @@ gdk_x11_event_source_select_events (GdkEventSource *source,
if (mask != 0)
{
- _gdk_x11_event_translator_select_window_events (translator, window, mask);
+ _gdk_x11_event_translator_select_surface_events (translator, window, mask);
event_mask &= ~mask;
}
diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c
index 7bb4c6668e..7344b882bc 100644
--- a/gdk/x11/gdkeventtranslator.c
+++ b/gdk/x11/gdkeventtranslator.c
@@ -18,7 +18,7 @@
#include "config.h"
#include "gdkeventtranslator.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
typedef GdkEventTranslatorIface GdkEventTranslatorInterface;
G_DEFINE_INTERFACE (GdkEventTranslator, _gdk_x11_event_translator, G_TYPE_OBJECT);
@@ -72,7 +72,7 @@ _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator)
}
void
-_gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator,
+_gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask)
{
@@ -82,14 +82,14 @@ _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator,
iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator);
- if (iface->select_window_events)
- iface->select_window_events (translator, window, event_mask);
+ if (iface->select_surface_events)
+ iface->select_surface_events (translator, window, event_mask);
}
-GdkWindow *
-_gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
- GdkDisplay *display,
- const XEvent *xevent)
+GdkSurface *
+_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 1bd9d78d5f..5cbc41d539 100644
--- a/gdk/x11/gdkeventtranslator.h
+++ b/gdk/x11/gdkeventtranslator.h
@@ -44,10 +44,10 @@ struct _GdkEventTranslatorIface
const XEvent *xevent);
GdkEventMask (* get_handled_events) (GdkEventTranslator *translator);
- void (* select_window_events) (GdkEventTranslator *translator,
+ void (* select_surface_events) (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask);
- GdkWindow * (* get_window) (GdkEventTranslator *translator,
+ GdkSurface * (* get_surface) (GdkEventTranslator *translator,
const XEvent *xevent);
};
@@ -57,10 +57,10 @@ GdkEvent * _gdk_x11_event_translator_translate (GdkEventTranslator *translator,
GdkDisplay *display,
const XEvent *xevent);
GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator);
-void _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator,
+void _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator,
Window window,
GdkEventMask event_mask);
-GdkWindow * _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 6d299fe475..268f852fc7 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -22,15 +22,15 @@
#include "gdkprivate-x11.h"
#include "gdkscreen-x11.h"
#include "gdkdisplay-x11.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
-typedef struct _GdkWindowQueueItem GdkWindowQueueItem;
-typedef struct _GdkWindowParentPos GdkWindowParentPos;
+typedef struct _GdkSurfaceQueueItem GdkSurfaceQueueItem;
+typedef struct _GdkSurfaceParentPos GdkSurfaceParentPos;
-struct _GdkWindowQueueItem
+struct _GdkSurfaceQueueItem
{
- GdkWindow *window;
+ GdkSurface *surface;
gulong serial;
cairo_region_t *antiexpose_area;
};
@@ -76,12 +76,12 @@ queue_delete_link (GQueue *queue,
}
static void
-queue_item_free (GdkWindowQueueItem *item)
+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_window_queue (GdkWindow *window,
- GdkWindowQueueItem *new_item)
+gdk_surface_queue (GdkSurface *surface,
+ GdkSurfaceQueueItem *new_item)
{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_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,12 +116,12 @@ gdk_window_queue (GdkWindow *window,
*/
if (display_x11->translate_queue->length >= 64)
{
- gulong serial = find_current_serial (GDK_WINDOW_XDISPLAY (window));
+ gulong serial = find_current_serial (GDK_SURFACE_XDISPLAY (surface));
GList *tmp_list = display_x11->translate_queue->head;
while (tmp_list)
{
- GdkWindowQueueItem *item = tmp_list->data;
+ GdkSurfaceQueueItem *item = tmp_list->data;
GList *next = tmp_list->next;
/* an overflow-safe (item->serial < serial) */
@@ -147,7 +147,7 @@ gdk_window_queue (GdkWindow *window,
while (tmp_list)
{
- GdkWindowQueueItem *item = tmp_list->data;
+ GdkSurfaceQueueItem *item = tmp_list->data;
GList *next = tmp_list->next;
queue_delete_link (display_x11->translate_queue, tmp_list);
@@ -157,32 +157,32 @@ gdk_window_queue (GdkWindow *window,
}
}
- new_item->window = window;
- new_item->serial = NextRequest (GDK_WINDOW_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_window_queue_antiexpose (GdkWindow *window,
+_gdk_x11_surface_queue_antiexpose (GdkSurface *surface,
cairo_region_t *area)
{
- GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1);
+ GdkSurfaceQueueItem *item = g_new (GdkSurfaceQueueItem, 1);
item->antiexpose_area = cairo_region_reference (area);
- gdk_window_queue (window, item);
+ gdk_surface_queue (surface, item);
}
void
-_gdk_x11_window_process_expose (GdkWindow *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_WINDOW_DISPLAY (window));
+ GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (surface));
if (display_x11->translate_queue)
{
@@ -190,13 +190,13 @@ _gdk_x11_window_process_expose (GdkWindow *window,
while (tmp_list)
{
- GdkWindowQueueItem *item = tmp_list->data;
+ GdkSurfaceQueueItem *item = tmp_list->data;
GList *next = tmp_list->next;
/* 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_window_process_expose (GdkWindow *window,
}
if (!cairo_region_is_empty (invalidate_region))
- _gdk_window_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 fdd9571b92..c5f104fde5 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -28,7 +28,7 @@
#include "gdkx11display.h"
#include "gdkx11glcontext.h"
#include "gdkx11screen.h"
-#include "gdkx11window.h"
+#include "gdkx11surface.h"
#include "gdkvisual-x11.h"
#include "gdkx11property.h"
#include <X11/Xatom.h>
@@ -79,16 +79,16 @@ drawable_info_free (gpointer data_)
}
static DrawableInfo *
-get_glx_drawable_info (GdkWindow *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 (GdkWindow *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);
- GdkWindow *window = gdk_gl_context_get_window (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_window_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);
- GdkWindow *window = gdk_draw_context_get_window (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,16 +363,16 @@ 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;
- GdkWindow *window;
- int unscaled_window_height;
- int window_scale;
+ GdkSurface *surface;
+ int unscaled_surface_height;
+ int surface_scale;
unsigned int texture_id;
gboolean use_texture_rectangle;
guint target;
@@ -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_window (paint_context)->impl_window;
- window_scale = gdk_window_get_scale_factor (window);
- gdk_window_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,11 +427,11 @@ 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 * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
- rect.width * window_scale, rect.height * window_scale);
+ glScissor (rect.x * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale),
+ rect.width * surface_scale, rect.height * surface_scale);
for (i = 0; i < n_rects; i++)
{
@@ -451,14 +451,14 @@ 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);
}
{
GdkTexturedQuad quad = {
- rect.x * window_scale, FLIP_Y(rect.y * window_scale),
- (rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
+ rect.x * surface_scale, FLIP_Y(rect.y * surface_scale),
+ (rect.x + rect.width) * surface_scale, FLIP_Y((rect.y + rect.height) * surface_scale),
uscale * src_x, vscale * src_y,
uscale * (src_x + src_width), vscale * (src_y + src_height),
};
@@ -566,12 +566,12 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
Display *dpy;
DrawableInfo *info;
GdkGLContext *share;
- GdkWindow *window;
+ GdkSurface *surface;
gboolean debug_bit, compat_bit, legacy_bit, es_bit;
int major, minor, flags;
- window = gdk_gl_context_get_window (context);
- display = gdk_window_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_window);
+ 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_window_get_xid (window->impl_window),
+ 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_window, info);
+ set_glx_drawable_info (surface->impl_surface, info);
}
XFree (xvisinfo);
- context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_window_get_xid (window->impl_window);
+ 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_window_create_gl_context (GdkWindow *window,
+gdk_x11_surface_create_gl_context (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error)
@@ -1202,9 +1202,9 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
GdkX11GLContext *context;
GLXFBConfig config;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (!gdk_x11_screen_init_gl (GDK_WINDOW_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_window_create_gl_context (GdkWindow *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/gdkglcontext-x11.h b/gdk/x11/gdkglcontext-x11.h
index f5af2115df..89d1131fcc 100644
--- a/gdk/x11/gdkglcontext-x11.h
+++ b/gdk/x11/gdkglcontext-x11.h
@@ -30,7 +30,7 @@
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkvisual-x11.h"
-#include "gdkwindow.h"
+#include "gdksurface.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
@@ -55,7 +55,7 @@ struct _GdkX11GLContextClass
};
gboolean gdk_x11_screen_init_gl (GdkX11Screen *screen);
-GdkGLContext * gdk_x11_window_create_gl_context (GdkWindow *window,
+GdkGLContext * gdk_x11_surface_create_gl_context (GdkSurface *window,
gboolean attached,
GdkGLContext *share,
GError **error);
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 72edfe1c09..4fe1d36b19 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -102,7 +102,7 @@ static int gdk_x_error (Display *display,
static int gdk_x_io_error (Display *display);
void
-_gdk_x11_windowing_init (void)
+_gdk_x11_surfaceing_init (void)
{
XSetErrorHandler (gdk_x_error);
XSetIOErrorHandler (gdk_x_io_error);
@@ -130,20 +130,20 @@ _gdk_x11_convert_grab_status (gint status)
}
/*
- * _gdk_x11_window_grab_check_unmap:
- * @window: a #GdkWindow
+ * _gdk_x11_surface_grab_check_unmap:
+ * @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_window_grab_check_unmap (GdkWindow *window,
+_gdk_x11_surface_grab_check_unmap (GdkSurface *surface,
gulong serial)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkSeat *seat;
GList *devices, *d;
@@ -153,24 +153,24 @@ _gdk_x11_window_grab_check_unmap (GdkWindow *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_window_grab_check_destroy:
- * @window: a #GdkWindow
+ * _gdk_x11_surface_grab_check_destroy:
+ * @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_window_grab_check_destroy (GdkWindow *window)
+_gdk_x11_surface_grab_check_destroy (GdkSurface *surface)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkSeat *seat;
GdkDeviceGrabInfo *grab;
GList *devices, *d;
@@ -183,10 +183,10 @@ _gdk_x11_window_grab_check_destroy (GdkWindow *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_window == 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 a10d41da6f..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;
- GdkWindow *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_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) == 0)
+ if ((gdk_surface_get_state (surface) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
continue;
- if (gdk_window_get_fullscreen_mode (window) == GDK_FULLSCREEN_ON_ALL_MONITORS ||
- gdk_display_get_monitor_at_window (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/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index bcd6b265b3..c55b0b3fc9 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -32,7 +32,7 @@
#include "gdkcursor.h"
#include "gdkinternals.h"
#include "gdkx.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
#include "gdkscreen-x11.h"
#include <X11/Xlib.h>
@@ -68,7 +68,7 @@ Colormap gdk_x11_display_get_window_colormap (GdkX11Display *displa
void _gdk_x11_display_add_window (GdkDisplay *display,
XID *xid,
- GdkWindow *window);
+ GdkSurface *window);
void _gdk_x11_display_remove_window (GdkDisplay *display,
XID xid);
@@ -79,13 +79,13 @@ gint _gdk_x11_display_send_xevent (GdkDisplay *display,
XEvent *event_send);
/* Routines from gdkgeometry-x11.c */
-void _gdk_x11_window_process_expose (GdkWindow *window,
+void _gdk_x11_surface_process_expose (GdkSurface *window,
gulong serial,
GdkRectangle *area);
-void _gdk_x11_window_queue_antiexpose (GdkWindow *window,
+void _gdk_x11_surface_queue_antiexpose (GdkSurface *window,
cairo_region_t *area);
-void _gdk_x11_window_translate (GdkWindow *window,
+void _gdk_x11_surface_translate (GdkSurface *window,
cairo_region_t *area,
gint dx,
gint dy);
@@ -106,7 +106,7 @@ void _gdk_x11_region_get_xrectangles (const cairo_region_t *region,
gboolean _gdk_x11_moveresize_handle_event (const XEvent *event);
gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display,
- GdkWindow *window);
+ GdkSurface *window);
void _gdk_x11_keymap_state_changed (GdkDisplay *display,
const XEvent *event);
@@ -114,11 +114,11 @@ void _gdk_x11_keymap_keys_changed (GdkDisplay *display);
void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap,
GdkModifierType *modifiers);
-void _gdk_x11_windowing_init (void);
+void _gdk_x11_surfaceing_init (void);
-void _gdk_x11_window_grab_check_unmap (GdkWindow *window,
+void _gdk_x11_surface_grab_check_unmap (GdkSurface *window,
gulong serial);
-void _gdk_x11_window_grab_check_destroy (GdkWindow *window);
+void _gdk_x11_surface_grab_check_destroy (GdkSurface *window);
gboolean _gdk_x11_display_is_root_window (GdkDisplay *display,
Window xroot_window);
@@ -196,11 +196,11 @@ void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display,
void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
-void _gdk_x11_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+void _gdk_x11_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *window,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes);
+ GdkSurfaceAttr *attributes);
GList * gdk_x11_display_get_toplevel_windows (GdkDisplay *display);
void _gdk_x11_precache_atoms (GdkDisplay *display,
@@ -217,29 +217,29 @@ _gdk_x11_dnd_filter (const XEvent *xevent,
gpointer data);
GdkFilterReturn
-xdnd_source_window_filter (const XEvent *xevent,
+xdnd_source_surface_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data);
-typedef struct _GdkWindowCache GdkWindowCache;
+typedef struct _GdkSurfaceCache GdkSurfaceCache;
-GdkWindowCache *
-gdk_window_cache_get (GdkDisplay *display);
+GdkSurfaceCache *
+gdk_surface_cache_get (GdkDisplay *display);
GdkFilterReturn
-gdk_window_cache_filter (const XEvent *xevent,
+gdk_surface_cache_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data);
GdkFilterReturn
-gdk_window_cache_shape_filter (const XEvent *xevent,
+gdk_surface_cache_shape_filter (const XEvent *xevent,
GdkEvent *event,
gpointer data);
void _gdk_x11_cursor_display_finalize (GdkDisplay *display);
-void _gdk_x11_window_register_dnd (GdkWindow *window);
+void _gdk_x11_surface_register_dnd (GdkSurface *window);
-GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window,
+GdkDragContext * _gdk_x11_surface_drag_begin (GdkSurface *window,
GdkDevice *device,
GdkContentProvider *content,
GdkDragAction actions,
@@ -258,20 +258,20 @@ extern const gint _gdk_x11_event_mask_table_size;
#define GDK_SCREEN_DISPLAY(screen) (GDK_X11_SCREEN (screen)->display)
#define GDK_SCREEN_XROOTWIN(screen) (GDK_X11_SCREEN (screen)->xroot_window)
#define GDK_DISPLAY_XROOTWIN(display) (GDK_SCREEN_XROOTWIN (GDK_X11_DISPLAY (display)->screen))
-#define GDK_WINDOW_SCREEN(win) (GDK_X11_DISPLAY (gdk_window_get_display (win))->screen)
-#define GDK_WINDOW_DISPLAY(win) (gdk_window_get_display (win))
-#define GDK_WINDOW_XROOTWIN(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xroot_window)
-#define GDK_WINDOW_IS_X11(win) (GDK_IS_WINDOW_IMPL_X11 ((win)->impl))
+#define GDK_SURFACE_SCREEN(win) (GDK_X11_DISPLAY (gdk_surface_get_display (win))->screen)
+#define GDK_SURFACE_DISPLAY(win) (gdk_surface_get_display (win))
+#define GDK_SURFACE_XROOTWIN(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xroot_window)
+#define GDK_SURFACE_IS_X11(win) (GDK_IS_SURFACE_IMPL_X11 ((win)->impl))
/* override some macros from gdkx.h with direct-access variants */
#undef GDK_DISPLAY_XDISPLAY
-#undef GDK_WINDOW_XDISPLAY
-#undef GDK_WINDOW_XID
+#undef GDK_SURFACE_XDISPLAY
+#undef GDK_SURFACE_XID
#undef GDK_SCREEN_XDISPLAY
#define GDK_DISPLAY_XDISPLAY(display) (GDK_X11_DISPLAY(display)->xdisplay)
-#define GDK_WINDOW_XDISPLAY(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xdisplay)
-#define GDK_WINDOW_XID(win) (GDK_WINDOW_IMPL_X11(GDK_WINDOW (win)->impl)->xid)
+#define GDK_SURFACE_XDISPLAY(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xdisplay)
+#define GDK_SURFACE_XID(win) (GDK_SURFACE_IMPL_X11(GDK_SURFACE (win)->impl)->xid)
#define GDK_SCREEN_XDISPLAY(screen) (GDK_X11_SCREEN (screen)->xdisplay)
#endif /* __GDK_PRIVATE_X11_H__ */
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 2ca0ac7886..4554c6ccd4 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -242,10 +242,10 @@ gdk_x11_screen_get_work_area (GdkX11Screen *x11_screen,
area->width = workareas[desktop * 4 + 2];
area->height = workareas[desktop * 4 + 3];
- area->x /= x11_screen->window_scale;
- area->y /= x11_screen->window_scale;
- area->width /= x11_screen->window_scale;
- area->height /= x11_screen->window_scale;
+ area->x /= x11_screen->surface_scale;
+ area->y /= x11_screen->surface_scale;
+ area->width /= x11_screen->surface_scale;
+ area->height /= x11_screen->surface_scale;
out:
if (ret_workarea)
@@ -408,10 +408,10 @@ init_randr15 (GdkX11Screen *x11_screen, gboolean *changed)
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
name = g_strndup (output_info->name, output_info->nameLen);
- newgeo.x = rr_monitors[i].x / x11_screen->window_scale;
- newgeo.y = rr_monitors[i].y / x11_screen->window_scale;
- newgeo.width = rr_monitors[i].width / x11_screen->window_scale;
- newgeo.height = rr_monitors[i].height / x11_screen->window_scale;
+ newgeo.x = rr_monitors[i].x / x11_screen->surface_scale;
+ newgeo.y = rr_monitors[i].y / x11_screen->surface_scale;
+ newgeo.width = rr_monitors[i].width / x11_screen->surface_scale;
+ newgeo.height = rr_monitors[i].height / x11_screen->surface_scale;
if (newgeo.x != geometry.x ||
newgeo.y != geometry.y ||
newgeo.width != geometry.width ||
@@ -430,7 +430,7 @@ init_randr15 (GdkX11Screen *x11_screen, gboolean *changed)
gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor),
translate_subpixel_order (output_info->subpixel_order));
gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh_rate);
- gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale);
+ gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale);
gdk_monitor_set_model (GDK_MONITOR (monitor), name);
g_free (name);
@@ -570,10 +570,10 @@ init_randr13 (GdkX11Screen *x11_screen, gboolean *changed)
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
name = g_strndup (output_info->name, output_info->nameLen);
- newgeo.x = crtc->x / x11_screen->window_scale;
- newgeo.y = crtc->y / x11_screen->window_scale;
- newgeo.width = crtc->width / x11_screen->window_scale;
- newgeo.height = crtc->height / x11_screen->window_scale;
+ newgeo.x = crtc->x / x11_screen->surface_scale;
+ newgeo.y = crtc->y / x11_screen->surface_scale;
+ newgeo.width = crtc->width / x11_screen->surface_scale;
+ newgeo.height = crtc->height / x11_screen->surface_scale;
if (newgeo.x != geometry.x ||
newgeo.y != geometry.y ||
newgeo.width != geometry.width ||
@@ -592,7 +592,7 @@ init_randr13 (GdkX11Screen *x11_screen, gboolean *changed)
gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor),
translate_subpixel_order (output_info->subpixel_order));
gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh_rate);
- gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale);
+ gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale);
gdk_monitor_set_model (GDK_MONITOR (monitor), name);
g_free (name);
@@ -712,7 +712,7 @@ init_no_multihead (GdkX11Screen *x11_screen, gboolean *changed)
gdk_monitor_set_size (GDK_MONITOR (monitor), width, height);
g_object_notify (G_OBJECT (monitor), "workarea");
gdk_monitor_set_physical_size (GDK_MONITOR (monitor), width_mm, height_mm);
- gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale);
+ gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->surface_scale);
if (x11_display->primary_monitor != 0)
*changed = TRUE;
@@ -772,13 +772,13 @@ _gdk_x11_screen_new (GdkDisplay *display,
scale_str = g_getenv ("GDK_SCALE");
if (scale_str)
{
- x11_screen->fixed_window_scale = TRUE;
- x11_screen->window_scale = atol (scale_str);
- if (x11_screen->window_scale == 0)
- x11_screen->window_scale = 1;
+ x11_screen->fixed_surface_scale = TRUE;
+ x11_screen->surface_scale = atol (scale_str);
+ if (x11_screen->surface_scale == 0)
+ x11_screen->surface_scale = 1;
}
else
- x11_screen->window_scale = 1;
+ x11_screen->surface_scale = 1;
init_randr_support (x11_screen);
init_multihead (x11_screen);
@@ -789,25 +789,25 @@ _gdk_x11_screen_new (GdkDisplay *display,
}
void
-_gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
+_gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen,
gint scale)
{
GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display);
GList *toplevels, *l;
int i;
- if (x11_screen->window_scale == scale)
+ if (x11_screen->surface_scale == scale)
return;
- x11_screen->window_scale = scale;
+ x11_screen->surface_scale = scale;
toplevels = gdk_x11_display_get_toplevel_windows (x11_screen->display);
for (l = toplevels; l != NULL; l = l->next)
{
- GdkWindow *window = l->data;
+ GdkSurface *surface = l->data;
- _gdk_x11_window_set_window_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/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
index 9553b4baba..08e3e8ba87 100644
--- a/gdk/x11/gdkscreen-x11.h
+++ b/gdk/x11/gdkscreen-x11.h
@@ -41,8 +41,8 @@ struct _GdkX11Screen
Window xroot_window;
gint screen_num;
- gint window_scale;
- gboolean fixed_window_scale;
+ gint surface_scale;
+ gboolean fixed_surface_scale;
/* Xft resources for the display, used for default values for
* the Xft/ XSETTINGS
@@ -108,7 +108,7 @@ void _gdk_x11_screen_get_edge_monitors (GdkX11Screen *screen,
gint *bottom,
gint *left,
gint *right);
-void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
+void _gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen,
int scale);
void gdk_x11_screen_get_work_area (GdkX11Screen *screen,
GdkRectangle *area);
diff --git a/gdk/x11/gdkselectioninputstream-x11.c b/gdk/x11/gdkselectioninputstream-x11.c
index c3ae895344..55f83b4975 100644
--- a/gdk/x11/gdkselectioninputstream-x11.c
+++ b/gdk/x11/gdkselectioninputstream-x11.c
@@ -27,7 +27,7 @@
#include "gdkintl.h"
#include "gdkx11display.h"
#include "gdkx11property.h"
-#include "gdkx11window.h"
+#include "gdkx11surface.h"
typedef struct GdkX11SelectionInputStreamPrivate GdkX11SelectionInputStreamPrivate;
diff --git a/gdk/x11/gdkselectionoutputstream-x11.c b/gdk/x11/gdkselectionoutputstream-x11.c
index 106c6b780c..5f35cdf6be 100644
--- a/gdk/x11/gdkselectionoutputstream-x11.c
+++ b/gdk/x11/gdkselectionoutputstream-x11.c
@@ -29,7 +29,7 @@
#include "gdktextlistconverter-x11.h"
#include "gdkx11display.h"
#include "gdkx11property.h"
-#include "gdkx11window.h"
+#include "gdkx11surface.h"
typedef struct _GdkX11PendingSelectionNotify GdkX11PendingSelectionNotify;
typedef struct _GdkX11SelectionOutputStreamPrivate GdkX11SelectionOutputStreamPrivate;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdksurface-x11.c
index 3fcaae3591..17a51c3fa6 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -25,10 +25,10 @@
#include "config.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
-#include "gdkwindow.h"
-#include "gdkwindowimpl.h"
+#include "gdksurface.h"
+#include "gdksurfaceimpl.h"
#include "gdkvisual-x11.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
@@ -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_window_apply_fullscreen_mode (GdkWindow *window);
-static gboolean gdk_window_icon_name_set (GdkWindow *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 (GdkWindow *window);
+static void move_to_current_desktop (GdkSurface *surface);
-static void gdk_window_impl_x11_finalize (GObject *object);
+static void gdk_surface_impl_x11_finalize (GObject *object);
-#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
- (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || \
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_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 WINDOW_IS_TOPLEVEL(window) \
- (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \
- GDK_WINDOW_TYPE (window) == GDK_WINDOW_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.
@@ -127,47 +127,47 @@ static void gdk_window_impl_x11_finalize (GObject *object);
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
)
-struct _GdkX11Window {
- GdkWindow parent;
+struct _GdkX11Surface {
+ GdkSurface parent;
};
-struct _GdkX11WindowClass {
- GdkWindowClass parent_class;
+struct _GdkX11SurfaceClass {
+ GdkSurfaceClass parent_class;
};
-G_DEFINE_TYPE (GdkX11Window, gdk_x11_window, GDK_TYPE_WINDOW)
+G_DEFINE_TYPE (GdkX11Surface, gdk_x11_surface, GDK_TYPE_SURFACE)
static void
-gdk_x11_window_class_init (GdkX11WindowClass *x11_window_class)
+gdk_x11_surface_class_init (GdkX11SurfaceClass *x11_surface_class)
{
}
static void
-gdk_x11_window_init (GdkX11Window *x11_window)
+gdk_x11_surface_init (GdkX11Surface *x11_surface)
{
}
-G_DEFINE_TYPE (GdkWindowImplX11, gdk_window_impl_x11, GDK_TYPE_WINDOW_IMPL)
+G_DEFINE_TYPE (GdkSurfaceImplX11, gdk_surface_impl_x11, GDK_TYPE_SURFACE_IMPL)
static void
-gdk_window_impl_x11_init (GdkWindowImplX11 *impl)
+gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl)
{
- impl->window_scale = 1;
+ impl->surface_scale = 1;
impl->frame_sync_enabled = TRUE;
}
GdkToplevelX11 *
-_gdk_x11_window_get_toplevel (GdkWindow *window)
+_gdk_x11_surface_get_toplevel (GdkSurface *surface)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (!WINDOW_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return NULL;
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (!impl->toplevel)
{
@@ -179,14 +179,14 @@ _gdk_x11_window_get_toplevel (GdkWindow *window)
}
/**
- * _gdk_x11_window_update_size:
- * @impl: a #GdkWindowImplX11.
+ * _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
-_gdk_x11_window_update_size (GdkWindowImplX11 *impl)
+_gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl)
{
if (impl->cairo_surface)
{
@@ -196,11 +196,11 @@ _gdk_x11_window_update_size (GdkWindowImplX11 *impl)
}
static void
-gdk_x11_window_get_unscaled_size (GdkWindow *window,
+gdk_x11_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_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_window_get_unscaled_size (GdkWindow *window,
}
static gboolean
-gdk_x11_window_supports_edge_constraints (GdkWindow *window)
+gdk_x11_surface_supports_edge_constraints (GdkSurface *surface)
{
- return gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
+ return gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_GTK_EDGE_CONSTRAINTS"));
}
@@ -230,21 +230,21 @@ set_sync_counter(Display *display,
}
static void
-window_pre_damage (GdkWindow *window)
+surface_pre_damage (GdkSurface *surface)
{
- GdkWindow *toplevel_window = gdk_window_get_toplevel (window);
- GdkWindowImplX11 *impl;
+ GdkSurface *toplevel_surface = gdk_surface_get_toplevel (surface);
+ GdkSurfaceImplX11 *impl;
- if (!toplevel_window || !WINDOW_IS_TOPLEVEL (toplevel_window))
+ if (!toplevel_surface || !SURFACE_IS_TOPLEVEL (toplevel_surface))
return;
- impl = GDK_WINDOW_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)
{
impl->toplevel->current_counter_value += 1;
- set_sync_counter (GDK_WINDOW_XDISPLAY (impl->wrapper),
+ set_sync_counter (GDK_SURFACE_XDISPLAY (impl->wrapper),
impl->toplevel->extended_update_counter,
impl->toplevel->current_counter_value);
}
@@ -253,11 +253,11 @@ window_pre_damage (GdkWindow *window)
static void
on_surface_changed (void *data)
{
- GdkWindow *window = data;
- GdkWindowImplX11 *impl = GDK_WINDOW_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 (GdkWindow *window)
+hook_surface_changed (GdkSurface *surface)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (impl->cairo_surface)
{
@@ -281,15 +281,15 @@ hook_surface_changed (GdkWindow *window)
(unsigned char *)"X",
1,
on_surface_changed,
- window);
+ surface);
impl->tracking_damage = 1;
}
}
static void
-unhook_surface_changed (GdkWindow *window)
+unhook_surface_changed (GdkSurface *surface)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (impl->cairo_surface)
{
@@ -302,18 +302,18 @@ unhook_surface_changed (GdkWindow *window)
}
static void
-gdk_x11_window_predict_presentation_time (GdkWindow *window)
+gdk_x11_surface_predict_presentation_time (GdkSurface *surface)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkFrameClock *clock;
GdkFrameTimings *timings;
gint64 presentation_time;
gint64 refresh_interval;
- if (!WINDOW_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return;
- clock = gdk_window_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_window_predict_presentation_time (GdkWindow *window)
}
static void
-gdk_x11_window_begin_frame (GdkWindow *window,
+gdk_x11_surface_begin_frame (GdkSurface *surface,
gboolean force_frame)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (!WINDOW_IS_TOPLEVEL (window) ||
+ if (!SURFACE_IS_TOPLEVEL (surface) ||
impl->toplevel->extended_update_counter == None)
return;
@@ -372,48 +372,48 @@ gdk_x11_window_begin_frame (GdkWindow *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_window_end_frame (GdkWindow *window)
+gdk_x11_surface_end_frame (GdkSurface *surface)
{
GdkFrameClock *clock;
GdkFrameTimings *timings;
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (!WINDOW_IS_TOPLEVEL (window) ||
+ if (!SURFACE_IS_TOPLEVEL (surface) ||
impl->toplevel->extended_update_counter == None ||
!impl->toplevel->in_frame)
return;
- clock = gdk_window_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_window_get_display (window), FRAMES))
+ if (GDK_DISPLAY_DEBUG_CHECK (gdk_surface_get_display (surface), FRAMES))
{
- XImage *image = XGetImage (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XImage *image = XGetImage (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
0, 0, 1, 1,
(1 << 24) - 1,
ZPixmap);
@@ -429,26 +429,26 @@ gdk_x11_window_end_frame (GdkWindow *window)
else
impl->toplevel->current_counter_value += 1;
- set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper),
+ set_sync_counter(GDK_SURFACE_XDISPLAY (impl->wrapper),
impl->toplevel->extended_update_counter,
impl->toplevel->current_counter_value);
if (impl->frame_sync_enabled &&
- gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_window_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_WINDOW_XDISPLAY (window),
+ set_sync_counter (GDK_SURFACE_XDISPLAY (surface),
impl->toplevel->update_counter,
impl->toplevel->configure_counter_value);
@@ -464,36 +464,36 @@ gdk_x11_window_end_frame (GdkWindow *window)
*****************************************************/
static cairo_surface_t *
-gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl,
+gdk_x11_create_cairo_surface (GdkSurfaceImplX11 *impl,
int width,
int height)
{
Visual *visual;
- visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_window_get_display (impl->wrapper)));
- return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
- GDK_WINDOW_IMPL_X11 (impl)->xid,
+ visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_surface_get_display (impl->wrapper)));
+ return cairo_xlib_surface_create (GDK_SURFACE_XDISPLAY (impl->wrapper),
+ GDK_SURFACE_IMPL_X11 (impl)->xid,
visual,
width, height);
}
static cairo_surface_t *
-gdk_x11_ref_cairo_surface (GdkWindow *window)
+gdk_x11_ref_cairo_surface (GdkSurface *surface)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
if (!impl->cairo_surface)
{
impl->cairo_surface = gdk_x11_create_cairo_surface (impl,
- gdk_window_get_width (window) * impl->window_scale,
- gdk_window_get_height (window) * impl->window_scale);
- cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_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 (WINDOW_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);
@@ -502,25 +502,25 @@ gdk_x11_ref_cairo_surface (GdkWindow *window)
}
static void
-gdk_window_impl_x11_finalize (GObject *object)
+gdk_surface_impl_x11_finalize (GObject *object)
{
- GdkWindow *wrapper;
- GdkWindowImplX11 *impl;
+ GdkSurface *wrapper;
+ GdkSurfaceImplX11 *impl;
- g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (object));
+ g_return_if_fail (GDK_IS_SURFACE_IMPL_X11 (object));
- impl = GDK_WINDOW_IMPL_X11 (object);
+ impl = GDK_SURFACE_IMPL_X11 (object);
wrapper = impl->wrapper;
- if (WINDOW_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame)
+ if (SURFACE_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame)
unhook_surface_changed (wrapper);
- _gdk_x11_window_grab_check_destroy (wrapper);
+ _gdk_x11_surface_grab_check_destroy (wrapper);
- if (!GDK_WINDOW_DESTROYED (wrapper))
+ if (!GDK_SURFACE_DESTROYED (wrapper))
{
- GdkDisplay *display = GDK_WINDOW_DISPLAY (wrapper);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (wrapper);
_gdk_x11_display_remove_window (display, impl->xid);
if (impl->toplevel && impl->toplevel->focus_window)
@@ -532,7 +532,7 @@ gdk_window_impl_x11_finalize (GObject *object)
if (impl->cursor)
g_object_unref (impl->cursor);
- G_OBJECT_CLASS (gdk_window_impl_x11_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gdk_surface_impl_x11_parent_class)->finalize (object);
}
typedef struct {
@@ -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_window_create_pixmap_surface (GdkWindow *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_window_get_display (window);
+ display = gdk_surface_get_display (surface);
dpy = GDK_DISPLAY_XDISPLAY (display);
pixmap = XCreatePixmap (dpy,
- GDK_WINDOW_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 (GdkWindow *window)
+set_wm_protocols (GdkSurface *surface)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
Atom protocols[4];
int n = 0;
@@ -638,7 +638,7 @@ set_wm_protocols (GdkWindow *window)
protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST");
#endif
- XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_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 (GdkWindow *window)
+ensure_sync_counter (GdkSurface *surface)
{
#ifdef HAVE_XSYNC
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
- GdkToplevelX11 *toplevel = _gdk_x11_window_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 (GdkWindow *window)
counters[0] = toplevel->update_counter;
counters[1] = toplevel->extended_update_counter;
- XChangeProperty (xdisplay, GDK_WINDOW_XID (window),
+ XChangeProperty (xdisplay, GDK_SURFACE_XID (surface),
atom, XA_CARDINAL,
32, PropModeReplace,
(guchar *)counters, 2);
@@ -743,29 +743,29 @@ ensure_sync_counter (GdkWindow *window)
}
static void
-setup_toplevel_window (GdkWindow *window,
+setup_toplevel_window (GdkSurface *surface,
GdkX11Screen *x11_screen)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
- GdkDisplay *display = gdk_window_get_display (window);
- Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
- XID xid = GDK_WINDOW_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 (GdkWindow *window,
* correct value???
*/
size_hints.flags = PSize;
- size_hints.width = window->width * impl->window_scale;
- size_hints.height = window->height * impl->window_scale;
+ size_hints.width = surface->width * impl->surface_scale;
+ size_hints.height = surface->height * impl->surface_scale;
XSetWMNormalHints (xdisplay, xid, &size_hints);
@@ -804,60 +804,60 @@ setup_toplevel_window (GdkWindow *window,
XA_WINDOW, 32, PropModeReplace,
(guchar *) &toplevel->focus_window, 1);
- if (!window->focus_on_map)
- gdk_x11_window_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_window_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_window_begin_frame (window, TRUE);
+ gdk_x11_surface_begin_frame (surface, TRUE);
}
static void
on_frame_clock_before_paint (GdkFrameClock *clock,
- GdkWindow *window)
+ GdkSurface *surface)
{
- gdk_x11_window_predict_presentation_time (window);
- gdk_x11_window_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,
- GdkWindow *window)
+ GdkSurface *surface)
{
- gdk_x11_window_end_frame (window);
+ gdk_x11_surface_end_frame (surface);
}
static void
-connect_frame_clock (GdkWindow *window)
+connect_frame_clock (GdkSurface *surface)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
- if (WINDOW_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_window_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;
}
}
void
-_gdk_x11_display_create_window_impl (GdkDisplay *display,
- GdkWindow *window,
- GdkWindow *real_parent,
+_gdk_x11_display_create_surface_impl (GdkDisplay *display,
+ GdkSurface *surface,
+ GdkSurface *real_parent,
GdkEventMask event_mask,
- GdkWindowAttr *attributes)
+ GdkSurfaceAttr *attributes)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
GdkX11Screen *x11_screen;
GdkX11Display *display_x11;
@@ -878,14 +878,14 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
display_x11 = GDK_X11_DISPLAY (display);
x11_screen = GDK_X11_SCREEN (display_x11->screen);
if (real_parent)
- xparent = GDK_WINDOW_XID (real_parent);
+ xparent = GDK_SURFACE_XID (real_parent);
else
xparent = GDK_SCREEN_XROOTWIN (x11_screen);
- impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
- window->impl = GDK_WINDOW_IMPL (impl);
- impl->wrapper = GDK_WINDOW (window);
- impl->window_scale = x11_screen->window_scale;
+ impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL);
+ surface->impl = GDK_SURFACE_IMPL (impl);
+ impl->wrapper = GDK_SURFACE (surface);
+ impl->surface_scale = x11_screen->surface_scale;
xdisplay = x11_screen->xdisplay;
@@ -896,24 +896,24 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
impl->override_redirect = FALSE;
/* Sanity checks */
- switch (window->window_type)
+ switch (surface->surface_type)
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
- if (window->parent)
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP:
+ if (surface->parent)
{
/* The common code warns for this case */
xparent = GDK_SCREEN_XROOTWIN (x11_screen);
}
break;
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
default:
g_assert_not_reached ();
break;
}
- if (!window->input_only)
+ if (!surface->input_only)
{
class = InputOutput;
@@ -928,7 +928,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
xattributes.colormap = gdk_x11_display_get_window_colormap (display_x11);
xattributes_mask |= CWColormap;
- if (window->window_type == GDK_WINDOW_TEMP)
+ if (surface->surface_type == GDK_SURFACE_TEMP)
{
xattributes.save_under = True;
xattributes.override_redirect = True;
@@ -944,7 +944,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
{
class = InputOnly;
- if (window->window_type == GDK_WINDOW_TEMP)
+ if (surface->surface_type == GDK_SURFACE_TEMP)
{
xattributes.override_redirect = True;
xattributes_mask |= CWOverrideRedirect;
@@ -955,24 +955,24 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
depth = 0;
}
- if (window->width * impl->window_scale > 32767 ||
- window->height * impl->window_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->window_scale > 32767)
- window->width = 32767 / impl->window_scale;
- if (window->height * impl->window_scale > 32767)
- window->height = 32767 / impl->window_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->window_scale;
- impl->unscaled_height = window->height * impl->window_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_window_impl (GdkDisplay *display,
}
impl->xid = XCreateWindow (xdisplay, xparent,
- (window->x + abs_x) * impl->window_scale,
- (window->y + abs_y) * impl->window_scale,
- window->width * impl->window_scale, window->height * impl->window_scale,
+ (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_WINDOW_TYPE (window))
+ switch (GDK_SURFACE_TYPE (surface))
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP:
- gdk_window_set_title (window, get_default_title ());
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP:
+ gdk_surface_set_title (surface, get_default_title ());
class_hint = XAllocClassHint ();
class_hint->res_name = (char *) g_get_prgname ();
@@ -1002,21 +1002,21 @@ _gdk_x11_display_create_window_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_WINDOW_CHILD:
+ case GDK_SURFACE_CHILD:
default:
break;
}
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_WINDOW_XID (window), event_mask,
+ GDK_SURFACE_XID (surface), event_mask,
StructureNotifyMask | PropertyChangeMask);
- connect_frame_clock (window);
+ connect_frame_clock (surface);
- gdk_window_freeze_toplevel_updates (window);
+ gdk_surface_freeze_toplevel_updates (surface);
}
static GdkEventMask
@@ -1035,29 +1035,29 @@ x_event_mask_to_gdk_event_mask (long mask)
}
/**
- * gdk_x11_window_foreign_new_for_display:
+ * gdk_x11_surface_foreign_new_for_display:
* @display: (type GdkX11Display): the #GdkDisplay where the window handle comes from.
* @window: an Xlib Window
*
- * Wraps a native window in a #GdkWindow. The function will try to
- * look up the window using gdk_x11_window_lookup_for_display() first.
+ * Wraps a native window in a #GdkSurface. The function will try to
+ * look up the window using gdk_x11_surface_lookup_for_display() first.
* If it does not find it there, it will create a new window.
*
* This may fail if the window has been destroyed. If the window
* was already known to GDK, a new reference to the existing
- * #GdkWindow is returned.
+ * #GdkSurface is returned.
*
- * Returns: (transfer full): a #GdkWindow wrapper for the native
+ * Returns: (transfer full): a #GdkSurface wrapper for the native
* window, or %NULL if the window has been destroyed. The wrapper
* will be newly created, if one doesn’t exist already.
*/
-GdkWindow *
-gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
+GdkSurface *
+gdk_x11_surface_foreign_new_for_display (GdkDisplay *display,
Window window)
{
GdkX11Screen *screen;
- GdkWindow *win;
- GdkWindowImplX11 *impl;
+ GdkSurface *win;
+ GdkSurfaceImplX11 *impl;
GdkX11Display *display_x11;
XWindowAttributes attrs;
Window root, parent;
@@ -1069,7 +1069,7 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
display_x11 = GDK_X11_DISPLAY (display);
- if ((win = gdk_x11_window_lookup_for_display (display, window)) != NULL)
+ if ((win = gdk_x11_surface_lookup_for_display (display, window)) != NULL)
return g_object_ref (win);
gdk_x11_display_error_trap_push (display);
@@ -1092,41 +1092,41 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
if (screen == NULL)
return NULL;
- win = _gdk_display_create_window (display);
- win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
- win->impl_window = win;
+ win = _gdk_display_create_surface (display);
+ win->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL);
+ win->impl_surface = win;
- impl = GDK_WINDOW_IMPL_X11 (win->impl);
+ impl = GDK_SURFACE_IMPL_X11 (win->impl);
impl->wrapper = win;
- impl->window_scale = GDK_X11_SCREEN (screen)->window_scale;
+ impl->surface_scale = GDK_X11_SCREEN (screen)->surface_scale;
/* Always treat foreigns as toplevels */
win->parent = NULL;
impl->xid = window;
- win->x = attrs.x / impl->window_scale;
- win->y = attrs.y / impl->window_scale;
+ win->x = attrs.x / impl->surface_scale;
+ win->y = attrs.y / impl->surface_scale;
impl->unscaled_width = attrs.width;
impl->unscaled_height = attrs.height;
- win->width = attrs.width / impl->window_scale;
- win->height = attrs.height / impl->window_scale;
- win->window_type = GDK_WINDOW_FOREIGN;
+ win->width = attrs.width / impl->surface_scale;
+ win->height = attrs.height / impl->surface_scale;
+ win->surface_type = GDK_SURFACE_FOREIGN;
win->destroyed = FALSE;
win->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
if (attrs.map_state == IsUnmapped)
- win->state = GDK_WINDOW_STATE_WITHDRAWN;
+ win->state = GDK_SURFACE_STATE_WITHDRAWN;
else
win->state = 0;
win->viewable = TRUE;
g_object_ref (win);
- _gdk_x11_display_add_window (display, &GDK_WINDOW_XID (win), win);
+ _gdk_x11_display_add_window (display, &GDK_SURFACE_XID (win), win);
/* Update the clip region, etc */
- _gdk_window_update_size (win);
+ _gdk_surface_update_size (win);
return win;
}
@@ -1166,20 +1166,20 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display,
}
static void
-gdk_x11_window_destroy (GdkWindow *window,
+gdk_x11_surface_destroy (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel)
- gdk_toplevel_x11_free_contents (GDK_WINDOW_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_window_destroy (GdkWindow *window,
}
if (!recursing && !foreign_destroy)
- XDestroyWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_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_window_destroy_notify (GdkWindow *window)
+gdk_x11_surface_destroy_notify (GdkSurface *surface)
{
- GdkWindowImplX11 *window_impl;
+ GdkSurfaceImplX11 *surface_impl;
- window_impl = GDK_WINDOW_IMPL_X11 ((window)->impl);
+ surface_impl = GDK_SURFACE_IMPL_X11 ((surface)->impl);
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- if (GDK_WINDOW_TYPE(window) != GDK_WINDOW_FOREIGN)
- g_warning ("GdkWindow %#lx unexpectedly destroyed", GDK_WINDOW_XID (window));
+ if (GDK_SURFACE_TYPE(surface) != GDK_SURFACE_FOREIGN)
+ g_warning ("GdkSurface %#lx unexpectedly destroyed", GDK_SURFACE_XID (surface));
- _gdk_window_destroy (window, TRUE);
+ _gdk_surface_destroy (surface, TRUE);
}
- _gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), GDK_WINDOW_XID (window));
- if (window_impl->toplevel && window_impl->toplevel->focus_window)
- _gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), window_impl->toplevel->focus_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 (surface), surface_impl->toplevel->focus_window);
- _gdk_x11_window_grab_check_destroy (window);
+ _gdk_x11_surface_grab_check_destroy (surface);
- g_object_unref (window);
+ g_object_unref (surface);
}
static void
-update_wm_hints (GdkWindow *window,
+update_wm_hints (GdkSurface *surface,
gboolean force)
{
- GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkDisplay *display = GDK_WINDOW_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_WINDOW_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_WINDOW_STATE_ICONIFIED)
+ if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
{
wm_hints.flags |= StateHint;
wm_hints.initial_state = IconicState;
@@ -1254,10 +1254,10 @@ update_wm_hints (GdkWindow *window,
}
wm_hints.flags |= WindowGroupHint;
- if (toplevel->group_leader && !GDK_WINDOW_DESTROYED (toplevel->group_leader))
+ if (toplevel->group_leader && !GDK_SURFACE_DESTROYED (toplevel->group_leader))
{
wm_hints.flags |= WindowGroupHint;
- wm_hints.window_group = GDK_WINDOW_XID (toplevel->group_leader);
+ wm_hints.window_group = GDK_SURFACE_XID (toplevel->group_leader);
}
else
wm_hints.window_group = GDK_X11_DISPLAY (display)->leader_window;
@@ -1265,27 +1265,27 @@ update_wm_hints (GdkWindow *window,
if (toplevel->urgency_hint)
wm_hints.flags |= XUrgencyHint;
- XSetWMHints (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XSetWMHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&wm_hints);
}
static void
-set_initial_hints (GdkWindow *window)
+set_initial_hints (GdkSurface *surface)
{
- GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
+ GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
- Window xwindow = GDK_WINDOW_XID (window);
+ Window xwindow = GDK_SURFACE_XID (surface);
GdkToplevelX11 *toplevel;
Atom atoms[9];
gint i;
- toplevel = _gdk_x11_window_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 (GdkWindow *window)
i = 0;
- if (window->state & GDK_WINDOW_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 (GdkWindow *window)
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
}
- if (window->state & GDK_WINDOW_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_WINDOW_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_WINDOW_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 (GdkWindow *window)
toplevel->have_sticky = TRUE;
}
- if (window->state & GDK_WINDOW_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 (GdkWindow *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 (GdkWindow *window)
++i;
}
- if (window->state & GDK_WINDOW_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 (GdkWindow *window)
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
}
- if (window->state & GDK_WINDOW_STATE_STICKY)
+ if (surface->state & GDK_SURFACE_STATE_STICKY)
{
atoms[0] = 0xFFFFFFFF;
XChangeProperty (xdisplay,
@@ -1400,27 +1400,27 @@ set_initial_hints (GdkWindow *window)
}
static void
-gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
+gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped)
{
GdkDisplay *display;
GdkX11Display *display_x11;
GdkToplevelX11 *toplevel;
- Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
- Window xwindow = GDK_WINDOW_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 (WINDOW_IS_TOPLEVEL (window))
+ if (SURFACE_IS_TOPLEVEL (surface))
{
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
display_x11 = GDK_X11_DISPLAY (display);
- toplevel = _gdk_x11_window_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_window_set_user_time (window, display_x11->user_time);
+ gdk_x11_surface_set_user_time (surface, display_x11->user_time);
}
XMapWindow (xdisplay, xwindow);
@@ -1429,81 +1429,81 @@ gdk_window_x11_show (GdkWindow *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_window_apply_fullscreen_mode (window);
+ if (surface->fullscreen_mode != GDK_FULLSCREEN_ON_CURRENT_MONITOR)
+ gdk_x11_surface_apply_fullscreen_mode (surface);
}
static void
-gdk_window_x11_hide (GdkWindow *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_window_grab_check_unmap (window,
- NextRequest (GDK_WINDOW_XDISPLAY (window)));
+ _gdk_x11_surface_grab_check_unmap (surface,
+ NextRequest (GDK_SURFACE_XDISPLAY (surface)));
- /* You can't simply unmap toplevel windows. */
- switch (window->window_type)
+ /* You can't simply unmap toplevel surfaces. */
+ switch (surface->surface_type)
{
- case GDK_WINDOW_TOPLEVEL:
- case GDK_WINDOW_TEMP: /* ? */
- gdk_window_withdraw (window);
+ case GDK_SURFACE_TOPLEVEL:
+ case GDK_SURFACE_TEMP: /* ? */
+ gdk_surface_withdraw (surface);
return;
- case GDK_WINDOW_FOREIGN:
- case GDK_WINDOW_CHILD:
+ case GDK_SURFACE_FOREIGN:
+ case GDK_SURFACE_CHILD:
default:
break;
}
- _gdk_window_clear_update_area (window);
+ _gdk_surface_clear_update_area (surface);
- XUnmapWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window));
+ XUnmapWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface));
}
static void
-gdk_window_x11_withdraw (GdkWindow *window)
+gdk_surface_x11_withdraw (GdkSurface *surface)
{
- if (!window->destroyed)
+ if (!surface->destroyed)
{
- if (GDK_WINDOW_IS_MAPPED (window))
- gdk_synthesize_window_state (window,
+ if (GDK_SURFACE_IS_MAPPED (surface))
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_WITHDRAWN);
+ GDK_SURFACE_STATE_WITHDRAWN);
- g_assert (!GDK_WINDOW_IS_MAPPED (window));
+ g_assert (!GDK_SURFACE_IS_MAPPED (surface));
- XWithdrawWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window), 0);
+ XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface), 0);
}
}
static inline void
-window_x11_move (GdkWindow *window,
+surface_x11_move (GdkSurface *surface,
gint x,
gint y)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- XMoveWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- x * impl->window_scale, y * impl->window_scale);
+ 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 (GdkWindow *window,
+surface_x11_resize (GdkSurface *surface,
gint width,
gint height)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
if (width < 1)
width = 1;
@@ -1511,35 +1511,35 @@ window_x11_resize (GdkWindow *window,
if (height < 1)
height = 1;
- window_pre_damage (window);
+ surface_pre_damage (surface);
- XResizeWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- width * impl->window_scale, height * impl->window_scale);
+ 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->window_scale;
- impl->unscaled_height = height * impl->window_scale;
- window->width = width;
- window->height = height;
- _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
+ impl->unscaled_width = width * impl->surface_scale;
+ impl->unscaled_height = height * impl->surface_scale;
+ surface->width = width;
+ surface->height = height;
+ _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl));
}
else
{
- if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height)
- window->resize_count += 1;
+ if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
+ surface->resize_count += 1;
}
}
static inline void
-window_x11_move_resize (GdkWindow *window,
+surface_x11_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_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 (GdkWindow *window,
if (height < 1)
height = 1;
- window_pre_damage (window);
+ surface_pre_damage (surface);
- XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- x * impl->window_scale, y * impl->window_scale,
- width * impl->window_scale, height * impl->window_scale);
+ 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->window_scale;
- impl->unscaled_height = height * impl->window_scale;
- window->width = width;
- window->height = height;
+ impl->unscaled_width = width * impl->surface_scale;
+ impl->unscaled_height = height * impl->surface_scale;
+ surface->width = width;
+ surface->height = height;
- _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
+ _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl));
}
else
{
- if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height)
- window->resize_count += 1;
+ if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
+ surface->resize_count += 1;
}
}
static void
-gdk_window_x11_move_resize (GdkWindow *window,
+gdk_surface_x11_move_resize (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
@@ -1582,131 +1582,131 @@ gdk_window_x11_move_resize (GdkWindow *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_window_set_window_scale (GdkWindow *window,
+_gdk_x11_surface_set_surface_scale (GdkSurface *surface,
int scale)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
GdkToplevelX11 *toplevel;
- GdkWindowHints geom_mask;
+ GdkSurfaceHints geom_mask;
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- impl->window_scale = scale;
+ impl->surface_scale = scale;
if (impl->cairo_surface)
- cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale);
- _gdk_window_update_size (window);
+ cairo_surface_set_device_scale (impl->cairo_surface, impl->surface_scale, impl->surface_scale);
+ _gdk_surface_update_size (surface);
- toplevel = _gdk_x11_window_get_toplevel (window);
- if (toplevel && window->window_type != GDK_WINDOW_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_window_set_geometry_hints (window,
+ gdk_surface_set_geometry_hints (surface,
&toplevel->last_geometry_hints,
geom_mask);
}
- if (window->window_type == GDK_WINDOW_FOREIGN)
- XMoveWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- window->x * impl->window_scale,
- window->y * impl->window_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->window_scale;
- impl->unscaled_height = window->height * impl->window_scale;
+ impl->unscaled_width = surface->width * impl->surface_scale;
+ impl->unscaled_height = surface->height * impl->surface_scale;
}
- XResizeWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- window->width * impl->window_scale,
- window->height * impl->window_scale);
+ XResizeWindow (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ surface->width * impl->surface_scale,
+ surface->height * impl->surface_scale);
}
- gdk_window_invalidate_rect (window, NULL, TRUE);
+ gdk_surface_invalidate_rect (surface, NULL, TRUE);
}
static void
-gdk_window_x11_raise (GdkWindow *window)
+gdk_surface_x11_raise (GdkSurface *surface)
{
- XRaiseWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
+ XRaiseWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface));
}
static void
-gdk_window_x11_restack_toplevel (GdkWindow *window,
- GdkWindow *sibling,
+gdk_surface_x11_restack_toplevel (GdkSurface *surface,
+ GdkSurface *sibling,
gboolean above)
{
XWindowChanges changes;
- changes.sibling = GDK_WINDOW_XID (sibling);
+ changes.sibling = GDK_SURFACE_XID (sibling);
changes.stack_mode = above ? Above : Below;
- XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- gdk_x11_screen_get_screen_number (GDK_WINDOW_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_window_x11_lower (GdkWindow *window)
+gdk_surface_x11_lower (GdkSurface *surface)
{
- XLowerWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
+ XLowerWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface));
}
/**
- * gdk_x11_window_move_to_current_desktop:
- * @window: (type GdkX11Window): a #GdkWindow
+ * gdk_x11_surface_move_to_current_desktop:
+ * @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_window_move_to_current_desktop (GdkWindow *window)
+gdk_x11_surface_move_to_current_desktop (GdkSurface *surface)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
+ g_return_if_fail (GDK_IS_SURFACE (surface));
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- toplevel = _gdk_x11_window_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 (GdkWindow *window)
+move_to_current_desktop (GdkSurface *surface)
{
guint32 desktop;
- desktop = gdk_x11_screen_get_current_desktop (GDK_WINDOW_SCREEN (window));
- gdk_x11_window_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 (GdkWindow *window,
+get_netwm_cardinal_property (GdkSurface *surface,
const gchar *name)
{
- GdkX11Screen *x11_screen = GDK_WINDOW_SCREEN (window);
+ GdkX11Screen *x11_screen = GDK_SURFACE_SCREEN (surface);
GdkAtom atom;
guint32 prop = 0;
Atom type;
@@ -1721,8 +1721,8 @@ get_netwm_cardinal_property (GdkWindow *window,
return 0;
XGetWindowProperty (x11_screen->xdisplay,
- GDK_WINDOW_XID (window),
- gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_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);
@@ -1736,49 +1736,49 @@ get_netwm_cardinal_property (GdkWindow *window,
}
/**
- * gdk_x11_window_get_desktop:
- * @window: (type GdkX11Window): a #GdkWindow
+ * gdk_x11_surface_get_desktop:
+ * @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_window_get_desktop (GdkWindow *window)
+gdk_x11_surface_get_desktop (GdkSurface *surface)
{
- g_return_val_if_fail (GDK_IS_WINDOW (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_window_move_to_desktop:
- * @window: (type GdkX11Window): a #GdkWindow
- * @desktop: the number of the workspace to move the window to
+ * gdk_x11_surface_move_to_desktop:
+ * @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_window_move_to_desktop (GdkWindow *window,
+gdk_x11_surface_move_to_desktop (GdkSurface *surface,
guint32 desktop)
{
GdkAtom atom;
XClientMessageEvent xclient;
- g_return_if_fail (GDK_IS_WINDOW (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_WINDOW_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_WINDOW_XID (window);
- xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_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_window_move_to_desktop (GdkWindow *window,
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XROOTWIN (window),
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XROOTWIN (surface),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
static void
-gdk_x11_window_focus (GdkWindow *window,
+gdk_x11_surface_focus (GdkSurface *surface,
guint32 timestamp)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = GDK_WINDOW_DISPLAY (window);
+ display = GDK_SURFACE_DISPLAY (surface);
- if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_WINDOW_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_window_focus (GdkWindow *window,
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
+ XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
else
{
- XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_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_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
RevertToParent,
timestamp);
gdk_x11_display_error_trap_pop_ignored (display);
@@ -1846,95 +1846,95 @@ gdk_x11_window_focus (GdkWindow *window,
}
static void
-gdk_x11_window_set_type_hint (GdkWindow *window,
- GdkWindowTypeHint hint)
+gdk_x11_surface_set_type_hint (GdkSurface *surface,
+ GdkSurfaceTypeHint hint)
{
GdkDisplay *display;
Atom atom;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
switch (hint)
{
- case GDK_WINDOW_TYPE_HINT_DIALOG:
+ case GDK_SURFACE_TYPE_HINT_DIALOG:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG");
break;
- case GDK_WINDOW_TYPE_HINT_MENU:
+ case GDK_SURFACE_TYPE_HINT_MENU:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU");
break;
- case GDK_WINDOW_TYPE_HINT_TOOLBAR:
+ case GDK_SURFACE_TYPE_HINT_TOOLBAR:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR");
break;
- case GDK_WINDOW_TYPE_HINT_UTILITY:
+ case GDK_SURFACE_TYPE_HINT_UTILITY:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY");
break;
- case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
+ case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH");
break;
- case GDK_WINDOW_TYPE_HINT_DOCK:
+ case GDK_SURFACE_TYPE_HINT_DOCK:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK");
break;
- case GDK_WINDOW_TYPE_HINT_DESKTOP:
+ case GDK_SURFACE_TYPE_HINT_DESKTOP:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP");
break;
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
+ case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU");
break;
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
+ case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU");
break;
- case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+ case GDK_SURFACE_TYPE_HINT_TOOLTIP:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP");
break;
- case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
+ case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION");
break;
- case GDK_WINDOW_TYPE_HINT_COMBO:
+ case GDK_SURFACE_TYPE_HINT_COMBO:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO");
break;
- case GDK_WINDOW_TYPE_HINT_DND:
+ case GDK_SURFACE_TYPE_HINT_DND:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND");
break;
default:
- g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint);
+ g_warning ("Unknown hint %d passed to gdk_surface_set_type_hint", hint);
/* Fall thru */
- case GDK_WINDOW_TYPE_HINT_NORMAL:
+ case GDK_SURFACE_TYPE_HINT_NORMAL:
atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NORMAL");
break;
}
- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_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 GdkWindowTypeHint
-gdk_x11_window_get_type_hint (GdkWindow *window)
+static GdkSurfaceTypeHint
+gdk_x11_surface_get_type_hint (GdkSurface *surface)
{
GdkDisplay *display;
- GdkWindowTypeHint type;
+ GdkSurfaceTypeHint type;
Atom type_return;
gint format_return;
gulong nitems_return;
gulong bytes_after_return;
guchar *data = NULL;
- g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_SURFACE_TYPE_HINT_NORMAL);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
- return GDK_WINDOW_TYPE_HINT_NORMAL;
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
+ return GDK_SURFACE_TYPE_HINT_NORMAL;
- type = GDK_WINDOW_TYPE_HINT_NORMAL;
+ type = GDK_SURFACE_TYPE_HINT_NORMAL;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_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,
@@ -1946,31 +1946,31 @@ gdk_x11_window_get_type_hint (GdkWindow *window)
Atom atom = *(Atom*)data;
if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"))
- type = GDK_WINDOW_TYPE_HINT_DIALOG;
+ type = GDK_SURFACE_TYPE_HINT_DIALOG;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU"))
- type = GDK_WINDOW_TYPE_HINT_MENU;
+ type = GDK_SURFACE_TYPE_HINT_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR"))
- type = GDK_WINDOW_TYPE_HINT_TOOLBAR;
+ type = GDK_SURFACE_TYPE_HINT_TOOLBAR;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY"))
- type = GDK_WINDOW_TYPE_HINT_UTILITY;
+ type = GDK_SURFACE_TYPE_HINT_UTILITY;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH"))
- type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
+ type = GDK_SURFACE_TYPE_HINT_SPLASHSCREEN;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK"))
- type = GDK_WINDOW_TYPE_HINT_DOCK;
+ type = GDK_SURFACE_TYPE_HINT_DOCK;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP"))
- type = GDK_WINDOW_TYPE_HINT_DESKTOP;
+ type = GDK_SURFACE_TYPE_HINT_DESKTOP;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"))
- type = GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU;
+ type = GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU"))
- type = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
+ type = GDK_SURFACE_TYPE_HINT_POPUP_MENU;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP"))
- type = GDK_WINDOW_TYPE_HINT_TOOLTIP;
+ type = GDK_SURFACE_TYPE_HINT_TOOLTIP;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION"))
- type = GDK_WINDOW_TYPE_HINT_NOTIFICATION;
+ type = GDK_SURFACE_TYPE_HINT_NOTIFICATION;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO"))
- type = GDK_WINDOW_TYPE_HINT_COMBO;
+ type = GDK_SURFACE_TYPE_HINT_COMBO;
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND"))
- type = GDK_WINDOW_TYPE_HINT_DND;
+ type = GDK_SURFACE_TYPE_HINT_DND;
}
if (type_return != None && data != NULL)
@@ -1982,11 +1982,11 @@ gdk_x11_window_get_type_hint (GdkWindow *window)
static void
gdk_wmspec_change_state (gboolean add,
- GdkWindow *window,
+ GdkSurface *surface,
GdkAtom state1,
GdkAtom state2)
{
- GdkDisplay *display = GDK_WINDOW_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_WINDOW_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_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
static void
-gdk_x11_window_set_modal_hint (GdkWindow *window,
+gdk_x11_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_WINDOW_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_window_set_skip_taskbar_hint (GdkWindow *window,
+gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
toplevel->skip_taskbar_hint = skips_taskbar;
- if (GDK_WINDOW_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_window_set_skip_pager_hint (GdkWindow *window,
+gdk_x11_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
toplevel->skip_pager_hint = skips_pager;
- if (GDK_WINDOW_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_window_set_urgency_hint (GdkWindow *window,
+gdk_x11_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
+ g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_window_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_window_set_geometry_hints (GdkWindow *window,
+gdk_x11_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
- GdkWindowHints geom_mask)
+ GdkSurfaceHints geom_mask)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
XSizeHints size_hints;
GdkToplevelX11 *toplevel;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel)
{
if (geometry)
@@ -2132,35 +2132,35 @@ gdk_x11_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_MIN_SIZE)
{
size_hints.flags |= PMinSize;
- size_hints.min_width = geometry->min_width * impl->window_scale;
- size_hints.min_height = geometry->min_height * impl->window_scale;
+ size_hints.min_width = geometry->min_width * impl->surface_scale;
+ size_hints.min_height = geometry->min_height * impl->surface_scale;
}
if (geom_mask & GDK_HINT_MAX_SIZE)
{
size_hints.flags |= PMaxSize;
- size_hints.max_width = MAX (geometry->max_width, 1) * impl->window_scale;
- size_hints.max_height = MAX (geometry->max_height, 1) * impl->window_scale;
+ size_hints.max_width = MAX (geometry->max_width, 1) * impl->surface_scale;
+ size_hints.max_height = MAX (geometry->max_height, 1) * impl->surface_scale;
}
if (geom_mask & GDK_HINT_BASE_SIZE)
{
size_hints.flags |= PBaseSize;
- size_hints.base_width = geometry->base_width * impl->window_scale;
- size_hints.base_height = geometry->base_height * impl->window_scale;
+ size_hints.base_width = geometry->base_width * impl->surface_scale;
+ size_hints.base_height = geometry->base_height * impl->surface_scale;
}
if (geom_mask & GDK_HINT_RESIZE_INC)
{
size_hints.flags |= PResizeInc;
- size_hints.width_inc = geometry->width_inc * impl->window_scale;
- size_hints.height_inc = geometry->height_inc * impl->window_scale;
+ size_hints.width_inc = geometry->width_inc * impl->surface_scale;
+ size_hints.height_inc = geometry->height_inc * impl->surface_scale;
}
- else if (impl->window_scale > 1)
+ else if (impl->surface_scale > 1)
{
size_hints.flags |= PResizeInc;
- size_hints.width_inc = impl->window_scale;
- size_hints.height_inc = impl->window_scale;
+ size_hints.width_inc = impl->surface_scale;
+ size_hints.height_inc = impl->surface_scale;
}
if (geom_mask & GDK_HINT_ASPECT)
@@ -2197,38 +2197,38 @@ gdk_x11_window_set_geometry_hints (GdkWindow *window,
/* FIXME: Would it be better to delete this property if
* geom_mask == 0? It would save space on the server
*/
- XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XSetWMNormalHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&size_hints);
}
static void
-gdk_window_get_geometry_hints (GdkWindow *window,
+gdk_surface_get_geometry_hints (GdkSurface *surface,
GdkGeometry *geometry,
- GdkWindowHints *geom_mask)
+ GdkSurfaceHints *geom_mask)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
XSizeHints *size_hints;
glong junk_supplied_mask = 0;
- g_return_if_fail (GDK_IS_WINDOW (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_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
size_hints = XAllocSizeHints ();
if (!size_hints)
return;
- if (!XGetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ if (!XGetWMNormalHints (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
size_hints,
&junk_supplied_mask))
size_hints->flags = 0;
@@ -2236,22 +2236,22 @@ gdk_window_get_geometry_hints (GdkWindow *window,
if (size_hints->flags & PMinSize)
{
*geom_mask |= GDK_HINT_MIN_SIZE;
- geometry->min_width = size_hints->min_width / impl->window_scale;
- geometry->min_height = size_hints->min_height / impl->window_scale;
+ geometry->min_width = size_hints->min_width / impl->surface_scale;
+ geometry->min_height = size_hints->min_height / impl->surface_scale;
}
if (size_hints->flags & PMaxSize)
{
*geom_mask |= GDK_HINT_MAX_SIZE;
- geometry->max_width = MAX (size_hints->max_width, 1) / impl->window_scale;
- geometry->max_height = MAX (size_hints->max_height, 1) / impl->window_scale;
+ geometry->max_width = MAX (size_hints->max_width, 1) / impl->surface_scale;
+ geometry->max_height = MAX (size_hints->max_height, 1) / impl->surface_scale;
}
if (size_hints->flags & PResizeInc)
{
*geom_mask |= GDK_HINT_RESIZE_INC;
- geometry->width_inc = size_hints->width_inc / impl->window_scale;
- geometry->height_inc = size_hints->height_inc / impl->window_scale;
+ geometry->width_inc = size_hints->width_inc / impl->surface_scale;
+ geometry->height_inc = size_hints->height_inc / impl->surface_scale;
}
if (size_hints->flags & PAspect)
@@ -2357,7 +2357,7 @@ set_wm_name (GdkDisplay *display,
}
static void
-gdk_x11_window_set_title (GdkWindow *window,
+gdk_x11_surface_set_title (GdkSurface *surface,
const gchar *title)
{
GdkDisplay *display;
@@ -2366,17 +2366,17 @@ gdk_x11_window_set_title (GdkWindow *window,
g_return_if_fail (title != NULL);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
- xwindow = GDK_WINDOW_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
set_wm_name (display, xwindow, title);
- if (!gdk_window_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,89 +2390,89 @@ gdk_x11_window_set_title (GdkWindow *window,
}
static void
-gdk_x11_window_set_role (GdkWindow *window,
+gdk_x11_surface_set_role (GdkSurface *surface,
const gchar *role)
{
GdkDisplay *display;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_WINDOW_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_WINDOW_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_window_set_startup_id (GdkWindow *window,
+gdk_x11_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_WINDOW_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_WINDOW_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_window_set_transient_for (GdkWindow *window,
- GdkWindow *parent)
+gdk_x11_surface_set_transient_for (GdkSurface *surface,
+ GdkSurface *parent)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_WINDOW_DESTROYED (parent))
- XSetTransientForHint (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- GDK_WINDOW_XID (parent));
+ if (parent && !GDK_SURFACE_DESTROYED (parent))
+ XSetTransientForHint (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ GDK_SURFACE_XID (parent));
else
- XDeleteProperty (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_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_window_get_cursor (GdkWindow *window)
+_gdk_x11_surface_get_cursor (GdkSurface *surface)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
return impl->cursor;
}
static void
-gdk_window_x11_get_geometry (GdkWindow *window,
+gdk_surface_x11_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
{
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
Window root;
gint tx;
gint ty;
@@ -2481,55 +2481,55 @@ gdk_window_x11_get_geometry (GdkWindow *window,
guint tborder_width;
guint tdepth;
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
- impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- XGetGeometry (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XGetGeometry (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
- *x = tx / impl->window_scale;
+ *x = tx / impl->surface_scale;
if (y)
- *y = ty / impl->window_scale;
+ *y = ty / impl->surface_scale;
if (width)
- *width = twidth / impl->window_scale;
+ *width = twidth / impl->surface_scale;
if (height)
- *height = theight / impl->window_scale;
+ *height = theight / impl->surface_scale;
}
}
static void
-gdk_window_x11_get_root_coords (GdkWindow *window,
+gdk_surface_x11_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
Window child;
gint tx;
gint ty;
- XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- GDK_WINDOW_XROOTWIN (window),
- x * impl->window_scale, y * impl->window_scale, &tx, &ty,
+ XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ GDK_SURFACE_XROOTWIN (surface),
+ x * impl->surface_scale, y * impl->surface_scale, &tx, &ty,
&child);
if (root_x)
- *root_x = tx / impl->window_scale;
+ *root_x = tx / impl->surface_scale;
if (root_y)
- *root_y = ty / impl->window_scale;
+ *root_y = ty / impl->surface_scale;
}
static void
-gdk_x11_window_get_frame_extents (GdkWindow *window,
+gdk_x11_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
{
GdkDisplay *display;
- GdkWindowImplX11 *impl;
+ GdkSurfaceImplX11 *impl;
Window xwindow;
Window xparent;
Window root;
@@ -2555,31 +2555,31 @@ gdk_x11_window_get_frame_extents (GdkWindow *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_WINDOW_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->window_scale;
- rect->y = window->y * impl->window_scale;
- rect->width = window->width * impl->window_scale;
- rect->height = window->height * impl->window_scale;
+ rect->x = 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_WINDOW_DESTROYED (window) || impl->override_redirect)
+ if (GDK_SURFACE_DESTROYED (surface) || impl->override_redirect)
return;
nvroots = 0;
vroots = NULL;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
gdk_x11_display_error_trap_push (display);
- xwindow = GDK_WINDOW_XID (window);
+ xwindow = GDK_SURFACE_XID (surface);
/* first try: use _NET_FRAME_EXTENTS */
- if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_window_get_frame_extents (GdkWindow *window,
tree to get our window's parent which hopefully is the window frame */
/* use NETWM_VIRTUAL_ROOTS if available */
- root = GDK_WINDOW_XROOTWIN (window);
+ root = GDK_SURFACE_XROOTWIN (surface);
- if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_window_get_frame_extents (GdkWindow *window,
}
}
- xparent = GDK_WINDOW_XID (window);
+ xparent = GDK_SURFACE_XID (surface);
do
{
@@ -2688,27 +2688,27 @@ gdk_x11_window_get_frame_extents (GdkWindow *window,
as well as round the size up when we divide by scale so that the returned
size is guaranteed to cover the real pixels, but it may overshoot a bit
in case the window is not positioned/sized according to the scale */
- rect->width = (rect->width + rect->x % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
- rect->height = (rect->height + rect->y % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
- rect->x = rect->x / impl->window_scale;
- rect->y = rect->y / impl->window_scale;
+ rect->width = (rect->width + rect->x % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale;
+ rect->height = (rect->height + rect->y % impl->surface_scale + impl->surface_scale - 1) / impl->surface_scale;
+ rect->x = rect->x / impl->surface_scale;
+ rect->y = rect->y / impl->surface_scale;
gdk_x11_display_error_trap_pop_ignored (display);
}
static gboolean
-gdk_window_x11_get_device_state (GdkWindow *window,
+gdk_surface_x11_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
- GdkWindow *child;
+ GdkSurface *child;
- if (GDK_WINDOW_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_window_x11_get_device_state (GdkWindow *window,
}
static GdkEventMask
-gdk_window_x11_get_events (GdkWindow *window)
+gdk_surface_x11_get_events (GdkSurface *surface)
{
XWindowAttributes attrs;
GdkEventMask event_mask;
GdkEventMask filtered;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 0;
else
{
- XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_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_window_x11_set_events (GdkWindow *window,
+gdk_surface_x11_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
long xevent_mask = 0;
- if (!GDK_WINDOW_DESTROYED (window))
+ if (!GDK_SURFACE_DESTROYED (surface))
{
GdkX11Display *display_x11;
- if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
+ if (GDK_SURFACE_XID (surface) != GDK_SURFACE_XROOTWIN (surface))
xevent_mask = StructureNotifyMask | PropertyChangeMask;
- display_x11 = GDK_X11_DISPLAY (gdk_window_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_WINDOW_XID (window), event_mask,
+ GDK_SURFACE_XID (surface), event_mask,
xevent_mask);
}
}
static inline void
-do_shape_combine_region (GdkWindow *window,
+do_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y,
gint shape)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_WINDOW_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_WINDOW_DISPLAY (window))
- : gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
+ ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (surface))
+ : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
{
- XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XShapeCombineMask (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
shape,
0, 0,
None,
@@ -2787,21 +2787,21 @@ do_shape_combine_region (GdkWindow *window,
}
if (shape == ShapeBounding
- ? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
- : gdk_display_supports_input_shapes (GDK_WINDOW_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;
_gdk_x11_region_get_xrectangles (shape_region,
- 0, 0, impl->window_scale,
+ 0, 0, impl->surface_scale,
&xrects, &n_rects);
- XShapeCombineRectangles (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
shape,
- offset_x * impl->window_scale,
- offset_y * impl->window_scale,
+ offset_x * impl->surface_scale,
+ offset_y * impl->surface_scale,
xrects, n_rects,
ShapeSet,
YXBanded);
@@ -2811,70 +2811,70 @@ do_shape_combine_region (GdkWindow *window,
}
static void
-gdk_window_x11_shape_combine_region (GdkWindow *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_window_x11_input_shape_combine_region (GdkWindow *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_window_set_accept_focus (GdkWindow *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_WINDOW_DESTROYED (window) &&
- WINDOW_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_window_set_focus_on_map (GdkWindow *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_WINDOW_DESTROYED (window)) &&
- (!window->focus_on_map) &&
- WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
- gdk_x11_window_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_window_set_user_time:
- * @window: (type GdkX11Window): A toplevel #GdkWindow
+ * gdk_x11_surface_set_user_time:
+ * @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_window_set_focus_on_map (GdkWindow *window,
* events bypassing GDK.
**/
void
-gdk_x11_window_set_user_time (GdkWindow *window,
+gdk_x11_surface_set_user_time (GdkSurface *surface,
guint32 timestamp)
{
GdkDisplay *display;
@@ -2891,26 +2891,26 @@ gdk_x11_window_set_user_time (GdkWindow *window,
glong timestamp_long = (glong)timestamp;
Window xid;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
display_x11 = GDK_X11_DISPLAY (display);
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (!toplevel)
{
- g_warning ("gdk_window_set_user_time called on non-toplevel\n");
+ g_warning ("gdk_surface_set_user_time called on non-toplevel\n");
return;
}
if (toplevel->focus_window != None &&
- gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_WINDOW_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"),
@@ -2927,31 +2927,31 @@ gdk_x11_window_set_user_time (GdkWindow *window,
}
/**
- * gdk_x11_window_set_utf8_property:
- * @window: (type GdkX11Window): a #GdkWindow
+ * gdk_x11_surface_set_utf8_property:
+ * @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_window_set_utf8_property (GdkWindow *window,
+gdk_x11_surface_set_utf8_property (GdkSurface *surface,
const gchar *name,
const gchar *value)
{
GdkDisplay *display;
- if (!WINDOW_IS_TOPLEVEL (window))
+ if (!SURFACE_IS_TOPLEVEL (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
if (value != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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,56 +2959,56 @@ gdk_x11_window_set_utf8_property (GdkWindow *window,
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, name));
}
}
static void
-gdk_x11_window_set_shadow_width (GdkWindow *window,
+gdk_x11_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
Atom frame_extents;
gulong data[4] = {
- left * impl->window_scale,
- right * impl->window_scale,
- top * impl->window_scale,
- bottom * impl->window_scale
+ left * impl->surface_scale,
+ right * impl->surface_scale,
+ top * impl->surface_scale,
+ bottom * impl->surface_scale
};
- frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window),
+ frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_surface_get_display (surface),
"_GTK_FRAME_EXTENTS");
- XChangeProperty (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
+ XChangeProperty (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
frame_extents, XA_CARDINAL,
32, PropModeReplace,
(guchar *) &data, 4);
}
/**
- * gdk_x11_window_set_theme_variant:
- * @window: (type GdkX11Window): a #GdkWindow
+ * gdk_x11_surface_set_theme_variant:
+ * @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_window_set_theme_variant (GdkWindow *window,
+gdk_x11_surface_set_theme_variant (GdkSurface *surface,
const char *variant)
{
- gdk_x11_window_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_window_set_theme_variant (GdkWindow *window,
: XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100)
static void
-gdk_window_update_icon (GdkWindow *window,
+gdk_surface_update_icon (GdkSurface *surface,
GList *icon_list)
{
GdkToplevelX11 *toplevel;
@@ -3027,7 +3027,7 @@ gdk_window_update_icon (GdkWindow *window,
GList *tmp_list;
int best_size;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (toplevel->icon_pixmap != NULL)
{
@@ -3080,17 +3080,17 @@ gdk_window_update_icon (GdkWindow *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_window_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_window_update_icon (GdkWindow *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_window_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_window_set_icon_list (GdkWindow *window,
+gdk_x11_surface_set_icon_list (GdkSurface *surface,
GList *textures)
{
gulong *data;
@@ -3134,11 +3134,11 @@ gdk_x11_window_set_icon_list (GdkWindow *window,
GdkDisplay *display;
gint i, n;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
size = 0;
n = 0;
@@ -3185,7 +3185,7 @@ gdk_x11_window_set_icon_list (GdkWindow *window,
if (size > 0)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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_window_set_icon_list (GdkWindow *window,
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"));
}
g_free (data);
- gdk_window_update_icon (window, textures);
+ gdk_surface_update_icon (surface, textures);
}
static gboolean
-gdk_window_icon_name_set (GdkWindow *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_window_set_icon_name (GdkWindow *window,
+gdk_x11_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
GdkDisplay *display;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- display = gdk_window_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_WINDOW_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_WINDOW_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_WINDOW_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_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"));
}
}
static void
-gdk_x11_window_iconify (GdkWindow *window)
+gdk_x11_surface_iconify (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
- XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- gdk_x11_screen_get_screen_number (GDK_WINDOW_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_window_state (window,
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_ICONIFIED);
- gdk_wmspec_change_state (TRUE, window,
+ GDK_SURFACE_STATE_ICONIFIED);
+ gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL);
}
}
static void
-gdk_x11_window_deiconify (GdkWindow *window)
+gdk_x11_surface_deiconify (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
- gdk_window_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_window_state (window,
- GDK_WINDOW_STATE_ICONIFIED,
+ 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_window_stick (GdkWindow *window)
+gdk_x11_surface_stick (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_stick (GdkWindow *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_WINDOW_XID (window);
- xclient.display = GDK_WINDOW_XDISPLAY (window);
- xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_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,93 +3334,93 @@ gdk_x11_window_stick (GdkWindow *window)
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
- XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_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_window_state (window,
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_STICKY);
+ GDK_SURFACE_STATE_STICKY);
}
}
static void
-gdk_x11_window_unstick (GdkWindow *window)
+gdk_x11_surface_unstick (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
- GDK_WINDOW_STATE_STICKY,
+ gdk_synthesize_surface_state (surface,
+ GDK_SURFACE_STATE_STICKY,
0);
}
}
static void
-gdk_x11_window_maximize (GdkWindow *window)
+gdk_x11_surface_maximize (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_MAXIMIZED);
+ GDK_SURFACE_STATE_MAXIMIZED);
}
static void
-gdk_x11_window_unmaximize (GdkWindow *window)
+gdk_x11_surface_unmaximize (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
- GDK_WINDOW_STATE_MAXIMIZED,
+ gdk_synthesize_surface_state (surface,
+ GDK_SURFACE_STATE_MAXIMIZED,
0);
}
static void
-gdk_x11_window_apply_fullscreen_mode (GdkWindow *window)
+gdk_x11_surface_apply_fullscreen_mode (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_WINDOW_IS_MAPPED (window))
+ if (GDK_SURFACE_IS_MAPPED (surface))
{
XClientMessageEvent xclient;
gint monitors[4];
@@ -3428,11 +3428,11 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window)
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_WINDOW_XID (window);
- xclient.display = GDK_WINDOW_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_window_apply_fullscreen_mode (GdkWindow *window)
case GDK_FULLSCREEN_ON_ALL_MONITORS:
- _gdk_x11_screen_get_edge_monitors (GDK_WINDOW_SCREEN (window),
+ _gdk_x11_screen_get_edge_monitors (GDK_SURFACE_SCREEN (surface),
&monitors[0],
&monitors[1],
&monitors[2],
@@ -3477,185 +3477,185 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window)
*/
if (xclient.data.l[i] < 0)
{
- g_warning ("gdk_x11_window_apply_fullscreen_mode: Invalid XINERAMA monitor index");
+ g_warning ("gdk_x11_surface_apply_fullscreen_mode: Invalid XINERAMA monitor index");
return;
}
}
break;
default:
- g_warning ("gdk_x11_window_apply_fullscreen_mode: Unhandled fullscreen mode %d",
- window->fullscreen_mode);
+ g_warning ("gdk_x11_surface_apply_fullscreen_mode: Unhandled fullscreen mode %d",
+ 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_WINDOW_DISPLAY (window),
+ xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"_NET_WM_FULLSCREEN_MONITORS");
- XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False,
+ XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
}
}
static void
-gdk_x11_window_fullscreen (GdkWindow *window)
+gdk_x11_surface_fullscreen (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_apply_fullscreen_mode (window);
+ if (surface->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS)
+ gdk_x11_surface_apply_fullscreen_mode (surface);
}
else
- gdk_synthesize_window_state (window,
+ gdk_synthesize_surface_state (surface,
0,
- GDK_WINDOW_STATE_FULLSCREEN);
+ GDK_SURFACE_STATE_FULLSCREEN);
}
static void
-gdk_x11_window_fullscreen_on_monitor (GdkWindow *window,
+gdk_x11_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
GdkRectangle geom;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
gdk_monitor_get_geometry (monitor, &geom);
- gdk_window_move (window, geom.x, geom.y);
+ gdk_surface_move (surface, geom.x, geom.y);
- gdk_window_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
- gdk_x11_window_fullscreen (window);
+ gdk_surface_set_fullscreen_mode (surface, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
+ gdk_x11_surface_fullscreen (surface);
}
static void
-gdk_x11_window_unfullscreen (GdkWindow *window)
+gdk_x11_surface_unfullscreen (GdkSurface *surface)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
- GDK_WINDOW_STATE_FULLSCREEN,
+ gdk_synthesize_surface_state (surface,
+ GDK_SURFACE_STATE_FULLSCREEN,
0);
}
static void
-gdk_x11_window_set_keep_above (GdkWindow *window,
+gdk_x11_surface_set_keep_above (GdkSurface *surface,
gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
- setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
- setting ? GDK_WINDOW_STATE_ABOVE : 0);
+ gdk_synthesize_surface_state (surface,
+ setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE,
+ setting ? GDK_SURFACE_STATE_ABOVE : 0);
}
static void
-gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting)
+gdk_x11_surface_set_keep_below (GdkSurface *surface, gboolean setting)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return;
- if (GDK_WINDOW_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_window_state (window,
- setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
- setting ? GDK_WINDOW_STATE_BELOW : 0);
+ gdk_synthesize_surface_state (surface,
+ setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW,
+ setting ? GDK_SURFACE_STATE_BELOW : 0);
}
-static GdkWindow *
-gdk_x11_window_get_group (GdkWindow *window)
+static GdkSurface *
+gdk_x11_surface_get_group (GdkSurface *surface)
{
GdkToplevelX11 *toplevel;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return NULL;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
return toplevel->group_leader;
}
static void
-gdk_x11_window_set_group (GdkWindow *window,
- GdkWindow *leader)
+gdk_x11_surface_set_group (GdkSurface *surface,
+ GdkSurface *leader)
{
GdkToplevelX11 *toplevel;
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
- g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
+ 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_WINDOW_DESTROYED (window) ||
- (leader != NULL && GDK_WINDOW_DESTROYED (leader)) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ (leader != NULL && GDK_SURFACE_DESTROYED (leader)) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- toplevel = _gdk_x11_window_get_toplevel (window);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
if (leader == NULL)
- leader = gdk_display_get_default_group (gdk_window_get_display (window));
+ leader = gdk_display_get_default_group (gdk_surface_get_display (surface));
if (toplevel->group_leader != leader)
{
if (toplevel->group_leader)
g_object_unref (toplevel->group_leader);
toplevel->group_leader = g_object_ref (leader);
- (_gdk_x11_window_get_toplevel (leader))->is_leader = TRUE;
+ (_gdk_x11_surface_get_toplevel (leader))->is_leader = TRUE;
}
- update_wm_hints (window, FALSE);
+ update_wm_hints (surface, FALSE);
}
static MotifWmHints *
-gdk_window_get_mwm_hints (GdkWindow *window)
+gdk_surface_get_mwm_hints (GdkSurface *surface)
{
GdkDisplay *display;
Atom hints_atom = None;
@@ -3665,14 +3665,14 @@ gdk_window_get_mwm_hints (GdkWindow *window)
gulong nitems;
gulong bytes_after;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
- display = gdk_window_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_WINDOW_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_window_get_mwm_hints (GdkWindow *window)
}
static void
-gdk_window_set_mwm_hints (GdkWindow *window,
+gdk_surface_set_mwm_hints (GdkSurface *surface,
MotifWmHints *new_hints)
{
GdkDisplay *display;
@@ -3696,14 +3696,14 @@ gdk_window_set_mwm_hints (GdkWindow *window,
gulong nitems;
gulong bytes_after;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
- display = gdk_window_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_WINDOW_XDISPLAY (window), GDK_WINDOW_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_window_set_mwm_hints (GdkWindow *window,
}
}
- XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_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_window_set_mwm_hints (GdkWindow *window,
}
static void
-gdk_x11_window_set_decorations (GdkWindow *window,
+gdk_x11_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
MotifWmHints hints;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_window_set_decorations (GdkWindow *window,
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = decorations;
- gdk_window_set_mwm_hints (window, &hints);
+ gdk_surface_set_mwm_hints (surface, &hints);
}
static gboolean
-gdk_x11_window_get_decorations(GdkWindow *window,
+gdk_x11_surface_get_decorations(GdkSurface *surface,
GdkWMDecoration *decorations)
{
MotifWmHints *hints;
gboolean result = FALSE;
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL_OR_FOREIGN (surface))
return FALSE;
- hints = gdk_window_get_mwm_hints (window);
+ hints = gdk_surface_get_mwm_hints (surface);
if (hints)
{
@@ -3781,15 +3781,15 @@ gdk_x11_window_get_decorations(GdkWindow *window,
}
static void
-gdk_x11_window_set_functions (GdkWindow *window,
+gdk_x11_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
MotifWmHints hints;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_window_set_functions (GdkWindow *window,
hints.flags = MWM_HINTS_FUNCTIONS;
hints.functions = functions;
- gdk_window_set_mwm_hints (window, &hints);
+ gdk_surface_set_mwm_hints (surface, &hints);
}
cairo_region_t *
@@ -3871,28 +3871,28 @@ _gdk_x11_xwindow_get_shape (Display *xdisplay,
static void
wmspec_send_message (GdkDisplay *display,
- GdkWindow *window,
+ GdkSurface *surface,
gint root_x,
gint root_y,
gint action,
gint button)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_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_WINDOW_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;
- xclient.data.l[0] = root_x * impl->window_scale;
- xclient.data.l[1] = root_y * impl->window_scale;
+ xclient.data.l[0] = root_x * impl->surface_scale;
+ xclient.data.l[1] = root_y * impl->surface_scale;
xclient.data.l[2] = action;
xclient.data.l[3] = button;
xclient.data.l[4] = 1; /* source indication */
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_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);
- GdkWindow *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_window_lookup_for_display (display, xidev->event);
+ surface = gdk_x11_surface_lookup_for_display (display, xidev->event);
else
#endif
- window = gdk_x11_window_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 (GdkWindow *window,
+wmspec_moveresize (GdkSurface *surface,
gint direction,
GdkDevice *device,
gint button,
@@ -3941,18 +3941,18 @@ wmspec_moveresize (GdkWindow *window,
gint root_y,
guint32 timestamp)
{
- GdkDisplay *display = GDK_WINDOW_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 (GdkWindow *window,
- GdkWindowEdge edge,
+wmspec_resize_drag (GdkSurface *surface,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
@@ -3969,45 +3969,45 @@ wmspec_resize_drag (GdkWindow *window,
/* Let the compiler turn a switch into a table, instead
* of doing the table manually, this way is easier to verify.
*/
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_TOPLEFT;
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
direction = _NET_WM_MOVERESIZE_SIZE_TOP;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_TOPRIGHT;
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_LEFT;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_RIGHT;
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOM;
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT;
break;
default:
- g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!",
+ g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!",
edge);
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,10 +4016,10 @@ struct _MoveResizeData
{
GdkDisplay *display;
- GdkWindow *moveresize_window;
- GdkWindow *moveresize_emulation_window;
+ GdkSurface *moveresize_surface;
+ GdkSurface *moveresize_emulation_surface;
gboolean is_resize;
- GdkWindowEdge resize_edge;
+ GdkSurfaceEdge resize_edge;
GdkDevice *device;
gint moveresize_button;
gint moveresize_x;
@@ -4028,7 +4028,7 @@ struct _MoveResizeData
gint moveresize_orig_y;
gint moveresize_orig_width;
gint moveresize_orig_height;
- GdkWindowHints moveresize_geom_mask;
+ GdkSurfaceHints moveresize_geom_mask;
GdkGeometry moveresize_geometry;
Time moveresize_process_time;
XEvent *moveresize_pending_event;
@@ -4062,21 +4062,21 @@ check_maximize (MoveResizeData *mv_resize,
gdouble x_root,
gdouble y_root)
{
- GdkWindowState state;
+ GdkSurfaceState state;
gint y;
if (mv_resize->is_resize)
return;
- state = gdk_window_get_state (mv_resize->moveresize_window);
+ state = gdk_surface_get_state (mv_resize->moveresize_surface);
- if (state & GDK_WINDOW_STATE_MAXIMIZED)
+ if (state & GDK_SURFACE_STATE_MAXIMIZED)
return;
y = mv_resize->moveresize_orig_y + (y_root - mv_resize->moveresize_y);
if (y < 10)
- gdk_window_maximize (mv_resize->moveresize_window);
+ gdk_surface_maximize (mv_resize->moveresize_surface);
}
static void
@@ -4084,22 +4084,22 @@ check_unmaximize (MoveResizeData *mv_resize,
gdouble x_root,
gdouble y_root)
{
- GdkWindowState state;
+ GdkSurfaceState state;
gint dx, dy;
if (mv_resize->is_resize)
return;
- state = gdk_window_get_state (mv_resize->moveresize_window);
+ state = gdk_surface_get_state (mv_resize->moveresize_surface);
- if ((state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)) == 0)
+ if ((state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_TILED)) == 0)
return;
dx = x_root - mv_resize->moveresize_x;
dy = y_root - mv_resize->moveresize_y;
if (ABS (dx) > 20 || ABS (dy) > 20)
- gdk_window_unmaximize (mv_resize->moveresize_window);
+ gdk_surface_unmaximize (mv_resize->moveresize_surface);
}
static void
@@ -4125,37 +4125,37 @@ update_pos (MoveResizeData *mv_resize,
switch (mv_resize->resize_edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
+ case GDK_SURFACE_EDGE_NORTH_WEST:
x += dx;
y += dy;
w -= dx;
h -= dy;
break;
- case GDK_WINDOW_EDGE_NORTH:
+ case GDK_SURFACE_EDGE_NORTH:
y += dy;
h -= dy;
break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
+ case GDK_SURFACE_EDGE_NORTH_EAST:
y += dy;
h -= dy;
w += dx;
break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
h += dy;
x += dx;
w -= dx;
break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
w += dx;
h += dy;
break;
- case GDK_WINDOW_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH:
h += dy;
break;
- case GDK_WINDOW_EDGE_EAST:
+ case GDK_SURFACE_EDGE_EAST:
w += dx;
break;
- case GDK_WINDOW_EDGE_WEST:
+ case GDK_SURFACE_EDGE_WEST:
x += dx;
w -= dx;
break;
@@ -4170,12 +4170,12 @@ update_pos (MoveResizeData *mv_resize,
if (mv_resize->moveresize_geom_mask)
{
- gdk_window_constrain_size (&mv_resize->moveresize_geometry,
+ gdk_surface_constrain_size (&mv_resize->moveresize_geometry,
mv_resize->moveresize_geom_mask,
w, h, &w, &h);
}
- gdk_window_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_window_move (mv_resize->moveresize_window, x, y);
+ gdk_surface_move (mv_resize->moveresize_surface, x, y);
}
}
static void
finish_drag (MoveResizeData *mv_resize)
{
- gdk_window_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);
}
@@ -4254,15 +4254,15 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
guint button_mask = 0;
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
- GdkWindowImplX11 *impl;
+ 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_WINDOW_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;
@@ -4284,8 +4284,8 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
break;
update_pos (mv_resize,
- event->xmotion.x_root / impl->window_scale,
- event->xmotion.y_root / impl->window_scale);
+ event->xmotion.x_root / impl->surface_scale,
+ event->xmotion.y_root / impl->surface_scale);
/* This should never be triggered in normal cases, but in the
* case where the drag started without an implicit grab being
@@ -4296,22 +4296,22 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
if ((event->xmotion.state & button_mask) == 0)
{
check_maximize (mv_resize,
- event->xmotion.x_root / impl->window_scale,
- event->xmotion.y_root / impl->window_scale);
+ event->xmotion.x_root / impl->surface_scale,
+ event->xmotion.y_root / impl->surface_scale);
finish_drag (mv_resize);
}
break;
case ButtonRelease:
update_pos (mv_resize,
- event->xbutton.x_root / impl->window_scale,
- event->xbutton.y_root / impl->window_scale);
+ event->xbutton.x_root / impl->surface_scale,
+ event->xbutton.y_root / impl->surface_scale);
if (event->xbutton.button == mv_resize->moveresize_button)
{
check_maximize (mv_resize,
- event->xmotion.x_root / impl->window_scale,
- event->xmotion.y_root / impl->window_scale);
+ event->xmotion.x_root / impl->surface_scale,
+ event->xmotion.y_root / impl->surface_scale);
finish_drag (mv_resize);
}
break;
@@ -4326,24 +4326,24 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
switch (ev->evtype)
{
case XI_Motion:
- update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale);
+ update_pos (mv_resize, xev->root_x / impl->surface_scale, xev->root_y / impl->surface_scale);
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
if ((state & button_mask) == 0)
{
check_maximize (mv_resize,
- xev->root_x / impl->window_scale,
- xev->root_y / impl->window_scale);
+ xev->root_x / impl->surface_scale,
+ xev->root_y / impl->surface_scale);
finish_drag (mv_resize);
}
break;
case XI_ButtonRelease:
- update_pos (mv_resize, xev->root_x / impl->window_scale, xev->root_y / impl->window_scale);
+ update_pos (mv_resize, xev->root_x / impl->surface_scale, xev->root_y / impl->surface_scale);
if (xev->detail == mv_resize->moveresize_button)
{
check_maximize (mv_resize,
- xev->root_x / impl->window_scale,
- xev->root_y / impl->window_scale);
+ xev->root_x / impl->surface_scale,
+ xev->root_y / impl->surface_scale);
finish_drag (mv_resize);
}
break;
@@ -4363,12 +4363,12 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
gboolean
_gdk_x11_moveresize_configure_done (GdkDisplay *display,
- GdkWindow *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_window_new_temp (mv_resize->display);
- gdk_window_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_window_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_window_get_frame_extents (mv_resize->moveresize_window, &rect);
- gdk_window_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,17 +4483,17 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
}
static void
-emulate_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+emulate_resize_drag (GdkSurface *surface,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_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 (GdkWindow *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_window_get_width (window);
- mv_resize->moveresize_orig_height = gdk_window_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_window_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 (GdkWindow *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_WINDOW_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 (GdkWindow *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 (GdkWindow *window,
+_should_perform_ewmh_drag (GdkSurface *surface,
GdkDevice *device)
{
- GdkPointerWindowInfo *info;
+ GdkPointerSurfaceInfo *info;
GdkDisplay *display;
- display = gdk_window_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_WINDOW_SCREEN (window),
+ gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_WM_MOVERESIZE")))
return TRUE;
@@ -4562,27 +4562,27 @@ _should_perform_ewmh_drag (GdkWindow *window,
}
static void
-gdk_x11_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
+gdk_x11_surface_begin_resize_drag (GdkSurface *surface,
+ GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_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_window_begin_move_drag (GdkWindow *window,
+gdk_x11_surface_begin_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
@@ -4591,7 +4591,7 @@ gdk_x11_window_begin_move_drag (GdkWindow *window,
{
gint direction;
- if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) || !SURFACE_IS_TOPLEVEL (surface))
return;
if (button == 0)
@@ -4600,24 +4600,24 @@ gdk_x11_window_begin_move_drag (GdkWindow *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_window_beep (GdkWindow *window)
+gdk_x11_surface_beep (GdkSurface *surface)
{
GdkDisplay *display;
- display = GDK_WINDOW_DISPLAY (window);
+ display = GDK_SURFACE_DISPLAY (surface);
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{
XkbBell (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
+ GDK_SURFACE_XID (surface),
0,
None);
return TRUE;
@@ -4628,19 +4628,19 @@ gdk_x11_window_beep (GdkWindow *window)
}
static void
-gdk_x11_window_set_opacity (GdkWindow *window,
+gdk_x11_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
{
GdkDisplay *display;
gulong cardinal;
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
+ if (GDK_SURFACE_DESTROYED (surface) ||
+ !SURFACE_IS_TOPLEVEL (surface))
return;
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
if (opacity < 0)
opacity = 0;
@@ -4651,11 +4651,11 @@ gdk_x11_window_set_opacity (GdkWindow *window,
if (cardinal == 0xffffffff)
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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_WINDOW_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 GdkX11Window): a #GdkWindow, 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 (GdkWindow *window)
+gdk_x11_get_server_time (GdkSurface *surface)
{
Display *xdisplay;
Window xwindow;
@@ -4699,13 +4699,13 @@ gdk_x11_get_server_time (GdkWindow *window)
XEvent xevent;
Atom timestamp_prop_atom;
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- g_return_val_if_fail (!GDK_WINDOW_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_WINDOW_XDISPLAY (window);
- xwindow = GDK_WINDOW_XID (window);
+ xdisplay = GDK_SURFACE_XDISPLAY (surface);
+ xwindow = GDK_SURFACE_XID (surface);
timestamp_prop_atom =
- gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
+ gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"GDK_TIMESTAMP_PROP");
XChangeProperty (xdisplay, xwindow, timestamp_prop_atom,
@@ -4719,73 +4719,73 @@ gdk_x11_get_server_time (GdkWindow *window)
}
/**
- * gdk_x11_window_get_xid:
- * @window: (type GdkX11Window): a native #GdkWindow.
+ * gdk_x11_surface_get_xid:
+ * @surface: (type GdkX11Surface): a native #GdkSurface.
*
- * Returns the X resource (window) belonging to a #GdkWindow.
+ * Returns the X resource (surface) belonging to a #GdkSurface.
*
* Returns: the ID of @drawable’s X resource.
**/
XID
-gdk_x11_window_get_xid (GdkWindow *window)
+gdk_x11_surface_get_xid (GdkSurface *surface)
{
- if (!GDK_WINDOW_IS_X11 (window) ||
- !_gdk_window_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_WINDOW_IMPL_X11 (window->impl)->xid;
+ return GDK_SURFACE_IMPL_X11 (surface->impl)->xid;
}
static gint
-gdk_x11_window_get_scale_factor (GdkWindow *window)
+gdk_x11_surface_get_scale_factor (GdkSurface *surface)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return 1;
- return impl->window_scale;
+ return impl->surface_scale;
}
/**
- * gdk_x11_window_set_frame_sync_enabled:
- * @window: (type GdkX11Window): a native #GdkWindow
+ * gdk_x11_surface_set_frame_sync_enabled:
+ * @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_window_set_frame_sync_enabled (GdkWindow *window,
+gdk_x11_surface_set_frame_sync_enabled (GdkSurface *surface,
gboolean frame_sync_enabled)
{
- if (!GDK_WINDOW_IS_X11 (window) ||
- !_gdk_window_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_WINDOW_IMPL_X11 (window->impl)->frame_sync_enabled = FALSE;
+ GDK_SURFACE_IMPL_X11 (surface->impl)->frame_sync_enabled = FALSE;
}
static void
-gdk_x11_window_set_opaque_region (GdkWindow *window,
+gdk_x11_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
GdkDisplay *display;
int nitems;
gulong *data;
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (region != NULL)
@@ -4800,10 +4800,10 @@ gdk_x11_window_set_opaque_region (GdkWindow *window,
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (region, i, &rect);
- data[i*4+0] = rect.x * impl->window_scale;
- data[i*4+1] = rect.y * impl->window_scale;
- data[i*4+2] = rect.width * impl->window_scale;
- data[i*4+3] = rect.height * impl->window_scale;
+ data[i*4+0] = rect.x * impl->surface_scale;
+ data[i*4+1] = rect.y * impl->surface_scale;
+ data[i*4+2] = rect.width * impl->surface_scale;
+ data[i*4+3] = rect.height * impl->surface_scale;
}
}
else
@@ -4812,10 +4812,10 @@ gdk_x11_window_set_opaque_region (GdkWindow *window,
data = NULL;
}
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (surface);
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_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_window_set_opaque_region (GdkWindow *window,
}
static gboolean
-gdk_x11_window_show_window_menu (GdkWindow *window,
+gdk_x11_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
- GdkDisplay *display = GDK_WINDOW_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_window_show_window_menu (GdkWindow *window,
return FALSE;
}
- if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_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_window_show_window_menu (GdkWindow *window,
gdk_seat_ungrab (gdk_device_get_seat (device));
xclient.type = ClientMessage;
- xclient.window = GDK_WINDOW_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->window_scale;
- xclient.data.l[2] = y_root * impl->window_scale;
+ xclient.data.l[1] = x_root * impl->surface_scale;
+ xclient.data.l[2] = y_root * impl->surface_scale;
xclient.format = 32;
- XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
+ XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (surface), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
@@ -4872,77 +4872,77 @@ gdk_x11_window_show_window_menu (GdkWindow *window,
}
static void
-gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
+gdk_surface_impl_x11_class_init (GdkSurfaceImplX11Class *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
+ GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
- object_class->finalize = gdk_window_impl_x11_finalize;
+ object_class->finalize = gdk_surface_impl_x11_finalize;
impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
- impl_class->show = gdk_window_x11_show;
- impl_class->hide = gdk_window_x11_hide;
- impl_class->withdraw = gdk_window_x11_withdraw;
- impl_class->set_events = gdk_window_x11_set_events;
- impl_class->get_events = gdk_window_x11_get_events;
- impl_class->raise = gdk_window_x11_raise;
- impl_class->lower = gdk_window_x11_lower;
- impl_class->restack_toplevel = gdk_window_x11_restack_toplevel;
- impl_class->move_resize = gdk_window_x11_move_resize;
- impl_class->get_geometry = gdk_window_x11_get_geometry;
- impl_class->get_root_coords = gdk_window_x11_get_root_coords;
- impl_class->get_device_state = gdk_window_x11_get_device_state;
- impl_class->shape_combine_region = gdk_window_x11_shape_combine_region;
- impl_class->input_shape_combine_region = gdk_window_x11_input_shape_combine_region;
- impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
- impl_class->destroy = gdk_x11_window_destroy;
- impl_class->beep = gdk_x11_window_beep;
-
- impl_class->focus = gdk_x11_window_focus;
- impl_class->set_type_hint = gdk_x11_window_set_type_hint;
- impl_class->get_type_hint = gdk_x11_window_get_type_hint;
- impl_class->set_modal_hint = gdk_x11_window_set_modal_hint;
- impl_class->set_skip_taskbar_hint = gdk_x11_window_set_skip_taskbar_hint;
- impl_class->set_skip_pager_hint = gdk_x11_window_set_skip_pager_hint;
- impl_class->set_urgency_hint = gdk_x11_window_set_urgency_hint;
- impl_class->set_geometry_hints = gdk_x11_window_set_geometry_hints;
- impl_class->set_title = gdk_x11_window_set_title;
- impl_class->set_role = gdk_x11_window_set_role;
- impl_class->set_startup_id = gdk_x11_window_set_startup_id;
- impl_class->set_transient_for = gdk_x11_window_set_transient_for;
- impl_class->get_frame_extents = gdk_x11_window_get_frame_extents;
- impl_class->set_accept_focus = gdk_x11_window_set_accept_focus;
- impl_class->set_focus_on_map = gdk_x11_window_set_focus_on_map;
- impl_class->set_icon_list = gdk_x11_window_set_icon_list;
- impl_class->set_icon_name = gdk_x11_window_set_icon_name;
- impl_class->iconify = gdk_x11_window_iconify;
- impl_class->deiconify = gdk_x11_window_deiconify;
- impl_class->stick = gdk_x11_window_stick;
- impl_class->unstick = gdk_x11_window_unstick;
- impl_class->maximize = gdk_x11_window_maximize;
- impl_class->unmaximize = gdk_x11_window_unmaximize;
- impl_class->fullscreen = gdk_x11_window_fullscreen;
- impl_class->fullscreen_on_monitor = gdk_x11_window_fullscreen_on_monitor;
- impl_class->apply_fullscreen_mode = gdk_x11_window_apply_fullscreen_mode;
- impl_class->unfullscreen = gdk_x11_window_unfullscreen;
- impl_class->set_keep_above = gdk_x11_window_set_keep_above;
- impl_class->set_keep_below = gdk_x11_window_set_keep_below;
- impl_class->get_group = gdk_x11_window_get_group;
- impl_class->set_group = gdk_x11_window_set_group;
- impl_class->set_decorations = gdk_x11_window_set_decorations;
- impl_class->get_decorations = gdk_x11_window_get_decorations;
- impl_class->set_functions = gdk_x11_window_set_functions;
- impl_class->begin_resize_drag = gdk_x11_window_begin_resize_drag;
- impl_class->begin_move_drag = gdk_x11_window_begin_move_drag;
- impl_class->set_opacity = gdk_x11_window_set_opacity;
- impl_class->destroy_notify = gdk_x11_window_destroy_notify;
- impl_class->register_dnd = _gdk_x11_window_register_dnd;
- impl_class->drag_begin = _gdk_x11_window_drag_begin;
- impl_class->get_scale_factor = gdk_x11_window_get_scale_factor;
- impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
- impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
- impl_class->show_window_menu = gdk_x11_window_show_window_menu;
- impl_class->create_gl_context = gdk_x11_window_create_gl_context;
- impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size;
- impl_class->supports_edge_constraints = gdk_x11_window_supports_edge_constraints;
+ impl_class->show = gdk_surface_x11_show;
+ impl_class->hide = gdk_surface_x11_hide;
+ impl_class->withdraw = gdk_surface_x11_withdraw;
+ impl_class->set_events = gdk_surface_x11_set_events;
+ impl_class->get_events = gdk_surface_x11_get_events;
+ impl_class->raise = gdk_surface_x11_raise;
+ impl_class->lower = gdk_surface_x11_lower;
+ impl_class->restack_toplevel = gdk_surface_x11_restack_toplevel;
+ impl_class->move_resize = gdk_surface_x11_move_resize;
+ impl_class->get_geometry = gdk_surface_x11_get_geometry;
+ impl_class->get_root_coords = gdk_surface_x11_get_root_coords;
+ impl_class->get_device_state = gdk_surface_x11_get_device_state;
+ impl_class->shape_combine_region = gdk_surface_x11_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_surface_x11_input_shape_combine_region;
+ impl_class->queue_antiexpose = _gdk_x11_surface_queue_antiexpose;
+ impl_class->destroy = gdk_x11_surface_destroy;
+ impl_class->beep = gdk_x11_surface_beep;
+
+ impl_class->focus = gdk_x11_surface_focus;
+ impl_class->set_type_hint = gdk_x11_surface_set_type_hint;
+ impl_class->get_type_hint = gdk_x11_surface_get_type_hint;
+ impl_class->set_modal_hint = gdk_x11_surface_set_modal_hint;
+ impl_class->set_skip_taskbar_hint = gdk_x11_surface_set_skip_taskbar_hint;
+ impl_class->set_skip_pager_hint = gdk_x11_surface_set_skip_pager_hint;
+ impl_class->set_urgency_hint = gdk_x11_surface_set_urgency_hint;
+ impl_class->set_geometry_hints = gdk_x11_surface_set_geometry_hints;
+ impl_class->set_title = gdk_x11_surface_set_title;
+ impl_class->set_role = gdk_x11_surface_set_role;
+ impl_class->set_startup_id = gdk_x11_surface_set_startup_id;
+ impl_class->set_transient_for = gdk_x11_surface_set_transient_for;
+ impl_class->get_frame_extents = gdk_x11_surface_get_frame_extents;
+ impl_class->set_accept_focus = gdk_x11_surface_set_accept_focus;
+ impl_class->set_focus_on_map = gdk_x11_surface_set_focus_on_map;
+ impl_class->set_icon_list = gdk_x11_surface_set_icon_list;
+ impl_class->set_icon_name = gdk_x11_surface_set_icon_name;
+ impl_class->iconify = gdk_x11_surface_iconify;
+ impl_class->deiconify = gdk_x11_surface_deiconify;
+ impl_class->stick = gdk_x11_surface_stick;
+ impl_class->unstick = gdk_x11_surface_unstick;
+ impl_class->maximize = gdk_x11_surface_maximize;
+ impl_class->unmaximize = gdk_x11_surface_unmaximize;
+ impl_class->fullscreen = gdk_x11_surface_fullscreen;
+ impl_class->fullscreen_on_monitor = gdk_x11_surface_fullscreen_on_monitor;
+ impl_class->apply_fullscreen_mode = gdk_x11_surface_apply_fullscreen_mode;
+ impl_class->unfullscreen = gdk_x11_surface_unfullscreen;
+ impl_class->set_keep_above = gdk_x11_surface_set_keep_above;
+ impl_class->set_keep_below = gdk_x11_surface_set_keep_below;
+ impl_class->get_group = gdk_x11_surface_get_group;
+ impl_class->set_group = gdk_x11_surface_set_group;
+ impl_class->set_decorations = gdk_x11_surface_set_decorations;
+ impl_class->get_decorations = gdk_x11_surface_get_decorations;
+ impl_class->set_functions = gdk_x11_surface_set_functions;
+ impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag;
+ impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
+ impl_class->set_opacity = gdk_x11_surface_set_opacity;
+ impl_class->destroy_notify = gdk_x11_surface_destroy_notify;
+ impl_class->register_dnd = _gdk_x11_surface_register_dnd;
+ impl_class->drag_begin = _gdk_x11_surface_drag_begin;
+ impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor;
+ impl_class->set_opaque_region = gdk_x11_surface_set_opaque_region;
+ impl_class->set_shadow_width = gdk_x11_surface_set_shadow_width;
+ impl_class->show_window_menu = gdk_x11_surface_show_window_menu;
+ impl_class->create_gl_context = gdk_x11_surface_create_gl_context;
+ impl_class->get_unscaled_size = gdk_x11_surface_get_unscaled_size;
+ impl_class->supports_edge_constraints = gdk_x11_surface_supports_edge_constraints;
}
diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdksurface-x11.h
index 2199692327..08f3befe43 100644
--- a/gdk/x11/gdkwindow-x11.h
+++ b/gdk/x11/gdksurface-x11.h
@@ -22,11 +22,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_WINDOW_X11_H__
-#define __GDK_WINDOW_X11_H__
+#ifndef __GDK_SURFACE_X11_H__
+#define __GDK_SURFACE_X11_H__
#include "gdk/x11/gdkprivate-x11.h"
-#include "gdk/gdkwindowimpl.h"
+#include "gdk/gdksurfaceimpl.h"
#include <X11/Xlib.h>
@@ -42,25 +42,25 @@
G_BEGIN_DECLS
typedef struct _GdkToplevelX11 GdkToplevelX11;
-typedef struct _GdkWindowImplX11 GdkWindowImplX11;
-typedef struct _GdkWindowImplX11Class GdkWindowImplX11Class;
+typedef struct _GdkSurfaceImplX11 GdkSurfaceImplX11;
+typedef struct _GdkSurfaceImplX11Class GdkSurfaceImplX11Class;
typedef struct _GdkXPositionInfo GdkXPositionInfo;
/* Window implementation for X11
*/
-#define GDK_TYPE_WINDOW_IMPL_X11 (gdk_window_impl_x11_get_type ())
-#define GDK_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11))
-#define GDK_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
-#define GDK_IS_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_X11))
-#define GDK_IS_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_X11))
-#define GDK_WINDOW_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
+#define GDK_TYPE_SURFACE_IMPL_X11 (gdk_surface_impl_x11_get_type ())
+#define GDK_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11))
+#define GDK_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class))
+#define GDK_IS_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_X11))
+#define GDK_IS_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_X11))
+#define GDK_SURFACE_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class))
-struct _GdkWindowImplX11
+struct _GdkSurfaceImplX11
{
- GdkWindowImpl parent_instance;
+ GdkSurfaceImpl parent_instance;
- GdkWindow *wrapper;
+ GdkSurface *wrapper;
Window xid;
@@ -74,11 +74,11 @@ struct _GdkWindowImplX11
guint frame_sync_enabled : 1;
guint tracking_damage: 1;
- gint window_scale;
+ gint surface_scale;
- /* Width and height not divided by window_scale - this matters in the
+ /* Width and height not divided by surface_scale - this matters in the
* corner-case where the window manager assigns us a size that isn't
- * a multiple of window_scale - for example for a maximized window
+ * a multiple of surface_scale - for example for a maximized window
* with an odd-sized title-bar.
*/
gint unscaled_width;
@@ -91,9 +91,9 @@ struct _GdkWindowImplX11
#endif
};
-struct _GdkWindowImplX11Class
+struct _GdkSurfaceImplX11Class
{
- GdkWindowImplClass parent_class;
+ GdkSurfaceImplClass parent_class;
};
struct _GdkToplevelX11
@@ -151,7 +151,7 @@ struct _GdkToplevelX11
cairo_surface_t *icon_pixmap;
cairo_surface_t *icon_mask;
- GdkWindow *group_leader;
+ GdkSurface *group_leader;
/* Time of most recent user interaction. */
gulong user_time;
@@ -162,7 +162,7 @@ struct _GdkToplevelX11
*/
Window focus_window;
- GdkWindowHints last_geometry_hints_mask;
+ GdkSurfaceHints last_geometry_hints_mask;
GdkGeometry last_geometry_hints;
/* Constrained edge information */
@@ -184,16 +184,16 @@ struct _GdkToplevelX11
#endif
};
-GType gdk_window_impl_x11_get_type (void);
+GType gdk_surface_impl_x11_get_type (void);
-GdkToplevelX11 *_gdk_x11_window_get_toplevel (GdkWindow *window);
+GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window);
-GdkCursor *_gdk_x11_window_get_cursor (GdkWindow *window);
+GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window);
-void _gdk_x11_window_update_size (GdkWindowImplX11 *impl);
-void _gdk_x11_window_set_window_scale (GdkWindow *window,
+void _gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl);
+void _gdk_x11_surface_set_surface_scale (GdkSurface *window,
int scale);
G_END_DECLS
-#endif /* __GDK_WINDOW_X11_H__ */
+#endif /* __GDK_SURFACE_X11_H__ */
diff --git a/gdk/x11/gdkvulkancontext-x11.c b/gdk/x11/gdkvulkancontext-x11.c
index 608a2e22d7..c59dbe3dec 100644
--- a/gdk/x11/gdkvulkancontext-x11.c
+++ b/gdk/x11/gdkvulkancontext-x11.c
@@ -28,7 +28,7 @@
#include "gdkinternals.h"
#include "gdkdisplay-x11.h"
-#include "gdkwindow-x11.h"
+#include "gdksurface-x11.h"
G_DEFINE_TYPE (GdkX11VulkanContext, gdk_x11_vulkan_context, GDK_TYPE_VULKAN_CONTEXT)
@@ -36,7 +36,7 @@ static VkResult
gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context,
VkSurfaceKHR *surface)
{
- GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
+ GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
/* This is necessary so that Vulkan sees the Window.
@@ -52,7 +52,7 @@ gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context,
NULL,
0,
gdk_x11_display_get_xdisplay (display),
- gdk_x11_window_get_xid (window)
+ gdk_x11_surface_get_xid (window)
},
NULL,
surface);
diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h
index d18abfa48b..ff3d5a43a9 100644
--- a/gdk/x11/gdkx-autocleanups.h
+++ b/gdk/x11/gdkx-autocleanups.h
@@ -31,6 +31,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DragContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11GLContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Keymap, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Screen, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Window, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Surface, g_object_unref)
#endif
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 153b4a501e..9fa9cb0711 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -48,7 +48,7 @@
#include <gdk/x11/gdkx11screen.h>
#include <gdk/x11/gdkx11selection.h>
#include <gdk/x11/gdkx11utils.h>
-#include <gdk/x11/gdkx11window.h>
+#include <gdk/x11/gdkx11surface.h>
#include <gdk/x11/gdkx-autocleanups.h>
diff --git a/gdk/x11/gdkx11display.h b/gdk/x11/gdkx11display.h
index 85f54995b1..4bf8de7452 100644
--- a/gdk/x11/gdkx11display.h
+++ b/gdk/x11/gdkx11display.h
@@ -111,7 +111,7 @@ GDK_AVAILABLE_IN_ALL
void gdk_x11_display_ungrab (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_display_set_window_scale (GdkDisplay *display,
+void gdk_x11_display_set_surface_scale (GdkDisplay *display,
gint scale);
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/x11/gdkx11window.h b/gdk/x11/gdkx11surface.h
index a9c13189fc..85f46c120e 100644
--- a/gdk/x11/gdkx11window.h
+++ b/gdk/x11/gdkx11surface.h
@@ -22,8 +22,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#ifndef __GDK_X11_WINDOW_H__
-#define __GDK_X11_WINDOW_H__
+#ifndef __GDK_X11_SURFACE_H__
+#define __GDK_X11_SURFACE_H__
#if !defined (__GDKX_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkx.h> can be included directly."
@@ -36,78 +36,78 @@
G_BEGIN_DECLS
-#define GDK_TYPE_X11_WINDOW (gdk_x11_window_get_type ())
-#define GDK_X11_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_WINDOW, GdkX11Window))
-#define GDK_X11_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_WINDOW, GdkX11WindowClass))
-#define GDK_IS_X11_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_WINDOW))
-#define GDK_IS_X11_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_WINDOW))
-#define GDK_X11_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_WINDOW, GdkX11WindowClass))
+#define GDK_TYPE_X11_SURFACE (gdk_x11_surface_get_type ())
+#define GDK_X11_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_SURFACE, GdkX11Surface))
+#define GDK_X11_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_SURFACE, GdkX11SurfaceClass))
+#define GDK_IS_X11_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_SURFACE))
+#define GDK_IS_X11_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_SURFACE))
+#define GDK_X11_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_SURFACE, GdkX11SurfaceClass))
#ifdef GDK_COMPILATION
-typedef struct _GdkX11Window GdkX11Window;
+typedef struct _GdkX11Surface GdkX11Surface;
#else
-typedef GdkWindow GdkX11Window;
+typedef GdkSurface GdkX11Surface;
#endif
-typedef struct _GdkX11WindowClass GdkX11WindowClass;
+typedef struct _GdkX11SurfaceClass GdkX11SurfaceClass;
GDK_AVAILABLE_IN_ALL
-GType gdk_x11_window_get_type (void);
+GType gdk_x11_surface_get_type (void);
GDK_AVAILABLE_IN_ALL
-Window gdk_x11_window_get_xid (GdkWindow *window);
+Window gdk_x11_surface_get_xid (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_set_user_time (GdkWindow *window,
+void gdk_x11_surface_set_user_time (GdkSurface *surface,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_set_utf8_property (GdkWindow *window,
+void gdk_x11_surface_set_utf8_property (GdkSurface *surface,
const gchar *name,
const gchar *value);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_set_theme_variant (GdkWindow *window,
+void gdk_x11_surface_set_theme_variant (GdkSurface *surface,
const char *variant);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_move_to_current_desktop (GdkWindow *window);
+void gdk_x11_surface_move_to_current_desktop (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-guint32 gdk_x11_window_get_desktop (GdkWindow *window);
+guint32 gdk_x11_surface_get_desktop (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_move_to_desktop (GdkWindow *window,
+void gdk_x11_surface_move_to_desktop (GdkSurface *surface,
guint32 desktop);
GDK_AVAILABLE_IN_ALL
-void gdk_x11_window_set_frame_sync_enabled (GdkWindow *window,
+void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *surface,
gboolean frame_sync_enabled);
/**
- * GDK_WINDOW_XDISPLAY:
- * @win: a #GdkWindow.
+ * GDK_SURFACE_XDISPLAY:
+ * @win: a #GdkSurface.
*
- * Returns the display of a #GdkWindow.
+ * Returns the display of a #GdkSurface.
*
* Returns: an Xlib Display*.
*/
-#define GDK_WINDOW_XDISPLAY(win) (GDK_DISPLAY_XDISPLAY (gdk_window_get_display (win)))
+#define GDK_SURFACE_XDISPLAY(win) (GDK_DISPLAY_XDISPLAY (gdk_surface_get_display (win)))
/**
- * GDK_WINDOW_XID:
- * @win: a #GdkWindow.
+ * GDK_SURFACE_XID:
+ * @win: a #GdkSurface.
*
- * Returns the X window belonging to a #GdkWindow.
+ * Returns the X window belonging to a #GdkSurface.
*
* Returns: the Xlib Window of @win.
*/
-#define GDK_WINDOW_XID(win) (gdk_x11_window_get_xid (win))
+#define GDK_SURFACE_XID(win) (gdk_x11_surface_get_xid (win))
GDK_AVAILABLE_IN_ALL
-guint32 gdk_x11_get_server_time (GdkWindow *window);
+guint32 gdk_x11_get_server_time (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
+GdkSurface *gdk_x11_surface_foreign_new_for_display (GdkDisplay *display,
Window window);
GDK_AVAILABLE_IN_ALL
-GdkWindow *gdk_x11_window_lookup_for_display (GdkDisplay *display,
+GdkSurface *gdk_x11_surface_lookup_for_display (GdkDisplay *display,
Window window);
G_END_DECLS
-#endif /* __GDK_X11_WINDOW_H__ */
+#endif /* __GDK_X11_SURFACE_H__ */
diff --git a/gdk/x11/gdkxid.c b/gdk/x11/gdkxid.c
index d74b367b41..93ca3c12a3 100644
--- a/gdk/x11/gdkxid.c
+++ b/gdk/x11/gdkxid.c
@@ -44,7 +44,7 @@ gdk_xid_equal (XID *a, XID *b)
void
_gdk_x11_display_add_window (GdkDisplay *display,
XID *xid,
- GdkWindow *data)
+ GdkSurface *data)
{
GdkX11Display *display_x11;
@@ -62,7 +62,7 @@ _gdk_x11_display_add_window (GdkDisplay *display,
g_hash_table_insert (display_x11->xid_ht, xid, data);
- if (gdk_window_get_parent (GDK_WINDOW (data)) == NULL)
+ if (gdk_surface_get_parent (GDK_SURFACE (data)) == NULL)
display_x11->toplevels = g_list_prepend (display_x11->toplevels, data);
}
@@ -71,7 +71,7 @@ _gdk_x11_display_remove_window (GdkDisplay *display,
XID xid)
{
GdkX11Display *display_x11;
- GdkWindow *window;
+ GdkSurface *surface;
g_return_if_fail (GDK_IS_DISPLAY (display));
@@ -80,30 +80,30 @@ _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_window_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);
}
/**
- * gdk_x11_window_lookup_for_display:
+ * gdk_x11_surface_lookup_for_display:
* @display: (type GdkX11Display): the #GdkDisplay corresponding to the
* window handle
* @window: an Xlib Window
*
- * Looks up the #GdkWindow that wraps the given native window handle.
+ * Looks up the #GdkSurface that wraps the given native window handle.
*
- * Returns: (transfer none) (type GdkX11Window): the #GdkWindow wrapper for the native
+ * Returns: (transfer none) (type GdkX11Surface): the #GdkSurface wrapper for the native
* window, or %NULL if there is none.
*/
-GdkWindow *
-gdk_x11_window_lookup_for_display (GdkDisplay *display,
+GdkSurface *
+gdk_x11_surface_lookup_for_display (GdkDisplay *display,
Window window)
{
GdkX11Display *display_x11;
- GdkWindow *data = NULL;
+ GdkSurface *data = NULL;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build
index 53213818fb..3912031c18 100644
--- a/gdk/x11/meson.build
+++ b/gdk/x11/meson.build
@@ -26,7 +26,7 @@ gdk_x11_sources = files([
'gdktextlistconverter-x11.c',
'gdkvisual-x11.c',
'gdkvulkancontext-x11.c',
- 'gdkwindow-x11.c',
+ 'gdksurface-x11.c',
'gdkxftdefaults.c',
'gdkxid.c',
'xsettings-client.c',
@@ -50,7 +50,7 @@ gdk_x11_public_headers = files([
'gdkx11screen.h',
'gdkx11selection.h',
'gdkx11utils.h',
- 'gdkx11window.h',
+ 'gdkx11surface.h',
])
install_headers(gdk_x11_public_headers, subdir: 'gtk-4.0/gdk/x11/')
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index 5713882320..247e90e9f7 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -28,7 +28,7 @@
#include <gdk/x11/gdkx11display.h>
#include <gdk/x11/gdkx11property.h>
#include <gdk/x11/gdkx11screen.h>
-#include <gdk/x11/gdkx11window.h>
+#include <gdk/x11/gdkx11surface.h>
#include <gdk/x11/gdkprivate-x11.h>
#include <gdk/x11/gdkdisplay-x11.h>
#include <gdk/x11/gdkscreen-x11.h>
@@ -445,7 +445,7 @@ read_settings (GdkX11Screen *x11_screen,
/* Since we support scaling we look at the specific Gdk/UnscaledDPI
setting if it exists and use that instead of Xft/DPI if it is set */
- if (x11_screen->xsettings && !x11_screen->fixed_window_scale)
+ if (x11_screen->xsettings && !x11_screen->fixed_surface_scale)
{
setting = g_hash_table_lookup (x11_screen->xsettings, "gdk-unscaled-dpi");
if (setting)
@@ -465,9 +465,9 @@ read_settings (GdkX11Screen *x11_screen,
g_value_init (&value, G_TYPE_INT);
- if (!x11_screen->fixed_window_scale &&
+ if (!x11_screen->fixed_surface_scale &&
gdk_display_get_setting (display, "gdk-window-scaling-factor", &value))
- _gdk_x11_screen_set_window_scale (x11_screen, g_value_get_int (&value));
+ _gdk_x11_screen_set_surface_scale (x11_screen, g_value_get_int (&value));
}
static Atom
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 127f50e0f1..a429adfc2a 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1886,7 +1886,7 @@ gsk_gl_renderer_create_programs (GskGLRenderer *self,
static gboolean
gsk_gl_renderer_realize (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
GskGLRenderer *self = GSK_GL_RENDERER (renderer);
@@ -1896,7 +1896,7 @@ gsk_gl_renderer_realize (GskRenderer *renderer,
*/
if (self->gl_context == NULL)
{
- self->gl_context = gdk_window_create_gl_context (window, error);
+ self->gl_context = gdk_surface_create_gl_context (window, error);
if (self->gl_context == NULL)
return FALSE;
}
@@ -1957,13 +1957,13 @@ gsk_gl_renderer_begin_draw_frame (GskRenderer *renderer,
cairo_region_t *damage;
GdkDrawingContext *result;
GdkRectangle whole_window;
- GdkWindow *window;
+ GdkSurface *window;
- window = gsk_renderer_get_window (renderer);
+ window = gsk_renderer_get_surface (renderer);
whole_window = (GdkRectangle) {
0, 0,
- gdk_window_get_width (window) * self->scale_factor,
- gdk_window_get_height (window) * self->scale_factor
+ gdk_surface_get_width (window) * self->scale_factor,
+ gdk_surface_get_height (window) * self->scale_factor
};
damage = gdk_gl_context_get_damage (self->gl_context);
cairo_region_union (damage, update_area);
@@ -1985,7 +1985,7 @@ gsk_gl_renderer_begin_draw_frame (GskRenderer *renderer,
self->render_mode = RENDER_SCISSOR;
}
- result = gdk_window_begin_draw_frame (window,
+ result = gdk_surface_begin_draw_frame (window,
GDK_DRAW_CONTEXT (self->gl_context),
damage);
@@ -2048,7 +2048,7 @@ gsk_gl_renderer_setup_render_mode (GskGLRenderer *self)
case RENDER_SCISSOR:
{
GdkDrawingContext *context = gsk_renderer_get_drawing_context (GSK_RENDERER (self));
- GdkWindow *window = gsk_renderer_get_window (GSK_RENDERER (self));
+ GdkSurface *window = gsk_renderer_get_surface (GSK_RENDERER (self));
cairo_region_t *clip = gdk_drawing_context_get_clip (context);
cairo_rectangle_int_t extents;
int window_height;
@@ -2062,7 +2062,7 @@ gsk_gl_renderer_setup_render_mode (GskGLRenderer *self)
g_assert (cairo_region_num_rectangles (clip) == 1);
- window_height = gdk_window_get_height (window) * self->scale_factor;
+ window_height = gdk_surface_get_height (window) * self->scale_factor;
/*cairo_region_get_extents (clip, &extents);*/
cairo_region_get_rectangle (clip, 0, &extents);
@@ -2567,7 +2567,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
width = ceilf (viewport->size.width);
height = ceilf (viewport->size.height);
- self->scale_factor = gdk_window_get_scale_factor (gsk_renderer_get_window (renderer));
+ self->scale_factor = gdk_surface_get_scale_factor (gsk_renderer_get_surface (renderer));
gdk_gl_context_make_current (self->gl_context);
/* Prepare our framebuffer */
@@ -2605,19 +2605,19 @@ gsk_gl_renderer_render (GskRenderer *renderer,
GskRenderNode *root)
{
GskGLRenderer *self = GSK_GL_RENDERER (renderer);
- GdkWindow *window = gsk_renderer_get_window (renderer);
+ GdkSurface *window = gsk_renderer_get_surface (renderer);
graphene_rect_t viewport;
if (self->gl_context == NULL)
return;
- self->scale_factor = gdk_window_get_scale_factor (window);
+ self->scale_factor = gdk_surface_get_scale_factor (window);
gdk_gl_context_make_current (self->gl_context);
viewport.origin.x = 0;
viewport.origin.y = 0;
- viewport.size.width = gdk_window_get_width (window) * self->scale_factor;
- viewport.size.height = gdk_window_get_height (window) * self->scale_factor;
+ viewport.size.width = gdk_surface_get_width (window) * self->scale_factor;
+ viewport.size.height = gdk_surface_get_height (window) * self->scale_factor;
gsk_gl_renderer_do_render (renderer, root, &viewport, 0, self->scale_factor);
diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c
index 887befdd4a..09896408bd 100644
--- a/gsk/gskbroadwayrenderer.c
+++ b/gsk/gskbroadwayrenderer.c
@@ -24,7 +24,7 @@ G_DEFINE_TYPE (GskBroadwayRenderer, gsk_broadway_renderer, GSK_TYPE_RENDERER)
static gboolean
gsk_broadway_renderer_realize (GskRenderer *self,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
return TRUE;
@@ -43,16 +43,16 @@ gsk_broadway_renderer_begin_draw_frame (GskRenderer *renderer,
cairo_region_t *region;
GdkDrawingContext *result;
cairo_rectangle_int_t whole_window;
- GdkWindow *window;
+ GdkSurface *window;
- window = gsk_renderer_get_window (renderer);
+ window = gsk_renderer_get_surface (renderer);
whole_window = (cairo_rectangle_int_t) {
0, 0,
- gdk_window_get_width (window),
- gdk_window_get_height (window)
+ gdk_surface_get_width (window),
+ gdk_surface_get_height (window)
};
region = cairo_region_create_rectangle (&whole_window);
- result = gdk_window_begin_draw_frame (window, NULL, region);
+ result = gdk_surface_begin_draw_frame (window, NULL, region);
cairo_region_destroy (region);
return result;
@@ -686,12 +686,12 @@ static void
gsk_broadway_renderer_render (GskRenderer *self,
GskRenderNode *root)
{
- GdkWindow *window = gsk_renderer_get_window (self);
+ GdkSurface *window = gsk_renderer_get_surface (self);
GArray *nodes = g_array_new (FALSE, FALSE, sizeof(guint32));
GPtrArray *node_textures = g_ptr_array_new_with_free_func (g_object_unref);
gsk_broadway_renderer_add_node (self, nodes, node_textures, root, 0, 0);
- gdk_broadway_window_set_nodes (window, nodes, node_textures);
+ gdk_broadway_surface_set_nodes (window, nodes, node_textures);
g_array_unref (nodes);
g_ptr_array_unref (node_textures);
}
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c
index ca0b493b7a..12cbe1cae8 100644
--- a/gsk/gskcairorenderer.c
+++ b/gsk/gskcairorenderer.c
@@ -32,7 +32,7 @@ G_DEFINE_TYPE (GskCairoRenderer, gsk_cairo_renderer, GSK_TYPE_RENDERER)
static gboolean
gsk_cairo_renderer_realize (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
return TRUE;
@@ -99,7 +99,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
GskRenderNode *root)
{
GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer);
- GdkWindow *window = gsk_renderer_get_window (renderer);
+ GdkSurface *window = gsk_renderer_get_surface (renderer);
cairo_t *cr;
@@ -114,7 +114,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_rectangle (cr,
0, 0,
- gdk_window_get_width (window), gdk_window_get_height (window));
+ gdk_surface_get_width (window), gdk_surface_get_height (window));
cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5);
cairo_stroke (cr);
cairo_restore (cr);
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 877aea7106..7b67e9ce4f 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -25,7 +25,7 @@
* tree of #GskRenderNode instances.
*
* Typically you will use a #GskRenderer instance with a #GdkDrawingContext
- * associated to a #GdkWindow, and call gsk_renderer_render() with the
+ * associated to a #GdkSurface, and call gsk_renderer_render() with the
* drawing context and the scene to be rendered.
*
* It is necessary to realize a #GskRenderer instance using gsk_renderer_realize()
@@ -69,7 +69,7 @@ typedef struct
GskScalingFilter min_filter;
GskScalingFilter mag_filter;
- GdkWindow *window;
+ GdkSurface *window;
GdkDrawingContext *drawing_context;
GskRenderNode *root_node;
GdkDisplay *display;
@@ -98,7 +98,7 @@ static GParamSpec *gsk_renderer_properties[N_PROPS];
static gboolean
gsk_renderer_real_realize (GskRenderer *self,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
GSK_RENDERER_WARN_NOT_IMPLEMENTED_METHOD (self, realize);
@@ -126,7 +126,7 @@ gsk_renderer_real_begin_draw_frame (GskRenderer *self,
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (self);
- return gdk_window_begin_draw_frame (priv->window,
+ return gdk_surface_begin_draw_frame (priv->window,
NULL,
region);
}
@@ -137,7 +137,7 @@ gsk_renderer_real_end_draw_frame (GskRenderer *self,
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (self);
- gdk_window_end_draw_frame (priv->window,
+ gdk_surface_end_draw_frame (priv->window,
context);
}
@@ -155,7 +155,7 @@ gsk_renderer_real_create_cairo_surface (GskRenderer *self,
int height)
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (self);
- int scale_factor = priv->window ? gdk_window_get_scale_factor (priv->window) : 1;
+ int scale_factor = priv->window ? gdk_surface_get_scale_factor (priv->window) : 1;
int real_width = width * scale_factor;
int real_height = height * scale_factor;
@@ -286,7 +286,7 @@ gsk_renderer_class_init (GskRendererClass *klass)
g_param_spec_object ("window",
"Window",
"The window associated to the renderer",
- GDK_TYPE_WINDOW,
+ GDK_TYPE_SURFACE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
@@ -316,16 +316,16 @@ gsk_renderer_init (GskRenderer *self)
}
/**
- * gsk_renderer_get_window:
+ * gsk_renderer_get_surface:
* @renderer: a #GskRenderer
*
- * Retrieves the #GdkWindow set using gsk_renderer_realize(). If the renderer
+ * Retrieves the #GdkSurface set using gsk_renderer_realize(). If the renderer
* has not been realized yet, %NULL will be returned.
*
- * Returns: (transfer none) (nullable): a #GdkWindow
+ * Returns: (transfer none) (nullable): a #GdkSurface
*/
-GdkWindow *
-gsk_renderer_get_window (GskRenderer *renderer)
+GdkSurface *
+gsk_renderer_get_surface (GskRenderer *renderer)
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
@@ -409,7 +409,7 @@ gsk_renderer_is_realized (GskRenderer *renderer)
/**
* gsk_renderer_realize:
* @renderer: a #GskRenderer
- * @window: the #GdkWindow renderer will be used on
+ * @window: the #GdkSurface renderer will be used on
* @error: return location for an error
*
* Creates the resources needed by the @renderer to render the scene
@@ -417,14 +417,14 @@ gsk_renderer_is_realized (GskRenderer *renderer)
*/
gboolean
gsk_renderer_realize (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
g_return_val_if_fail (GSK_IS_RENDERER (renderer), FALSE);
g_return_val_if_fail (!gsk_renderer_is_realized (renderer), FALSE);
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
priv->window = g_object_ref (window);
@@ -625,9 +625,9 @@ get_renderer_for_name (const char *renderer_name)
}
static GType
-get_renderer_for_display (GdkWindow *window)
+get_renderer_for_display (GdkSurface *window)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
const char *renderer_name;
renderer_name = g_object_get_data (G_OBJECT (display), "gsk-renderer");
@@ -635,7 +635,7 @@ get_renderer_for_display (GdkWindow *window)
}
static GType
-get_renderer_for_env_var (GdkWindow *window)
+get_renderer_for_env_var (GdkSurface *window)
{
static GType env_var_type = G_TYPE_NONE;
@@ -649,18 +649,18 @@ get_renderer_for_env_var (GdkWindow *window)
}
static GType
-get_renderer_for_backend (GdkWindow *window)
+get_renderer_for_backend (GdkSurface *window)
{
#ifdef GDK_WINDOWING_X11
- if (GDK_IS_X11_WINDOW (window))
+ if (GDK_IS_X11_SURFACE (window))
return GSK_TYPE_GL_RENDERER;
#endif
#ifdef GDK_WINDOWING_WAYLAND
- if (GDK_IS_WAYLAND_WINDOW (window))
+ if (GDK_IS_WAYLAND_SURFACE (window))
return GSK_TYPE_GL_RENDERER;
#endif
#ifdef GDK_WINDOWING_BROADWAY
- if (GDK_IS_BROADWAY_WINDOW (window))
+ if (GDK_IS_BROADWAY_SURFACE (window))
return GSK_TYPE_BROADWAY_RENDERER;
#endif
@@ -668,14 +668,14 @@ get_renderer_for_backend (GdkWindow *window)
}
static GType
-get_renderer_fallback (GdkWindow *window)
+get_renderer_fallback (GdkSurface *window)
{
return GSK_TYPE_CAIRO_RENDERER;
}
static struct {
gboolean verbose;
- GType (* get_renderer) (GdkWindow *window);
+ GType (* get_renderer) (GdkSurface *window);
} renderer_possibilities[] = {
{ TRUE, get_renderer_for_display },
{ TRUE, get_renderer_for_env_var },
@@ -684,8 +684,8 @@ static struct {
};
/**
- * gsk_renderer_new_for_window:
- * @window: a #GdkWindow
+ * gsk_renderer_new_for_surface:
+ * @window: a #GdkSurface
*
* Creates an appropriate #GskRenderer instance for the given @window.
*
@@ -694,7 +694,7 @@ static struct {
* Returns: (transfer full) (nullable): a #GskRenderer
*/
GskRenderer *
-gsk_renderer_new_for_window (GdkWindow *window)
+gsk_renderer_new_for_surface (GdkSurface *window)
{
GType renderer_type;
GskRenderer *renderer;
@@ -702,7 +702,7 @@ gsk_renderer_new_for_window (GdkWindow *window)
gboolean verbose = FALSE;
guint i;
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
for (i = 0; i < G_N_ELEMENTS (renderer_possibilities); i++)
{
@@ -715,7 +715,7 @@ gsk_renderer_new_for_window (GdkWindow *window)
*/
verbose |= renderer_possibilities[i].verbose;
renderer = g_object_new (renderer_type,
- "display", gdk_window_get_display (window),
+ "display", gdk_surface_get_display (window),
NULL);
if (gsk_renderer_realize (renderer, window, &error))
@@ -784,8 +784,8 @@ gsk_renderer_begin_draw_frame (GskRenderer *renderer,
full_window = cairo_region_create_rectangle (&(GdkRectangle) {
0, 0,
- gdk_window_get_width (priv->window),
- gdk_window_get_height (priv->window)
+ gdk_surface_get_width (priv->window),
+ gdk_surface_get_height (priv->window)
});
priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, full_window);
diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h
index 46509bd814..0c867f9b4a 100644
--- a/gsk/gskrenderer.h
+++ b/gsk/gskrenderer.h
@@ -39,17 +39,17 @@ GDK_AVAILABLE_IN_ALL
GType gsk_renderer_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-GskRenderer * gsk_renderer_new_for_window (GdkWindow *window);
+GskRenderer * gsk_renderer_new_for_surface (GdkSurface *window);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gsk_renderer_get_window (GskRenderer *renderer);
+GdkSurface * gsk_renderer_get_surface (GskRenderer *renderer);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gsk_renderer_get_display (GskRenderer *renderer);
GDK_AVAILABLE_IN_ALL
gboolean gsk_renderer_realize (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error);
GDK_AVAILABLE_IN_ALL
void gsk_renderer_unrealize (GskRenderer *renderer);
diff --git a/gsk/gskrendererprivate.h b/gsk/gskrendererprivate.h
index 9cd3c57034..c6b29f4242 100644
--- a/gsk/gskrendererprivate.h
+++ b/gsk/gskrendererprivate.h
@@ -39,7 +39,7 @@ struct _GskRendererClass
GObjectClass parent_class;
gboolean (* realize) (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error);
void (* unrealize) (GskRenderer *renderer);
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 9775c926bf..5c7af11493 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -210,7 +210,7 @@ gsk_render_node_get_name (GskRenderNode *node)
*
* Typically, you'll use this function to implement fallback rendering
* of #GskRenderNodes on an intermediate Cairo context, instead of using
- * the drawing context associated to a #GdkWindow's rendering buffer.
+ * the drawing context associated to a #GdkSurface's rendering buffer.
*
* For advanced nodes that cannot be supported using Cairo, in particular
* for nodes doing 3D operations, this function may fail.
diff --git a/gsk/vulkan/gskvulkanrender.c b/gsk/vulkan/gskvulkanrender.c
index 66291b9ba5..f5d7ce0adb 100644
--- a/gsk/vulkan/gskvulkanrender.c
+++ b/gsk/vulkan/gskvulkanrender.c
@@ -67,7 +67,7 @@ gsk_vulkan_render_setup (GskVulkanRender *self,
GskVulkanImage *target,
const graphene_rect_t *rect)
{
- GdkWindow *window = gsk_renderer_get_window (self->renderer);
+ GdkSurface *window = gsk_renderer_get_surface (self->renderer);
self->target = g_object_ref (target);
@@ -83,10 +83,10 @@ gsk_vulkan_render_setup (GskVulkanRender *self,
}
else
{
- self->scale_factor = gdk_window_get_scale_factor (gsk_renderer_get_window (self->renderer));
+ self->scale_factor = gdk_surface_get_scale_factor (gsk_renderer_get_surface (self->renderer));
self->viewport = GRAPHENE_RECT_INIT (0, 0,
- gdk_window_get_width (window) * self->scale_factor,
- gdk_window_get_height (window) * self->scale_factor);
+ gdk_surface_get_width (window) * self->scale_factor,
+ gdk_surface_get_height (window) * self->scale_factor);
self->clip = gdk_drawing_context_get_clip (gsk_renderer_get_drawing_context (self->renderer));
}
}
diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c
index 0a0cdab3bb..f00d900882 100644
--- a/gsk/vulkan/gskvulkanrenderer.c
+++ b/gsk/vulkan/gskvulkanrenderer.c
@@ -84,7 +84,7 @@ static void
gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context,
GskVulkanRenderer *self)
{
- GdkWindow *window;
+ GdkSurface *window;
gint scale_factor;
gsize width, height;
guint i;
@@ -94,10 +94,10 @@ gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context,
self->n_targets = gdk_vulkan_context_get_n_images (context);
self->targets = g_new (GskVulkanImage *, self->n_targets);
- window = gsk_renderer_get_window (GSK_RENDERER (self));
- scale_factor = gdk_window_get_scale_factor (window);
- width = gdk_window_get_width (window) * scale_factor;
- height = gdk_window_get_height (window) * scale_factor;
+ window = gsk_renderer_get_surface (GSK_RENDERER (self));
+ scale_factor = gdk_surface_get_scale_factor (window);
+ width = gdk_surface_get_width (window) * scale_factor;
+ height = gdk_surface_get_height (window) * scale_factor;
for (i = 0; i < self->n_targets; i++)
{
@@ -110,12 +110,12 @@ gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context,
static gboolean
gsk_vulkan_renderer_realize (GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
GError **error)
{
GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer);
- self->vulkan = gdk_window_create_vulkan_context (window, error);
+ self->vulkan = gdk_surface_create_vulkan_context (window, error);
if (self->vulkan == NULL)
return FALSE;
@@ -256,7 +256,7 @@ gsk_vulkan_renderer_begin_draw_frame (GskRenderer *renderer,
GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer);
GdkDrawingContext *result;
- result = gdk_window_begin_draw_frame (gsk_renderer_get_window (renderer),
+ result = gdk_surface_begin_draw_frame (gsk_renderer_get_surface (renderer),
GDK_DRAW_CONTEXT (self->vulkan),
region);
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
index 1061774742..2a990a685f 100644
--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -243,7 +243,7 @@ gtk_entry_icon_accessible_do_action (AtkAction *action,
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
event = gdk_event_new (GDK_BUTTON_PRESS);
- event->any.window = g_object_ref (gtk_widget_get_window (widget));
+ event->any.surface = g_object_ref (gtk_widget_get_surface (widget));
event->button.button = 1;
event->any.send_event = TRUE;
event->button.time = GDK_CURRENT_TIME;
@@ -956,7 +956,7 @@ gtk_entry_accessible_get_character_extents (AtkText *text,
PangoRectangle char_rect;
gchar *entry_text;
gint index, x_layout, y_layout;
- GdkWindow *window;
+ GdkSurface *window;
gint x_window, y_window;
GtkAllocation allocation;
@@ -976,8 +976,8 @@ gtk_entry_accessible_get_character_extents (AtkText *text,
_gtk_widget_get_allocation (widget, &allocation);
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x = x_window + allocation.x + x_layout + char_rect.x;
*y = y_window + allocation.y + y_layout + char_rect.y;
@@ -986,8 +986,8 @@ gtk_entry_accessible_get_character_extents (AtkText *text,
if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x -= x_window;
*y -= y_window;
@@ -1006,7 +1006,7 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text,
gint index, x_layout, y_layout;
gint x_window, y_window;
gint x_local, y_local;
- GdkWindow *window;
+ GdkSurface *window;
glong offset;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
@@ -1017,16 +1017,16 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text,
gtk_entry_get_layout_offsets (entry, &x_layout, &y_layout);
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, &x_window, &y_window);
x_local = x - x_layout - x_window;
y_local = y - y_layout - y_window;
if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
x_local += x_window;
y_local += y_window;
diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c
index 91b1ac861d..754b7990a1 100644
--- a/gtk/a11y/gtklabelaccessible.c
+++ b/gtk/a11y/gtklabelaccessible.c
@@ -995,7 +995,7 @@ gtk_label_accessible_get_character_extents (AtkText *text,
PangoRectangle char_rect;
const gchar *label_text;
gint index, x_layout, y_layout;
- GdkWindow *window;
+ GdkSurface *window;
gint x_window, y_window;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
@@ -1010,8 +1010,8 @@ gtk_label_accessible_get_character_extents (AtkText *text,
pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect);
pango_extents_to_pixels (&char_rect, NULL);
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x = x_window + x_layout + char_rect.x;
*y = y_window + y_layout + char_rect.y;
@@ -1020,8 +1020,8 @@ gtk_label_accessible_get_character_extents (AtkText *text,
if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x -= x_window;
*y -= y_window;
@@ -1040,7 +1040,7 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text,
gint index, x_layout, y_layout;
gint x_window, y_window;
gint x_local, y_local;
- GdkWindow *window;
+ GdkSurface *window;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
if (widget == NULL)
@@ -1050,16 +1050,16 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text,
gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, &x_window, &y_window);
x_local = x - x_layout - x_window;
y_local = y - y_layout - y_window;
if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
x_local += x_window;
y_local += y_window;
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index a64df616bb..32ce984c7f 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -484,19 +484,19 @@ get_origins (GtkWidget *widget,
gint *x_toplevel,
gint *y_toplevel)
{
- GdkWindow *window;
+ GdkSurface *window;
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, x_window, y_window);
- window = gdk_window_get_toplevel (gtk_widget_get_window (widget));
- gdk_window_get_origin (window, x_toplevel, y_toplevel);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, x_window, y_window);
+ window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
+ gdk_surface_get_origin (window, x_toplevel, y_toplevel);
if (GTK_IS_TREE_VIEW (widget))
{
- gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
+ gtk_tree_view_convert_widget_to_bin_surface_coords (GTK_TREE_VIEW (widget),
*x_window, *y_window,
x_window, y_window);
- gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
+ gtk_tree_view_convert_widget_to_bin_surface_coords (GTK_TREE_VIEW (widget),
*x_toplevel, *y_toplevel,
x_toplevel, y_toplevel);
}
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index c50439e9ed..3445a36308 100644
--- a/gtk/a11y/gtktextviewaccessible.c
+++ b/gtk/a11y/gtktextviewaccessible.c
@@ -446,7 +446,7 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text,
GtkTextIter iter;
gint x_widget, y_widget, x_window, y_window, buff_x, buff_y;
GtkWidget *widget;
- GdkWindow *window;
+ GdkSurface *window;
GdkRectangle rect;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
@@ -454,8 +454,8 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text,
return -1;
view = GTK_TEXT_VIEW (widget);
- window = gtk_widget_get_window (widget);
- gdk_window_get_origin (window, &x_widget, &y_widget);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_get_origin (window, &x_widget, &y_widget);
if (coords == ATK_XY_SCREEN)
{
@@ -464,8 +464,8 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text,
}
else if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
x = x - x_widget + x_window;
y = y - y_widget + y_window;
@@ -506,7 +506,7 @@ gtk_text_view_accessible_get_character_extents (AtkText *text,
GtkTextIter iter;
GtkWidget *widget;
GdkRectangle rectangle;
- GdkWindow *window;
+ GdkSurface *window;
gint x_widget, y_widget, x_window, y_window;
*x = 0;
@@ -523,21 +523,21 @@ gtk_text_view_accessible_get_character_extents (AtkText *text,
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
gtk_text_view_get_iter_location (view, &iter, &rectangle);
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
if (window == NULL)
return;
- gdk_window_get_origin (window, &x_widget, &y_widget);
+ gdk_surface_get_origin (window, &x_widget, &y_widget);
*height = rectangle.height;
*width = rectangle.width;
- gtk_text_view_buffer_to_window_coords (view, GTK_TEXT_WINDOW_WIDGET,
+ gtk_text_view_buffer_to_surface_coords (view, GTK_TEXT_WINDOW_WIDGET,
rectangle.x, rectangle.y, x, y);
if (coords == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
+ window = gdk_surface_get_toplevel (window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x += x_widget - x_window;
*y += y_widget - y_window;
}
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 05629a06e3..4c97e67830 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -546,7 +546,7 @@ gtk_tree_view_accessible_ref_accessible_at_point (AtkComponent *component,
tree_view = GTK_TREE_VIEW (widget);
atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &bx, &by);
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y, &bx, &by);
if (!gtk_tree_view_get_path_at_pos (tree_view,
bx - x_pos, by - y_pos,
&path, &column, NULL, NULL))
@@ -1090,17 +1090,17 @@ gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent,
tree_view = GTK_TREE_VIEW (widget);
gtk_tree_view_accessible_get_cell_area (parent, cell, &cell_rect);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view,
0, 0,
&w_x, &w_y);
if (coord_type != ATK_XY_WINDOW)
{
- GdkWindow *window;
+ GdkSurface *window;
gint x_toplevel, y_toplevel;
- window = gdk_window_get_toplevel (gtk_widget_get_window (widget));
- gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
+ window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
+ gdk_surface_get_origin (window, &x_toplevel, &y_toplevel);
w_x += x_toplevel;
w_y += y_toplevel;
@@ -1175,7 +1175,7 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
{
#ifdef GDK_WINDOWING_X11
gtk_window_present_with_time (GTK_WINDOW (toplevel),
- gdk_x11_get_server_time (gtk_widget_get_window (widget)));
+ gdk_x11_get_server_time (gtk_widget_get_surface (widget)));
#else
gtk_window_present (GTK_WINDOW (toplevel));
#endif
@@ -1443,7 +1443,7 @@ is_cell_showing (GtkTreeView *tree_view,
tree_cell_rect->height = cell_rect->height;
gtk_tree_view_get_visible_rect (tree_view, visible_rect);
- gtk_tree_view_convert_tree_to_bin_window_coords (tree_view, visible_rect->x,
+ gtk_tree_view_convert_tree_to_bin_surface_coords (tree_view, visible_rect->x,
visible_rect->y, &bx, &by);
if (((tree_cell_rect->x + tree_cell_rect->width) < bx) ||
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c
index 2bd384c98a..4f80a852ca 100644
--- a/gtk/a11y/gtkwidgetaccessible.c
+++ b/gtk/a11y/gtkwidgetaccessible.c
@@ -562,7 +562,7 @@ gtk_widget_accessible_get_extents (AtkComponent *component,
gint *height,
AtkCoordType coord_type)
{
- GdkWindow *window;
+ GdkSurface *window;
gint x_window, y_window;
gint x_toplevel, y_toplevel;
GtkWidget *widget;
@@ -586,22 +586,22 @@ gtk_widget_accessible_get_extents (AtkComponent *component,
{
*x = allocation.x;
*y = allocation.y;
- window = gtk_widget_get_parent_window (widget);
+ window = gtk_widget_get_parent_surface (widget);
}
else
{
*x = 0;
*y = 0;
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
}
- gdk_window_get_origin (window, &x_window, &y_window);
+ gdk_surface_get_origin (window, &x_window, &y_window);
*x += x_window;
*y += y_window;
if (coord_type == ATK_XY_WINDOW)
{
- window = gdk_window_get_toplevel (gtk_widget_get_window (widget));
- gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
+ window = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
+ gdk_surface_get_origin (window, &x_toplevel, &y_toplevel);
*x -= x_toplevel;
*y -= y_toplevel;
@@ -635,7 +635,7 @@ gtk_widget_accessible_grab_focus (AtkComponent *component)
{
#ifdef GDK_WINDOWING_X11
gtk_window_present_with_time (GTK_WINDOW (toplevel),
- gdk_x11_get_server_time (gtk_widget_get_window (widget)));
+ gdk_x11_get_server_time (gtk_widget_get_surface (widget)));
#else
gtk_window_present (GTK_WINDOW (toplevel));
#endif
@@ -663,9 +663,9 @@ gtk_widget_accessible_set_extents (AtkComponent *component,
if (coord_type == ATK_XY_WINDOW)
{
gint x_current, y_current;
- GdkWindow *window = gtk_widget_get_window (widget);
+ GdkSurface *window = gtk_widget_get_surface (widget);
- gdk_window_get_origin (window, &x_current, &y_current);
+ gdk_surface_get_origin (window, &x_current, &y_current);
x_current += x;
y_current += y;
if (x_current < 0 || y_current < 0)
@@ -703,9 +703,9 @@ gtk_widget_accessible_set_position (AtkComponent *component,
if (coord_type == ATK_XY_WINDOW)
{
gint x_current, y_current;
- GdkWindow *window = gtk_widget_get_window (widget);
+ GdkSurface *window = gtk_widget_get_surface (widget);
- gdk_window_get_origin (window, &x_current, &y_current);
+ gdk_surface_get_origin (window, &x_current, &y_current);
x_current += x;
y_current += y;
if (x_current < 0 || y_current < 0)
diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c
index dc0753a5e2..3b072ca981 100644
--- a/gtk/a11y/gtkwindowaccessible.c
+++ b/gtk/a11y/gtkwindowaccessible.c
@@ -226,8 +226,8 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible)
AtkStateSet *state_set;
GtkWidget *widget;
GtkWindow *window;
- GdkWindow *gdk_window;
- GdkWindowState state;
+ GdkSurface *gdk_surface;
+ GdkSurfaceState state;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
if (widget == NULL)
@@ -240,11 +240,11 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible)
if (gtk_window_is_active (window))
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
- gdk_window = gtk_widget_get_window (widget);
- if (gdk_window)
+ gdk_surface = gtk_widget_get_surface (widget);
+ if (gdk_surface)
{
- state = gdk_window_get_state (gdk_window);
- if (state & GDK_WINDOW_STATE_ICONIFIED)
+ state = gdk_surface_get_state (gdk_surface);
+ if (state & GDK_SURFACE_STATE_ICONIFIED)
atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED);
}
if (gtk_window_get_modal (window))
@@ -305,7 +305,7 @@ static AtkAttributeSet *
gtk_widget_accessible_get_attributes (AtkObject *obj)
{
GtkWidget *window;
- GdkWindowTypeHint hint;
+ GdkSurfaceTypeHint hint;
AtkAttributeSet *attributes;
AtkAttribute *attr;
GEnumClass *class;
@@ -319,7 +319,7 @@ gtk_widget_accessible_get_attributes (AtkObject *obj)
window = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
hint = gtk_window_get_type_hint (GTK_WINDOW (window));
- class = g_type_class_ref (GDK_TYPE_WINDOW_TYPE_HINT);
+ class = g_type_class_ref (GDK_TYPE_SURFACE_TYPE_HINT);
for (value = class->values; value->value_name; value++)
{
if (hint == value->value)
@@ -368,7 +368,7 @@ gtk_window_accessible_get_extents (AtkComponent *component,
AtkCoordType coord_type)
{
GtkWidget *widget;
- GdkWindow *window;
+ GdkSurface *window;
GdkRectangle rect;
gint x_toplevel, y_toplevel;
@@ -385,11 +385,11 @@ gtk_window_accessible_get_extents (AtkComponent *component,
return;
}
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
if (window == NULL)
return;
- gdk_window_get_frame_extents (window, &rect);
+ gdk_surface_get_frame_extents (window, &rect);
*width = rect.width;
*height = rect.height;
@@ -404,7 +404,7 @@ gtk_window_accessible_get_extents (AtkComponent *component,
*y = rect.y;
if (coord_type == ATK_XY_WINDOW)
{
- gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
+ gdk_surface_get_origin (window, &x_toplevel, &y_toplevel);
*x -= x_toplevel;
*y -= y_toplevel;
}
@@ -416,7 +416,7 @@ gtk_window_accessible_get_size (AtkComponent *component,
gint *height)
{
GtkWidget *widget;
- GdkWindow *window;
+ GdkSurface *window;
GdkRectangle rect;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
@@ -432,11 +432,11 @@ gtk_window_accessible_get_size (AtkComponent *component,
return;
}
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
if (window == NULL)
return;
- gdk_window_get_frame_extents (window, &rect);
+ gdk_surface_get_frame_extents (window, &rect);
*width = rect.width;
*height = rect.height;
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index ad9f205cfb..3730b1feb2 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -321,7 +321,7 @@ gtk_accel_label_init (GtkAccelLabel *accel_label)
{
GtkAccelLabelPrivate *priv;
- gtk_widget_set_has_window (GTK_WIDGET (accel_label), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (accel_label), FALSE);
accel_label->priv = gtk_accel_label_get_instance_private (accel_label);
priv = accel_label->priv;
diff --git a/gtk/gtkactionbar.c b/gtk/gtkactionbar.c
index a567240560..5e179a4682 100644
--- a/gtk/gtkactionbar.c
+++ b/gtk/gtkactionbar.c
@@ -411,7 +411,7 @@ gtk_action_bar_init (GtkActionBar *action_bar)
GtkWidget *widget = GTK_WIDGET (action_bar);
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
priv->revealer = gtk_revealer_new ();
gtk_widget_set_parent (priv->revealer, widget);
diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c
index e396d05cf8..7f0e7525b2 100644
--- a/gtk/gtkappchooserwidget.c
+++ b/gtk/gtkappchooserwidget.c
@@ -1176,7 +1176,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self)
self->priv = gtk_app_chooser_widget_get_instance_private (self);
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
gtk_widget_init_template (GTK_WIDGET (self));
diff --git a/gtk/gtkapplication-wayland.c b/gtk/gtkapplication-wayland.c
index 221a1adb3b..a5f48df251 100644
--- a/gtk/gtkapplication-wayland.c
+++ b/gtk/gtkapplication-wayland.c
@@ -41,17 +41,17 @@ gtk_application_impl_wayland_handle_window_realize (GtkApplicationImpl *impl,
GtkApplicationImplClass *impl_class =
GTK_APPLICATION_IMPL_CLASS (gtk_application_impl_wayland_parent_class);
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
gchar *window_path;
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
- if (!GDK_IS_WAYLAND_WINDOW (gdk_window))
+ if (!GDK_IS_WAYLAND_SURFACE (gdk_surface))
return;
window_path = gtk_application_impl_dbus_get_window_path (dbus, window);
- gdk_wayland_window_set_dbus_properties_libgtk_only (gdk_window,
+ gdk_wayland_surface_set_dbus_properties_libgtk_only (gdk_surface,
dbus->application_id, dbus->app_menu_path, dbus->menubar_path,
window_path, dbus->object_path, dbus->unique_name);
diff --git a/gtk/gtkapplication-x11.c b/gtk/gtkapplication-x11.c
index 0d93f3c2c1..989e9c3380 100644
--- a/gtk/gtkapplication-x11.c
+++ b/gtk/gtkapplication-x11.c
@@ -39,22 +39,22 @@ gtk_application_impl_x11_handle_window_realize (GtkApplicationImpl *impl,
GtkWindow *window)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
gchar *window_path;
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
- if (!GDK_IS_X11_WINDOW (gdk_window))
+ if (!GDK_IS_X11_SURFACE (gdk_surface))
return;
window_path = gtk_application_impl_dbus_get_window_path (dbus, window);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APPLICATION_ID", dbus->application_id);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_UNIQUE_BUS_NAME", dbus->unique_name);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APPLICATION_OBJECT_PATH", dbus->object_path);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_WINDOW_OBJECT_PATH", window_path);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APP_MENU_OBJECT_PATH", dbus->app_menu_path);
- gdk_x11_window_set_utf8_property (gdk_window, "_GTK_MENUBAR_OBJECT_PATH", dbus->menubar_path);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APPLICATION_ID", dbus->application_id);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_UNIQUE_BUS_NAME", dbus->unique_name);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APPLICATION_OBJECT_PATH", dbus->object_path);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_WINDOW_OBJECT_PATH", window_path);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APP_MENU_OBJECT_PATH", dbus->app_menu_path);
+ gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_MENUBAR_OBJECT_PATH", dbus->menubar_path);
g_free (window_path);
}
@@ -63,12 +63,12 @@ static GVariant *
gtk_application_impl_x11_get_window_system_id (GtkApplicationImplDBus *dbus,
GtkWindow *window)
{
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
- if (GDK_IS_X11_WINDOW (gdk_window))
- return g_variant_new_uint32 (GDK_WINDOW_XID (gdk_window));
+ if (GDK_IS_X11_SURFACE (gdk_surface))
+ return g_variant_new_uint32 (GDK_SURFACE_XID (gdk_surface));
return GTK_APPLICATION_IMPL_DBUS_CLASS (gtk_application_impl_x11_parent_class)->get_window_system_id (dbus, window);
}
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index 90f2ddea17..79f882d8e4 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -94,7 +94,7 @@ gtk_bin_class_init (GtkBinClass *class)
static void
gtk_bin_init (GtkBin *bin)
{
- gtk_widget_set_has_window (GTK_WIDGET (bin), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (bin), FALSE);
}
static GType
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 892f5b7c4e..bfe4b2bf11 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -1288,7 +1288,7 @@ gtk_box_init (GtkBox *box)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
- gtk_widget_set_has_window (GTK_WIDGET (box), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->children = NULL;
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index b5803375d7..6f6599479a 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -435,7 +435,7 @@ gtk_button_init (GtkButton *button)
gtk_widget_set_can_focus (GTK_WIDGET (button), TRUE);
gtk_widget_set_receives_default (GTK_WIDGET (button), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE);
priv->in_button = FALSE;
priv->button_down = FALSE;
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index f04a7c358c..94ae028d38 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -665,7 +665,7 @@ gtk_calendar_init (GtkCalendar *calendar)
priv = calendar->priv = gtk_calendar_get_instance_private (calendar);
gtk_widget_set_can_focus (widget, TRUE);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)),
GTK_STYLE_CLASS_VIEW);
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index ab9e1c4d86..1703e99760 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -440,7 +440,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell,
GtkWidget *editable;
gboolean is_editable;
GdkDevice *device, *pointer;
- GdkWindow *window;
+ GdkSurface *window;
celltext = GTK_CELL_RENDERER_TEXT (cell);
accel = GTK_CELL_RENDERER_ACCEL (cell);
@@ -451,7 +451,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell,
if (!is_editable)
return NULL;
- window = gtk_widget_get_window (gtk_widget_get_toplevel (widget));
+ window = gtk_widget_get_surface (gtk_widget_get_toplevel (widget));
if (event)
device = gdk_event_get_device (event);
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index e29eee4164..9b3dc1997c 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -419,7 +419,7 @@ gtk_cell_view_init (GtkCellView *cellview)
cellview->priv = gtk_cell_view_get_instance_private (cellview);
cellview->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
- gtk_widget_set_has_window (GTK_WIDGET (cellview), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (cellview), FALSE);
}
static void
diff --git a/gtk/gtkcenterbox.c b/gtk/gtkcenterbox.c
index f7b4382749..dd88735cfb 100644
--- a/gtk/gtkcenterbox.c
+++ b/gtk/gtkcenterbox.c
@@ -724,7 +724,7 @@ gtk_center_box_class_init (GtkCenterBoxClass *klass)
static void
gtk_center_box_init (GtkCenterBox *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->start_widget = NULL;
self->center_widget = NULL;
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index be3d40fee5..91d2395620 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -376,7 +376,7 @@ gtk_color_button_init (GtkColorButton *button)
GtkStyleContext *context;
GdkContentFormats *targets;
- gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE);
/* Create the widgets */
priv = button->priv = gtk_color_button_get_instance_private (button);
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c
index 221664c3be..3f7178fbd8 100644
--- a/gtk/gtkcolorplane.c
+++ b/gtk/gtkcolorplane.c
@@ -134,7 +134,7 @@ create_surface (GtkColorPlane *plane)
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR,
width, height);
@@ -408,7 +408,7 @@ gtk_color_plane_init (GtkColorPlane *plane)
plane->priv = gtk_color_plane_get_instance_private (plane);
- gtk_widget_set_has_window (GTK_WIDGET (plane), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (plane), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (plane));
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 16347a048d..b763f558ef 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -579,7 +579,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
swatch->priv->has_menu = TRUE;
gtk_widget_set_can_focus (GTK_WIDGET (swatch), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (swatch), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (swatch), FALSE);
swatch->priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (swatch));
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->long_press_gesture),
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 0b18c42779..7f3d959ff6 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1392,7 +1392,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box)
gtk_menu_update_scroll_offset,
NULL);
- g_object_set (priv->popup_widget, "menu-type-hint", GDK_WINDOW_TYPE_HINT_COMBO, NULL);
+ g_object_set (priv->popup_widget, "menu-type-hint", GDK_SURFACE_TYPE_HINT_COMBO, NULL);
if (priv->wrap_width > 0 || priv->cell_view == NULL)
{
diff --git a/gtk/gtkdebugupdates.c b/gtk/gtkdebugupdates.c
index 81ef6ad0cc..672afae4d4 100644
--- a/gtk/gtkdebugupdates.c
+++ b/gtk/gtkdebugupdates.c
@@ -180,7 +180,7 @@ gtk_window_manage_updates (GtkWidget *widget,
cairo_region_union (region, draw->region);
}
gtk_debug_updates_print (updates, region, "Queued update");
- gdk_window_invalidate_region (gtk_widget_get_window (widget), region, TRUE);
+ gdk_surface_invalidate_region (gtk_widget_get_surface (widget), region, TRUE);
cairo_region_destroy (region);
/* Then remove all outdated regions */
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 9e80abf97e..25e763f998 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -348,10 +348,10 @@ static NSWindow *
get_toplevel_nswindow (GtkWidget *widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
- GdkWindow *window = gtk_widget_get_window (toplevel);
+ GdkSurface *window = gtk_widget_get_surface (toplevel);
if (gtk_widget_is_toplevel (toplevel) && window)
- return [gdk_quartz_window_get_nsview (window) window];
+ return [gdk_quartz_surface_get_nsview (window) window];
else
return NULL;
}
@@ -633,11 +633,11 @@ gtk_drag_find_widget (GtkWidget *widget,
if (gtk_widget_get_parent (widget))
{
gint tx, ty;
- GdkWindow *window = gtk_widget_get_window (widget);
- GdkWindow *parent_window;
+ GdkSurface *window = gtk_widget_get_surface (widget);
+ GdkSurface *parent_window;
GtkAllocation allocation;
- parent_window = gtk_widget_get_window (gtk_widget_get_parent (widget));
+ parent_window = gtk_widget_get_surface (gtk_widget_get_parent (widget));
/* Compute the offset from allocation-relative to
* window-relative coordinates.
@@ -646,12 +646,12 @@ gtk_drag_find_widget (GtkWidget *widget,
allocation_to_window_x = allocation.x;
allocation_to_window_y = allocation.y;
- if (gtk_widget_get_has_window (widget))
+ if (gtk_widget_get_has_surface (widget))
{
/* The allocation is relative to the parent window for
* window widgets, not to widget->window.
*/
- gdk_window_get_position (window, &tx, &ty);
+ gdk_surface_get_position (window, &tx, &ty);
allocation_to_window_x -= tx;
allocation_to_window_y -= ty;
@@ -664,18 +664,18 @@ gtk_drag_find_widget (GtkWidget *widget,
{
GdkRectangle window_rect = { 0, 0, 0, 0 };
- window_rect.width = gdk_window_get_width (window);
- window_rect.height = gdk_window_get_height (window);
+ window_rect.width = gdk_surface_get_width (window);
+ window_rect.height = gdk_surface_get_height (window);
gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation);
- gdk_window_get_position (window, &tx, &ty);
+ gdk_surface_get_position (window, &tx, &ty);
new_allocation.x += tx;
x_offset += tx;
new_allocation.y += ty;
y_offset += ty;
- window = gdk_window_get_parent (window);
+ window = gdk_surface_get_parent (window);
}
if (!window) /* Window and widget heirarchies didn't match. */
@@ -930,7 +930,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
}
}
- gdk_window_get_position (gtk_widget_get_window (toplevel), &tx, &ty);
+ gdk_surface_get_position (gtk_widget_get_surface (toplevel), &tx, &ty);
data.x = event->dnd.x_root - tx;
data.y = event->dnd.y_root - ty;
@@ -1091,10 +1091,10 @@ gtk_drag_begin_idle (gpointer arg)
}
/* Fake protocol to let us call GdkNSView gdkWindow without including
* gdk/GdkNSView.h (which we can’t because it pulls in the internal-only
- * gdkwindow.h).
+ * gdksurface.h).
*/
@protocol GdkNSView
-- (GdkWindow *)gdkWindow;
+- (GdkSurface *)gdkWindow;
@end
GdkDragContext *
@@ -1109,7 +1109,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
{
GtkDragSourceInfo *info;
GdkDevice *pointer;
- GdkWindow *window;
+ GdkSurface *window;
GdkDragContext *context;
NSWindow *nswindow = get_toplevel_nswindow (widget);
NSPoint point = {0, 0};
@@ -1119,14 +1119,14 @@ gtk_drag_begin_internal (GtkWidget *widget,
if ((x != -1 && y != -1) || event)
{
- GdkWindow *window;
+ GdkSurface *window;
gdouble dx, dy;
if (x != -1 && y != -1)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
- window = gtk_widget_get_window (toplevel);
+ window = gtk_widget_get_surface (toplevel);
gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y);
- gdk_window_get_root_coords (gtk_widget_get_window (toplevel), x, y,
+ gdk_surface_get_root_coords (gtk_widget_get_surface (toplevel), x, y,
&x, &y);
dx = (gdouble)x;
dy = (gdouble)y;
@@ -1136,26 +1136,26 @@ gtk_drag_begin_internal (GtkWidget *widget,
if (gdk_event_get_coords (event, &dx, &dy))
{
/* We need to translate (x, y) to coordinates relative to the
- * toplevel GdkWindow, which should be the GdkWindow backing
+ * toplevel GdkSurface, which should be the GdkSurface backing
* nswindow. Then, we convert to the NSWindow coordinate system.
*/
- window = event->any.window;
- GdkWindow *toplevel = gdk_window_get_toplevel (window);
+ window = event->any.surface;
+ GdkSurface *toplevel = gdk_surface_get_toplevel (window);
while (window != toplevel)
{
double old_x = dx;
double old_y = dy;
- gdk_window_coords_to_parent (window, old_x, old_y,
+ gdk_surface_coords_to_parent (window, old_x, old_y,
&dx, &dy);
- window = gdk_window_get_parent (window);
+ window = gdk_surface_get_parent (window);
}
}
time = (double)gdk_event_get_time (event);
}
point.x = dx;
- point.y = gdk_window_get_height (window) - dy;
+ point.y = gdk_surface_get_height (window) - dy;
}
nstime = [[NSDate dateWithTimeIntervalSince1970: time / 1000] timeIntervalSinceReferenceDate];
@@ -1445,7 +1445,7 @@ gtk_drag_set_icon_name (GdkDragContext *context,
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
g_return_if_fail (icon_name != NULL);
- display = gdk_window_get_display (gdk_drag_context_get_source_window (context));
+ display = gdk_surface_get_display (gdk_drag_context_get_source_surface (context));
g_return_if_fail (display != NULL);
gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, &height);
@@ -1574,7 +1574,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
switch (event->type)
{
case GDK_DROP_FINISHED:
- result = (gdk_drag_context_get_dest_window (context) != NULL) ? GTK_DRAG_RESULT_SUCCESS : GTK_DRAG_RESULT_NO_TARGET;
+ result = (gdk_drag_context_get_dest_surface (context) != NULL) ? GTK_DRAG_RESULT_SUCCESS : GTK_DRAG_RESULT_NO_TARGET;
gtk_drag_drop_finished (info, result);
break;
default:
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index ffaf0847ff..05189ea9cc 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -326,7 +326,7 @@ gtk_drag_get_source_widget (GdkDragContext *context)
{
GtkWidget *widget = tmp_list->data;
- if (gtk_widget_get_window (widget) == gdk_drag_context_get_source_window (context))
+ if (gtk_widget_get_surface (widget) == gdk_drag_context_get_source_surface (context))
return widget;
tmp_list = tmp_list->next;
@@ -428,7 +428,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
case GDK_DRAG_MOTION:
case GDK_DROP_START:
{
- GdkWindow *window;
+ GdkSurface *window;
gint tx, ty;
double x_root, y_root;
gboolean found;
@@ -445,9 +445,9 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
}
}
- window = gtk_widget_get_window (toplevel);
+ window = gtk_widget_get_surface (toplevel);
- gdk_window_get_position (window, &tx, &ty);
+ gdk_surface_get_position (window, &tx, &ty);
gdk_event_get_root_coords (event, &x_root, &y_root);
found = gtk_drag_find_widget (toplevel,
@@ -501,7 +501,7 @@ gtk_drag_find_widget (GtkWidget *widget,
/* Get the widget at the pointer coordinates and travel up
* the widget hierarchy from there.
*/
- widget = _gtk_widget_find_at_coords (gtk_widget_get_window (widget),
+ widget = _gtk_widget_find_at_coords (gtk_widget_get_surface (widget),
x, y, &x, &y);
if (!widget)
return FALSE;
@@ -946,7 +946,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
toplevel = gtk_widget_get_toplevel (widget);
gtk_widget_translate_coordinates (widget, toplevel,
x, y, &x, &y);
- gdk_window_get_device_position (gtk_widget_get_window (toplevel),
+ gdk_surface_get_device_position (gtk_widget_get_surface (toplevel),
device,
&dx, &dy,
NULL);
@@ -958,7 +958,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
content->formats = gdk_content_formats_ref (target_list);
content->time = time;
- context = gdk_drag_begin (gtk_widget_get_window (toplevel), device, GDK_CONTENT_PROVIDER (content), actions, dx, dy);
+ context = gdk_drag_begin (gtk_widget_get_surface (toplevel), device, GDK_CONTENT_PROVIDER (content), actions, dx, dy);
if (context == NULL)
{
g_object_unref (content);
@@ -1109,13 +1109,13 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
display = gdk_drag_context_get_display (context);
info->icon_window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_WINDOW_TYPE_HINT_DND);
+ gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_SURFACE_TYPE_HINT_DND);
gtk_window_set_display (GTK_WINDOW (info->icon_window), display);
gtk_widget_set_size_request (info->icon_window, 24, 24);
gtk_style_context_remove_class (gtk_widget_get_style_context (info->icon_window), "background");
gtk_window_set_hardcoded_window (GTK_WINDOW (info->icon_window),
- gdk_drag_context_get_drag_window (context));
+ gdk_drag_context_get_drag_surface (context));
gtk_widget_show (info->icon_window);
}
diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c
index e9cf698e1a..ade77fb8db 100644
--- a/gtk/gtkdragdest.c
+++ b/gtk/gtkdragdest.c
@@ -37,7 +37,7 @@ gtk_drag_dest_realized (GtkWidget *widget)
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
if (gtk_widget_is_toplevel (toplevel))
- gdk_window_register_dnd (gtk_widget_get_window (toplevel));
+ gdk_surface_register_dnd (gtk_widget_get_surface (toplevel));
}
static void
@@ -47,7 +47,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
if (gtk_widget_is_toplevel (toplevel) && gtk_widget_get_realized (toplevel))
- gdk_window_register_dnd (gtk_widget_get_window (toplevel));
+ gdk_surface_register_dnd (gtk_widget_get_surface (toplevel));
}
static void
@@ -132,7 +132,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget,
* {
* GdkModifierType mask;
*
- * gdk_window_get_pointer (gtk_widget_get_window (widget),
+ * gdk_surface_get_pointer (gtk_widget_get_surface (widget),
* NULL, NULL, &mask);
* if (mask & GDK_CONTROL_MASK)
* gdk_drag_status (context, GDK_ACTION_COPY, time);
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index a42db6cb57..977e48e019 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -304,7 +304,7 @@ gtk_drawing_area_class_init (GtkDrawingAreaClass *class)
static void
gtk_drawing_area_init (GtkDrawingArea *darea)
{
- gtk_widget_set_has_window (GTK_WIDGET (darea), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (darea), FALSE);
}
/**
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 8cdac60e2c..b5832bc8c4 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2499,7 +2499,7 @@ gtk_entry_init (GtkEntry *entry)
gint i;
gtk_widget_set_can_focus (GTK_WIDGET (entry), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (entry), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (entry), FALSE);
priv->editable = TRUE;
priv->visible = TRUE;
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index a5e6aa68af..63e7bec3c8 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -568,7 +568,7 @@ gtk_entry_completion_constructed (GObject *object)
gtk_window_set_use_subsurface (GTK_WINDOW (priv->popup_window), TRUE);
gtk_window_set_resizable (GTK_WINDOW (priv->popup_window), FALSE);
gtk_window_set_type_hint (GTK_WINDOW(priv->popup_window),
- GDK_WINDOW_TYPE_HINT_COMBO);
+ GDK_SURFACE_TYPE_HINT_COMBO);
g_signal_connect (priv->popup_window, "event",
G_CALLBACK (gtk_entry_completion_popup_event),
@@ -1372,7 +1372,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle area;
- GdkWindow *window;
+ GdkSurface *window;
GtkRequisition popup_req;
GtkRequisition entry_req;
GtkRequisition tree_req;
@@ -1382,7 +1382,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
GtkTreeViewColumn *action_column;
gint action_height;
- window = gtk_widget_get_window (completion->priv->entry);
+ window = gtk_widget_get_surface (completion->priv->entry);
if (!window)
return;
@@ -1390,11 +1390,11 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
if (!completion->priv->filter_model)
return;
- gtk_widget_get_window_allocation (completion->priv->entry, &allocation);
+ gtk_widget_get_surface_allocation (completion->priv->entry, &allocation);
gtk_widget_get_preferred_size (completion->priv->entry,
&entry_req, NULL);
- gdk_window_get_origin (window, &x, &y);
+ gdk_surface_get_origin (window, &x, &y);
x += allocation.x;
y += allocation.y + (allocation.height - entry_req.height) / 2;
@@ -1415,7 +1415,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
gtk_widget_realize (completion->priv->tree_view);
display = gtk_widget_get_display (GTK_WIDGET (completion->priv->entry));
- monitor = gdk_display_get_monitor_at_window (display, window);
+ monitor = gdk_display_get_monitor_at_surface (display, window);
gdk_monitor_get_workarea (monitor, &area);
if (height == 0)
@@ -1478,7 +1478,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
static void
prepare_popup_func (GdkSeat *seat,
- GdkWindow *window,
+ GdkSurface *window,
gpointer user_data)
{
GtkEntryCompletion *completion = user_data;
@@ -1533,7 +1533,7 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
{
gtk_grab_add (completion->priv->popup_window);
gdk_seat_grab (gdk_device_get_seat (completion->priv->device),
- gtk_widget_get_window (completion->priv->popup_window),
+ gtk_widget_get_surface (completion->priv->popup_window),
GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH,
TRUE, NULL, NULL,
prepare_popup_func, completion);
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index e27bfab98f..e2f47c44e3 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -341,7 +341,7 @@ gtk_expander_init (GtkExpander *expander)
expander->priv = priv = gtk_expander_get_instance_private (expander);
gtk_widget_set_can_focus (GTK_WIDGET (expander), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (expander), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (expander), FALSE);
priv->label_widget = NULL;
priv->child = NULL;
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 706ab3c2a5..7900b07969 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -466,7 +466,7 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
GtkWidget *icon;
GdkContentFormats *target_list;
- gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE);
priv = button->priv = gtk_file_chooser_button_get_instance_private (button);
diff --git a/gtk/gtkfilechoosernativequartz.c b/gtk/gtkfilechoosernativequartz.c
index 65f2579b90..08c7a74d2c 100644
--- a/gtk/gtkfilechoosernativequartz.c
+++ b/gtk/gtkfilechoosernativequartz.c
@@ -529,7 +529,7 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self)
if (transient_for)
{
gtk_widget_realize (GTK_WIDGET (transient_for));
- data->parent = gdk_quartz_window_get_nswindow (gtk_widget_get_window (GTK_WIDGET (transient_for)));
+ data->parent = gdk_quartz_surface_get_nswindow (gtk_widget_get_surface (GTK_WIDGET (transient_for)));
if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self)))
data->modal = TRUE;
diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c
index cb9c42ef4d..c0635d2d0c 100644
--- a/gtk/gtkfilechoosernativewin32.c
+++ b/gtk/gtkfilechoosernativewin32.c
@@ -789,7 +789,7 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self)
if (transient_for)
{
gtk_widget_realize (GTK_WIDGET (transient_for));
- data->parent = gdk_win32_window_get_handle (gtk_widget_get_window (GTK_WIDGET (transient_for)));
+ data->parent = gdk_win32_surface_get_handle (gtk_widget_get_surface (GTK_WIDGET (transient_for)));
if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self)))
data->modal = TRUE;
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index b23f1dbf00..575a68e79a 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -8506,7 +8506,7 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl)
impl->priv = gtk_file_chooser_widget_get_instance_private (impl);
priv = impl->priv;
- gtk_widget_set_has_window (GTK_WIDGET (impl), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (impl), FALSE);
priv->local_only = FALSE;
priv->preview_widget_active = TRUE;
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index a54ee0e2d9..e22a2d2fa0 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -176,7 +176,7 @@ gtk_fixed_init (GtkFixed *fixed)
fixed->priv->children = NULL;
- gtk_widget_set_has_window (GTK_WIDGET (fixed), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (fixed), FALSE);
}
/**
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index d95aaff98e..83fab0146f 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -3734,7 +3734,7 @@ gtk_flow_box_init (GtkFlowBox *box)
{
GtkFlowBoxPrivate *priv = BOX_PRIV (box);
- gtk_widget_set_has_window (GTK_WIDGET (box), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->selection_mode = GTK_SELECTION_SINGLE;
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 4a6dcba0dc..480da183ed 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -578,7 +578,7 @@ gtk_font_button_init (GtkFontButton *font_button)
font_button->priv = gtk_font_button_get_instance_private (font_button);
priv = font_button->priv;
- gtk_widget_set_has_window (GTK_WIDGET (font_button), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (font_button), FALSE);
priv->button = gtk_button_new ();
g_signal_connect (priv->button, "clicked", G_CALLBACK (gtk_font_button_clicked), font_button);
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 3ab05f3d9d..f34e187447 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -825,7 +825,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
fontchooser->priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
priv = fontchooser->priv;
- gtk_widget_set_has_window (GTK_WIDGET (fontchooser), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (fontchooser), FALSE);
gtk_widget_init_template (GTK_WIDGET (fontchooser));
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 4cabe4a242..48e36aca71 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -109,7 +109,7 @@
* On the platforms that support it, #GtkGesture will handle transparently
* touchpad gesture events. The only precautions users of #GtkGesture should do
* to enable this support are:
- * - Enabling %GDK_TOUCHPAD_GESTURE_MASK on their #GdkWindows
+ * - Enabling %GDK_TOUCHPAD_GESTURE_MASK on their #GdkSurfaces
* - If the gesture has %GTK_PHASE_NONE, ensuring events of type
* %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the #GtkGesture
*/
@@ -600,20 +600,20 @@ _gtk_gesture_cancel_all (GtkGesture *gesture)
static gboolean
gesture_within_window (GtkGesture *gesture,
- GdkWindow *parent)
+ GdkSurface *parent)
{
- GdkWindow *window;
+ GdkSurface *window;
GtkWidget *widget;
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
while (window)
{
if (window == parent)
return TRUE;
- window = gdk_window_get_parent (window);
+ window = gdk_surface_get_parent (window);
}
return FALSE;
@@ -740,10 +740,10 @@ gtk_gesture_handle_event (GtkEventController *controller,
}
else if (event_type == GDK_GRAB_BROKEN)
{
- GdkWindow *window = NULL;
+ GdkSurface *surface = NULL;
- gdk_event_get_grab_window (event, &window);
- if (!window || !gesture_within_window (gesture, window))
+ gdk_event_get_grab_surface (event, &surface);
+ if (!surface || !gesture_within_window (gesture, surface))
_gtk_gesture_cancel_all (gesture);
return FALSE;
diff --git a/gtk/gtkgizmo.c b/gtk/gtkgizmo.c
index 69544c7abb..b0b921f536 100644
--- a/gtk/gtkgizmo.c
+++ b/gtk/gtkgizmo.c
@@ -84,7 +84,7 @@ gtk_gizmo_class_init (GtkGizmoClass *klass)
static void
gtk_gizmo_init (GtkGizmo *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
}
GtkWidget *
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 85b3cb9906..bbe935f2a7 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -312,7 +312,7 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
GError *error = NULL;
GdkGLContext *context;
- context = gdk_window_create_gl_context (gtk_widget_get_window (widget), &error);
+ context = gdk_surface_create_gl_context (gtk_widget_get_surface (widget), &error);
if (error != NULL)
{
gtk_gl_area_set_error (area, error);
@@ -958,7 +958,7 @@ gtk_gl_area_init (GtkGLArea *area)
{
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
- gtk_widget_set_has_window (GTK_WIDGET (area), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (area), FALSE);
priv->auto_render = TRUE;
priv->needs_render = TRUE;
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 3419756f91..65dd19b475 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -1699,7 +1699,7 @@ gtk_grid_init (GtkGrid *grid)
{
GtkGridPrivate *priv = gtk_grid_get_instance_private (grid);
- gtk_widget_set_has_window (GTK_WIDGET (grid), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (grid), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->baseline_row = 0;
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index a919fc8235..8f66a80b87 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -94,7 +94,7 @@ struct _GtkHeaderBarPrivate
GtkWidget *titlebar_icon;
- GdkWindowState state;
+ GdkSurfaceState state;
guint shows_app_menu : 1;
};
@@ -326,7 +326,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
is_sovereign_window = (!gtk_window_get_modal (window) &&
gtk_window_get_transient_for (window) == NULL &&
- gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL);
+ gtk_window_get_type_hint (window) == GDK_SURFACE_TYPE_HINT_NORMAL);
tokens = g_strsplit (layout_desc, ":", 2);
if (tokens)
@@ -1764,7 +1764,7 @@ gtk_header_bar_set_child_property (GtkContainer *container,
}
}
-static void window_state_changed (GtkWidget *widget);
+static void surface_state_changed (GtkWidget *widget);
static void
gtk_header_bar_realize (GtkWidget *widget)
@@ -1778,8 +1778,8 @@ gtk_header_bar_realize (GtkWidget *widget)
G_CALLBACK (_gtk_header_bar_update_window_buttons), widget);
g_signal_connect_swapped (settings, "notify::gtk-decoration-layout",
G_CALLBACK (_gtk_header_bar_update_window_buttons), widget);
- g_signal_connect_swapped (_gtk_widget_get_window (widget), "notify::state",
- G_CALLBACK (window_state_changed), widget);
+ g_signal_connect_swapped (_gtk_widget_get_surface (widget), "notify::state",
+ G_CALLBACK (surface_state_changed), widget);
_gtk_header_bar_update_window_buttons (GTK_HEADER_BAR (widget));
}
@@ -1791,29 +1791,29 @@ gtk_header_bar_unrealize (GtkWidget *widget)
settings = gtk_widget_get_settings (widget);
g_signal_handlers_disconnect_by_func (settings, _gtk_header_bar_update_window_buttons, widget);
- g_signal_handlers_disconnect_by_func (_gtk_widget_get_window (widget), window_state_changed, widget);
+ g_signal_handlers_disconnect_by_func (_gtk_widget_get_surface (widget), surface_state_changed, widget);
GTK_WIDGET_CLASS (gtk_header_bar_parent_class)->unrealize (widget);
}
static void
-window_state_changed (GtkWidget *widget)
+surface_state_changed (GtkWidget *widget)
{
GtkHeaderBar *bar = GTK_HEADER_BAR (widget);
GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (bar);
- GdkWindowState changed, new_state;
+ GdkSurfaceState changed, new_state;
- new_state = gdk_window_get_state (_gtk_widget_get_window (widget));
+ new_state = gdk_surface_get_state (_gtk_widget_get_surface (widget));
changed = new_state ^ priv->state;
priv->state = new_state;
- if (changed & (GDK_WINDOW_STATE_FULLSCREEN |
- GDK_WINDOW_STATE_MAXIMIZED |
- GDK_WINDOW_STATE_TILED |
- GDK_WINDOW_STATE_TOP_TILED |
- GDK_WINDOW_STATE_RIGHT_TILED |
- GDK_WINDOW_STATE_BOTTOM_TILED |
- GDK_WINDOW_STATE_LEFT_TILED))
+ if (changed & (GDK_SURFACE_STATE_FULLSCREEN |
+ GDK_SURFACE_STATE_MAXIMIZED |
+ GDK_SURFACE_STATE_TILED |
+ GDK_SURFACE_STATE_TOP_TILED |
+ GDK_SURFACE_STATE_RIGHT_TILED |
+ GDK_SURFACE_STATE_BOTTOM_TILED |
+ GDK_SURFACE_STATE_LEFT_TILED))
_gtk_header_bar_update_window_buttons (bar);
}
@@ -1977,7 +1977,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
priv = gtk_header_bar_get_instance_private (bar);
- gtk_widget_set_has_window (GTK_WIDGET (bar), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (bar), FALSE);
priv->title = NULL;
priv->subtitle = NULL;
@@ -1988,7 +1988,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
priv->decoration_layout = NULL;
priv->decoration_layout_set = FALSE;
priv->shows_app_menu = FALSE;
- priv->state = GDK_WINDOW_STATE_WITHDRAWN;
+ priv->state = GDK_SURFACE_STATE_WITHDRAWN;
init_sizing_box (bar);
construct_label_box (bar);
diff --git a/gtk/gtkicon.c b/gtk/gtkicon.c
index 2611230060..b6225fe0e9 100644
--- a/gtk/gtkicon.c
+++ b/gtk/gtkicon.c
@@ -87,7 +87,7 @@ gtk_icon_class_init (GtkIconClass *klass)
static void
gtk_icon_init (GtkIcon *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->image = GTK_CSS_IMAGE_BUILTIN_NONE;
}
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 7df1100973..0faca7d72c 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -1947,7 +1947,7 @@ choose_icon (GtkIconTheme *icon_theme,
*
* When rendering on displays with high pixel densities you should not
* use a @size multiplied by the scaling factor returned by functions
- * like gdk_window_get_scale_factor(). Instead, you should use
+ * like gdk_surface_get_scale_factor(). Instead, you should use
* gtk_icon_theme_lookup_icon_for_scale(), as the assets loaded
* for a given scaling factor may be different.
*
@@ -4832,7 +4832,7 @@ gtk_icon_info_load_symbolic_for_context_finish (GtkIconInfo *icon_info,
*
* When rendering on displays with high pixel densities you should not
* use a @size multiplied by the scaling factor returned by functions
- * like gdk_window_get_scale_factor(). Instead, you should use
+ * like gdk_surface_get_scale_factor(). Instead, you should use
* gtk_icon_theme_lookup_by_gicon_for_scale(), as the assets loaded
* for a given scaling factor may be different.
*
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index b0d5ae756d..e90e68b8a7 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -925,7 +925,7 @@ gtk_icon_view_init (GtkIconView *icon_view)
icon_view->priv->mouse_x = -1;
icon_view->priv->mouse_y = -1;
- gtk_widget_set_has_window (GTK_WIDGET (icon_view), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (icon_view), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE);
icon_view->priv->item_orientation = GTK_ORIENTATION_VERTICAL;
@@ -6719,7 +6719,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
item->cell_area.height + icon_view->priv->item_padding * 2
};
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (icon_view)),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (GTK_WIDGET (icon_view)),
CAIRO_CONTENT_COLOR_ALPHA,
rect.width,
rect.height);
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 863f88aebd..5c008e2785 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -296,7 +296,7 @@ gtk_image_init (GtkImage *image)
GtkCssNode *widget_node;
widget_node = gtk_widget_get_css_node (GTK_WIDGET (image));
- gtk_widget_set_has_window (GTK_WIDGET (image), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (image), FALSE);
priv->icon_helper = gtk_icon_helper_new (widget_node, GTK_WIDGET (image));
priv->keep_aspect_ratio = TRUE;
diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c
index 146cc129db..792477a468 100644
--- a/gtk/gtkimcontextime.c
+++ b/gtk/gtkimcontextime.c
@@ -119,7 +119,7 @@ static GdkFilterReturn
gtk_im_context_ime_message_filter (GdkXEvent *xevent,
GdkEvent *event,
gpointer data);
-static void get_window_position (GdkWindow *win,
+static void get_window_position (GdkSurface *win,
gint *x,
gint *y);
static void cb_client_widget_hierarchy_changed (GtkWidget *widget,
@@ -261,19 +261,19 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context,
{
GtkIMContextIME *context_ime;
GtkWidget *toplevel;
- GdkWindow *client_window;
+ GdkSurface *client_window;
g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context));
context_ime = GTK_IM_CONTEXT_IME (context);
toplevel = gtk_widget_get_toplevel (widget);
- client_window = gtk_widget_get_window (toplevel);
+ client_window = gtk_widget_get_surface (toplevel);
if (client_window)
{
HIMC himc;
HWND hwnd;
- hwnd = gdk_win32_window_get_impl_hwnd (client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (client_window);
himc = ImmGetContext (hwnd);
if (himc)
{
@@ -377,7 +377,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
if (!context_ime->focus)
return FALSE;
- if (!GDK_IS_WINDOW (context_ime->client_window))
+ if (!GDK_IS_SURFACE (context_ime->client_window))
return FALSE;
gdk_event_get_keyval ((GdkEvent *) event, &keyval);
@@ -430,7 +430,7 @@ gtk_im_context_ime_reset (GtkIMContext *context)
if (!context_ime->client_window)
return;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
@@ -461,7 +461,7 @@ get_utf8_preedit_string (GtkIMContextIME *context_ime, gint *pos_ret)
if (!context_ime->client_window)
return g_strdup ("");
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return g_strdup ("");
@@ -522,7 +522,7 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const gchar *utf8str)
if (!context_ime->client_window)
return attrs;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return attrs;
@@ -649,26 +649,26 @@ static void
gtk_im_context_ime_focus_in (GtkIMContext *context)
{
GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context);
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
GtkWidget *widget = NULL;
HWND hwnd;
HIMC himc;
- if (!GDK_IS_WINDOW (context_ime->client_window))
+ if (!GDK_IS_SURFACE (context_ime->client_window))
return;
/* swtich current context */
context_ime->focus = TRUE;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
- toplevel = gdk_window_get_toplevel (context_ime->client_window);
- if (GDK_IS_WINDOW (toplevel))
+ toplevel = gdk_surface_get_toplevel (context_ime->client_window);
+ if (GDK_IS_SURFACE (toplevel))
{
- gdk_window_add_filter (toplevel,
+ gdk_surface_add_filter (toplevel,
gtk_im_context_ime_message_filter, context_ime);
context_ime->toplevel = toplevel;
}
@@ -680,7 +680,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context)
}
/* trace reparenting (probably no need) */
- gdk_window_get_user_data (context_ime->client_window, (gpointer) & widget);
+ gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget);
if (GTK_IS_WIDGET (widget))
{
g_signal_connect (widget, "hierarchy-changed",
@@ -720,18 +720,18 @@ static void
gtk_im_context_ime_focus_out (GtkIMContext *context)
{
GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context);
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
GtkWidget *widget = NULL;
HWND hwnd;
HIMC himc;
- if (!GDK_IS_WINDOW (context_ime->client_window))
+ if (!GDK_IS_SURFACE (context_ime->client_window))
return;
/* swtich current context */
context_ime->focus = FALSE;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
@@ -778,7 +778,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context)
}
/* remove signal handler */
- gdk_window_get_user_data (context_ime->client_window, (gpointer) & widget);
+ gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget);
if (GTK_IS_WIDGET (widget))
{
g_signal_handlers_disconnect_by_func
@@ -787,10 +787,10 @@ gtk_im_context_ime_focus_out (GtkIMContext *context)
}
/* remove event fileter */
- toplevel = gdk_window_get_toplevel (context_ime->client_window);
- if (GDK_IS_WINDOW (toplevel))
+ toplevel = gdk_surface_get_toplevel (context_ime->client_window);
+ if (GDK_IS_SURFACE (toplevel))
{
- gdk_window_remove_filter (toplevel,
+ gdk_surface_remove_filter (toplevel,
gtk_im_context_ime_message_filter,
context_ime);
context_ime->toplevel = NULL;
@@ -825,7 +825,7 @@ gtk_im_context_ime_set_cursor_location (GtkIMContext *context,
if (!context_ime->client_window)
return;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
@@ -855,7 +855,7 @@ gtk_im_context_ime_set_use_preedit (GtkIMContext *context,
HWND hwnd;
HIMC himc;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
@@ -889,11 +889,11 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
if (!context_ime->client_window)
return;
- gdk_window_get_user_data (context_ime->client_window, (gpointer) &widget);
+ gdk_surface_get_user_data (context_ime->client_window, (gpointer) &widget);
if (!GTK_IS_WIDGET (widget))
return;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return;
@@ -1009,7 +1009,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent,
if (!context_ime->focus)
return retval;
- hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window);
+ hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
return retval;
@@ -1029,7 +1029,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent,
RECT rc;
hwnd_top =
- gdk_win32_window_get_impl_hwnd (gdk_window_get_toplevel
+ gdk_win32_surface_get_impl_hwnd (gdk_surface_get_toplevel
(context_ime->client_window));
GetWindowRect (hwnd_top, &rc);
pt.x = wx;
@@ -1127,19 +1127,19 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent,
* x and y must be initialized to 0.
*/
static void
-get_window_position (GdkWindow *win, gint *x, gint *y)
+get_window_position (GdkSurface *win, gint *x, gint *y)
{
- GdkWindow *parent, *toplevel;
+ GdkSurface *parent, *toplevel;
gint wx, wy;
- g_return_if_fail (GDK_IS_WINDOW (win));
+ g_return_if_fail (GDK_IS_SURFACE (win));
g_return_if_fail (x && y);
- gdk_window_get_position (win, &wx, &wy);
+ gdk_surface_get_position (win, &wx, &wy);
*x += wx;
*y += wy;
- parent = gdk_window_get_parent (win);
- toplevel = gdk_window_get_toplevel (win);
+ parent = gdk_surface_get_parent (win);
+ toplevel = gdk_surface_get_toplevel (win);
if (parent && parent != toplevel)
get_window_position (parent, x, y);
@@ -1154,7 +1154,7 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget,
GtkWidget *widget2,
GtkIMContextIME *context_ime)
{
- GdkWindow *new_toplevel;
+ GdkSurface *new_toplevel;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context_ime));
@@ -1164,14 +1164,14 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget,
if (!context_ime->focus)
return;
- new_toplevel = gdk_window_get_toplevel (context_ime->client_window);
+ new_toplevel = gdk_surface_get_toplevel (context_ime->client_window);
if (context_ime->toplevel == new_toplevel)
return;
/* remove filter from old toplevel */
- if (GDK_IS_WINDOW (context_ime->toplevel))
+ if (GDK_IS_SURFACE (context_ime->toplevel))
{
- gdk_window_remove_filter (context_ime->toplevel,
+ gdk_surface_remove_filter (context_ime->toplevel,
gtk_im_context_ime_message_filter,
context_ime);
}
@@ -1180,9 +1180,9 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget,
}
/* add filter to new toplevel */
- if (GDK_IS_WINDOW (new_toplevel))
+ if (GDK_IS_SURFACE (new_toplevel))
{
- gdk_window_add_filter (new_toplevel,
+ gdk_surface_add_filter (new_toplevel,
gtk_im_context_ime_message_filter, context_ime);
}
else
diff --git a/gtk/gtkimcontextime.h b/gtk/gtkimcontextime.h
index 6bb036558f..4fe5b9e141 100644
--- a/gtk/gtkimcontextime.h
+++ b/gtk/gtkimcontextime.h
@@ -36,8 +36,8 @@ struct _GtkIMContextIME
{
GtkIMContext object;
- GdkWindow *client_window;
- GdkWindow *toplevel;
+ GdkSurface *client_window;
+ GdkSurface *toplevel;
guint use_preedit : 1;
guint preediting : 1;
guint opened : 1;
diff --git a/gtk/gtkimcontextquartz.c b/gtk/gtkimcontextquartz.c
index 14637de186..6bc7821d87 100644
--- a/gtk/gtkimcontextquartz.c
+++ b/gtk/gtkimcontextquartz.c
@@ -37,7 +37,7 @@ typedef struct _GtkIMContextQuartz
{
GtkIMContext parent;
GtkIMContext *slave;
- GdkWindow *client_window;
+ GdkSurface *client_window;
gchar *preedit_str;
unsigned int cursor_index;
unsigned int selected_len;
@@ -110,7 +110,7 @@ quartz_get_preedit_string (GtkIMContext *context,
static gboolean
output_result (GtkIMContext *context,
- GdkWindow *win)
+ GdkSurface *win)
{
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
gboolean retval = FALSE;
@@ -168,15 +168,15 @@ quartz_filter_keypress (GtkIMContext *context,
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
gboolean retval;
NSView *nsview;
- GdkWindow *win;
+ GdkSurface *win;
GTK_NOTE (MISC, g_print ("quartz_filter_keypress\n"));
- if (!GDK_IS_QUARTZ_WINDOW (qc->client_window))
+ if (!GDK_IS_QUARTZ_SURFACE (qc->client_window))
return FALSE;
- nsview = gdk_quartz_window_get_nsview (qc->client_window);
- win = (GdkWindow *)[ (GdkQuartzView *)nsview gdkWindow];
+ nsview = gdk_quartz_surface_get_nsview (qc->client_window);
+ win = (GdkSurface *)[ (GdkQuartzView *)nsview gdkWindow];
GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n",
qc->client_window, win, nsview));
@@ -224,10 +224,10 @@ discard_preedit (GtkIMContext *context)
if (!qc->client_window)
return;
- if (!GDK_IS_QUARTZ_WINDOW (qc->client_window))
+ if (!GDK_IS_QUARTZ_SURFACE (qc->client_window))
return;
- NSView *nsview = gdk_quartz_window_get_nsview (qc->client_window);
+ NSView *nsview = gdk_quartz_surface_get_nsview (qc->client_window);
if (!nsview)
return;
@@ -260,7 +260,7 @@ quartz_set_client_window (GtkIMContext *context, GtkWidget *widget)
GTK_NOTE (MISC, g_print ("quartz_set_client_window: %p\n", widget));
- qc->client_window = gtk_widget_get_parent_window (widget);
+ qc->client_window = gtk_widget_get_parent_surface (widget);
}
static void
@@ -290,7 +290,7 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area)
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
gint x, y;
NSView *nsview;
- GdkWindow *win;
+ GdkSurface *win;
GTK_NOTE (MISC, g_print ("quartz_set_cursor_location\n"));
@@ -305,16 +305,16 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area)
qc->cursor_rect->width = area->width;
qc->cursor_rect->height = area->height;
- gdk_window_get_origin (qc->client_window, &x, &y);
+ gdk_surface_get_origin (qc->client_window, &x, &y);
qc->cursor_rect->x = area->x + x;
qc->cursor_rect->y = area->y + y;
- if (!GDK_IS_QUARTZ_WINDOW (qc->client_window))
+ if (!GDK_IS_QUARTZ_SURFACE (qc->client_window))
return;
- nsview = gdk_quartz_window_get_nsview (qc->client_window);
- win = (GdkWindow *)[ (GdkQuartzView*)nsview gdkWindow];
+ nsview = gdk_quartz_surface_get_nsview (qc->client_window);
+ win = (GdkSurface *)[ (GdkQuartzView*)nsview gdkWindow];
g_object_set_data (G_OBJECT (win), GIC_CURSOR_RECT, qc->cursor_rect);
}
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 3995b002c6..134e7e3083 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -1022,9 +1022,9 @@ check_emoji (GtkIMContextSimple *context_simple,
}
static void
-beep_window (GdkWindow *window)
+beep_window (GdkSurface *window)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (window);
gboolean beep;
g_object_get (gtk_settings_get_for_display (display),
@@ -1032,7 +1032,7 @@ beep_window (GdkWindow *window)
NULL);
if (beep)
- gdk_window_beep (window);
+ gdk_surface_beep (window);
}
static gboolean
@@ -1074,7 +1074,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
priv->compose_buffer[0] = 0;
if (n_compose > 1) /* Invalid sequence */
{
- beep_window (gdk_event_get_window ((GdkEvent *) event));
+ beep_window (gdk_event_get_surface ((GdkEvent *) event));
return TRUE;
}
@@ -1102,8 +1102,8 @@ is_hex_keyval (guint keyval)
static guint
canonical_hex_keyval (GdkEventKey *event)
{
- GdkWindow *window = gdk_event_get_window ((GdkEvent *) event);
- GdkKeymap *keymap = gdk_display_get_keymap (gdk_window_get_display (window));
+ GdkSurface *window = gdk_event_get_surface ((GdkEvent *) event);
+ GdkKeymap *keymap = gdk_display_get_keymap (gdk_surface_get_display (window));
guint keyval, event_keyval;
guint *keyvals = NULL;
gint n_vals = 0;
@@ -1162,8 +1162,8 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
{
GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context);
GtkIMContextSimplePrivate *priv = context_simple->priv;
- GdkWindow *window = gdk_event_get_window ((GdkEvent *) event);
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkSurface *window = gdk_event_get_surface ((GdkEvent *) event);
+ GdkDisplay *display = gdk_surface_get_display (window);
GdkKeymap *keymap = gdk_display_get_keymap (display);
GSList *tmp_list;
int n_compose = 0;
diff --git a/gtk/gtkimcontextxim.c b/gtk/gtkimcontextxim.c
index 23c4f0f7b3..815229ee4f 100644
--- a/gtk/gtkimcontextxim.c
+++ b/gtk/gtkimcontextxim.c
@@ -37,7 +37,7 @@ struct _GtkIMContextXIM
gchar *locale;
gchar *mb_charset;
- GdkWindow *client_window;
+ GdkSurface *client_window;
Window client_window_xid;
GtkWidget *client_widget;
@@ -123,7 +123,7 @@ static void gtk_im_context_xim_get_preedit_string (GtkIMContext *co
static void reinitialize_ic (GtkIMContextXIM *context_xim);
static void set_ic_client_window (GtkIMContextXIM *context_xim,
- GdkWindow *client_window);
+ GdkSurface *client_window);
static void setup_styles (GtkXIMInfo *info);
@@ -397,12 +397,12 @@ xim_destroy_callback (XIM xim,
}
static GtkXIMInfo *
-get_im (GdkWindow *client_window,
+get_im (GdkSurface *client_window,
const char *locale)
{
GSList *tmp_list;
GtkXIMInfo *info;
- GdkDisplay *display = gdk_window_get_display (client_window);
+ GdkDisplay *display = gdk_surface_get_display (client_window);
info = NULL;
tmp_list = open_ims;
@@ -546,7 +546,7 @@ reinitialize_ic (GtkIMContextXIM *context_xim)
static void
set_ic_client_window (GtkIMContextXIM *context_xim,
- GdkWindow *client_window)
+ GdkSurface *client_window)
{
reinitialize_ic (context_xim);
if (context_xim->client_window)
@@ -560,16 +560,16 @@ set_ic_client_window (GtkIMContextXIM *context_xim,
if (context_xim->client_window)
{
- GdkWindow *native;
+ GdkSurface *native;
context_xim->im_info = get_im (context_xim->client_window, context_xim->locale);
context_xim->im_info->ics = g_slist_prepend (context_xim->im_info->ics, context_xim);
- for (native = client_window; native; native = gdk_window_get_parent (native))
+ for (native = client_window; native; native = gdk_surface_get_parent (native))
{
- if (gdk_window_has_native (native))
+ if (gdk_surface_has_native (native))
{
- context_xim->client_window_xid = gdk_x11_window_get_xid (native);
+ context_xim->client_window_xid = gdk_x11_surface_get_xid (native);
break;
}
}
@@ -583,12 +583,12 @@ gtk_im_context_xim_set_client_widget (GtkIMContext *context,
GtkWidget *widget)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
- GdkWindow *window = NULL;
+ GdkSurface *surface = NULL;
if (widget != NULL)
- window = gtk_widget_get_window (gtk_widget_get_toplevel (widget));
+ surface = gtk_widget_get_surface (gtk_widget_get_toplevel (widget));
- set_ic_client_window (context_xim, window);
+ set_ic_client_window (context_xim, surface);
}
static char *
@@ -628,7 +628,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
KeySym keysym;
Status status;
gboolean result = FALSE;
- GdkWindow *window;
+ GdkSurface *window;
XKeyPressedEvent xevent;
GdkEventType event_type;
guint state;
@@ -641,14 +641,14 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
if (event_type == GDK_KEY_RELEASE && !context_xim->filter_key_release)
return FALSE;
- window = gdk_window_get_toplevel (gdk_event_get_window ((GdkEvent *) event));
+ window = gdk_surface_get_toplevel (gdk_event_get_surface ((GdkEvent *) event));
xevent.type = (event_type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
xevent.serial = 0; /* hope it doesn't matter */
xevent.send_event = gdk_event_is_sent ((GdkEvent *)event);
- xevent.display = GDK_WINDOW_XDISPLAY (window);
- xevent.window = GDK_WINDOW_XID (window);
- xevent.root = DefaultRootWindow(GDK_WINDOW_XDISPLAY (window));
+ xevent.display = GDK_SURFACE_XDISPLAY (window);
+ xevent.window = GDK_SURFACE_XID (window);
+ xevent.root = DefaultRootWindow(GDK_SURFACE_XDISPLAY (window));
xevent.subwindow = xevent.window;
xevent.time = gdk_event_get_time ((GdkEvent *) event);
xevent.x = xevent.x_root = 0;
@@ -1426,11 +1426,11 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim)
* For B) we basically have to depend on our callers
* calling ::focus-in and ::focus-out at the right time.
*
- * The toplevel is computed by walking up the GdkWindow
+ * The toplevel is computed by walking up the GdkSurface
* hierarchy from context->client_window until we find a
* window that is owned by some widget, and then calling
* gtk_widget_get_toplevel() on that widget. This should
- * handle both cases where we might have GdkWindows without widgets,
+ * handle both cases where we might have GdkSurfaces without widgets,
* and cases where GtkWidgets have strange window hierarchies
* (like a torn off GtkHandleBox.)
*
@@ -1531,16 +1531,16 @@ on_client_widget_hierarchy_changed (GtkWidget *widget,
* widget owning the nearest parent that has a widget.
*/
static GtkWidget *
-widget_for_window (GdkWindow *window)
+widget_for_window (GdkSurface *window)
{
while (window)
{
gpointer user_data;
- gdk_window_get_user_data (window, &user_data);
+ gdk_surface_get_user_data (window, &user_data);
if (user_data)
return user_data;
- window = gdk_window_get_parent (window);
+ window = gdk_surface_get_parent (window);
}
return NULL;
@@ -1613,9 +1613,9 @@ on_status_toplevel_configure (GtkWidget *toplevel,
if (status_window->window)
{
- height = DisplayHeight(GDK_WINDOW_XDISPLAY (gtk_widget_get_window (toplevel)), 0);
+ height = DisplayHeight(GDK_SURFACE_XDISPLAY (gtk_widget_get_surface (toplevel)), 0);
- gdk_window_get_frame_extents (gtk_widget_get_window (toplevel), &rect);
+ gdk_surface_get_frame_extents (gtk_widget_get_surface (toplevel), &rect);
gtk_widget_get_preferred_size ( (status_window->window), &requisition, NULL);
if (rect.y + rect.height + requisition.height < height)
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index 83f7a177ab..c68ece9e94 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -363,7 +363,7 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context,
GdkDisplay *display;
GdkModifierType no_text_input_mask;
- display = gdk_window_get_display (gdk_event_get_window ((GdkEvent *) event));
+ display = gdk_surface_get_display (gdk_event_get_surface ((GdkEvent *) event));
no_text_input_mask =
gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display),
diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c
index d2aec30cff..8bff84442c 100644
--- a/gtk/gtkinvisible.c
+++ b/gtk/gtkinvisible.c
@@ -106,7 +106,7 @@ gtk_invisible_init (GtkInvisible *invisible)
invisible->priv = gtk_invisible_get_instance_private (invisible);
priv = invisible->priv;
- gtk_widget_set_has_window (GTK_WIDGET (invisible), TRUE);
+ gtk_widget_set_has_surface (GTK_WIDGET (invisible), TRUE);
_gtk_widget_set_is_toplevel (GTK_WIDGET (invisible), TRUE);
g_object_ref_sink (invisible);
@@ -220,13 +220,13 @@ gtk_invisible_get_display (GtkInvisible *invisible)
static void
gtk_invisible_realize (GtkWidget *widget)
{
- GdkWindow *window;
+ GdkSurface *window;
gtk_widget_set_realized (widget, TRUE);
- window = gdk_window_new_temp (gtk_widget_get_display (widget));
- gtk_widget_set_window (widget, window);
- gtk_widget_register_window (widget, window);
+ window = gdk_surface_new_temp (gtk_widget_get_display (widget));
+ gtk_widget_set_surface (widget, window);
+ gtk_widget_register_surface (widget, window);
}
static void
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index ba41f68f81..951f392060 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1273,7 +1273,7 @@ gtk_label_init (GtkLabel *label)
{
GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
- gtk_widget_set_has_window (GTK_WIDGET (label), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (label), FALSE);
priv->width_chars = -1;
priv->max_width_chars = -1;
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index c7fe6c20b2..24e8a02826 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -694,7 +694,7 @@ gtk_layout_init (GtkLayout *layout)
{
GtkLayoutPrivate *priv;
- gtk_widget_set_has_window (GTK_WIDGET (layout), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (layout), FALSE);
layout->priv = gtk_layout_get_instance_private (layout);
priv = layout->priv;
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 251d48808c..d7fbfbe3af 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -1085,7 +1085,7 @@ gtk_level_bar_init (GtkLevelBar *self)
priv->inverted = FALSE;
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
priv->trough_widget = gtk_gizmo_new ("trough",
gtk_level_bar_measure_trough,
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index f0778b9b72..a0c9440eed 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -612,7 +612,7 @@ gtk_list_box_init (GtkListBox *box)
GtkListBoxPrivate *priv = BOX_PRIV (box);
GtkWidget *widget = GTK_WIDGET (box);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
priv->selection_mode = GTK_SELECTION_SINGLE;
priv->activate_single_click = TRUE;
diff --git a/gtk/gtkmagnifier.c b/gtk/gtkmagnifier.c
index c69b3cbdee..fbcab5733c 100644
--- a/gtk/gtkmagnifier.c
+++ b/gtk/gtkmagnifier.c
@@ -319,7 +319,7 @@ _gtk_magnifier_init (GtkMagnifier *magnifier)
priv = _gtk_magnifier_get_instance_private (magnifier);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
priv->magnification = 1;
priv->resize = FALSE;
}
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index bd0720d5c8..8e54c00d8d 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1160,62 +1160,62 @@ gtk_main_iteration_do (gboolean blocking)
}
static void
-rewrite_events_translate (GdkWindow *old_window,
- GdkWindow *new_window,
+rewrite_events_translate (GdkSurface *old_surface,
+ GdkSurface *new_surface,
gdouble *x,
gdouble *y)
{
gint old_origin_x, old_origin_y;
gint new_origin_x, new_origin_y;
- gdk_window_get_origin (old_window, &old_origin_x, &old_origin_y);
- gdk_window_get_origin (new_window, &new_origin_x, &new_origin_y);
+ gdk_surface_get_origin (old_surface, &old_origin_x, &old_origin_y);
+ gdk_surface_get_origin (new_surface, &new_origin_x, &new_origin_y);
*x += old_origin_x - new_origin_x;
*y += old_origin_y - new_origin_y;
}
static GdkEvent *
-rewrite_event_for_window (GdkEvent *event,
- GdkWindow *new_window)
+rewrite_event_for_surface (GdkEvent *event,
+ GdkSurface *new_surface)
{
event = gdk_event_copy (event);
switch ((guint) event->any.type)
{
case GDK_SCROLL:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->scroll.x, &event->scroll.y);
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->button.x, &event->button.y);
break;
case GDK_MOTION_NOTIFY:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->motion.x, &event->motion.y);
break;
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->touch.x, &event->touch.y);
break;
case GDK_TOUCHPAD_SWIPE:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->touchpad_swipe.x,
&event->touchpad_swipe.y);
break;
case GDK_TOUCHPAD_PINCH:
- rewrite_events_translate (event->any.window,
- new_window,
+ rewrite_events_translate (event->any.surface,
+ new_surface,
&event->touchpad_pinch.x,
&event->touchpad_pinch.y);
break;
@@ -1229,15 +1229,15 @@ rewrite_event_for_window (GdkEvent *event,
return event;
}
- g_object_unref (event->any.window);
- event->any.window = g_object_ref (new_window);
+ g_object_unref (event->any.surface);
+ event->any.surface = g_object_ref (new_surface);
return event;
}
/* If there is a pointer or keyboard grab in effect with owner_events = TRUE,
* then what X11 does is deliver the event normally if it was going to this
- * client, otherwise, delivers it in terms of the grab window. This function
+ * client, otherwise, delivers it in terms of the grab surface. This function
* rewrites events to the effect that events going to the same window group
* are delivered normally, otherwise, the event is delivered in terms of the
* grab window.
@@ -1245,7 +1245,7 @@ rewrite_event_for_window (GdkEvent *event,
static GdkEvent *
rewrite_event_for_grabs (GdkEvent *event)
{
- GdkWindow *grab_window;
+ GdkSurface *grab_surface;
GtkWidget *event_widget, *grab_widget;
gpointer grab_widget_ptr;
gboolean owner_events;
@@ -1268,10 +1268,10 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
- display = gdk_window_get_display (event->any.window);
+ display = gdk_surface_get_display (event->any.surface);
device = gdk_event_get_device (event);
- if (!gdk_device_grab_info (display, device, &grab_window, &owner_events) ||
+ if (!gdk_device_grab_info (display, device, &grab_surface, &owner_events) ||
!owner_events)
return NULL;
break;
@@ -1280,12 +1280,12 @@ rewrite_event_for_grabs (GdkEvent *event)
}
event_widget = gtk_get_event_widget (event);
- gdk_window_get_user_data (grab_window, &grab_widget_ptr);
+ gdk_surface_get_user_data (grab_surface, &grab_widget_ptr);
grab_widget = grab_widget_ptr;
if (grab_widget &&
gtk_main_get_window_group (grab_widget) != gtk_main_get_window_group (event_widget))
- return rewrite_event_for_window (event, grab_window);
+ return rewrite_event_for_surface (event, grab_surface);
else
return NULL;
}
@@ -1374,9 +1374,9 @@ synth_crossing (GtkWidget *widget,
gdk_event_set_device (event, gdk_event_get_device (source));
gdk_event_set_source_device (event, gdk_event_get_source_device (source));
- event->any.window = g_object_ref (gtk_widget_get_window (toplevel));
+ event->any.surface = g_object_ref (gtk_widget_get_surface (toplevel));
if (other_widget)
- event->crossing.subwindow = g_object_ref (gtk_widget_get_window (other_widget));
+ event->crossing.child_surface = g_object_ref (gtk_widget_get_surface (other_widget));
if (enter)
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_PRELIGHT, FALSE);
@@ -1659,10 +1659,10 @@ gtk_main_do_event (GdkEvent *event)
GList *tmp_list;
/* Find the widget which got the event. We store the widget
- * in the user_data field of GdkWindow's. Ignore the event
+ * in the user_data field of GdkSurface's. Ignore the event
* if we don't have a widget for it, except for GDK_PROPERTY_NOTIFY
* events which are handled specially. Though this happens rarely,
- * bogus events can occur for e.g. destroyed GdkWindows.
+ * bogus events can occur for e.g. destroyed GdkSurfaces.
*/
event_widget = gtk_get_event_widget (event);
if (!event_widget)
@@ -1776,8 +1776,8 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_EXPOSE:
- if (event->any.window)
- gtk_widget_render (event_widget, event->any.window, event->expose.region);
+ if (event->any.surface)
+ gtk_widget_render (event_widget, event->any.surface, event->expose.region);
break;
case GDK_FOCUS_CHANGE:
@@ -1917,7 +1917,7 @@ synth_crossing_for_grab_notify (GtkWidget *from,
while (devices)
{
GdkDevice *device = devices->data;
- GdkWindow *from_window, *to_window;
+ GdkSurface *from_window, *to_window;
/* Do not propagate events more than once to
* the same windows if non-multidevice aware.
@@ -1929,7 +1929,7 @@ synth_crossing_for_grab_notify (GtkWidget *from,
from_window = _gtk_widget_get_device_window (from, device);
if (from_window &&
- !gdk_window_get_support_multidevice (from_window) &&
+ !gdk_surface_get_support_multidevice (from_window) &&
g_list_find (info->notified_windows, from_window))
from_window = NULL;
}
@@ -1941,7 +1941,7 @@ synth_crossing_for_grab_notify (GtkWidget *from,
to_window = _gtk_widget_get_device_window (to, device);
if (to_window &&
- !gdk_window_get_support_multidevice (to_window) &&
+ !gdk_surface_get_support_multidevice (to_window) &&
g_list_find (info->notified_windows, to_window))
to_window = NULL;
}
@@ -2317,10 +2317,10 @@ gtk_get_event_widget (const GdkEvent *event)
gpointer widget_ptr;
widget = NULL;
- if (event && event->any.window &&
- (event->any.type == GDK_DESTROY || !gdk_window_is_destroyed (event->any.window)))
+ if (event && event->any.surface &&
+ (event->any.type == GDK_DESTROY || !gdk_surface_is_destroyed (event->any.surface)))
{
- gdk_window_get_user_data (event->any.window, &widget_ptr);
+ gdk_surface_get_user_data (event->any.surface, &widget_ptr);
widget = widget_ptr;
}
diff --git a/gtk/gtkmediacontrols.c b/gtk/gtkmediacontrols.c
index a55475e662..f590a434f6 100644
--- a/gtk/gtkmediacontrols.c
+++ b/gtk/gtkmediacontrols.c
@@ -294,7 +294,7 @@ static void
gtk_media_controls_init (GtkMediaControls *controls)
{
gtk_widget_init_template (GTK_WIDGET (controls));
- gtk_widget_set_has_window (GTK_WIDGET (controls), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (controls), FALSE);
}
/**
diff --git a/gtk/gtkmediastream.c b/gtk/gtkmediastream.c
index 6c03939ab6..594a29b92c 100644
--- a/gtk/gtkmediastream.c
+++ b/gtk/gtkmediastream.c
@@ -129,13 +129,13 @@ gtk_media_stream_default_update_audio (GtkMediaStream *self,
static void
gtk_media_stream_default_realize (GtkMediaStream *self,
- GdkWindow *window)
+ GdkSurface *window)
{
}
static void
gtk_media_stream_default_unrealize (GtkMediaStream *self,
- GdkWindow *window)
+ GdkSurface *window)
{
}
@@ -856,9 +856,9 @@ gtk_media_stream_set_volume (GtkMediaStream *self,
/**
* gtk_media_stream_realize:
* @self: a #GtkMediaStream
- * @window: a #GdkWindow
+ * @window: a #GdkSurface
*
- * Called by users to attach the media stream to a #GdkWindow they manage.
+ * Called by users to attach the media stream to a #GdkSurface they manage.
* The stream can then access the resources of @window for its rendering
* purposes. In particular, media streams might want to create
* #GdkGLContexts or sync to the #GdkFrameClock.
@@ -875,10 +875,10 @@ gtk_media_stream_set_volume (GtkMediaStream *self,
**/
void
gtk_media_stream_realize (GtkMediaStream *self,
- GdkWindow *window)
+ GdkSurface *window)
{
g_return_if_fail (GTK_IS_MEDIA_STREAM (self));
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
g_object_ref (self);
g_object_ref (window);
@@ -889,17 +889,17 @@ gtk_media_stream_realize (GtkMediaStream *self,
/**
* gtk_media_stream_unrealize:
* @self: a #GtkMediaStream previously realized
- * @window: the #GdkWindow the stream was realized with
+ * @window: the #GdkSurface the stream was realized with
*
* Undoes a previous call to gtk_media_stream_realize() and causes
* the stream to release all resources it had allocated from @window.
**/
void
gtk_media_stream_unrealize (GtkMediaStream *self,
- GdkWindow *window)
+ GdkSurface *window)
{
g_return_if_fail (GTK_IS_MEDIA_STREAM (self));
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (window));
GTK_MEDIA_STREAM_GET_CLASS (self)->unrealize (self, window);
diff --git a/gtk/gtkmediastream.h b/gtk/gtkmediastream.h
index a04fafd8fa..aa1ba62add 100644
--- a/gtk/gtkmediastream.h
+++ b/gtk/gtkmediastream.h
@@ -45,9 +45,9 @@ struct _GtkMediaStreamClass
gboolean muted,
double volume);
void (* realize) (GtkMediaStream *self,
- GdkWindow *window);
+ GdkSurface *window);
void (* unrealize) (GtkMediaStream *self,
- GdkWindow *window);
+ GdkSurface *window);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
@@ -110,10 +110,10 @@ void gtk_media_stream_set_volume (GtkMediaStream
double volume);
GDK_AVAILABLE_IN_ALL
void gtk_media_stream_realize (GtkMediaStream *self,
- GdkWindow *window);
+ GdkSurface *window);
GDK_AVAILABLE_IN_ALL
void gtk_media_stream_unrealize (GtkMediaStream *self,
- GdkWindow *window);
+ GdkSurface *window);
/* for implementations only */
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index dc8a9ac950..d004672c05 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -299,7 +299,7 @@ static void gtk_menu_remove (GtkContainer *menu,
GtkWidget *widget);
static void menu_grab_transfer_window_destroy (GtkMenu *menu);
-static GdkWindow *menu_grab_transfer_window_get (GtkMenu *menu);
+static GdkSurface *menu_grab_transfer_window_get (GtkMenu *menu);
static gboolean gtk_menu_real_can_activate_accel (GtkWidget *widget,
guint signal_id);
@@ -773,7 +773,7 @@ gtk_menu_class_init (GtkMenuClass *class)
/**
* GtkMenu:menu-type-hint:
*
- * The #GdkWindowTypeHint to use for the menu's #GdkWindow.
+ * The #GdkSurfaceTypeHint to use for the menu's #GdkSurface.
*
* See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (),
* gtk_menu_popup_at_pointer (), #GtkMenu:anchor-hints,
@@ -784,8 +784,8 @@ gtk_menu_class_init (GtkMenuClass *class)
g_param_spec_enum ("menu-type-hint",
P_("Menu type hint"),
P_("Menu window type hint"),
- GDK_TYPE_WINDOW_TYPE_HINT,
- GDK_WINDOW_TYPE_HINT_POPUP_MENU,
+ GDK_TYPE_SURFACE_TYPE_HINT,
+ GDK_SURFACE_TYPE_HINT_POPUP_MENU,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_NAME |
@@ -1124,7 +1124,7 @@ gtk_menu_init (GtkMenu *menu)
priv->anchor_hints = GDK_ANCHOR_FLIP | GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE;
priv->rect_anchor_dx = 0;
priv->rect_anchor_dy = 0;
- priv->menu_type_hint = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
+ priv->menu_type_hint = GDK_SURFACE_TYPE_HINT_POPUP_MENU;
_gtk_widget_set_captured_event_handler (GTK_WIDGET (menu), gtk_menu_captured_event);
@@ -1162,7 +1162,7 @@ gtk_menu_init (GtkMenu *menu)
}
static void
-moved_to_rect_cb (GdkWindow *window,
+moved_to_rect_cb (GdkSurface *window,
const GdkRectangle *flipped_rect,
const GdkRectangle *final_rect,
gboolean flipped_x,
@@ -1470,7 +1470,7 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell,
}
static gboolean
-popup_grab_on_window (GdkWindow *window,
+popup_grab_on_window (GdkSurface *window,
GdkDevice *pointer)
{
GdkGrabStatus status;
@@ -1488,16 +1488,16 @@ static void
associate_menu_grab_transfer_window (GtkMenu *menu)
{
GtkMenuPrivate *priv = menu->priv;
- GdkWindow *toplevel_window;
- GdkWindow *transfer_window;
+ GdkSurface *toplevel_window;
+ GdkSurface *transfer_window;
- toplevel_window = gtk_widget_get_window (priv->toplevel);
+ toplevel_window = gtk_widget_get_surface (priv->toplevel);
transfer_window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
if (toplevel_window == NULL || transfer_window == NULL)
return;
- g_object_set_data (G_OBJECT (toplevel_window), I_("gdk-attached-grab-window"), transfer_window);
+ g_object_set_data (G_OBJECT (toplevel_window), I_("gdk-attached-grab-surface"), transfer_window);
}
static void
@@ -1595,7 +1595,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
if (xgrab_shell && xgrab_shell != widget)
{
- if (popup_grab_on_window (gtk_widget_get_window (xgrab_shell), pointer))
+ if (popup_grab_on_window (gtk_widget_get_surface (xgrab_shell), pointer))
{
_gtk_menu_shell_set_grab_device (GTK_MENU_SHELL (xgrab_shell), pointer);
GTK_MENU_SHELL (xgrab_shell)->priv->have_xgrab = TRUE;
@@ -1603,7 +1603,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
}
else
{
- GdkWindow *transfer_window;
+ GdkSurface *transfer_window;
xgrab_shell = widget;
transfer_window = menu_grab_transfer_window_get (menu);
@@ -1693,7 +1693,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
gtk_widget_show (priv->toplevel);
if (xgrab_shell == widget)
- popup_grab_on_window (gtk_widget_get_window (widget), pointer); /* Should always succeed */
+ popup_grab_on_window (gtk_widget_get_surface (widget), pointer); /* Should always succeed */
gtk_grab_add (GTK_WIDGET (menu));
@@ -1861,7 +1861,7 @@ get_device_for_event (const GdkEvent *event)
/**
* gtk_menu_popup_at_rect:
* @menu: the #GtkMenu to pop up
- * @rect_window: (not nullable): the #GdkWindow @rect is relative to
+ * @rect_window: (not nullable): the #GdkSurface @rect is relative to
* @rect: (not nullable): the #GdkRectangle to align @menu with
* @rect_anchor: the point on @rect to align with @menu's anchor point
* @menu_anchor: the point on @menu to align with @rect's anchor point
@@ -1889,7 +1889,7 @@ get_device_for_event (const GdkEvent *event)
*/
void
gtk_menu_popup_at_rect (GtkMenu *menu,
- GdkWindow *rect_window,
+ GdkSurface *rect_window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity menu_anchor,
@@ -1902,7 +1902,7 @@ gtk_menu_popup_at_rect (GtkMenu *menu,
guint32 activate_time = GDK_CURRENT_TIME;
g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (GDK_IS_WINDOW (rect_window));
+ g_return_if_fail (GDK_IS_SURFACE (rect_window));
g_return_if_fail (rect);
priv = menu->priv;
@@ -2054,7 +2054,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu,
const GdkEvent *trigger_event)
{
GdkEvent *current_event = NULL;
- GdkWindow *rect_window = NULL;
+ GdkSurface *rect_window = NULL;
GdkDevice *device = NULL;
GdkRectangle rect = { 0, 0, 1, 1 };
@@ -2068,7 +2068,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu,
if (trigger_event)
{
- rect_window = gdk_event_get_window (trigger_event);
+ rect_window = gdk_event_get_surface (trigger_event);
if (rect_window)
{
@@ -2078,7 +2078,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu,
device = gdk_device_get_associated_device (device);
if (device)
- gdk_window_get_device_position (rect_window, device, &rect.x, &rect.y, NULL);
+ gdk_surface_get_device_position (rect_window, device, &rect.x, &rect.y, NULL);
}
}
else
@@ -2517,16 +2517,16 @@ gtk_menu_focus (GtkWidget *widget,
/* See notes in gtk_menu_popup() for information
* about the “grab transfer window”
*/
-static GdkWindow *
+static GdkSurface *
menu_grab_transfer_window_get (GtkMenu *menu)
{
- GdkWindow *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
+ GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
if (!window)
{
- window = gdk_window_new_temp (gtk_widget_get_display (GTK_WIDGET (menu)));
- gtk_widget_register_window (GTK_WIDGET (menu), window);
+ window = gdk_surface_new_temp (gtk_widget_get_display (GTK_WIDGET (menu)));
+ gtk_widget_register_surface (GTK_WIDGET (menu), window);
- gdk_window_show (window);
+ gdk_surface_show (window);
g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), window);
}
@@ -2537,17 +2537,17 @@ menu_grab_transfer_window_get (GtkMenu *menu)
static void
menu_grab_transfer_window_destroy (GtkMenu *menu)
{
- GdkWindow *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
+ GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
if (window)
{
- GdkWindow *widget_window;
+ GdkSurface *widget_window;
- gtk_widget_unregister_window (GTK_WIDGET (menu), window);
- gdk_window_destroy (window);
+ gtk_widget_unregister_surface (GTK_WIDGET (menu), window);
+ gdk_surface_destroy (window);
g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), NULL);
- widget_window = gtk_widget_get_window (GTK_WIDGET (menu));
- g_object_set_data (G_OBJECT (widget_window), I_("gdk-attached-grab-window"), window);
+ widget_window = gtk_widget_get_surface (GTK_WIDGET (menu));
+ g_object_set_data (G_OBJECT (widget_window), I_("gdk-attached-grab-surface"), window);
}
}
@@ -2956,7 +2956,7 @@ pointer_in_menu_window (GtkWidget *widget,
GtkMenuShell *menu_shell;
gint window_x, window_y;
- gdk_window_get_position (gtk_widget_get_window (priv->toplevel),
+ gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel),
&window_x, &window_y);
gtk_widget_get_allocation (widget, &allocation);
@@ -3194,7 +3194,7 @@ gtk_menu_scroll_by (GtkMenu *menu,
if ((priv->scroll_offset >= 0) && (offset < 0))
offset = 0;
- view_height = gdk_window_get_height (gtk_widget_get_window (widget));
+ view_height = gdk_surface_get_height (gtk_widget_get_surface (widget));
if (priv->scroll_offset == 0 &&
view_height >= priv->requested_height)
@@ -3242,7 +3242,7 @@ get_arrows_sensitive_area (GtkMenu *menu,
{
GtkMenuPrivate *priv = menu->priv;
GtkWidget *widget = GTK_WIDGET (menu);
- GdkWindow *window;
+ GdkSurface *window;
gint width, height;
gint win_x, win_y;
gint top_arrow_height, bottom_arrow_height;
@@ -3258,11 +3258,11 @@ get_arrows_sensitive_area (GtkMenu *menu,
&bottom_arrow_height, NULL,
NULL, NULL);
- window = gtk_widget_get_window (widget);
- width = gdk_window_get_width (window);
- height = gdk_window_get_height (window);
+ window = gtk_widget_get_surface (widget);
+ width = gdk_surface_get_width (window);
+ height = gdk_surface_get_height (window);
- gdk_window_get_position (window, &win_x, &win_y);
+ gdk_surface_get_position (window, &win_x, &win_y);
if (upper)
{
@@ -3297,7 +3297,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
menu_shell = GTK_MENU_SHELL (menu);
- gdk_window_get_position (gtk_widget_get_window (priv->toplevel),
+ gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel),
&top_x, &top_y);
x -= top_x;
y -= top_y;
@@ -3509,7 +3509,7 @@ pointer_on_menu_widget (GtkMenu *menu,
gint window_x, window_y;
gtk_widget_get_allocation (GTK_WIDGET (menu), &allocation);
- gdk_window_get_position (gtk_widget_get_window (priv->toplevel),
+ gdk_surface_get_position (gtk_widget_get_surface (priv->toplevel),
&window_x, &window_y);
if (x_root >= window_x && x_root < window_x + allocation.width &&
@@ -3598,7 +3598,7 @@ gtk_menu_captured_event (GtkWidget *widget,
y_diff = y_root - priv->drag_start_y;
offset = priv->initial_drag_offset - y_diff;
- view_height = gdk_window_get_height (gtk_widget_get_window (widget));
+ view_height = gdk_surface_get_height (gtk_widget_get_surface (widget));
get_arrows_border (menu, &arrow_border);
if (priv->upper_arrow_visible)
@@ -3772,7 +3772,7 @@ gtk_menu_position_legacy (GtkMenu *menu,
* to set a different hint
*/
if (!gtk_widget_get_visible (priv->toplevel))
- gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), GDK_WINDOW_TYPE_HINT_POPUP_MENU);
+ gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), GDK_SURFACE_TYPE_HINT_POPUP_MENU);
if (priv->position_func)
{
@@ -3977,14 +3977,14 @@ gtk_menu_position (GtkMenu *menu,
gboolean set_scroll_offset)
{
GtkMenuPrivate *priv = menu->priv;
- GdkWindow *rect_window = NULL;
+ GdkSurface *rect_window = NULL;
GdkRectangle rect;
GtkTextDirection text_direction = GTK_TEXT_DIR_NONE;
GdkGravity rect_anchor;
GdkGravity menu_anchor;
GdkAnchorHints anchor_hints;
gint rect_anchor_dx, rect_anchor_dy;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
gboolean emulated_move_to_rect = FALSE;
rect_anchor = priv->rect_anchor;
@@ -4000,8 +4000,8 @@ gtk_menu_position (GtkMenu *menu,
}
else if (priv->widget)
{
- rect_window = gtk_widget_get_window (priv->widget);
- gtk_widget_get_window_allocation (priv->widget, &rect);
+ rect_window = gtk_widget_get_surface (priv->widget);
+ gtk_widget_get_surface_allocation (priv->widget, &rect);
text_direction = gtk_widget_get_direction (priv->widget);
}
else if (!priv->position_func)
@@ -4022,8 +4022,8 @@ gtk_menu_position (GtkMenu *menu,
{
rect = (GdkRectangle) { 0, 0, 1, 1 };
- rect_window = gtk_widget_get_window (attach_widget);
- gdk_window_get_device_position (rect_window, grab_device,
+ rect_window = gtk_widget_get_surface (attach_widget);
+ gdk_surface_get_device_position (rect_window, grab_device,
&rect.x, &rect.y, NULL);
text_direction = gtk_widget_get_direction (attach_widget);
rect_anchor = GDK_GRAVITY_SOUTH_EAST;
@@ -4058,9 +4058,9 @@ gtk_menu_position (GtkMenu *menu,
menu_anchor = get_horizontally_flipped_anchor (menu_anchor);
}
- toplevel = gtk_widget_get_window (priv->toplevel);
+ toplevel = gtk_widget_get_surface (priv->toplevel);
- gdk_window_set_transient_for (toplevel, rect_window);
+ gdk_surface_set_transient_for (toplevel, rect_window);
g_signal_handlers_disconnect_by_func (toplevel, moved_to_rect_cb, menu);
@@ -4069,7 +4069,7 @@ gtk_menu_position (GtkMenu *menu,
menu);
- gdk_window_move_to_rect (toplevel,
+ gdk_surface_move_to_rect (toplevel,
&rect,
rect_anchor,
menu_anchor,
@@ -4187,7 +4187,7 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell,
&child_offset, &child_height, &last_child))
{
y = priv->scroll_offset;
- height = gdk_window_get_height (gtk_widget_get_window (widget));
+ height = gdk_surface_get_height (gtk_widget_get_surface (widget));
if (child_offset < y)
{
diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h
index 119138701e..1eb9dfeaa6 100644
--- a/gtk/gtkmenu.h
+++ b/gtk/gtkmenu.h
@@ -154,7 +154,7 @@ void gtk_menu_popup_for_device (GtkMenu *menu,
guint32 activate_time);
GDK_AVAILABLE_IN_ALL
void gtk_menu_popup_at_rect (GtkMenu *menu,
- GdkWindow *rect_window,
+ GdkSurface *rect_window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity menu_anchor,
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index ee0eec7561..2703ea6ee1 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -295,7 +295,7 @@ popup_menu (GtkMenuButton *menu_button,
"anchor-hints", (GDK_ANCHOR_FLIP_Y |
GDK_ANCHOR_SLIDE |
GDK_ANCHOR_RESIZE),
- "menu-type-hint", GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU,
+ "menu-type-hint", GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU,
NULL);
switch (gtk_widget_get_halign (priv->menu))
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index c849677300..6df94a0dca 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -670,7 +670,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
priv = gtk_menu_item_get_instance_private (menu_item);
menu_item->priv = priv;
- gtk_widget_set_has_window (GTK_WIDGET (menu_item), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (menu_item), FALSE);
g_signal_connect (menu_item, "notify::parent", G_CALLBACK (gtk_menu_item_parent_cb), NULL);
@@ -1406,7 +1406,7 @@ gtk_menu_item_real_popup_submenu (GtkWidget *widget,
/* Position the submenu at the menu item if it is mapped.
* Otherwise, position the submenu at the pointer device.
*/
- if (gtk_widget_get_window (widget))
+ if (gtk_widget_get_surface (widget))
{
switch (priv->submenu_placement)
{
@@ -1416,8 +1416,8 @@ gtk_menu_item_real_popup_submenu (GtkWidget *widget,
GDK_ANCHOR_SLIDE |
GDK_ANCHOR_RESIZE),
"menu-type-hint", (priv->from_menubar ?
- GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU :
- GDK_WINDOW_TYPE_HINT_POPUP_MENU),
+ GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU :
+ GDK_SURFACE_TYPE_HINT_POPUP_MENU),
NULL);
gtk_menu_popup_at_widget (GTK_MENU (priv->submenu),
diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h
index ea64d6ea6d..28ca2a6187 100644
--- a/gtk/gtkmenuprivate.h
+++ b/gtk/gtkmenuprivate.h
@@ -53,7 +53,7 @@ struct _GtkMenuPrivate
gint position_x;
gint position_y;
- GdkWindow *rect_window;
+ GdkSurface *rect_window;
GdkRectangle rect;
GtkWidget *widget;
GdkGravity rect_anchor;
@@ -61,7 +61,7 @@ struct _GtkMenuPrivate
GdkAnchorHints anchor_hints;
gint rect_anchor_dx;
gint rect_anchor_dy;
- GdkWindowTypeHint menu_type_hint;
+ GdkSurfaceTypeHint menu_type_hint;
guint toggle_size;
guint accel_size;
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index b554b7df35..e0a58ec1a8 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -408,7 +408,7 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell)
menu_shell->priv = gtk_menu_shell_get_instance_private (menu_shell);
menu_shell->priv->take_focus = TRUE;
- gtk_widget_set_has_window (GTK_WIDGET (menu_shell), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (menu_shell), FALSE);
}
static void
@@ -598,11 +598,11 @@ gtk_menu_shell_event (GtkWidget *widget,
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
GtkMenuShellPrivate *priv = menu_shell->priv;
- GdkWindow *window;
+ GdkSurface *window;
if (gdk_event_get_event_type (event) == GDK_GRAB_BROKEN)
{
- gdk_event_get_grab_window (event, &window);
+ gdk_event_get_grab_surface (event, &window);
if (priv->have_xgrab && window == NULL)
{
diff --git a/gtk/gtkmnemonichash.c b/gtk/gtkmnemonichash.c
index 845119f590..4a87f0c3e7 100644
--- a/gtk/gtkmnemonichash.c
+++ b/gtk/gtkmnemonichash.c
@@ -111,7 +111,7 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash,
{
GSList *list, *targets;
GtkWidget *widget, *chosen_widget;
- GdkWindow *window;
+ GdkSurface *window;
gboolean overloaded;
targets = g_hash_table_lookup (mnemonic_hash->hash,
@@ -124,11 +124,11 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash,
for (list = targets; list; list = list->next)
{
widget = GTK_WIDGET (list->data);
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
if (gtk_widget_is_sensitive (widget) &&
gtk_widget_get_mapped (widget) &&
- window && gdk_window_is_viewable (window))
+ window && gdk_surface_is_viewable (window))
{
if (chosen_widget)
{
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 49e0445086..96533a2b89 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -195,8 +195,8 @@ struct _GtkNotebookPrivate
gint drag_begin_y;
gint drag_offset_x;
gint drag_offset_y;
- gint drag_window_x;
- gint drag_window_y;
+ gint drag_surface_x;
+ gint drag_surface_y;
gint mouse_x;
gint mouse_y;
gint pressed_button;
@@ -1046,7 +1046,7 @@ gtk_notebook_init (GtkNotebook *notebook)
GdkContentFormats *targets;
gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
- gtk_widget_set_has_window (GTK_WIDGET (notebook), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (notebook), FALSE);
notebook->priv = gtk_notebook_get_instance_private (notebook);
priv = notebook->priv;
@@ -2472,7 +2472,7 @@ tab_drag_begin (GtkNotebook *notebook,
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_widget), GTK_STYLE_CLASS_DND);
}
-/* This function undoes the reparenting that happens both when drag_window
+/* This function undoes the reparenting that happens both when drag_surface
* is shown for reordering and when the DnD icon is shown for detaching
*/
static void
@@ -4171,7 +4171,7 @@ gtk_notebook_remove_tab_label (GtkNotebook *notebook,
page->mnemonic_activate_signal);
page->mnemonic_activate_signal = 0;
- if (gtk_widget_get_window (page->tab_label) != gtk_widget_get_window (GTK_WIDGET (notebook)) ||
+ if (gtk_widget_get_surface (page->tab_label) != gtk_widget_get_surface (GTK_WIDGET (notebook)) ||
!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
{
GtkWidget *parent;
@@ -5043,7 +5043,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
{
if (left_x >= anchor)
{
- left_x = priv->drag_window_x = anchor;
+ left_x = priv->drag_surface_x = anchor;
anchor += drag_allocation.width;
}
}
@@ -5052,7 +5052,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
if (right_x <= anchor)
{
anchor -= drag_allocation.width;
- left_x = priv->drag_window_x = anchor;
+ left_x = priv->drag_surface_x = anchor;
}
}
@@ -5061,8 +5061,8 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
if (priv->operation == DRAG_OPERATION_REORDER && page == priv->cur_page)
{
- priv->drag_window_x = left_x;
- priv->drag_window_y = child_allocation.y;
+ priv->drag_surface_x = left_x;
+ priv->drag_surface_y = child_allocation.y;
}
else
{
@@ -5095,7 +5095,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
{
if (!allocate_at_bottom && top_y >= anchor)
{
- top_y = priv->drag_window_y = anchor;
+ top_y = priv->drag_surface_y = anchor;
anchor += drag_allocation.height;
}
@@ -5104,8 +5104,8 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
if (priv->operation == DRAG_OPERATION_REORDER && page == priv->cur_page)
{
- priv->drag_window_x = child_allocation.x;
- priv->drag_window_y = top_y;
+ priv->drag_surface_x = child_allocation.x;
+ priv->drag_surface_y = top_y;
}
else
{
@@ -5139,7 +5139,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
if (page == priv->cur_page && priv->operation == DRAG_OPERATION_REORDER)
{
- GtkAllocation fixed_allocation = { priv->drag_window_x, priv->drag_window_y,
+ GtkAllocation fixed_allocation = { priv->drag_surface_x, priv->drag_surface_y,
child_allocation.width, child_allocation.height };
gtk_widget_size_allocate (page->tab_widget, &fixed_allocation, -1, &page_clip);
}
@@ -5217,18 +5217,18 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
if (allocate_at_bottom)
anchor -= drag_allocation.width;
- if ((!allocate_at_bottom && priv->drag_window_x > anchor) ||
- (allocate_at_bottom && priv->drag_window_x < anchor))
- priv->drag_window_x = anchor;
+ if ((!allocate_at_bottom && priv->drag_surface_x > anchor) ||
+ (allocate_at_bottom && priv->drag_surface_x < anchor))
+ priv->drag_surface_x = anchor;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
if (allocate_at_bottom)
anchor -= drag_allocation.height;
- if ((!allocate_at_bottom && priv->drag_window_y > anchor) ||
- (allocate_at_bottom && priv->drag_window_y < anchor))
- priv->drag_window_y = anchor;
+ if ((!allocate_at_bottom && priv->drag_surface_y > anchor) ||
+ (allocate_at_bottom && priv->drag_surface_y < anchor))
+ priv->drag_surface_y = anchor;
break;
default:
g_assert_not_reached ();
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index fca3fb6098..d12381bd84 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -842,7 +842,7 @@ gtk_overlay_class_init (GtkOverlayClass *klass)
static void
gtk_overlay_init (GtkOverlay *overlay)
{
- gtk_widget_set_has_window (GTK_WIDGET (overlay), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (overlay), FALSE);
}
static void
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index d6d0173c9a..75f441a0f3 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1499,7 +1499,7 @@ gtk_paned_init (GtkPaned *paned)
GtkPanedPrivate *priv = gtk_paned_get_instance_private (paned);
GtkGesture *gesture;
- gtk_widget_set_has_window (GTK_WIDGET (paned), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (paned), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (paned), TRUE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 6ff6932846..da0fd38b77 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -237,7 +237,7 @@ gtk_path_bar_init (GtkPathBar *path_bar)
g_signal_connect_swapped (path_bar->priv->down_slider_button, "clicked",
G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
- gtk_widget_set_has_window (GTK_WIDGET (path_bar), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (path_bar), FALSE);
context = gtk_widget_get_style_context (GTK_WIDGET (path_bar));
gtk_style_context_add_class (context, "path-bar");
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 2dcab2f8ad..0d26728cb3 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -273,7 +273,7 @@ gtk_popover_init (GtkPopover *popover)
GtkStyleContext *context;
widget = GTK_WIDGET (popover);
- gtk_widget_set_has_window (widget, TRUE);
+ gtk_widget_set_has_surface (widget, TRUE);
popover->priv = gtk_popover_get_instance_private (popover);
popover->priv->modal = TRUE;
popover->priv->tick_id = 0;
@@ -389,7 +389,7 @@ gtk_popover_hide_internal (GtkPopover *popover)
if (gtk_widget_get_realized (widget))
{
cairo_region_t *region = cairo_region_create ();
- gdk_window_input_shape_combine_region (gtk_widget_get_window (widget),
+ gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget),
region, 0, 0);
cairo_region_destroy (region);
}
@@ -471,9 +471,9 @@ static void
gtk_popover_realize (GtkWidget *widget)
{
GtkAllocation allocation;
- GdkWindow *window;
+ GdkSurface *window;
- gtk_widget_get_window_allocation (widget, &allocation);
+ gtk_widget_get_surface_allocation (widget, &allocation);
/* We want to use subsurfaces for popovers, so they can extend outside
* the main window, but for that, we first need to have clean subsurface
@@ -486,21 +486,21 @@ gtk_popover_realize (GtkWidget *widget)
g_assert (GTK_IS_WINDOW (toplevel));
- window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (toplevel),
+ window = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (toplevel),
&allocation);
- gdk_window_set_transient_for (window,
- gtk_widget_get_window (toplevel));
+ gdk_surface_set_transient_for (window,
+ gtk_widget_get_surface (toplevel));
}
else
#endif
{
- window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
+ window = gdk_surface_new_child (gtk_widget_get_parent_surface (widget),
&allocation);
}
- gtk_widget_set_window (widget, window);
- gtk_widget_register_window (widget, window);
+ gtk_widget_set_surface (widget, window);
+ gtk_widget_register_surface (widget, window);
gtk_widget_set_realized (widget, TRUE);
}
@@ -746,7 +746,7 @@ gtk_popover_map (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_popover_parent_class)->map (widget);
- gdk_window_show (gtk_widget_get_window (widget));
+ gdk_surface_show (gtk_widget_get_surface (widget));
gtk_popover_update_position (GTK_POPOVER (widget));
gtk_window_set_default (priv->window, priv->default_widget);
@@ -759,7 +759,7 @@ gtk_popover_unmap (GtkWidget *widget)
priv->button_pressed = FALSE;
- gdk_window_hide (gtk_widget_get_window (widget));
+ gdk_surface_hide (gtk_widget_get_surface (widget));
GTK_WIDGET_CLASS (gtk_popover_parent_class)->unmap (widget);
if (gtk_window_get_default_widget (priv->window) == priv->default_widget)
@@ -826,7 +826,7 @@ gtk_popover_get_gap_coords (GtkPopover *popover,
gtk_widget_translate_coordinates (priv->widget, GTK_WIDGET (priv->window),
rect.x, rect.y, &rect.x, &rect.y);
- gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (popover)),
+ gdk_surface_get_origin (gtk_widget_get_surface (GTK_WIDGET (popover)),
&win_x, &win_y);
rect.x -= win_x;
rect.y -= win_y;
@@ -1018,7 +1018,7 @@ gtk_popover_update_shape (GtkPopover *popover)
GtkWidget *widget = GTK_WIDGET (popover);
cairo_surface_t *surface;
cairo_region_t *region;
- GdkWindow *win;
+ GdkSurface *win;
cairo_t *cr;
#ifdef GDK_WINDOWING_WAYLAND
@@ -1026,12 +1026,12 @@ gtk_popover_update_shape (GtkPopover *popover)
return;
#endif
- win = gtk_widget_get_window (widget);
+ win = gtk_widget_get_surface (widget);
surface =
- gdk_window_create_similar_surface (win,
+ gdk_surface_create_similar_surface (win,
CAIRO_CONTENT_COLOR_ALPHA,
- gdk_window_get_width (win),
- gdk_window_get_height (win));
+ gdk_surface_get_width (win),
+ gdk_surface_get_height (win));
cr = cairo_create (surface);
gtk_popover_fill_border_path (popover, cr);
@@ -1043,7 +1043,7 @@ gtk_popover_update_shape (GtkPopover *popover)
gtk_widget_shape_combine_region (widget, region);
cairo_region_destroy (region);
- gdk_window_set_child_shapes (gtk_widget_get_window (widget));
+ gdk_surface_set_child_shapes (gtk_widget_get_surface (widget));
}
static void
@@ -1362,8 +1362,8 @@ gtk_popover_size_allocate (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
GtkAllocation a;
- gtk_widget_get_window_allocation (widget, &a);
- gdk_window_move_resize (gtk_widget_get_window (widget),
+ gtk_widget_get_surface_allocation (widget, &a);
+ gdk_surface_move_resize (gtk_widget_get_surface (widget),
a.x, a.y, a.width, a.height);
gtk_popover_update_shape (popover);
}
@@ -1500,7 +1500,7 @@ gtk_popover_show (GtkWidget *widget)
priv->state = STATE_SHOWN;
if (gtk_widget_get_realized (widget))
- gdk_window_input_shape_combine_region (gtk_widget_get_window (widget),
+ gdk_surface_input_shape_combine_region (gtk_widget_get_surface (widget),
NULL, 0, 0);
}
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 71c5688f68..db7247e0e4 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -659,7 +659,7 @@ static HWND
get_parent_hwnd (GtkWidget *widget)
{
gtk_widget_realize (widget);
- return gdk_win32_window_get_handle (gtk_widget_get_window (widget));
+ return gdk_win32_surface_get_handle (gtk_widget_get_surface (widget));
}
static void
@@ -1343,7 +1343,7 @@ plug_grab_notify (GtkWidget *widget,
gboolean was_grabbed,
GtkPrintOperation *op)
{
- EnableWindow (GetAncestor (GDK_WINDOW_HWND (gtk_widget_get_window (widget)), GA_ROOT),
+ EnableWindow (GetAncestor (GDK_SURFACE_HWND (gtk_widget_get_surface (widget)), GA_ROOT),
was_grabbed);
}
@@ -1371,7 +1371,7 @@ pageDlgProc (HWND wnd, UINT message, WPARAM wparam, LPARAM lparam)
gtk_container_add (GTK_CONTAINER (plug), op->priv->custom_widget);
gtk_widget_show (op->priv->custom_widget);
gtk_widget_show (plug);
- gdk_window_focus (gtk_widget_get_window (plug), GDK_CURRENT_TIME);
+ gdk_surface_focus (gtk_widget_get_surface (plug), GDK_CURRENT_TIME);
/* This dialog is modal, so we grab the embed widget */
gtk_grab_add (plug);
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index c4f8e80473..2a9a877f9c 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -778,7 +778,7 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
page_name_func, NULL, NULL);
/* Preview drawing area has no window */
- gtk_widget_set_has_window (priv->page_layout_preview, FALSE);
+ gtk_widget_set_has_surface (priv->page_layout_preview, FALSE);
/* Load backends */
load_print_backends (dialog);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 3609e6d51b..7c5dea58cb 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -476,7 +476,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
priv->text = NULL;
priv->fraction = 0.0;
- gtk_widget_set_has_window (GTK_WIDGET (pbar), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (pbar), FALSE);
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index ba37dbee34..eb58677aa4 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -535,7 +535,7 @@ gtk_range_init (GtkRange *range)
{
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
- gtk_widget_set_has_window (GTK_WIDGET (range), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (range), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->adjustment = NULL;
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index 8fc7219403..1b67c2337e 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -123,7 +123,7 @@ gtk_revealer_init (GtkRevealer *revealer)
priv->current_pos = 0.0;
priv->target_pos = 0.0;
- gtk_widget_set_has_window ((GtkWidget*) revealer, FALSE);
+ gtk_widget_set_has_surface ((GtkWidget*) revealer, FALSE);
}
static void
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index 131c197c50..7aef93f62f 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -248,7 +248,7 @@ gtk_scrollbar_init (GtkScrollbar *self)
{
GtkScrollbarPrivate *priv = gtk_scrollbar_get_instance_private (self);
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index bce856969d..496c5eed95 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1913,7 +1913,7 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
scrolled_window->priv = priv =
gtk_scrolled_window_get_instance_private (scrolled_window);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
gtk_widget_set_can_focus (widget, TRUE);
/* Instantiated by gtk_scrolled_window_set_[hv]adjustment
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index e968bb4a31..cd5af76fce 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -119,7 +119,7 @@ gtk_separator_init (GtkSeparator *separator)
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
- gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (separator), FALSE);
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (separator));
}
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index 2a305a0920..7964f5e8e2 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -114,7 +114,7 @@ gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
priv = separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item);
priv->draw = TRUE;
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
}
static void
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 67e377f1ba..050b765db8 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -560,7 +560,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
*
* When %TRUE, keyboard navigation and other input-related errors
* will cause a beep. Since the error bell is implemented using
- * gdk_window_beep(), the windowing system may offer ways to
+ * gdk_surface_beep(), the windowing system may offer ways to
* configure the error bell in many ways, such as flashing the
* window or similar visual effects.
*/
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index 4a11d296ef..c38feb14e5 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -720,7 +720,7 @@ gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass)
static void
gtk_shortcuts_shortcut_init (GtkShortcutsShortcut *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->box = g_object_new (GTK_TYPE_BOX,
"orientation", GTK_ORIENTATION_HORIZONTAL,
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index a173512863..771a71018e 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -876,7 +876,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
PangoAttrList *attributes;
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
- gtk_window_set_type_hint (GTK_WINDOW (self), GDK_WINDOW_TYPE_HINT_DIALOG);
+ gtk_window_set_type_hint (GTK_WINDOW (self), GDK_SURFACE_TYPE_HINT_DIALOG);
g_signal_connect (self, "key-press-event",
G_CALLBACK (window_key_press_event_cb), NULL);
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 05b52e8c79..109a2fd1f1 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -833,7 +833,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
- gtk_widget_set_has_window (GTK_WIDGET (spin_button), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (spin_button), FALSE);
priv->adjustment = NULL;
priv->timer = 0;
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 97239649f6..800a3ed9f8 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -208,7 +208,7 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
static void
gtk_spinner_init (GtkSpinner *spinner)
{
- gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (spinner), FALSE);
}
/**
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index a14f4730d5..22efd3250e 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2152,7 +2152,7 @@ gtk_stack_init (GtkStack *stack)
{
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
- gtk_widget_set_has_window (GTK_WIDGET (stack), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (stack), FALSE);
priv->vhomogeneous = TRUE;
priv->hhomogeneous = TRUE;
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 2c7566e61f..000e87bf9c 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -87,7 +87,7 @@ gtk_stack_switcher_init (GtkStackSwitcher *switcher)
GtkStyleContext *context;
GtkStackSwitcherPrivate *priv;
- gtk_widget_set_has_window (GTK_WIDGET (switcher), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (switcher), FALSE);
priv = gtk_stack_switcher_get_instance_private (switcher);
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index fc0336cbb2..2c9dfaaee6 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -226,7 +226,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
{
GtkStatusbarPrivate *priv;
- gtk_widget_set_has_window (GTK_WIDGET (statusbar), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (statusbar), FALSE);
statusbar->priv = gtk_statusbar_get_instance_private (statusbar);
priv = statusbar->priv;
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index 2d9f31e62f..71121abb57 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -622,7 +622,7 @@ gtk_switch_init (GtkSwitch *self)
GtkSwitchPrivate *priv = gtk_switch_get_instance_private (self);
GtkGesture *gesture;
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self));
diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c
index 5a59ee540f..3d28902d78 100644
--- a/gtk/gtktextutil.c
+++ b/gtk/gtktextutil.c
@@ -233,7 +233,7 @@ _gtk_text_util_create_drag_icon (GtkWidget *widget,
pixmap_width = layout_width / PANGO_SCALE;
pixmap_height = layout_height / PANGO_SCALE;
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR_ALPHA,
pixmap_width, pixmap_height);
cr = cairo_create (surface);
@@ -342,7 +342,7 @@ _gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH);
layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT);
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR_ALPHA,
layout_width, layout_height);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 85daa761d0..bd91df47f2 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -104,9 +104,9 @@
* is to change which lines are onscreen. This happens when the value
* of a scroll adjustment changes. So the code path begins in
* gtk_text_view_value_changed() and goes like this:
- * - gdk_window_scroll() to reflect the new adjustment value
+ * - gdk_surface_scroll() to reflect the new adjustment value
* - validate the lines that were moved onscreen
- * - gdk_window_process_updates() to handle the exposes immediately
+ * - gdk_surface_process_updates() to handle the exposes immediately
*
* The second way is that you get the “invalidated” signal from the layout,
* indicating that lines have become invalid. This code path begins in
@@ -1629,7 +1629,7 @@ gtk_text_view_init (GtkTextView *text_view)
text_view->priv = gtk_text_view_get_instance_private (text_view);
priv = text_view->priv;
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
gtk_widget_set_can_focus (widget, TRUE);
context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
@@ -1989,7 +1989,7 @@ gtk_text_view_get_buffer (GtkTextView *text_view)
* cursor’s offset within the preedit sequence.
*
* The rectangle position is in buffer coordinates; use
- * gtk_text_view_buffer_to_window_coords() to convert these
+ * gtk_text_view_buffer_to_surface_coords() to convert these
* coordinates to coordinates for one of the windows in the text view.
**/
void
@@ -2092,7 +2092,7 @@ gtk_text_view_get_iter_at_position (GtkTextView *text_view,
*
* Gets a rectangle which roughly contains the character at @iter.
* The rectangle position is in buffer coordinates; use
- * gtk_text_view_buffer_to_window_coords() to convert these
+ * gtk_text_view_buffer_to_surface_coords() to convert these
* coordinates to coordinates for one of the windows in the text view.
**/
void
@@ -2117,7 +2117,7 @@ gtk_text_view_get_iter_location (GtkTextView *text_view,
*
* Gets the y coordinate of the top of the line containing @iter,
* and the height of the line. The coordinate is a buffer coordinate;
- * convert to window coordinates with gtk_text_view_buffer_to_window_coords().
+ * convert to window coordinates with gtk_text_view_buffer_to_surface_coords().
**/
void
gtk_text_view_get_line_yrange (GtkTextView *text_view,
@@ -2767,7 +2767,7 @@ gtk_text_view_move_mark_onscreen (GtkTextView *text_view,
*
* Fills @visible_rect with the currently-visible
* region of the buffer, in buffer coordinates. Convert to window coordinates
- * with gtk_text_view_buffer_to_window_coords().
+ * with gtk_text_view_buffer_to_surface_coords().
**/
void
gtk_text_view_get_visible_rect (GtkTextView *text_view,
@@ -4674,7 +4674,7 @@ _text_window_to_widget_coords (GtkTextView *text_view,
}
static void
-_widget_to_text_window_coords (GtkTextView *text_view,
+_widget_to_text_surface_coords (GtkTextView *text_view,
gint *x,
gint *y)
{
@@ -4750,7 +4750,7 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
gtk_text_view_get_iter_location (text_view, iter,
(GdkRectangle *) &rect);
rect.x = x + priv->xoffset;
- gtk_text_view_buffer_to_window_coords (text_view, GTK_TEXT_WINDOW_TEXT,
+ gtk_text_view_buffer_to_surface_coords (text_view, GTK_TEXT_WINDOW_TEXT,
rect.x, rect.y, &rect.x, &rect.y);
_text_window_to_widget_coords (text_view, &rect.x, &rect.y);
req.height = rect.height * N_LINES *
@@ -4791,7 +4791,7 @@ gtk_text_view_handle_dragged (GtkTextHandle *handle,
buffer = get_buffer (text_view);
mode = _gtk_text_handle_get_mode (handle);
- _widget_to_text_window_coords (text_view, &x, &y);
+ _widget_to_text_surface_coords (text_view, &x, &y);
gtk_text_view_selection_bubble_popup_unset (text_view);
gtk_text_layout_get_iter_at_pixel (priv->layout, &iter,
@@ -5111,7 +5111,7 @@ get_iter_from_gesture (GtkTextView *text_view,
xcoord = px + priv->xoffset;
ycoord = py + priv->yoffset;
- _widget_to_text_window_coords (text_view, &xcoord, &ycoord);
+ _widget_to_text_surface_coords (text_view, &xcoord, &ycoord);
gtk_text_layout_get_iter_at_pixel (priv->layout, iter, xcoord, ycoord);
if (x)
@@ -7092,7 +7092,7 @@ selection_data_free (SelectionData *data)
}
static gboolean
-drag_gesture_get_text_window_coords (GtkGestureDrag *gesture,
+drag_gesture_get_text_surface_coords (GtkGestureDrag *gesture,
GtkTextView *text_view,
gint *start_x,
gint *start_y,
@@ -7107,11 +7107,11 @@ drag_gesture_get_text_window_coords (GtkGestureDrag *gesture,
*start_x = sx;
*start_y = sy;
- _widget_to_text_window_coords (text_view, start_x, start_y);
+ _widget_to_text_surface_coords (text_view, start_x, start_y);
*x = sx + ox;
*y = sy + oy;
- _widget_to_text_window_coords (text_view, x, y);
+ _widget_to_text_surface_coords (text_view, x, y);
return TRUE;
}
@@ -7133,7 +7133,7 @@ gtk_text_view_drag_gesture_update (GtkGestureDrag *gesture,
data = g_object_get_qdata (G_OBJECT (gesture), quark_text_selection_data);
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
- drag_gesture_get_text_window_coords (gesture, text_view,
+ drag_gesture_get_text_surface_coords (gesture, text_view,
&start_x, &start_y, &x, &y);
device = gdk_event_get_source_device (event);
@@ -7249,7 +7249,7 @@ gtk_text_view_drag_gesture_end (GtkGestureDrag *gesture,
priv = text_view->priv;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
- drag_gesture_get_text_window_coords (gesture, text_view,
+ drag_gesture_get_text_surface_coords (gesture, text_view,
&start_x, &start_y, &x, &y);
clicked_in_selection =
@@ -8738,7 +8738,7 @@ gtk_text_view_do_popup (GtkTextView *text_view,
if (is_visible)
{
- gtk_text_view_buffer_to_window_coords (text_view,
+ gtk_text_view_buffer_to_surface_coords (text_view,
GTK_TEXT_WINDOW_WIDGET,
iter_location.x,
iter_location.y,
@@ -8746,7 +8746,7 @@ gtk_text_view_do_popup (GtkTextView *text_view,
&iter_location.y);
gtk_menu_popup_at_rect (GTK_MENU (priv->popup_menu),
- gtk_widget_get_window (GTK_WIDGET (text_view)),
+ gtk_widget_get_surface (GTK_WIDGET (text_view)),
&iter_location,
GDK_GRAVITY_SOUTH_EAST,
GDK_GRAVITY_NORTH_WEST,
@@ -8978,7 +8978,7 @@ gtk_text_view_selection_bubble_popup_set (GtkTextView *text_view)
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb");
}
-/* Child GdkWindows */
+/* Child GdkSurfaces */
static void
node_style_changed_cb (GtkCssNode *node,
@@ -9119,7 +9119,7 @@ text_window_invalidate_rect (GtkTextWindow *win,
gtk_widget_queue_draw (GTK_WIDGET (win->widget));
return;
- gtk_text_view_buffer_to_window_coords (GTK_TEXT_VIEW (win->widget),
+ gtk_text_view_buffer_to_surface_coords (GTK_TEXT_VIEW (win->widget),
win->type,
rect->x,
rect->y,
@@ -9302,7 +9302,7 @@ gtk_text_view_get_css_node (GtkTextView *text_view,
}
/**
- * gtk_text_view_buffer_to_window_coords:
+ * gtk_text_view_buffer_to_surface_coords:
* @text_view: a #GtkTextView
* @win: a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE
* @buffer_x: buffer x coordinate
@@ -9317,7 +9317,7 @@ gtk_text_view_get_css_node (GtkTextView *text_view,
* gtk_text_view_set_border_window_size()).
**/
void
-gtk_text_view_buffer_to_window_coords (GtkTextView *text_view,
+gtk_text_view_buffer_to_surface_coords (GtkTextView *text_view,
GtkTextWindowType win,
gint buffer_x,
gint buffer_y,
@@ -10111,7 +10111,7 @@ gtk_text_view_insert_emoji (GtkTextView *text_view)
gtk_text_buffer_get_insert (buffer));
gtk_text_view_get_iter_location (text_view, &iter, (GdkRectangle *) &rect);
- gtk_text_view_buffer_to_window_coords (text_view, GTK_TEXT_WINDOW_TEXT,
+ gtk_text_view_buffer_to_surface_coords (text_view, GTK_TEXT_WINDOW_TEXT,
rect.x, rect.y, &rect.x, &rect.y);
_text_window_to_widget_coords (text_view, &rect.x, &rect.y);
diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h
index 2fa4fe3daa..bde46f363c 100644
--- a/gtk/gtktextview.h
+++ b/gtk/gtktextview.h
@@ -274,7 +274,7 @@ void gtk_text_view_get_line_at_y (GtkTextView *text_view
gint *line_top);
GDK_AVAILABLE_IN_ALL
-void gtk_text_view_buffer_to_window_coords (GtkTextView *text_view,
+void gtk_text_view_buffer_to_surface_coords (GtkTextView *text_view,
GtkTextWindowType win,
gint buffer_x,
gint buffer_y,
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 5d923e8223..60dd8bfc6f 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -566,7 +566,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
priv = toolbar->priv;
gtk_widget_set_can_focus (widget, FALSE);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->style = DEFAULT_TOOLBAR_STYLE;
@@ -2238,7 +2238,7 @@ show_menu (GtkToolbar *toolbar,
"anchor-hints", (GDK_ANCHOR_FLIP_Y |
GDK_ANCHOR_SLIDE |
GDK_ANCHOR_RESIZE),
- "menu-type-hint", GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU,
+ "menu-type-hint", GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU,
"rect-anchor-dx", -minimum_size.width,
NULL);
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 99b8ac736e..5b325f233d 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -109,7 +109,7 @@ struct _GtkTooltip
gdouble last_x;
gdouble last_y;
- GdkWindow *last_window;
+ GdkSurface *last_window;
guint timeout_id;
guint browse_mode_timeout_id;
@@ -137,10 +137,10 @@ static void gtk_tooltip_display_closed (GdkDisplay *display,
gboolean was_error,
GtkTooltip *tooltip);
static void gtk_tooltip_set_last_window (GtkTooltip *tooltip,
- GdkWindow *window);
+ GdkSurface *window);
static void gtk_tooltip_handle_event_internal (GdkEventType event_type,
- GdkWindow *window,
+ GdkSurface *window,
gdouble dx,
gdouble dy);
@@ -386,12 +386,12 @@ void
gtk_tooltip_trigger_tooltip_query (GdkDisplay *display)
{
gint x, y;
- GdkWindow *window;
+ GdkSurface *window;
GdkDevice *device;
/* Trigger logic as if the mouse moved */
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- window = gdk_device_get_window_at_position (device, &x, &y);
+ window = gdk_device_get_surface_at_position (device, &x, &y);
if (!window)
return;
@@ -408,7 +408,7 @@ gtk_tooltip_window_hide (GtkWidget *widget,
}
GtkWidget *
-_gtk_widget_find_at_coords (GdkWindow *window,
+_gtk_widget_find_at_coords (GdkSurface *window,
gint window_x,
gint window_y,
gint *widget_x,
@@ -417,9 +417,9 @@ _gtk_widget_find_at_coords (GdkWindow *window,
GtkWidget *event_widget;
GtkWidget *picked_widget;
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_SURFACE (window), NULL);
- gdk_window_get_user_data (window, (void **)&event_widget);
+ gdk_surface_get_user_data (window, (void **)&event_widget);
if (!event_widget)
return NULL;
@@ -436,7 +436,7 @@ _gtk_widget_find_at_coords (GdkWindow *window,
* allocation relative (x, y) of the returned widget.
*/
static GtkWidget *
-find_topmost_widget_coords (GdkWindow *window,
+find_topmost_widget_coords (GdkSurface *window,
gdouble dx,
gdouble dy,
gint *x,
@@ -518,7 +518,7 @@ gtk_tooltip_display_closed (GdkDisplay *display,
static void
gtk_tooltip_set_last_window (GtkTooltip *tooltip,
- GdkWindow *window)
+ GdkSurface *window)
{
GtkWidget *window_widget = NULL;
@@ -536,7 +536,7 @@ gtk_tooltip_set_last_window (GtkTooltip *tooltip,
(gpointer *) &tooltip->last_window);
if (window)
- gdk_window_get_user_data (window, (gpointer *) &window_widget);
+ gdk_surface_get_user_data (window, (gpointer *) &window_widget);
if (window_widget)
window_widget = gtk_widget_get_toplevel (window_widget);
@@ -606,7 +606,7 @@ get_bounding_box (GtkWidget *widget,
{
GtkWidget *toplevel;
GtkAllocation allocation;
- GdkWindow *window;
+ GdkSurface *window;
gint x, y;
gint w, h;
gint x1, y1;
@@ -614,9 +614,9 @@ get_bounding_box (GtkWidget *widget,
gint x3, y3;
gint x4, y4;
- window = gtk_widget_get_parent_window (widget);
+ window = gtk_widget_get_parent_surface (widget);
if (window == NULL)
- window = gtk_widget_get_window (widget);
+ window = gtk_widget_get_surface (widget);
gtk_widget_get_allocation (widget, &allocation);
@@ -646,10 +646,10 @@ get_bounding_box (GtkWidget *widget,
h -= border.top + border.bottom;
}
- gdk_window_get_root_coords (window, x, y, &x1, &y1);
- gdk_window_get_root_coords (window, x + w, y, &x2, &y2);
- gdk_window_get_root_coords (window, x, y + h, &x3, &y3);
- gdk_window_get_root_coords (window, x + w, y + h, &x4, &y4);
+ gdk_surface_get_root_coords (window, x, y, &x1, &y1);
+ gdk_surface_get_root_coords (window, x + w, y, &x2, &y2);
+ gdk_surface_get_root_coords (window, x, y + h, &x3, &y3);
+ gdk_surface_get_root_coords (window, x + w, y + h, &x4, &y4);
#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d))
#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
@@ -847,7 +847,7 @@ static void
gtk_tooltip_show_tooltip (GdkDisplay *display)
{
gint x, y;
- GdkWindow *window;
+ GdkSurface *window;
GtkWidget *tooltip_widget;
GtkTooltip *tooltip;
gboolean return_value = FALSE;
@@ -866,14 +866,14 @@ gtk_tooltip_show_tooltip (GdkDisplay *display)
window = tooltip->last_window;
- if (!GDK_IS_WINDOW (window))
+ if (!GDK_IS_SURFACE (window))
return;
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_window_get_device_position (window, device, &x, &y, NULL);
+ gdk_surface_get_device_position (window, device, &x, &y, NULL);
- gdk_window_get_root_coords (window, x, y, &tx, &ty);
+ gdk_surface_get_root_coords (window, x, y, &tx, &ty);
tooltip->last_x = tx;
tooltip->last_y = ty;
@@ -1052,7 +1052,7 @@ _gtk_tooltip_focus_in (GtkWidget *widget)
tooltip->keyboard_widget = g_object_ref (widget);
- gdk_window_get_device_position (gtk_widget_get_window (widget),
+ gdk_surface_get_device_position (gtk_widget_get_surface (widget),
device, &x, &y, NULL);
return_value = gtk_tooltip_run_requery (&widget, tooltip, &x, &y);
@@ -1174,22 +1174,22 @@ void
_gtk_tooltip_handle_event (GdkEvent *event)
{
GdkEventType event_type;
- GdkWindow *window;
+ GdkSurface *surface;
gdouble dx, dy;
if (!tooltips_enabled (event))
return;
event_type = gdk_event_get_event_type (event);
- window = gdk_event_get_window (event);
+ surface = gdk_event_get_surface (event);
gdk_event_get_coords (event, &dx, &dy);
- gtk_tooltip_handle_event_internal (event_type, window, dx, dy);
+ gtk_tooltip_handle_event_internal (event_type, surface, dx, dy);
}
static void
gtk_tooltip_handle_event_internal (GdkEventType event_type,
- GdkWindow *window,
+ GdkSurface *window,
gdouble dx,
gdouble dy)
{
@@ -1199,7 +1199,7 @@ gtk_tooltip_handle_event_internal (GdkEventType event_type,
GtkTooltip *current_tooltip;
has_tooltip_widget = find_topmost_widget_coords (window, dx, dy, &x, &y);
- display = gdk_window_get_display (window);
+ display = gdk_surface_get_display (window);
current_tooltip = g_object_get_qdata (G_OBJECT (display), quark_current_tooltip);
if (current_tooltip)
diff --git a/gtk/gtktooltipprivate.h b/gtk/gtktooltipprivate.h
index 427015e007..34f37934f4 100644
--- a/gtk/gtktooltipprivate.h
+++ b/gtk/gtktooltipprivate.h
@@ -37,7 +37,7 @@ void _gtk_tooltip_toggle_keyboard_mode (GtkWidget *widget);
void _gtk_tooltip_handle_event (GdkEvent *event);
void _gtk_tooltip_hide (GtkWidget *widget);
-GtkWidget * _gtk_widget_find_at_coords (GdkWindow *window,
+GtkWidget * _gtk_widget_find_at_coords (GdkSurface *window,
gint window_x,
gint window_y,
gint *widget_x,
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c8be4bba9b..68613ea597 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -101,7 +101,7 @@
* Several functions are available for converting between the different
* coordinate systems. The most common translations are between widget and bin
* window coordinates and between bin window and tree coordinates. For the
- * former you can use gtk_tree_view_convert_widget_to_bin_window_coords()
+ * former you can use gtk_tree_view_convert_widget_to_bin_surface_coords()
* (and vice versa), for the latter gtk_tree_view_convert_bin_window_to_tree_coords()
* (and vice versa).
*
@@ -389,8 +389,8 @@ struct _GtkTreeViewPrivate
guint scroll_timeout;
/* Interactive Header reordering */
- GdkWindow *drag_window;
- GdkWindow *drag_highlight_window;
+ GdkSurface *drag_surface;
+ GdkSurface *drag_highlight_window;
GtkTreeViewColumn *drag_column;
gint drag_column_x;
@@ -476,7 +476,7 @@ struct _GtkTreeViewPrivate
guint activate_on_single_click : 1;
guint reorderable : 1;
guint header_has_focus : 1;
- guint drag_column_window_state : 3;
+ guint drag_column_surface_state : 3;
guint mark_rows_col_dirty : 1;
/* for DnD */
@@ -1707,7 +1707,7 @@ gtk_tree_view_init (GtkTreeView *tree_view)
priv->event_last_x = -10000;
priv->event_last_y = -10000;
- gtk_widget_set_has_window (GTK_WIDGET (tree_view), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (tree_view), FALSE);
gtk_tree_view_do_set_vadjustment (tree_view, NULL);
gtk_tree_view_do_set_hadjustment (tree_view, NULL);
@@ -2268,17 +2268,17 @@ gtk_tree_view_unrealize (GtkWidget *widget)
priv->typeselect_flush_timeout = 0;
}
- if (priv->drag_window)
+ if (priv->drag_surface)
{
- gtk_widget_unregister_window (widget, priv->drag_window);
- gdk_window_destroy (priv->drag_window);
- priv->drag_window = NULL;
+ gtk_widget_unregister_surface (widget, priv->drag_surface);
+ gdk_surface_destroy (priv->drag_surface);
+ priv->drag_surface = NULL;
}
if (priv->drag_highlight_window)
{
- gtk_widget_unregister_window (widget, priv->drag_highlight_window);
- gdk_window_destroy (priv->drag_highlight_window);
+ gtk_widget_unregister_surface (widget, priv->drag_highlight_window);
+ gdk_surface_destroy (priv->drag_highlight_window);
priv->drag_highlight_window = NULL;
}
@@ -2539,8 +2539,8 @@ gtk_tree_view_size_allocate_drag_column (GtkWidget *widget)
drag_allocation.x = 0;
drag_allocation.y = 0;
- drag_allocation.width = gdk_window_get_width (tree_view->priv->drag_window);
- drag_allocation.height = gdk_window_get_height (tree_view->priv->drag_window);
+ drag_allocation.width = gdk_surface_get_width (tree_view->priv->drag_surface);
+ drag_allocation.height = gdk_surface_get_height (tree_view->priv->drag_surface);
gtk_widget_size_allocate (button, &drag_allocation, -1, &clip);
}
@@ -2791,7 +2791,7 @@ gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
/* Because grab_focus can cause reentrancy, we delay grab_focus until after
* we're done handling the button press.
*/
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y,
&bin_x, &bin_y);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
@@ -3036,7 +3036,7 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture,
return;
}
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y,
&bin_x, &bin_y);
tree_view->priv->press_start_x = tree_view->priv->rubber_band_x = bin_x;
tree_view->priv->press_start_y = tree_view->priv->rubber_band_y = bin_y;
@@ -3200,9 +3200,9 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view)
tree_view->priv->cur_reorder->left_column);
}
tree_view->priv->drag_column = NULL;
- gtk_widget_unregister_window (widget, tree_view->priv->drag_window);
- gdk_window_destroy (tree_view->priv->drag_window);
- tree_view->priv->drag_window = NULL;
+ gtk_widget_unregister_surface (widget, tree_view->priv->drag_surface);
+ gdk_surface_destroy (tree_view->priv->drag_surface);
+ tree_view->priv->drag_surface = NULL;
for (l = tree_view->priv->column_drag_info; l != NULL; l = l->next)
g_slice_free (GtkTreeViewColumnReorder, l->data);
@@ -3211,10 +3211,10 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view)
tree_view->priv->cur_reorder = NULL;
if (tree_view->priv->drag_highlight_window)
- gdk_window_hide (tree_view->priv->drag_highlight_window);
+ gdk_surface_hide (tree_view->priv->drag_highlight_window);
/* Reset our flags */
- tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_UNSET;
+ tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_UNSET;
tree_view->priv->in_column_drag = FALSE;
return TRUE;
@@ -3637,30 +3637,30 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
/* We want to draw the rectangle over the initial location. */
if (arrow_type == DRAG_COLUMN_WINDOW_STATE_ORIGINAL)
{
- if (tree_view->priv->drag_column_window_state != DRAG_COLUMN_WINDOW_STATE_ORIGINAL)
+ if (tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ORIGINAL)
{
GtkAllocation drag_allocation;
GtkWidget *button;
if (tree_view->priv->drag_highlight_window)
{
- gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
- gdk_window_destroy (tree_view->priv->drag_highlight_window);
+ gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gdk_surface_destroy (tree_view->priv->drag_highlight_window);
}
button = gtk_tree_view_column_get_button (tree_view->priv->drag_column);
gtk_widget_get_allocation (button, &drag_allocation);
width = drag_allocation.width;
height = drag_allocation.height;
- tree_view->priv->drag_highlight_window = gdk_window_new_child (gtk_widget_get_window (widget),
+ tree_view->priv->drag_highlight_window = gdk_surface_new_child (gtk_widget_get_surface (widget),
&(GdkRectangle){
tree_view->priv->drag_column_x,
0,
drag_allocation.width,
drag_allocation.height});
- gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
- tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_ORIGINAL;
+ tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_ORIGINAL;
}
}
else if (arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW)
@@ -3693,17 +3693,17 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
height += width;
/* Create the new window */
- if (tree_view->priv->drag_column_window_state != DRAG_COLUMN_WINDOW_STATE_ARROW)
+ if (tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW)
{
if (tree_view->priv->drag_highlight_window)
{
- gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
- gdk_window_destroy (tree_view->priv->drag_highlight_window);
+ gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gdk_surface_destroy (tree_view->priv->drag_highlight_window);
}
- tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget),
+ tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget),
&(GdkRectangle) { x, y, width, height });
- gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height);
@@ -3718,15 +3718,15 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
cairo_destroy (cr);
mask_region = gdk_cairo_region_create_from_surface (mask_image);
- gdk_window_shape_combine_region (tree_view->priv->drag_highlight_window,
+ gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window,
mask_region, 0, 0);
cairo_region_destroy (mask_region);
cairo_surface_destroy (mask_image);
}
- tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_ARROW;
- gdk_window_move (tree_view->priv->drag_highlight_window, x, y);
+ tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_ARROW;
+ gdk_surface_move (tree_view->priv->drag_highlight_window, x, y);
}
else if (arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT ||
arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT)
@@ -3762,18 +3762,18 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
height += 2 * expander_size;
/* Create the new window */
- if (tree_view->priv->drag_column_window_state != DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT &&
- tree_view->priv->drag_column_window_state != DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT)
+ if (tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT &&
+ tree_view->priv->drag_column_surface_state != DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT)
{
if (tree_view->priv->drag_highlight_window)
{
- gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
- gdk_window_destroy (tree_view->priv->drag_highlight_window);
+ gtk_widget_unregister_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gdk_surface_destroy (tree_view->priv->drag_highlight_window);
}
- tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget),
+ tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget),
&(GdkRectangle) { x, y, width, height });
- gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
+ gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height);
@@ -3794,25 +3794,25 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
cairo_destroy (cr);
mask_region = gdk_cairo_region_create_from_surface (mask_image);
- gdk_window_shape_combine_region (tree_view->priv->drag_highlight_window,
+ gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window,
mask_region, 0, 0);
cairo_region_destroy (mask_region);
cairo_surface_destroy (mask_image);
}
- tree_view->priv->drag_column_window_state = arrow_type;
- gdk_window_move (tree_view->priv->drag_highlight_window, x, y);
+ tree_view->priv->drag_column_surface_state = arrow_type;
+ gdk_surface_move (tree_view->priv->drag_highlight_window, x, y);
}
else
{
g_warning (G_STRLOC"Invalid GtkTreeViewColumnReorder struct");
- gdk_window_hide (tree_view->priv->drag_highlight_window);
+ gdk_surface_hide (tree_view->priv->drag_highlight_window);
return;
}
- gdk_window_show (tree_view->priv->drag_highlight_window);
- gdk_window_raise (tree_view->priv->drag_highlight_window);
+ gdk_surface_show (tree_view->priv->drag_highlight_window);
+ gdk_surface_raise (tree_view->priv->drag_highlight_window);
}
static gboolean
@@ -3876,13 +3876,13 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture));
gtk_gesture_get_point (tree_view->priv->drag_gesture, sequence, NULL, &py);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, py,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, py,
NULL, &y);
}
else
{
y = tree_view->priv->event_last_y;
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, y, NULL, &y);
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, y, NULL, &y);
}
y += tree_view->priv->dy;
@@ -3948,13 +3948,13 @@ gtk_tree_view_motion_drag_column (GtkTreeView *tree_view,
x += gtk_adjustment_get_value (tree_view->priv->hadjustment);
/* Handle moving the header */
- gdk_window_get_position (tree_view->priv->drag_window, &win_x, &win_y);
+ gdk_surface_get_position (tree_view->priv->drag_surface, &win_x, &win_y);
width = gtk_widget_get_allocated_width (GTK_WIDGET (tree_view));
button_width = gtk_widget_get_allocated_width (button);
win_x = CLAMP (x - _gtk_tree_view_column_get_drag_x (column), 0,
MAX (tree_view->priv->width, width) - button_width);
- gdk_window_move (tree_view->priv->drag_window, win_x, win_y);
- gdk_window_raise (tree_view->priv->drag_window);
+ gdk_surface_move (tree_view->priv->drag_surface, win_x, win_y);
+ gdk_surface_raise (tree_view->priv->drag_surface);
/* autoscroll, if needed */
gtk_tree_view_horizontal_autoscroll (tree_view);
@@ -4128,7 +4128,7 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view)
NULL, &offset_y);
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture),
NULL, &start_y);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, start_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, 0, start_y,
NULL, &bin_y);
bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy);
@@ -4287,7 +4287,7 @@ gtk_tree_view_update_rubber_band (GtkTreeView *tree_view)
&offset_x, &offset_y);
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture),
&start_x, &start_y);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y,
&bin_x, &bin_y);
bin_y += tree_view->priv->dy;
@@ -4326,7 +4326,7 @@ gtk_tree_view_snapshot_rubber_band (GtkTreeView *tree_view,
&offset_x, &offset_y);
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture),
&start_x, &start_y);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y,
&bin_x, &bin_y);
bin_x = MAX (0, bin_x + offset_x);
bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy);
@@ -4436,7 +4436,7 @@ gtk_tree_view_motion_controller_motion (GtkEventControllerMotion *controller,
gtk_gesture_is_active (tree_view->priv->multipress_gesture))
node = NULL;
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, x, y,
&bin_x, &bin_y);
new_y = MAX (0, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, bin_y));
@@ -5234,15 +5234,15 @@ gtk_tree_view_snapshot (GtkWidget *widget,
gtk_style_context_get_color (context, &color);
cairo_save (cr);
- if (tree_view->priv->drag_column_window_state == DRAG_COLUMN_WINDOW_STATE_ORIGINAL)
+ if (tree_view->priv->drag_column_surface_state == DRAG_COLUMN_WINDOW_STATE_ORIGINAL)
{
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint (cr);
gdk_cairo_set_source_rgba (cr, &color);
cairo_rectangle (cr,
1, 1,
- gdk_window_get_width (tree_view->priv->drag_highlight_window) - 2,
- gdk_window_get_height (tree_view->priv->drag_highlight_window) - 2);
+ gdk_surface_get_width (tree_view->priv->drag_highlight_window) - 2,
+ gdk_surface_get_height (tree_view->priv->drag_highlight_window) - 2);
cairo_stroke (cr);
}
else
@@ -5280,7 +5280,7 @@ gtk_tree_view_snapshot (GtkWidget *widget,
}
}
- if (tree_view->priv->drag_window)
+ if (tree_view->priv->drag_surface)
{
button = gtk_tree_view_column_get_button (tree_view->priv->drag_column);
gtk_widget_snapshot_child (widget,
@@ -5712,9 +5712,9 @@ gtk_tree_view_key_press (GtkWidget *widget,
gulong popup_menu_id;
new_event = gdk_event_copy ((GdkEvent *) event);
- g_object_unref (((GdkEventKey *) new_event)->any.window);
- ((GdkEventKey *) new_event)->any.window =
- g_object_ref (gtk_widget_get_window (search_window));
+ g_object_unref (((GdkEventKey *) new_event)->any.surface);
+ ((GdkEventKey *) new_event)->any.surface =
+ g_object_ref (gtk_widget_get_surface (search_window));
gtk_widget_realize (search_window);
popup_menu_id = g_signal_connect (tree_view->priv->search_entry,
@@ -7069,7 +7069,7 @@ drag_scan_timeout (gpointer data)
tree_view = GTK_TREE_VIEW (data);
seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (tree_view)));
- gdk_window_get_device_position (tree_view->priv->bin_window,
+ gdk_surface_get_device_position (tree_view->priv->bin_window,
gdk_seat_get_pointer (seat),
&x, &y, &state);
@@ -7432,7 +7432,7 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view)
gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->multipress_gesture),
GTK_EVENT_SEQUENCE_DENIED);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, start_x, start_y,
&bin_x, &bin_y);
gtk_tree_view_get_path_at_pos (tree_view, bin_x, bin_y, &path,
NULL, NULL, NULL);
@@ -9560,7 +9560,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
g_return_if_fail (tree_view->priv->column_drag_info == NULL);
g_return_if_fail (tree_view->priv->cur_reorder == NULL);
- g_return_if_fail (tree_view->priv->drag_window == NULL);
+ g_return_if_fail (tree_view->priv->drag_surface == NULL);
gtk_tree_view_set_column_drag_info (tree_view, column);
@@ -9575,14 +9575,14 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
gtk_widget_get_allocation (button, &button_allocation);
button_allocation.y = 0;
- tree_view->priv->drag_window = gdk_window_new_child (gtk_widget_get_window (GTK_WIDGET (tree_view)),
+ tree_view->priv->drag_surface = gdk_surface_new_child (gtk_widget_get_surface (GTK_WIDGET (tree_view)),
&button_allocation);
- gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_window);
+ gtk_widget_register_surface (GTK_WIDGET (tree_view), tree_view->priv->drag_surface);
/* Kids, don't try this at home */
g_object_ref (button);
gtk_container_remove (GTK_CONTAINER (tree_view), button);
- gtk_widget_set_parent_window (button, tree_view->priv->drag_window);
+ gtk_widget_set_parent_surface (button, tree_view->priv->drag_surface);
gtk_widget_set_parent (button, GTK_WIDGET (tree_view));
g_object_unref (button);
@@ -9593,7 +9593,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
gtk_widget_size_allocate (button, &allocation, -1, &clip);
tree_view->priv->drag_column = column;
- gdk_window_show (tree_view->priv->drag_window);
+ gdk_surface_show (tree_view->priv->drag_surface);
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
@@ -9603,7 +9603,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
* the implicit grab, replace it with an active one.
*/
gdk_seat_grab (gdk_device_get_seat (device),
- tree_view->priv->drag_window,
+ tree_view->priv->drag_surface,
GDK_SEAT_CAPABILITY_ALL, FALSE,
NULL, NULL, NULL, NULL);
@@ -10605,20 +10605,20 @@ send_focus_change (GtkWidget *widget,
{
GdkDevice *dev = d->data;
GdkEvent *fevent;
- GdkWindow *window;
+ GdkSurface *surface;
/* Skip non-master keyboards that haven't
- * selected for events from this window
+ * selected for events from this surface
*/
- window = gtk_widget_get_window (widget);
+ surface = gtk_widget_get_surface (widget);
if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER &&
- !gdk_window_get_device_events (window, dev))
+ !gdk_surface_get_device_events (surface, dev))
continue;
fevent = gdk_event_new (GDK_FOCUS_CHANGE);
fevent->any.type = GDK_FOCUS_CHANGE;
- fevent->any.window = g_object_ref (window);
+ fevent->any.surface = g_object_ref (surface);
fevent->focus_change.in = in;
gdk_event_set_device (fevent, device);
@@ -10666,7 +10666,7 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view)
GTK_WINDOW (tree_view->priv->search_window));
gtk_window_set_type_hint (GTK_WINDOW (tree_view->priv->search_window),
- GDK_WINDOW_TYPE_HINT_UTILITY);
+ GDK_SURFACE_TYPE_HINT_UTILITY);
gtk_window_set_modal (GTK_WINDOW (tree_view->priv->search_window), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (tree_view->priv->search_window),
GTK_WINDOW (toplevel));
@@ -12751,7 +12751,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view,
* Finds the path at the point (@x, @y), relative to bin_window coordinates.
* That is, @x and @y are relative to an events coordinates. Widget-relative
* coordinates must be converted using
- * gtk_tree_view_convert_widget_to_bin_window_coords(). It is primarily for
+ * gtk_tree_view_convert_widget_to_bin_surface_coords(). It is primarily for
* things like popup menus. If @path is non-%NULL, then it will be filled
* with the #GtkTreePath at that point. This path should be freed with
* gtk_tree_path_free(). If @column is non-%NULL, then it will be filled
@@ -12763,7 +12763,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view,
*
* For converting widget coordinates (eg. the ones you get from
* GtkWidget::query-tooltip), please see
- * gtk_tree_view_convert_widget_to_bin_window_coords().
+ * gtk_tree_view_convert_widget_to_bin_surface_coords().
*
* Returns: %TRUE if a row exists at that coordinate.
**/
@@ -13092,7 +13092,7 @@ gtk_tree_view_get_background_area (GtkTreeView *tree_view,
*
* Fills @visible_rect with the currently-visible region of the
* buffer, in tree coordinates. Convert to bin_window coordinates with
- * gtk_tree_view_convert_tree_to_bin_window_coords().
+ * gtk_tree_view_convert_tree_to_bin_surface_coords().
* Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
* scrollable area of the tree.
**/
@@ -13139,7 +13139,7 @@ gtk_tree_view_convert_widget_to_tree_coords (GtkTreeView *tree_view,
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view,
wx, wy,
&x, &y);
gtk_tree_view_convert_bin_window_to_tree_coords (tree_view,
@@ -13169,7 +13169,7 @@ gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view,
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
- gtk_tree_view_convert_tree_to_bin_window_coords (tree_view,
+ gtk_tree_view_convert_tree_to_bin_surface_coords (tree_view,
tx, ty,
&x, &y);
gtk_tree_view_convert_bin_window_to_widget_coords (tree_view,
@@ -13178,7 +13178,7 @@ gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view,
}
/**
- * gtk_tree_view_convert_widget_to_bin_window_coords:
+ * gtk_tree_view_convert_widget_to_bin_surface_coords:
* @tree_view: a #GtkTreeView
* @wx: X coordinate relative to the widget
* @wy: Y coordinate relative to the widget
@@ -13188,7 +13188,7 @@ gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view,
* Converts widget coordinates to coordinates for the bin_window.
**/
void
-gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view,
+gtk_tree_view_convert_widget_to_bin_surface_coords (GtkTreeView *tree_view,
gint wx,
gint wy,
gint *bx,
@@ -13228,7 +13228,7 @@ gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view,
}
/**
- * gtk_tree_view_convert_tree_to_bin_window_coords:
+ * gtk_tree_view_convert_tree_to_bin_surface_coords:
* @tree_view: a #GtkTreeView
* @tx: tree X coordinate
* @ty: tree Y coordinate
@@ -13239,7 +13239,7 @@ gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view,
* to bin_window coordinates.
**/
void
-gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view,
+gtk_tree_view_convert_tree_to_bin_surface_coords (GtkTreeView *tree_view,
gint tx,
gint ty,
gint *bx,
@@ -13363,11 +13363,11 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
*
* The @x and @y coordinate that are provided must be relative to bin_window
* coordinates. Widget-relative coordinates must be converted using
- * gtk_tree_view_convert_widget_to_bin_window_coords().
+ * gtk_tree_view_convert_widget_to_bin_surface_coords().
*
* For converting widget coordinates (eg. the ones you get from
* GtkWidget::query-tooltip), please see
- * gtk_tree_view_convert_widget_to_bin_window_coords().
+ * gtk_tree_view_convert_widget_to_bin_surface_coords().
*
* The @path, @column, @cell_x and @cell_y arguments will be filled in
* likewise as for gtk_tree_view_get_path_at_pos(). Please see
@@ -13747,7 +13747,7 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
* in the bottom fourth, drop after that row; if in the middle,
* and the row has children, drop into the row.
*/
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, drag_x, drag_y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, drag_x, drag_y,
&bin_x, &bin_y);
if (!gtk_tree_view_get_path_at_pos (tree_view,
@@ -13866,7 +13866,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view));
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (tree_view)),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (GTK_WIDGET (tree_view)),
CAIRO_CONTENT_COLOR,
bin_window_width + 2,
background_area.height + 2);
@@ -14280,13 +14280,13 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle workarea;
- GdkWindow *tree_window = gtk_widget_get_window (GTK_WIDGET (tree_view));
+ GdkSurface *tree_window = gtk_widget_get_surface (GTK_WIDGET (tree_view));
GtkRequisition requisition;
gtk_widget_realize (search_window);
display = gtk_widget_get_display (GTK_WIDGET (tree_view));
- monitor = gdk_display_get_monitor_at_window (display, tree_window);
+ monitor = gdk_display_get_monitor_at_surface (display, tree_window);
monitor = gdk_display_get_monitor (display, 0);
gdk_monitor_get_workarea (monitor, &workarea);
@@ -15456,7 +15456,7 @@ gtk_tree_view_get_tooltip_context (GtkTreeView *tree_view,
}
else
{
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, *x, *y,
+ gtk_tree_view_convert_widget_to_bin_surface_coords (tree_view, *x, *y,
x, y);
if (!gtk_tree_view_get_path_at_pos (tree_view, *x, *y,
diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h
index 61348106b1..de8f86c4bd 100644
--- a/gtk/gtktreeview.h
+++ b/gtk/gtktreeview.h
@@ -459,7 +459,7 @@ void gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view,
gint *wx,
gint *wy);
GDK_AVAILABLE_IN_ALL
-void gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view,
+void gtk_tree_view_convert_widget_to_bin_surface_coords (GtkTreeView *tree_view,
gint wx,
gint wy,
gint *bx,
@@ -471,7 +471,7 @@ void gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view,
gint *wx,
gint *wy);
GDK_AVAILABLE_IN_ALL
-void gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view,
+void gtk_tree_view_convert_tree_to_bin_surface_coords (GtkTreeView *tree_view,
gint tx,
gint ty,
gint *bx,
diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c
index eb13ead95e..36f51bc7be 100644
--- a/gtk/gtkvideo.c
+++ b/gtk/gtkvideo.c
@@ -103,7 +103,7 @@ gtk_video_realize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_video_parent_class)->realize (widget);
if (self->media_stream)
- gtk_media_stream_realize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self)));
+ gtk_media_stream_realize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self)));
if (self->file)
gtk_media_file_set_file (GTK_MEDIA_FILE (self->media_stream), self->file);
@@ -115,7 +115,7 @@ gtk_video_unrealize (GtkWidget *widget)
GtkVideo *self = GTK_VIDEO (widget);
if (self->media_stream)
- gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self)));
+ gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self)));
GTK_WIDGET_CLASS (gtk_video_parent_class)->unrealize (widget);
}
@@ -280,7 +280,7 @@ static void
gtk_video_init (GtkVideo *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->motion_controller = gtk_event_controller_motion_new (GTK_WIDGET (self));
g_signal_connect (self->motion_controller, "motion", G_CALLBACK (gtk_video_motion), self);
@@ -518,7 +518,7 @@ gtk_video_set_media_stream (GtkVideo *self,
gtk_video_notify_cb,
self);
if (gtk_widget_get_realized (GTK_WIDGET (self)))
- gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_window (GTK_WIDGET (self)));
+ gtk_media_stream_unrealize (self->media_stream, gtk_widget_get_surface (GTK_WIDGET (self)));
g_object_unref (self->media_stream);
self->media_stream = NULL;
}
@@ -527,7 +527,7 @@ gtk_video_set_media_stream (GtkVideo *self,
{
self->media_stream = g_object_ref (stream);
if (gtk_widget_get_realized (GTK_WIDGET (self)))
- gtk_media_stream_realize (stream, gtk_widget_get_window (GTK_WIDGET (self)));
+ gtk_media_stream_realize (stream, gtk_widget_get_surface (GTK_WIDGET (self)));
g_signal_connect (self->media_stream,
"notify",
G_CALLBACK (gtk_video_notify_cb),
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 3343586480..e16a5a48c3 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -358,7 +358,7 @@ gtk_viewport_init (GtkViewport *viewport)
widget = GTK_WIDGET (viewport);
- gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_has_surface (widget, FALSE);
priv->shadow_type = GTK_SHADOW_IN;
priv->hadjustment = NULL;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f78add8c09..9c8b5acb31 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -531,7 +531,7 @@ enum {
PROP_HAS_TOOLTIP,
PROP_TOOLTIP_MARKUP,
PROP_TOOLTIP_TEXT,
- PROP_WINDOW,
+ PROP_SURFACE,
PROP_OPACITY,
PROP_HALIGN,
PROP_VALIGN,
@@ -690,7 +690,7 @@ static void gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
gint height);
-static gboolean event_window_is_still_viewable (const GdkEvent *event);
+static gboolean event_surface_is_still_viewable (const GdkEvent *event);
static void gtk_widget_update_input_shape (GtkWidget *widget);
@@ -708,7 +708,7 @@ GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
static GQuark quark_accel_path = 0;
static GQuark quark_accel_closures = 0;
-static GQuark quark_parent_window = 0;
+static GQuark quark_parent_surface = 0;
static GQuark quark_shape_info = 0;
static GQuark quark_input_shape_info = 0;
static GQuark quark_pango_context = 0;
@@ -926,7 +926,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
quark_accel_path = g_quark_from_static_string ("gtk-accel-path");
quark_accel_closures = g_quark_from_static_string ("gtk-accel-closures");
- quark_parent_window = g_quark_from_static_string ("gtk-parent-window");
+ quark_parent_surface = g_quark_from_static_string ("gtk-parent-surface");
quark_shape_info = g_quark_from_static_string ("gtk-shape-info");
quark_input_shape_info = g_quark_from_static_string ("gtk-input-shape-info");
quark_pango_context = g_quark_from_static_string ("gtk-pango-context");
@@ -1174,15 +1174,15 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_PARAM_READWRITE);
/**
- * GtkWidget:window:
+ * GtkWidget:surface:
*
- * The widget's window if it is realized, %NULL otherwise.
+ * The widget's surface if it is realized, %NULL otherwise.
*/
- widget_props[PROP_WINDOW] =
- g_param_spec_object ("window",
- P_("Window"),
- P_("The widget’s window if it is realized"),
- GDK_TYPE_WINDOW,
+ widget_props[PROP_SURFACE] =
+ g_param_spec_object ("surface",
+ P_("Surface"),
+ P_("The widget’s surface if it is realized"),
+ GDK_TYPE_SURFACE,
GTK_PARAM_READABLE);
/**
@@ -1497,7 +1497,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* @widget: the object which received the signal.
*
* The ::realize signal is emitted when @widget is associated with a
- * #GdkWindow, which means that gtk_widget_realize() has been called or the
+ * #GdkSurface, which means that gtk_widget_realize() has been called or the
* widget has been mapped (that is, it is going to be drawn).
*/
widget_signals[REALIZE] =
@@ -1513,7 +1513,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* GtkWidget::unrealize:
* @widget: the object which received the signal.
*
- * The ::unrealize signal is emitted when the #GdkWindow associated with
+ * The ::unrealize signal is emitted when the #GdkSurface associated with
* @widget is destroyed, which means that gtk_widget_unrealize() has been
* called or the widget has been unmapped (that is, it is going to be
* hidden).
@@ -1830,7 +1830,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* The ::key-press-event signal is emitted when a key is pressed. The signal
* emission will reoccur at the key-repeat rate when the key is kept pressed.
*
- * To receive this signal, the #GdkWindow associated to the widget needs
+ * To receive this signal, the #GdkSurface associated to the widget needs
* to enable the #GDK_KEY_PRESS_MASK mask.
*
* This signal will be sent to the grab widget if there is one.
@@ -1857,7 +1857,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
*
* The ::key-release-event signal is emitted when a key is released.
*
- * To receive this signal, the #GdkWindow associated to the widget needs
+ * To receive this signal, the #GdkSurface associated to the widget needs
* to enable the #GDK_KEY_RELEASE_MASK mask.
*
* This signal will be sent to the grab widget if there is one.
@@ -2621,8 +2621,8 @@ gtk_widget_get_property (GObject *object,
case PROP_TOOLTIP_MARKUP:
g_value_set_string (value, g_object_get_qdata (object, quark_tooltip_markup));
break;
- case PROP_WINDOW:
- g_value_set_object (value, _gtk_widget_get_window (widget));
+ case PROP_SURFACE:
+ g_value_set_object (value, _gtk_widget_get_surface (widget));
break;
case PROP_HALIGN:
g_value_set_enum (value, gtk_widget_get_halign (widget));
@@ -2708,7 +2708,7 @@ _gtk_widget_emulate_press (GtkWidget *widget,
else if (event->any.type == GDK_MOTION_NOTIFY)
{
press = gdk_event_new (GDK_BUTTON_PRESS);
- press->any.window = g_object_ref (event->any.window);
+ press->any.surface = g_object_ref (event->any.surface);
press->button.time = event->motion.time;
press->button.x = event->motion.x;
press->button.y = event->motion.y;
@@ -3003,7 +3003,7 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
priv->clip = priv->allocation;
priv->user_alpha = 255;
priv->alpha = 255;
- priv->window = NULL;
+ priv->surface = NULL;
priv->parent = NULL;
priv->first_child = NULL;
priv->last_child = NULL;
@@ -3304,7 +3304,7 @@ gtk_widget_unparent (GtkWidget *widget)
* an embedded GtkWindow the window will become toplevel again and hierarchy-changed
* will fire again for the new subhierarchy.
*/
- gtk_widget_set_parent_window (widget, NULL);
+ gtk_widget_set_parent_surface (widget, NULL);
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
g_object_thaw_notify (G_OBJECT (widget));
@@ -3550,7 +3550,7 @@ gtk_widget_map (GtkWidget *widget)
update_cursor_on_state_change (widget);
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
gtk_widget_queue_draw (widget);
gtk_widget_pop_verify_invariants (widget);
@@ -3574,7 +3574,7 @@ gtk_widget_unmap (GtkWidget *widget)
g_object_ref (widget);
gtk_widget_push_verify_invariants (widget);
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
gtk_widget_queue_draw (widget);
_gtk_tooltip_hide (widget);
@@ -3851,7 +3851,7 @@ gtk_widget_disconnect_frame_clock (GtkWidget *widget,
* @widget: a #GtkWidget
*
* Creates the GDK (windowing system) resources associated with a
- * widget. For example, @widget->window will be created when a widget
+ * widget. For example, @widget->surface will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
@@ -3886,7 +3886,7 @@ gtk_widget_realize (GtkWidget *widget)
gtk_widget_push_verify_invariants (widget);
/*
- if (GTK_IS_CONTAINER (widget) && _gtk_widget_get_has_window (widget))
+ if (GTK_IS_CONTAINER (widget) && _gtk_widget_get_has_surface (widget))
g_message ("gtk_widget_realize(%s)", G_OBJECT_TYPE_NAME (widget));
*/
@@ -3906,13 +3906,13 @@ gtk_widget_realize (GtkWidget *widget)
if (priv->has_shape_mask)
{
region = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);
- gdk_window_shape_combine_region (priv->window, region, 0, 0);
+ gdk_surface_shape_combine_region (priv->surface, region, 0, 0);
}
gtk_widget_update_input_shape (widget);
if (priv->multidevice)
- gdk_window_set_support_multidevice (priv->window, TRUE);
+ gdk_surface_set_support_multidevice (priv->surface, TRUE);
gtk_widget_update_alpha (widget);
@@ -3931,7 +3931,7 @@ gtk_widget_realize (GtkWidget *widget)
*
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
- * associated with the widget, such as @widget->window).
+ * associated with the widget, such as @widget->surface).
**/
void
gtk_widget_unrealize (GtkWidget *widget)
@@ -3965,11 +3965,11 @@ gtk_widget_unrealize (GtkWidget *widget)
}
/*
- * Returns the values you're supposed to pass to gdk_window_move_resize
+ * Returns the values you're supposed to pass to gdk_surface_move_resize
* for a windowed widget.
*/
void
-gtk_widget_get_window_allocation (GtkWidget *widget,
+gtk_widget_get_surface_allocation (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkWidget *parent;
@@ -3977,7 +3977,7 @@ gtk_widget_get_window_allocation (GtkWidget *widget,
/* Don't consider the parent == widget case here. */
parent = _gtk_widget_get_parent (widget);
- while (parent && !_gtk_widget_get_has_window (parent))
+ while (parent && !_gtk_widget_get_has_surface (parent))
parent = _gtk_widget_get_parent (parent);
g_assert (GTK_IS_WINDOW (parent) || GTK_IS_POPOVER (parent));
@@ -4052,7 +4052,7 @@ gtk_widget_queue_draw (GtkWidget *widget)
parent = _gtk_widget_get_parent (widget);
rect = &widget->priv->clip;
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
gtk_widget_queue_draw_area (parent ? parent : widget,
rect->x, rect->y, rect->width, rect->height);
else
@@ -4210,15 +4210,15 @@ gtk_widget_get_frame_clock (GtkWidget *widget)
{
/* We use gtk_widget_get_toplevel() here to make it explicit that
* the frame clock is a property of the toplevel that a widget
- * is anchored to; gdk_window_get_toplevel() will go up the
+ * is anchored to; gdk_surface_get_toplevel() will go up the
* hierarchy anyways, but should squash any funny business with
* reparenting windows and widgets.
*/
GtkWidget *toplevel = _gtk_widget_get_toplevel (widget);
- GdkWindow *window = _gtk_widget_get_window (toplevel);
- g_assert (window != NULL);
+ GdkSurface *surface = _gtk_widget_get_surface (toplevel);
+ g_assert (surface != NULL);
- return gdk_window_get_frame_clock (window);
+ return gdk_surface_get_frame_clock (surface);
}
else
{
@@ -4304,7 +4304,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget,
if (!_gtk_widget_get_parent (widget))
{
- g_assert (_gtk_widget_get_has_window (widget));
+ g_assert (_gtk_widget_get_has_surface (widget));
region2 = cairo_region_copy (region);
windowed_parent = widget;
goto invalidate;
@@ -4321,7 +4321,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget,
/* Look for the parent with a window and invalidate @region in there. */
windowed_parent = widget;
- while (windowed_parent != NULL && !_gtk_widget_get_has_window (windowed_parent))
+ while (windowed_parent != NULL && !_gtk_widget_get_has_surface (windowed_parent))
windowed_parent = _gtk_widget_get_parent (windowed_parent);
g_assert (windowed_parent != NULL);
@@ -4338,7 +4338,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget,
/* At this point, x and y are relative to the windowed parent's origin,
* but the window of the parent spans over its entire allocation, so we need
* to account for border and padding manually. The values returned from
- * gtk_widget_get_window_allocation, which should've been used to size and position
+ * gtk_widget_get_surface_allocation, which should've been used to size and position
* @parent's window, do not include widget margins nor css margins.
*/
parent_style = gtk_css_node_get_style (windowed_parent->priv->cssnode);
@@ -4352,7 +4352,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget,
invalidate:
gtk_debug_updates_add (windowed_parent, region2);
- gdk_window_invalidate_region (_gtk_widget_get_window (widget), region2, TRUE);
+ gdk_surface_invalidate_region (_gtk_widget_get_surface (widget), region2, TRUE);
cairo_region_destroy (region2);
@@ -4547,7 +4547,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
real_allocation.height = 0;
}
- if (G_UNLIKELY (_gtk_widget_get_has_window (widget)))
+ if (G_UNLIKELY (_gtk_widget_get_has_surface (widget)))
{
real_allocation.width = MAX (1, real_allocation.width);
real_allocation.height = MAX (1, real_allocation.height);
@@ -4570,12 +4570,12 @@ gtk_widget_size_allocate (GtkWidget *widget,
/* Still have to move the window... */
if (_gtk_widget_get_realized (widget) &&
- _gtk_widget_get_has_window (widget))
+ _gtk_widget_get_has_surface (widget))
{
GtkAllocation window_alloc;
- gtk_widget_get_window_allocation (widget, &window_alloc);
- gdk_window_move_resize (priv->window,
+ gtk_widget_get_surface_allocation (widget, &window_alloc);
+ gdk_surface_move_resize (priv->surface,
window_alloc.x, window_alloc.y,
window_alloc.width, window_alloc.height);
}
@@ -4884,12 +4884,12 @@ gtk_widget_real_size_allocate (GtkWidget *widget,
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
if (_gtk_widget_get_realized (widget) &&
- _gtk_widget_get_has_window (widget))
+ _gtk_widget_get_has_surface (widget))
{
GtkAllocation window_alloc;
- gtk_widget_get_window_allocation (widget, &window_alloc);
- gdk_window_move_resize (priv->window,
+ gtk_widget_get_surface_allocation (widget, &window_alloc);
+ gdk_surface_move_resize (priv->surface,
window_alloc.x, window_alloc.y,
window_alloc.width, window_alloc.height);
}
@@ -5008,7 +5008,7 @@ gtk_widget_real_can_activate_accel (GtkWidget *widget,
/* widgets must be onscreen for accels to take effect */
return gtk_widget_is_sensitive (widget) &&
_gtk_widget_is_drawable (widget) &&
- gdk_window_is_viewable (priv->window);
+ gdk_surface_is_viewable (priv->surface);
}
/**
@@ -5441,7 +5441,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
if (gdk_cairo_get_clip_rectangle (cr, NULL))
{
GtkWidgetClass *widget_class = GTK_WIDGET_GET_CLASS (widget);
- GdkWindow *event_window = NULL;
+ GdkSurface *event_surface = NULL;
gboolean result;
RenderMode mode;
@@ -5542,7 +5542,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
#endif
if (cairo_status (cr) &&
- event_window != NULL)
+ event_surface != NULL)
{
/* We check the event so we only warn about internal GTK+ calls.
* Errors might come from PDF streams having write failures and
@@ -5640,8 +5640,8 @@ gtk_widget_event (GtkWidget *widget,
if (event->any.type == GDK_EXPOSE)
{
g_warning ("Events of type GDK_EXPOSE cannot be synthesized. To get "
- "the same effect, call gdk_window_invalidate_rect/region(), "
- "followed by gdk_window_process_updates().");
+ "the same effect, call gdk_surface_invalidate_rect/region(), "
+ "followed by gdk_surface_process_updates().");
return TRUE;
}
@@ -5740,12 +5740,12 @@ _gtk_widget_captured_event (GtkWidget *widget,
if (event->any.type == GDK_EXPOSE)
{
g_warning ("Events of type GDK_EXPOSE cannot be synthesized. To get "
- "the same effect, call gdk_window_invalidate_rect/region(), "
- "followed by gdk_window_process_updates().");
+ "the same effect, call gdk_surface_invalidate_rect/region(), "
+ "followed by gdk_surface_process_updates().");
return TRUE;
}
- if (!event_window_is_still_viewable (event))
+ if (!event_surface_is_still_viewable (event))
return TRUE;
event_copy = gdk_event_copy (event);
@@ -5771,7 +5771,7 @@ out:
}
static gboolean
-event_window_is_still_viewable (const GdkEvent *event)
+event_surface_is_still_viewable (const GdkEvent *event)
{
/* Check that we think the event's window is viewable before
* delivering the event, to prevent surprises. We do this here
@@ -5787,7 +5787,7 @@ event_window_is_still_viewable (const GdkEvent *event)
case GDK_ENTER_NOTIFY:
case GDK_PROXIMITY_IN:
case GDK_SCROLL:
- return event->any.window && gdk_window_is_viewable (event->any.window);
+ return event->any.surface && gdk_surface_is_viewable (event->any.surface);
#if 0
/* The following events are the second half of paired events;
@@ -5841,7 +5841,7 @@ gtk_widget_event_internal (GtkWidget *widget,
* they are responsible for returning TRUE to terminate
* handling.
*/
- if (!event_window_is_still_viewable (event))
+ if (!event_surface_is_still_viewable (event))
return TRUE;
/* Non input events get handled right away */
@@ -6019,7 +6019,7 @@ gtk_widget_intersect (GtkWidget *widget,
return_val = gdk_rectangle_intersect (&priv->allocation, area, dest);
- if (return_val && intersection && _gtk_widget_get_has_window (widget))
+ if (return_val && intersection && _gtk_widget_get_has_surface (widget))
{
intersection->x -= priv->allocation.x;
intersection->y -= priv->allocation.y;
@@ -6989,50 +6989,50 @@ gtk_widget_is_visible (GtkWidget *widget)
}
/**
- * gtk_widget_set_has_window:
+ * gtk_widget_set_has_surface:
* @widget: a #GtkWidget
- * @has_window: whether or not @widget has a window.
+ * @has_surface: whether or not @widget has a window.
*
- * Specifies whether @widget has a #GdkWindow of its own. Note that
+ * Specifies whether @widget has a #GdkSurface of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
- * (gtk_widget_get_window() never returns a %NULL window when a widget
- * is realized), but for many of them it’s actually the #GdkWindow of
+ * (gtk_widget_get_surface() never returns a %NULL window when a widget
+ * is realized), but for many of them it’s actually the #GdkSurface of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
- * calling this function with @has_window = %FALSE.
+ * calling this function with @has_surface = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
**/
void
-gtk_widget_set_has_window (GtkWidget *widget,
- gboolean has_window)
+gtk_widget_set_has_surface (GtkWidget *widget,
+ gboolean has_surface)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- widget->priv->no_window = !has_window;
- widget->priv->no_window_set = TRUE;
+ widget->priv->no_surface = !has_surface;
+ widget->priv->no_surface_set = TRUE;
- /* GdkWindow has a min size of 1×1 */
+ /* GdkSurface has a min size of 1×1 */
widget->priv->allocation.width = 1;
widget->priv->allocation.height = 1;
}
/**
- * gtk_widget_get_has_window:
+ * gtk_widget_get_has_surface:
* @widget: a #GtkWidget
*
- * Determines whether @widget has a #GdkWindow of its own. See
- * gtk_widget_set_has_window().
+ * Determines whether @widget has a #GdkSurface of its own. See
+ * gtk_widget_set_has_surface().
*
* Returns: %TRUE if @widget has a window, %FALSE otherwise
**/
gboolean
-gtk_widget_get_has_window (GtkWidget *widget)
+gtk_widget_get_has_surface (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return ! widget->priv->no_window;
+ return ! widget->priv->no_surface;
}
/**
@@ -7101,7 +7101,7 @@ gtk_widget_get_realized (GtkWidget *widget)
* @realized: %TRUE to mark the widget as realized
*
* Marks the widget as being realized. This function must only be
- * called after all #GdkWindows for the @widget have been created
+ * called after all #GdkSurfaces for the @widget have been created
* and registered.
*
* This function should only ever be called in a derived widget's
@@ -8058,13 +8058,13 @@ gtk_widget_create_pango_layout (GtkWidget *widget,
}
/**
- * gtk_widget_set_parent_window:
+ * gtk_widget_set_parent_surface:
* @widget: a #GtkWidget.
- * @parent_window: the new parent window.
+ * @parent_surface: the new parent window.
*
* Sets a non default parent window for @widget.
*
- * For #GtkWindow classes, setting a @parent_window effects whether
+ * For #GtkWindow classes, setting a @parent_surface effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
@@ -8072,30 +8072,30 @@ gtk_widget_create_pango_layout (GtkWidget *widget,
* window is realized.
*/
void
-gtk_widget_set_parent_window (GtkWidget *widget,
- GdkWindow *parent_window)
+gtk_widget_set_parent_surface (GtkWidget *widget,
+ GdkSurface *parent_surface)
{
- GdkWindow *old_parent_window;
+ GdkSurface *old_parent_surface;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (!GTK_IS_WINDOW (widget));
- old_parent_window = g_object_get_qdata (G_OBJECT (widget),
- quark_parent_window);
+ old_parent_surface = g_object_get_qdata (G_OBJECT (widget),
+ quark_parent_surface);
- if (parent_window != old_parent_window)
+ if (parent_surface != old_parent_surface)
{
- g_object_set_qdata (G_OBJECT (widget), quark_parent_window,
- parent_window);
- if (old_parent_window)
- g_object_unref (old_parent_window);
- if (parent_window)
- g_object_ref (parent_window);
+ g_object_set_qdata (G_OBJECT (widget), quark_parent_surface,
+ parent_surface);
+ if (old_parent_surface)
+ g_object_unref (old_parent_surface);
+ if (parent_surface)
+ g_object_ref (parent_surface);
}
}
/**
- * gtk_widget_get_parent_window:
+ * gtk_widget_get_parent_surface:
* @widget: a #GtkWidget.
*
* Gets @widget’s parent window, or %NULL if it does not have one.
@@ -8103,20 +8103,20 @@ gtk_widget_set_parent_window (GtkWidget *widget,
* Returns: (transfer none) (nullable): the parent window of @widget, or %NULL
* if it does not have a parent window.
**/
-GdkWindow *
-gtk_widget_get_parent_window (GtkWidget *widget)
+GdkSurface *
+gtk_widget_get_parent_surface (GtkWidget *widget)
{
GtkWidgetPrivate *priv;
- GdkWindow *parent_window;
+ GdkSurface *parent_surface;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
priv = widget->priv;
- parent_window = g_object_get_qdata (G_OBJECT (widget), quark_parent_window);
+ parent_surface = g_object_get_qdata (G_OBJECT (widget), quark_parent_surface);
- return (parent_window != NULL) ? parent_window :
- (priv->parent != NULL) ? priv->parent->priv->window : NULL;
+ return (parent_surface != NULL) ? parent_surface :
+ (priv->parent != NULL) ? priv->parent->priv->surface : NULL;
}
@@ -8232,7 +8232,7 @@ _gtk_widget_scale_changed (GtkWidget *widget)
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
- * See gdk_window_get_scale_factor().
+ * See gdk_surface_get_scale_factor().
*
* Returns: the scale factor for @widget
*/
@@ -8246,7 +8246,7 @@ gtk_widget_get_scale_factor (GtkWidget *widget)
g_return_val_if_fail (GTK_IS_WIDGET (widget), 1);
if (_gtk_widget_get_realized (widget))
- return gdk_window_get_scale_factor (_gtk_widget_get_window (widget));
+ return gdk_surface_get_scale_factor (_gtk_widget_get_surface (widget));
toplevel = _gtk_widget_get_toplevel (widget);
if (toplevel && toplevel != widget)
@@ -8404,9 +8404,9 @@ gtk_widget_keynav_failed (GtkWidget *widget,
*
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
- * gdk_window_beep(), otherwise it does nothing.
+ * gdk_surface_beep(), otherwise it does nothing.
*
- * Note that the effect of gdk_window_beep() can be configured in many
+ * Note that the effect of gdk_surface_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
**/
@@ -8429,8 +8429,8 @@ gtk_widget_error_bell (GtkWidget *widget)
"gtk-error-bell", &beep,
NULL);
- if (beep && priv->window)
- gdk_window_beep (priv->window);
+ if (beep && priv->surface)
+ gdk_surface_beep (priv->surface);
}
static void
@@ -8858,9 +8858,9 @@ gtk_widget_constructed (GObject *object)
G_OBJECT_CLASS (gtk_widget_parent_class)->constructed (object);
- if (!widget->priv->no_window_set)
+ if (!widget->priv->no_surface_set)
{
- g_warning ("%s does not call gtk_widget_set_has_window() in its init function", G_OBJECT_TYPE_NAME (widget));
+ g_warning ("%s does not call gtk_widget_set_has_surface() in its init function", G_OBJECT_TYPE_NAME (widget));
}
}
@@ -9148,8 +9148,8 @@ gtk_widget_real_map (GtkWidget *widget)
GtkWidget *p;
priv->mapped = TRUE;
- if (_gtk_widget_get_has_window (widget))
- gdk_window_show (priv->window);
+ if (_gtk_widget_get_has_surface (widget))
+ gdk_surface_show (priv->surface);
for (p = gtk_widget_get_first_child (widget);
p != NULL;
@@ -9181,8 +9181,8 @@ gtk_widget_real_unmap (GtkWidget *widget)
GtkWidget *child;
priv->mapped = FALSE;
- if (_gtk_widget_get_has_window (widget))
- gdk_window_hide (priv->window);
+ if (_gtk_widget_get_has_surface (widget))
+ gdk_surface_hide (priv->surface);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
@@ -9210,13 +9210,13 @@ gtk_widget_real_realize (GtkWidget *widget)
{
GtkWidgetPrivate *priv = widget->priv;
- g_assert (!_gtk_widget_get_has_window (widget));
+ g_assert (!_gtk_widget_get_has_surface (widget));
gtk_widget_set_realized (widget, TRUE);
if (priv->parent)
{
- priv->window = gtk_widget_get_parent_window (widget);
- g_object_ref (priv->window);
+ priv->surface = gtk_widget_get_parent_surface (widget);
+ g_object_ref (priv->surface);
}
}
@@ -9236,23 +9236,23 @@ gtk_widget_real_unrealize (GtkWidget *widget)
g_assert (!widget->priv->mapped);
/* We must do unrealize child widget BEFORE container widget.
- * gdk_window_destroy() destroys specified xwindow and its sub-xwindows.
+ * gdk_surface_destroy() destroys specified xwindow and its sub-xwindows.
* So, unrealizing container widget before its children causes the problem
* (for example, gdk_ic_destroy () with destroyed window causes crash.)
*/
gtk_widget_forall (widget, (GtkCallback)gtk_widget_unrealize, NULL);
- if (_gtk_widget_get_has_window (widget))
+ if (_gtk_widget_get_has_surface (widget))
{
- gtk_widget_unregister_window (widget, priv->window);
- gdk_window_destroy (priv->window);
- priv->window = NULL;
+ gtk_widget_unregister_surface (widget, priv->surface);
+ gdk_surface_destroy (priv->surface);
+ priv->surface = NULL;
}
else
{
- g_object_unref (priv->window);
- priv->window = NULL;
+ g_object_unref (priv->surface);
+ priv->surface = NULL;
}
gtk_widget_set_realized (widget, FALSE);
@@ -9311,14 +9311,14 @@ gtk_widget_adjust_baseline_request (GtkWidget *widget,
static gboolean
is_my_window (GtkWidget *widget,
- GdkWindow *window)
+ GdkSurface *window)
{
gpointer user_data;
if (!window)
return FALSE;
- gdk_window_get_user_data (window, &user_data);
+ gdk_surface_get_user_data (window, &user_data);
return (user_data == widget);
}
@@ -9329,11 +9329,11 @@ is_my_window (GtkWidget *widget,
*
* Returns: (nullable): the window of @widget that @device is in, or %NULL
*/
-GdkWindow *
+GdkSurface *
_gtk_widget_get_device_window (GtkWidget *widget,
GdkDevice *device)
{
- GdkWindow *window;
+ GdkSurface *window;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
@@ -9341,7 +9341,7 @@ _gtk_widget_get_device_window (GtkWidget *widget,
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
return NULL;
- window = gdk_device_get_last_event_window (device);
+ window = gdk_device_get_last_event_surface (device);
if (window && is_my_window (widget, window))
return window;
else
@@ -9373,14 +9373,14 @@ _gtk_widget_list_devices (GtkWidget *widget)
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
device = gdk_seat_get_pointer (seat);
- if (is_my_window (widget, gdk_device_get_last_event_window (device)))
+ if (is_my_window (widget, gdk_device_get_last_event_surface (device)))
result = g_list_prepend (result, device);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL_POINTING);
for (l = devices; l; l = l->next)
{
device = l->data;
- if (is_my_window (widget, gdk_device_get_last_event_window (device)))
+ if (is_my_window (widget, gdk_device_get_last_event_surface (device)))
result = g_list_prepend (result, device);
}
g_list_free (devices);
@@ -9391,7 +9391,7 @@ _gtk_widget_list_devices (GtkWidget *widget)
static void
synth_crossing (GtkWidget *widget,
GdkEventType type,
- GdkWindow *window,
+ GdkSurface *surface,
GdkDevice *device,
GdkCrossingMode mode,
GdkNotifyType detail)
@@ -9400,14 +9400,14 @@ synth_crossing (GtkWidget *widget,
event = gdk_event_new (type);
- event->any.window = g_object_ref (window);
+ event->any.surface = g_object_ref (surface);
event->any.send_event = TRUE;
- event->crossing.subwindow = g_object_ref (window);
+ event->crossing.child_surface = g_object_ref (surface);
event->crossing.time = GDK_CURRENT_TIME;
gdk_device_get_position_double (device,
&event->crossing.x_root,
&event->crossing.y_root);
- gdk_window_get_device_position_double (window,
+ gdk_surface_get_device_position_double (surface,
device,
&event->crossing.x,
&event->crossing.y,
@@ -9464,7 +9464,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
GdkDevice *device,
GdkCrossingMode mode)
{
- GdkWindow *from_window = NULL, *to_window = NULL;
+ GdkSurface *from_window = NULL, *to_window = NULL;
g_return_if_fail (from != NULL || to != NULL);
@@ -9473,7 +9473,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
from_window = _gtk_widget_get_device_window (from, device);
if (!from_window)
- from_window = from->priv->window;
+ from_window = from->priv->surface;
}
if (to != NULL)
@@ -9481,7 +9481,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
to_window = _gtk_widget_get_device_window (to, device);
if (!to_window)
- to_window = to->priv->window;
+ to_window = to->priv->surface;
}
if (from_window == NULL && to_window == NULL)
@@ -9489,11 +9489,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
else if (from_window != NULL && to_window == NULL)
{
GList *from_ancestors = NULL, *list;
- GdkWindow *from_ancestor = from_window;
+ GdkSurface *from_ancestor = from_window;
while (from_ancestor != NULL)
{
- from_ancestor = gdk_window_get_parent (from_ancestor);
+ from_ancestor = gdk_surface_get_parent (from_ancestor);
if (from_ancestor == NULL)
break;
from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
@@ -9503,7 +9503,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
device, mode, GDK_NOTIFY_ANCESTOR);
for (list = g_list_last (from_ancestors); list; list = list->prev)
{
- synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_VIRTUAL);
}
@@ -9514,11 +9514,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
else if (from_window == NULL && to_window != NULL)
{
GList *to_ancestors = NULL, *list;
- GdkWindow *to_ancestor = to_window;
+ GdkSurface *to_ancestor = to_window;
while (to_ancestor != NULL)
{
- to_ancestor = gdk_window_get_parent (to_ancestor);
+ to_ancestor = gdk_surface_get_parent (to_ancestor);
if (to_ancestor == NULL)
break;
to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
@@ -9528,7 +9528,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
for (list = to_ancestors; list; list = list->next)
{
- synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_VIRTUAL);
}
synth_crossing (to, GDK_ENTER_NOTIFY, to_window,
@@ -9541,13 +9541,13 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
else
{
GList *from_ancestors = NULL, *to_ancestors = NULL, *list;
- GdkWindow *from_ancestor = from_window, *to_ancestor = to_window;
+ GdkSurface *from_ancestor = from_window, *to_ancestor = to_window;
while (from_ancestor != NULL || to_ancestor != NULL)
{
if (from_ancestor != NULL)
{
- from_ancestor = gdk_window_get_parent (from_ancestor);
+ from_ancestor = gdk_surface_get_parent (from_ancestor);
if (from_ancestor == to_window)
break;
if (from_ancestor)
@@ -9555,7 +9555,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
}
if (to_ancestor != NULL)
{
- to_ancestor = gdk_window_get_parent (to_ancestor);
+ to_ancestor = gdk_surface_get_parent (to_ancestor);
if (to_ancestor == from_window)
break;
if (to_ancestor)
@@ -9568,7 +9568,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
synth_crossing (from, GDK_LEAVE_NOTIFY, from_window,
device, mode, GDK_NOTIFY_INFERIOR);
for (list = to_ancestors; list; list = list->next)
- synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_VIRTUAL);
synth_crossing (to, GDK_ENTER_NOTIFY, to_window,
device, mode, GDK_NOTIFY_ANCESTOR);
@@ -9579,7 +9579,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
device, mode, GDK_NOTIFY_ANCESTOR);
for (list = g_list_last (from_ancestors); list; list = list->prev)
{
- synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_VIRTUAL);
}
if (mode != GDK_CROSSING_GTK_GRAB)
@@ -9601,12 +9601,12 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
for (list = g_list_last (from_ancestors); list; list = list->prev)
{
- synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL);
}
for (list = to_ancestors; list; list = list->next)
{
- synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data,
+ synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data,
device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL);
}
synth_crossing (to, GDK_ENTER_NOTIFY, to_window,
@@ -9663,14 +9663,14 @@ gtk_widget_propagate_state (GtkWidget *widget,
if (!priv->shadowed &&
(new_flags & GTK_STATE_FLAG_INSENSITIVE) != (old_flags & GTK_STATE_FLAG_INSENSITIVE))
{
- GList *event_windows = NULL;
+ GList *event_surfaces = NULL;
GList *devices, *d;
devices = _gtk_widget_list_devices (widget);
for (d = devices; d; d = d->next)
{
- GdkWindow *window;
+ GdkSurface *window;
GdkDevice *device;
device = d->data;
@@ -9679,8 +9679,8 @@ gtk_widget_propagate_state (GtkWidget *widget,
/* Do not propagate more than once to the
* same window if non-multidevice aware.
*/
- if (!gdk_window_get_support_multidevice (window) &&
- g_list_find (event_windows, window))
+ if (!gdk_surface_get_support_multidevice (window) &&
+ g_list_find (event_surfaces, window))
continue;
if (!gtk_widget_is_sensitive (widget))
@@ -9690,10 +9690,10 @@ gtk_widget_propagate_state (GtkWidget *widget,
_gtk_widget_synthesize_crossing (NULL, widget, d->data,
GDK_CROSSING_STATE_CHANGED);
- event_windows = g_list_prepend (event_windows, window);
+ event_surfaces = g_list_prepend (event_surfaces, window);
}
- g_list_free (event_windows);
+ g_list_free (event_surfaces);
g_list_free (devices);
}
@@ -9726,8 +9726,8 @@ gtk_widget_propagate_state (GtkWidget *widget,
* @widget: a #GtkWidget
* @region: (allow-none): shape to be added, or %NULL to remove an existing shape
*
- * Sets a shape for this widget’s GDK window. This allows for
- * transparent windows etc., see gdk_window_shape_combine_region()
+ * Sets a shape for this widget’s GDK surface. This allows for
+ * transparent windows etc., see gdk_surface_shape_combine_region()
* for more information.
**/
void
@@ -9737,8 +9737,8 @@ gtk_widget_shape_combine_region (GtkWidget *widget,
GtkWidgetPrivate *priv;
g_return_if_fail (GTK_IS_WIDGET (widget));
- /* set_shape doesn't work on widgets without GDK window */
- g_return_if_fail (_gtk_widget_get_has_window (widget));
+ /* set_shape doesn't work on widgets without GDK surface */
+ g_return_if_fail (_gtk_widget_get_has_surface (widget));
priv = widget->priv;
@@ -9746,8 +9746,8 @@ gtk_widget_shape_combine_region (GtkWidget *widget,
{
priv->has_shape_mask = FALSE;
- if (priv->window)
- gdk_window_shape_combine_region (priv->window, NULL, 0, 0);
+ if (priv->surface)
+ gdk_surface_shape_combine_region (priv->surface, NULL, 0, 0);
g_object_set_qdata (G_OBJECT (widget), quark_shape_info, NULL);
}
@@ -9759,11 +9759,11 @@ gtk_widget_shape_combine_region (GtkWidget *widget,
cairo_region_copy (region),
(GDestroyNotify) cairo_region_destroy);
- /* set shape if widget has a GDK window already.
+ /* set shape if widget has a GDK surface already.
* otherwise the shape is scheduled to be set by gtk_widget_realize().
*/
- if (priv->window)
- gdk_window_shape_combine_region (priv->window, region, 0, 0);
+ if (priv->surface)
+ gdk_surface_shape_combine_region (priv->surface, region, 0, 0);
}
}
@@ -9772,10 +9772,10 @@ gtk_widget_update_input_shape (GtkWidget *widget)
{
GtkWidgetPrivate *priv = widget->priv;
- /* set shape if widget has a GDK window already.
+ /* set shape if widget has a GDK surface already.
* otherwise the shape is scheduled to be set by gtk_widget_realize().
*/
- if (priv->window)
+ if (priv->surface)
{
cairo_region_t *region;
cairo_region_t *csd_region;
@@ -9800,7 +9800,7 @@ gtk_widget_update_input_shape (GtkWidget *widget)
else
region = NULL;
- gdk_window_input_shape_combine_region (priv->window, region, 0, 0);
+ gdk_surface_input_shape_combine_region (priv->surface, region, 0, 0);
if (free_region)
cairo_region_destroy (region);
@@ -9825,17 +9825,17 @@ gtk_widget_set_csd_input_shape (GtkWidget *widget,
* @widget: a #GtkWidget
* @region: (allow-none): shape to be added, or %NULL to remove an existing shape
*
- * Sets an input shape for this widget’s GDK window. This allows for
+ * Sets an input shape for this widget’s GDK surface. This allows for
* windows which react to mouse click in a nonrectangular region, see
- * gdk_window_input_shape_combine_region() for more information.
+ * gdk_surface_input_shape_combine_region() for more information.
**/
void
gtk_widget_input_shape_combine_region (GtkWidget *widget,
cairo_region_t *region)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- /* set_shape doesn't work on widgets without GDK window */
- g_return_if_fail (_gtk_widget_get_has_window (widget));
+ /* set_shape doesn't work on widgets without GDK surface */
+ g_return_if_fail (_gtk_widget_get_has_surface (widget));
if (region == NULL)
g_object_set_qdata (G_OBJECT (widget), quark_input_shape_info, NULL);
@@ -12142,115 +12142,115 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget)
}
/**
- * gtk_widget_set_window:
+ * gtk_widget_set_surface:
* @widget: a #GtkWidget
- * @window: (transfer full): a #GdkWindow
+ * @surface: (transfer full): a #GdkSurface
*
- * Sets a widget’s window. This function should only be used in a
- * widget’s #GtkWidget::realize implementation. The %window passed is
- * usually either new window created with gdk_window_new(), or the
- * window of its parent widget as returned by
- * gtk_widget_get_parent_window().
+ * Sets a widget’s surface. This function should only be used in a
+ * widget’s #GtkWidget::realize implementation. The %surface passed is
+ * usually either new surface created with gdk_surface_new(), or the
+ * surface of its parent widget as returned by
+ * gtk_widget_get_parent_surface().
*
- * Widgets must indicate whether they will create their own #GdkWindow
- * by calling gtk_widget_set_has_window(). This is usually done in the
+ * Widgets must indicate whether they will create their own #GdkSurface
+ * by calling gtk_widget_set_has_surface(). This is usually done in the
* widget’s init() function.
*
- * Note that this function does not add any reference to @window.
+ * Note that this function does not add any reference to @surface.
*/
void
-gtk_widget_set_window (GtkWidget *widget,
- GdkWindow *window)
+gtk_widget_set_surface (GtkWidget *widget,
+ GdkSurface *surface)
{
GtkWidgetPrivate *priv;
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
+ g_return_if_fail (surface == NULL || GDK_IS_SURFACE (surface));
priv = widget->priv;
- if (priv->window != window)
+ if (priv->surface != surface)
{
- priv->window = window;
+ priv->surface = surface;
- g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WINDOW]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_SURFACE]);
}
}
/**
- * gtk_widget_register_window:
+ * gtk_widget_register_surface:
* @widget: a #GtkWidget
- * @window: a #GdkWindow
+ * @surface: a #GdkSurface
*
- * Registers a #GdkWindow with the widget and sets it up so that
- * the widget receives events for it. Call gtk_widget_unregister_window()
- * when destroying the window.
+ * Registers a #GdkSurface with the widget and sets it up so that
+ * the widget receives events for it. Call gtk_widget_unregister_surface()
+ * when destroying the surface.
*
- * Before 3.8 you needed to call gdk_window_set_user_data() directly to set
- * this up. This is now deprecated and you should use gtk_widget_register_window()
+ * Before 3.8 you needed to call gdk_surface_set_user_data() directly to set
+ * this up. This is now deprecated and you should use gtk_widget_register_surface()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
*/
void
-gtk_widget_register_window (GtkWidget *widget,
- GdkWindow *window)
+gtk_widget_register_surface (GtkWidget *widget,
+ GdkSurface *surface)
{
GtkWidgetPrivate *priv;
gpointer user_data;
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
- gdk_window_get_user_data (window, &user_data);
+ gdk_surface_get_user_data (surface, &user_data);
g_assert (user_data == NULL);
priv = widget->priv;
- gdk_window_set_user_data (window, widget);
- priv->registered_windows = g_list_prepend (priv->registered_windows, window);
+ gdk_surface_set_user_data (surface, widget);
+ priv->registered_surfaces = g_list_prepend (priv->registered_surfaces, surface);
}
/**
- * gtk_widget_unregister_window:
+ * gtk_widget_unregister_surface:
* @widget: a #GtkWidget
- * @window: a #GdkWindow
+ * @surface: a #GdkSurface
*
- * Unregisters a #GdkWindow from the widget that was previously set up with
- * gtk_widget_register_window(). You need to call this when the window is
+ * Unregisters a #GdkSurface from the widget that was previously set up with
+ * gtk_widget_register_surface(). You need to call this when the surface is
* no longer used by the widget, such as when you destroy it.
*/
void
-gtk_widget_unregister_window (GtkWidget *widget,
- GdkWindow *window)
+gtk_widget_unregister_surface (GtkWidget *widget,
+ GdkSurface *surface)
{
GtkWidgetPrivate *priv;
gpointer user_data;
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (GDK_IS_SURFACE (surface));
priv = widget->priv;
- gdk_window_get_user_data (window, &user_data);
+ gdk_surface_get_user_data (surface, &user_data);
g_assert (user_data == widget);
- gdk_window_set_user_data (window, NULL);
- priv->registered_windows = g_list_remove (priv->registered_windows, window);
+ gdk_surface_set_user_data (surface, NULL);
+ priv->registered_surfaces = g_list_remove (priv->registered_surfaces, surface);
}
/**
- * gtk_widget_get_window:
+ * gtk_widget_get_surface:
* @widget: a #GtkWidget
*
- * Returns the widget’s window if it is realized, %NULL otherwise
+ * Returns the widget’s surface if it is realized, %NULL otherwise
*
- * Returns: (transfer none) (nullable): @widget’s window.
+ * Returns: (transfer none) (nullable): @widget’s surface.
*/
-GdkWindow*
-gtk_widget_get_window (GtkWidget *widget)
+GdkSurface*
+gtk_widget_get_surface (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- return widget->priv->window;
+ return widget->priv->surface;
}
/**
@@ -12277,8 +12277,8 @@ gtk_widget_get_support_multidevice (GtkWidget *widget)
*
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* @widget will start receiving multiple, per device enter/leave events. Note
- * that if custom #GdkWindows are created in #GtkWidget::realize,
- * gdk_window_set_support_multidevice() will have to be called manually on them.
+ * that if custom #GdkSurfaces are created in #GtkWidget::realize,
+ * gdk_surface_set_support_multidevice() will have to be called manually on them.
**/
void
gtk_widget_set_support_multidevice (GtkWidget *widget,
@@ -12292,7 +12292,7 @@ gtk_widget_set_support_multidevice (GtkWidget *widget,
priv->multidevice = (support_multidevice == TRUE);
if (_gtk_widget_get_realized (widget))
- gdk_window_set_support_multidevice (priv->window, support_multidevice);
+ gdk_surface_set_support_multidevice (priv->surface, support_multidevice);
}
/* There are multiple alpha related sources. First of all the user can specify alpha
@@ -12327,7 +12327,7 @@ gtk_widget_update_alpha (GtkWidget *widget)
if (_gtk_widget_get_realized (widget))
{
if (_gtk_widget_is_toplevel (widget))
- gdk_window_set_opacity (priv->window, priv->alpha / 255.0);
+ gdk_surface_set_opacity (priv->surface, priv->alpha / 255.0);
gtk_widget_queue_draw (widget);
}
@@ -12414,7 +12414,7 @@ gtk_widget_get_opacity (GtkWidget *widget)
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
- * fevent->focus_change.window = _gtk_widget_get_window (widget);
+ * fevent->focus_change.window = _gtk_widget_get_surface (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
@@ -14022,7 +14022,7 @@ should_record_names (GtkWidget *widget,
void
gtk_widget_render (GtkWidget *widget,
- GdkWindow *window,
+ GdkSurface *surface,
const cairo_region_t *region)
{
GdkDrawingContext *context;
@@ -14032,7 +14032,7 @@ gtk_widget_render (GtkWidget *widget,
cairo_region_t *clip;
/* We only render double buffered on native windows */
- if (!gdk_window_has_native (window))
+ if (!gdk_surface_has_native (surface))
return;
renderer = gtk_widget_get_renderer (widget);
@@ -14053,7 +14053,7 @@ gtk_widget_render (GtkWidget *widget,
{
gtk_inspector_record_render (widget,
renderer,
- window,
+ surface,
region,
context,
root);
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 58b7f3df90..10fd37fd3d 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -146,9 +146,9 @@ struct _GtkWidget
* means that either it or any of its parents up to the toplevel
* widget have been set as hidden.
* @realize: Signal emitted when widget is associated with a
- * #GdkWindow, which means that gtk_widget_realize() has been called or
+ * #GdkSurface, which means that gtk_widget_realize() has been called or
* the widget has been mapped (that is, it is going to be drawn).
- * @unrealize: Signal emitted when the GdkWindow associated with
+ * @unrealize: Signal emitted when the GdkSurface associated with
* widget is destroyed, which means that gtk_widget_unrealize() has
* been called or the widget has been unmapped (that is, it is going
* to be hidden).
@@ -578,10 +578,10 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_is_visible (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_has_window (GtkWidget *widget,
- gboolean has_window);
+void gtk_widget_set_has_surface (GtkWidget *widget,
+ gboolean has_surface);
GDK_AVAILABLE_IN_ALL
-gboolean gtk_widget_get_has_window (GtkWidget *widget);
+gboolean gtk_widget_get_has_surface (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_is_toplevel (GtkWidget *widget);
@@ -602,10 +602,10 @@ GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_parent_window (GtkWidget *widget,
- GdkWindow *parent_window);
+void gtk_widget_set_parent_surface (GtkWidget *widget,
+ GdkSurface *parent_surface);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget);
+GdkSurface * gtk_widget_get_parent_surface (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_child_visible (GtkWidget *widget,
@@ -614,16 +614,16 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_get_child_visible (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_window (GtkWidget *widget,
- GdkWindow *window);
+void gtk_widget_set_surface (GtkWidget *widget,
+ GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkWindow * gtk_widget_get_window (GtkWidget *widget);
+GdkSurface * gtk_widget_get_surface (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-void gtk_widget_register_window (GtkWidget *widget,
- GdkWindow *window);
+void gtk_widget_register_surface (GtkWidget *widget,
+ GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gtk_widget_unregister_window (GtkWidget *widget,
- GdkWindow *window);
+void gtk_widget_unregister_surface (GtkWidget *widget,
+ GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
int gtk_widget_get_allocated_width (GtkWidget *widget);
@@ -817,7 +817,7 @@ void gtk_widget_set_default_direction (GtkTextDirection dir);
GDK_AVAILABLE_IN_ALL
GtkTextDirection gtk_widget_get_default_direction (void);
-/* Counterpart to gdk_window_shape_combine_region.
+/* Counterpart to gdk_surface_shape_combine_region.
*/
GDK_AVAILABLE_IN_ALL
void gtk_widget_shape_combine_region (GtkWidget *widget,
diff --git a/gtk/gtkwidgetfocus.c b/gtk/gtkwidgetfocus.c
index 40990007e6..99c010e11d 100644
--- a/gtk/gtkwidgetfocus.c
+++ b/gtk/gtkwidgetfocus.c
@@ -299,13 +299,13 @@ focus_sort_left_right (GtkWidget *widget,
}
else
{
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
compare_info.y = allocation.y + allocation.height / 2;
else
compare_info.y = allocation.height / 2;
}
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
compare_info.x = (direction == GTK_DIR_RIGHT) ? allocation.x : allocation.x + allocation.width;
else
compare_info.x = (direction == GTK_DIR_RIGHT) ? 0 : allocation.width;
@@ -398,13 +398,13 @@ focus_sort_up_down (GtkWidget *widget,
}
else
{
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
compare_info.x = allocation.x + allocation.width / 2;
else
compare_info.x = allocation.width / 2;
}
- if (!_gtk_widget_get_has_window (widget))
+ if (!_gtk_widget_get_has_surface (widget))
compare_info.y = (direction == GTK_DIR_DOWN) ? allocation.y : allocation.y + allocation.height;
else
compare_info.y = (direction == GTK_DIR_DOWN) ? 0 : + allocation.height;
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 5edcbd1e5c..509e76724e 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -53,8 +53,8 @@ struct _GtkWidgetPrivate
guint in_destruction : 1;
guint toplevel : 1;
guint anchored : 1;
- guint no_window : 1;
- guint no_window_set : 1;
+ guint no_surface : 1;
+ guint no_surface_set : 1;
guint realized : 1;
guint mapped : 1;
guint visible : 1;
@@ -143,12 +143,12 @@ struct _GtkWidgetPrivate
/* The widget's requested sizes */
SizeRequestCache requests;
- /* The widget's window or its parent window if it does
- * not have a window. (Which will be indicated by the
- * no_window field being set).
+ /* The widget's surface or its surface window if it does
+ * not have a surface. (Which will be indicated by the
+ * no_surface field being set).
*/
- GdkWindow *window;
- GList *registered_windows;
+ GdkSurface *surface;
+ GList *registered_surfaces;
GList *event_controllers;
@@ -220,8 +220,8 @@ void _gtk_widget_propagate_display_changed (GtkWidget *widget,
void _gtk_widget_set_device_window (GtkWidget *widget,
GdkDevice *device,
- GdkWindow *pointer_window);
-GdkWindow * _gtk_widget_get_device_window (GtkWidget *widget,
+ GdkSurface *pointer_window);
+GdkSurface * _gtk_widget_get_device_window (GtkWidget *widget,
GdkDevice *device);
GList * _gtk_widget_list_devices (GtkWidget *widget);
@@ -278,7 +278,7 @@ gboolean gtk_widget_query_tooltip (GtkWidget *widget,
GtkTooltip *tooltip);
void gtk_widget_render (GtkWidget *widget,
- GdkWindow *window,
+ GdkSurface *surface,
const cairo_region_t *region);
@@ -315,7 +315,7 @@ void gtk_widget_get_outer_allocation (GtkWidget *wi
void gtk_widget_get_own_allocation (GtkWidget *widget,
GtkAllocation *allocation);
-void gtk_widget_get_window_allocation (GtkWidget *widget,
+void gtk_widget_get_surface_allocation (GtkWidget *widget,
GtkAllocation *allocation);
@@ -371,9 +371,9 @@ _gtk_widget_is_drawable (GtkWidget *widget)
}
static inline gboolean
-_gtk_widget_get_has_window (GtkWidget *widget)
+_gtk_widget_get_has_surface (GtkWidget *widget)
{
- return !widget->priv->no_window;
+ return !widget->priv->no_surface;
}
static inline gboolean
@@ -429,10 +429,10 @@ _gtk_widget_peek_request_cache (GtkWidget *widget)
return &widget->priv->requests;
}
-static inline GdkWindow *
-_gtk_widget_get_window (GtkWidget *widget)
+static inline GdkSurface *
+_gtk_widget_get_surface (GtkWidget *widget)
{
- return widget->priv->window;
+ return widget->priv->surface;
}
static inline void
diff --git a/gtk/gtkwin32theme.c b/gtk/gtkwin32theme.c
index 5b5014ada5..085389b690 100644
--- a/gtk/gtkwin32theme.c
+++ b/gtk/gtkwin32theme.c
@@ -157,7 +157,7 @@ invalidate_win32_themes (GdkXEvent *xevent,
gpointer theme;
MSG *msg;
- if (!GDK_IS_WIN32_WINDOW (event->any.window))
+ if (!GDK_IS_WIN32_SURFACE (event->any.surface))
return GDK_FILTER_CONTINUE;
msg = (MSG *) xevent;
@@ -170,7 +170,7 @@ invalidate_win32_themes (GdkXEvent *xevent,
theme_was_open |= gtk_win32_theme_close (theme);
}
if (theme_was_open)
- gtk_style_context_reset_widgets (gdk_window_get_display (event->any.window));
+ gtk_style_context_reset_widgets (gdk_surface_get_display (event->any.surface));
return GDK_FILTER_CONTINUE;
}
@@ -233,7 +233,7 @@ gtk_win32_theme_init (void)
use_xp_theme = FALSE;
}
- gdk_window_add_filter (NULL, invalidate_win32_themes, NULL);
+ gdk_surface_add_filter (NULL, invalidate_win32_themes, NULL);
}
static HTHEME
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index be5e903233..b68e4f9090 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -226,7 +226,7 @@ struct _GtkWindowPrivate
GdkMonitor *initial_fullscreen_monitor;
guint edge_constraints;
- GdkWindowState state;
+ GdkSurfaceState state;
/* The following flags are initially TRUE (before a window is mapped).
* They cause us to compute a configure request that involves
@@ -275,12 +275,12 @@ struct _GtkWindowPrivate
guint hide_on_close : 1;
guint in_emit_close_request : 1;
- GdkWindowTypeHint type_hint;
+ GdkSurfaceTypeHint type_hint;
GtkGesture *multipress_gesture;
GtkGesture *drag_gesture;
- GdkWindow *hardcoded_window;
+ GdkSurface *hardcoded_window;
GtkCssNode *decoration_node;
@@ -352,7 +352,7 @@ enum {
static GParamSpec *window_props[LAST_ARG] = { NULL, };
-/* Must be kept in sync with GdkWindowEdge ! */
+/* Must be kept in sync with GdkSurfaceEdge ! */
typedef enum
{
GTK_WINDOW_REGION_EDGE_NW,
@@ -379,7 +379,7 @@ typedef struct
typedef struct {
GdkGeometry geometry; /* Last set of geometry hints we set */
- GdkWindowHints flags;
+ GdkSurfaceHints flags;
GdkRectangle configure_request;
} GtkWindowLastGeometryInfo;
@@ -439,7 +439,7 @@ static gint gtk_window_key_release_event (GtkWidget *widget,
GdkEventKey *event);
static void gtk_window_focus_in (GtkWidget *widget);
static void gtk_window_focus_out (GtkWidget *widget);
-static void window_state_changed (GtkWidget *widget);
+static void surface_state_changed (GtkWidget *widget);
static void gtk_window_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_window_check_resize (GtkContainer *container);
@@ -525,7 +525,7 @@ static void gtk_window_set_theme_variant (GtkWindow *window);
static void gtk_window_do_popup (GtkWindow *window,
GdkEventButton *event);
static void gtk_window_style_updated (GtkWidget *widget);
-static void gtk_window_state_flags_changed (GtkWidget *widget,
+static void gtk_surface_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state);
static GSList *toplevel_list = NULL;
@@ -813,7 +813,7 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->focus = gtk_window_focus;
widget_class->move_focus = gtk_window_move_focus;
widget_class->measure = gtk_window_measure;
- widget_class->state_flags_changed = gtk_window_state_flags_changed;
+ widget_class->state_flags_changed = gtk_surface_state_flags_changed;
widget_class->style_updated = gtk_window_style_updated;
widget_class->snapshot = gtk_window_snapshot;
widget_class->pick = gtk_window_pick;
@@ -988,8 +988,8 @@ gtk_window_class_init (GtkWindowClass *klass)
g_param_spec_enum ("type-hint",
P_("Type hint"),
P_("Hint to help the desktop environment understand what kind of window this is and how to treat it."),
- GDK_TYPE_WINDOW_TYPE_HINT,
- GDK_WINDOW_TYPE_HINT_NORMAL,
+ GDK_TYPE_SURFACE_TYPE_HINT,
+ GDK_SURFACE_TYPE_HINT_NORMAL,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
window_props[PROP_SKIP_TASKBAR_HINT] =
@@ -1403,13 +1403,13 @@ gtk_window_titlebar_action (GtkWindow *window,
* consistency.
*/
if (gtk_window_get_resizable (window) &&
- gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL)
+ gtk_window_get_type_hint (window) == GDK_SURFACE_TYPE_HINT_NORMAL)
_gtk_window_toggle_maximized (window);
}
else if (g_str_equal (action, "lower"))
- gdk_window_lower (_gtk_widget_get_window (GTK_WIDGET (window)));
+ gdk_surface_lower (_gtk_widget_get_surface (GTK_WIDGET (window)));
else if (g_str_equal (action, "minimize"))
- gdk_window_iconify (_gtk_widget_get_window (GTK_WIDGET (window)));
+ gdk_surface_iconify (_gtk_widget_get_surface (GTK_WIDGET (window)));
else if (g_str_equal (action, "menu"))
gtk_window_do_popup (window, (GdkEventButton*) event);
else
@@ -1482,7 +1482,7 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
event_widget = gtk_get_event_widget ((GdkEvent *) event);
if (region == GTK_WINDOW_REGION_TITLE)
- gdk_window_raise (_gtk_widget_get_window (widget));
+ gdk_surface_raise (_gtk_widget_get_surface (widget));
switch (region)
{
@@ -1524,8 +1524,8 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
gdk_event_get_root_coords (event, &x_root, &y_root);
- gdk_window_begin_resize_drag_for_device (_gtk_widget_get_window (widget),
- (GdkWindowEdge) region,
+ gdk_surface_begin_resize_drag_for_device (_gtk_widget_get_surface (widget),
+ (GdkSurfaceEdge) region,
gdk_event_get_device ((GdkEvent *) event),
GDK_BUTTON_PRIMARY,
x_root, y_root,
@@ -1632,10 +1632,10 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
- gdk_window_get_root_coords (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_get_root_coords (_gtk_widget_get_surface (GTK_WIDGET (window)),
start_x, start_y, &x_root, &y_root);
- gdk_window_begin_move_drag_for_device (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_begin_move_drag_for_device (_gtk_widget_get_surface (GTK_WIDGET (window)),
gtk_gesture_get_device (GTK_GESTURE (gesture)),
gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)),
x_root, y_root,
@@ -1683,26 +1683,26 @@ device_removed_cb (GdkSeat *seat,
}
static guint
-constraints_for_edge (GdkWindowEdge edge)
+constraints_for_edge (GdkSurfaceEdge edge)
{
switch (edge)
{
- case GDK_WINDOW_EDGE_NORTH_WEST:
- return GDK_WINDOW_STATE_LEFT_RESIZABLE | GDK_WINDOW_STATE_TOP_RESIZABLE;
- case GDK_WINDOW_EDGE_NORTH:
- return GDK_WINDOW_STATE_TOP_RESIZABLE;
- case GDK_WINDOW_EDGE_NORTH_EAST:
- return GDK_WINDOW_STATE_RIGHT_RESIZABLE | GDK_WINDOW_STATE_TOP_RESIZABLE;
- case GDK_WINDOW_EDGE_WEST:
- return GDK_WINDOW_STATE_LEFT_RESIZABLE;
- case GDK_WINDOW_EDGE_EAST:
- return GDK_WINDOW_STATE_RIGHT_RESIZABLE;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- return GDK_WINDOW_STATE_LEFT_RESIZABLE | GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
- case GDK_WINDOW_EDGE_SOUTH:
- return GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
- return GDK_WINDOW_STATE_RIGHT_RESIZABLE | GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE;
+ case GDK_SURFACE_EDGE_NORTH:
+ return GDK_SURFACE_STATE_TOP_RESIZABLE;
+ case GDK_SURFACE_EDGE_NORTH_EAST:
+ return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE;
+ case GDK_SURFACE_EDGE_WEST:
+ return GDK_SURFACE_STATE_LEFT_RESIZABLE;
+ case GDK_SURFACE_EDGE_EAST:
+ return GDK_SURFACE_STATE_RIGHT_RESIZABLE;
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
+ return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
+ case GDK_SURFACE_EDGE_SOUTH:
+ return GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
+ return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
default:
g_warn_if_reached ();
return 0;
@@ -1713,7 +1713,7 @@ static gboolean
edge_under_coordinates (GtkWindow *window,
gint x,
gint y,
- GdkWindowEdge edge)
+ GdkSurfaceEdge edge)
{
GtkWindowPrivate *priv = window->priv;
GtkAllocation allocation;
@@ -1730,7 +1730,7 @@ edge_under_coordinates (GtkWindow *window,
priv->maximized)
return FALSE;
- supports_edge_constraints = gdk_window_supports_edge_constraints (_gtk_widget_get_window (GTK_WIDGET (window)));
+ supports_edge_constraints = gdk_surface_supports_edge_constraints (_gtk_widget_get_surface (GTK_WIDGET (window)));
constraints = constraints_for_edge (edge);
if (!supports_edge_constraints && priv->tiled)
@@ -1769,71 +1769,71 @@ edge_under_coordinates (GtkWindow *window,
/* Check X axis */
if (x < allocation.x + border.left + handle_h)
{
- if (edge != GDK_WINDOW_EDGE_NORTH_WEST &&
- edge != GDK_WINDOW_EDGE_WEST &&
- edge != GDK_WINDOW_EDGE_SOUTH_WEST &&
- edge != GDK_WINDOW_EDGE_NORTH &&
- edge != GDK_WINDOW_EDGE_SOUTH)
+ if (edge != GDK_SURFACE_EDGE_NORTH_WEST &&
+ edge != GDK_SURFACE_EDGE_WEST &&
+ edge != GDK_SURFACE_EDGE_SOUTH_WEST &&
+ edge != GDK_SURFACE_EDGE_NORTH &&
+ edge != GDK_SURFACE_EDGE_SOUTH)
return FALSE;
if (supports_edge_constraints &&
- (edge == GDK_WINDOW_EDGE_NORTH ||
- edge == GDK_WINDOW_EDGE_SOUTH) &&
- (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_WEST)))
+ (edge == GDK_SURFACE_EDGE_NORTH ||
+ edge == GDK_SURFACE_EDGE_SOUTH) &&
+ (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_WEST)))
return FALSE;
}
else if (x >= allocation.x + allocation.width - border.right - handle_h)
{
- if (edge != GDK_WINDOW_EDGE_NORTH_EAST &&
- edge != GDK_WINDOW_EDGE_EAST &&
- edge != GDK_WINDOW_EDGE_SOUTH_EAST &&
- edge != GDK_WINDOW_EDGE_NORTH &&
- edge != GDK_WINDOW_EDGE_SOUTH)
+ if (edge != GDK_SURFACE_EDGE_NORTH_EAST &&
+ edge != GDK_SURFACE_EDGE_EAST &&
+ edge != GDK_SURFACE_EDGE_SOUTH_EAST &&
+ edge != GDK_SURFACE_EDGE_NORTH &&
+ edge != GDK_SURFACE_EDGE_SOUTH)
return FALSE;
if (supports_edge_constraints &&
- (edge == GDK_WINDOW_EDGE_NORTH ||
- edge == GDK_WINDOW_EDGE_SOUTH) &&
- (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_EAST)))
+ (edge == GDK_SURFACE_EDGE_NORTH ||
+ edge == GDK_SURFACE_EDGE_SOUTH) &&
+ (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_EAST)))
return FALSE;
}
- else if (edge != GDK_WINDOW_EDGE_NORTH &&
- edge != GDK_WINDOW_EDGE_SOUTH)
+ else if (edge != GDK_SURFACE_EDGE_NORTH &&
+ edge != GDK_SURFACE_EDGE_SOUTH)
return FALSE;
/* Check Y axis */
if (y < allocation.y + border.top + handle_v)
{
- if (edge != GDK_WINDOW_EDGE_NORTH_WEST &&
- edge != GDK_WINDOW_EDGE_NORTH &&
- edge != GDK_WINDOW_EDGE_NORTH_EAST &&
- edge != GDK_WINDOW_EDGE_EAST &&
- edge != GDK_WINDOW_EDGE_WEST)
+ if (edge != GDK_SURFACE_EDGE_NORTH_WEST &&
+ edge != GDK_SURFACE_EDGE_NORTH &&
+ edge != GDK_SURFACE_EDGE_NORTH_EAST &&
+ edge != GDK_SURFACE_EDGE_EAST &&
+ edge != GDK_SURFACE_EDGE_WEST)
return FALSE;
if (supports_edge_constraints &&
- (edge == GDK_WINDOW_EDGE_EAST ||
- edge == GDK_WINDOW_EDGE_WEST) &&
- (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_NORTH)))
+ (edge == GDK_SURFACE_EDGE_EAST ||
+ edge == GDK_SURFACE_EDGE_WEST) &&
+ (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_NORTH)))
return FALSE;
}
else if (y > allocation.y + allocation.height - border.bottom - handle_v)
{
- if (edge != GDK_WINDOW_EDGE_SOUTH_WEST &&
- edge != GDK_WINDOW_EDGE_SOUTH &&
- edge != GDK_WINDOW_EDGE_SOUTH_EAST &&
- edge != GDK_WINDOW_EDGE_EAST &&
- edge != GDK_WINDOW_EDGE_WEST)
+ if (edge != GDK_SURFACE_EDGE_SOUTH_WEST &&
+ edge != GDK_SURFACE_EDGE_SOUTH &&
+ edge != GDK_SURFACE_EDGE_SOUTH_EAST &&
+ edge != GDK_SURFACE_EDGE_EAST &&
+ edge != GDK_SURFACE_EDGE_WEST)
return FALSE;
if (supports_edge_constraints &&
- (edge == GDK_WINDOW_EDGE_EAST ||
- edge == GDK_WINDOW_EDGE_WEST) &&
- (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_SOUTH)))
+ (edge == GDK_SURFACE_EDGE_EAST ||
+ edge == GDK_SURFACE_EDGE_WEST) &&
+ (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_SOUTH)))
return FALSE;
}
- else if (edge != GDK_WINDOW_EDGE_WEST &&
- edge != GDK_WINDOW_EDGE_EAST)
+ else if (edge != GDK_SURFACE_EDGE_WEST &&
+ edge != GDK_SURFACE_EDGE_EAST)
return FALSE;
return TRUE;
@@ -1888,7 +1888,7 @@ gtk_window_init (GtkWindow *window)
window->priv = gtk_window_get_instance_private (window);
priv = window->priv;
- gtk_widget_set_has_window (widget, TRUE);
+ gtk_widget_set_has_surface (widget, TRUE);
_gtk_widget_set_is_toplevel (widget, TRUE);
_gtk_widget_set_anchored (widget, TRUE);
@@ -1910,12 +1910,12 @@ gtk_window_init (GtkWindow *window)
priv->mnemonic_modifier = GDK_MOD1_MASK;
priv->display = gdk_display_get_default ();
- priv->state = GDK_WINDOW_STATE_WITHDRAWN;
+ priv->state = GDK_SURFACE_STATE_WITHDRAWN;
priv->accept_focus = TRUE;
priv->focus_on_map = TRUE;
priv->deletable = TRUE;
- priv->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
+ priv->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL;
priv->startup_id = NULL;
priv->initial_timestamp = GDK_CURRENT_TIME;
priv->mnemonics_visible = TRUE;
@@ -2559,7 +2559,7 @@ gtk_window_set_title_internal (GtkWindow *window,
priv->title = new_title;
if (_gtk_widget_get_realized (widget))
- gdk_window_set_title (_gtk_widget_get_window (widget), new_title != NULL ? new_title : "");
+ gdk_surface_set_title (_gtk_widget_get_surface (widget), new_title != NULL ? new_title : "");
if (update_titlebar && GTK_IS_HEADER_BAR (priv->title_box))
gtk_header_bar_set_title (GTK_HEADER_BAR (priv->title_box), new_title != NULL ? new_title : "");
@@ -2646,7 +2646,7 @@ gtk_window_set_role (GtkWindow *window,
priv->wm_role = new_role;
if (_gtk_widget_get_realized (widget))
- gdk_window_set_role (_gtk_widget_get_window (widget), priv->wm_role);
+ gdk_surface_set_role (_gtk_widget_get_surface (widget), priv->wm_role);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ROLE]);
}
@@ -2659,7 +2659,7 @@ gtk_window_set_role (GtkWindow *window,
* Startup notification identifiers are used by desktop environment to
* track application startup, to provide user feedback and other
* features. This function changes the corresponding property on the
- * underlying GdkWindow. Normally, startup identifier is managed
+ * underlying GdkSurface. Normally, startup identifier is managed
* automatically and you should only use this function in special cases
* like transferring focus from other processes. You should use this
* function before calling gtk_window_present() or any equivalent
@@ -2684,14 +2684,14 @@ gtk_window_set_startup_id (GtkWindow *window,
if (_gtk_widget_get_realized (widget))
{
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
guint32 timestamp = extract_time_from_startup_id (priv->startup_id);
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
#ifdef GDK_WINDOWING_X11
- if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_WINDOW(gdk_window))
- gdk_x11_window_set_user_time (gdk_window, timestamp);
+ if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE(gdk_surface))
+ gdk_x11_surface_set_user_time (gdk_surface, timestamp);
#endif
/* Here we differentiate real and "fake" startup notification IDs,
@@ -2701,7 +2701,7 @@ gtk_window_set_startup_id (GtkWindow *window,
gtk_window_present_with_time (window, timestamp);
else
{
- gdk_window_set_startup_id (gdk_window, priv->startup_id);
+ gdk_surface_set_startup_id (gdk_surface, priv->startup_id);
/* If window is mapped, terminate the startup-notification too */
if (_gtk_widget_get_mapped (widget) && !disable_startup_notification)
@@ -3237,7 +3237,7 @@ gtk_window_set_modal (GtkWindow *window,
/* adjust desired modality state */
if (_gtk_widget_get_realized (widget))
- gdk_window_set_modal_hint (_gtk_widget_get_window (widget), priv->modal);
+ gdk_surface_set_modal_hint (_gtk_widget_get_surface (widget), priv->modal);
if (gtk_widget_get_visible (widget))
{
@@ -3367,8 +3367,8 @@ gtk_window_transient_parent_realized (GtkWidget *parent,
GtkWidget *window)
{
if (_gtk_widget_get_realized (window))
- gdk_window_set_transient_for (_gtk_widget_get_window (window),
- _gtk_widget_get_window (parent));
+ gdk_surface_set_transient_for (_gtk_widget_get_surface (window),
+ _gtk_widget_get_surface (parent));
}
static void
@@ -3376,7 +3376,7 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent,
GtkWidget *window)
{
if (_gtk_widget_get_realized (window))
- gdk_window_set_transient_for (_gtk_widget_get_window (window), NULL);
+ gdk_surface_set_transient_for (_gtk_widget_get_surface (window), NULL);
}
static void
@@ -3439,7 +3439,7 @@ gtk_window_unset_transient_for (GtkWindow *window)
* On Wayland, this function can also be used to attach a new
* #GTK_WINDOW_POPUP to a #GTK_WINDOW_TOPLEVEL parent already mapped
* on screen so that the #GTK_WINDOW_POPUP will be created as a
- * subsurface-based window #GDK_WINDOW_SUBSURFACE which can be
+ * subsurface-based window #GDK_SURFACE_SUBSURFACE which can be
* positioned at will relatively to the #GTK_WINDOW_TOPLEVEL surface.
*
* On Windows, this function puts the child window on top of the parent,
@@ -3692,10 +3692,10 @@ gtk_window_set_application (GtkWindow *window,
**/
void
gtk_window_set_type_hint (GtkWindow *window,
- GdkWindowTypeHint hint)
+ GdkSurfaceTypeHint hint)
{
GtkWindowPrivate *priv;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -3706,9 +3706,9 @@ gtk_window_set_type_hint (GtkWindow *window,
priv->type_hint = hint;
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
- if (gdk_window)
- gdk_window_set_type_hint (gdk_window, hint);
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
+ if (gdk_surface)
+ gdk_surface_set_type_hint (gdk_surface, hint);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_TYPE_HINT]);
@@ -3723,10 +3723,10 @@ gtk_window_set_type_hint (GtkWindow *window,
*
* Returns: the type hint for @window.
**/
-GdkWindowTypeHint
+GdkSurfaceTypeHint
gtk_window_get_type_hint (GtkWindow *window)
{
- g_return_val_if_fail (GTK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
+ g_return_val_if_fail (GTK_IS_WINDOW (window), GDK_SURFACE_TYPE_HINT_NORMAL);
return window->priv->type_hint;
}
@@ -3755,7 +3755,7 @@ gtk_window_set_skip_taskbar_hint (GtkWindow *window,
{
priv->skips_taskbar = setting;
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_window_set_skip_taskbar_hint (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_set_skip_taskbar_hint (_gtk_widget_get_surface (GTK_WIDGET (window)),
priv->skips_taskbar);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_TASKBAR_HINT]);
}
@@ -3804,7 +3804,7 @@ gtk_window_set_skip_pager_hint (GtkWindow *window,
{
priv->skips_pager = setting;
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_window_set_skip_pager_hint (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_set_skip_pager_hint (_gtk_widget_get_surface (GTK_WIDGET (window)),
priv->skips_pager);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_PAGER_HINT]);
}
@@ -3850,7 +3850,7 @@ gtk_window_set_urgency_hint (GtkWindow *window,
{
priv->urgent = setting;
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_window_set_urgency_hint (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_set_urgency_hint (_gtk_widget_get_surface (GTK_WIDGET (window)),
priv->urgent);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_URGENCY_HINT]);
}
@@ -3896,7 +3896,7 @@ gtk_window_set_accept_focus (GtkWindow *window,
{
priv->accept_focus = setting;
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_window_set_accept_focus (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_set_accept_focus (_gtk_widget_get_surface (GTK_WIDGET (window)),
priv->accept_focus);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ACCEPT_FOCUS]);
}
@@ -3943,7 +3943,7 @@ gtk_window_set_focus_on_map (GtkWindow *window,
{
priv->focus_on_map = setting;
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_window_set_focus_on_map (_gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_surface_set_focus_on_map (_gtk_widget_get_surface (GTK_WIDGET (window)),
priv->focus_on_map);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_ON_MAP]);
}
@@ -4291,7 +4291,7 @@ gtk_window_set_decorated (GtkWindow *window,
gboolean setting)
{
GtkWindowPrivate *priv;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -4304,18 +4304,18 @@ gtk_window_set_decorated (GtkWindow *window,
priv->decorated = setting;
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
- if (gdk_window)
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
+ if (gdk_surface)
{
if (priv->decorated)
{
if (priv->client_decorated)
- gdk_window_set_decorations (gdk_window, 0);
+ gdk_surface_set_decorations (gdk_surface, 0);
else
- gdk_window_set_decorations (gdk_window, GDK_DECOR_ALL);
+ gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL);
}
else
- gdk_window_set_decorations (gdk_window, 0);
+ gdk_surface_set_decorations (gdk_surface, 0);
}
update_window_buttons (window);
@@ -4362,7 +4362,7 @@ gtk_window_set_deletable (GtkWindow *window,
gboolean setting)
{
GtkWindowPrivate *priv;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -4375,14 +4375,14 @@ gtk_window_set_deletable (GtkWindow *window,
priv->deletable = setting;
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
- if (gdk_window)
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
+ if (gdk_surface)
{
if (priv->deletable)
- gdk_window_set_functions (gdk_window,
+ gdk_surface_set_functions (gdk_surface,
GDK_FUNC_ALL);
else
- gdk_window_set_functions (gdk_window,
+ gdk_surface_set_functions (gdk_surface,
GDK_FUNC_ALL | GDK_FUNC_CLOSE);
}
@@ -4494,13 +4494,13 @@ gtk_window_realize_icon (GtkWindow *window)
GtkWindowPrivate *priv = window->priv;
GtkWidget *widget;
GtkWindowIconInfo *info;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
GList *icon_list;
widget = GTK_WIDGET (window);
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
- g_return_if_fail (gdk_window != NULL);
+ g_return_if_fail (gdk_surface != NULL);
/* no point setting an icon on override-redirect */
if (priv->type == GTK_WINDOW_POPUP)
@@ -4553,7 +4553,7 @@ gtk_window_realize_icon (GtkWindow *window)
info->realized = TRUE;
- gdk_window_set_icon_list (gdk_window, icon_list);
+ gdk_surface_set_icon_list (gdk_surface, icon_list);
if (GTK_IS_HEADER_BAR (priv->title_box))
_gtk_header_bar_update_window_icon (GTK_HEADER_BAR (priv->title_box), window);
@@ -5474,8 +5474,8 @@ gtk_window_get_size (GtkWindow *window,
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
{
- w = gdk_window_get_width (_gtk_widget_get_window (GTK_WIDGET (window)));
- h = gdk_window_get_height (_gtk_widget_get_window (GTK_WIDGET (window)));
+ w = gdk_surface_get_width (_gtk_widget_get_surface (GTK_WIDGET (window)));
+ h = gdk_surface_get_height (_gtk_widget_get_surface (GTK_WIDGET (window)));
}
else
{
@@ -5670,7 +5670,7 @@ gtk_window_move (GtkWindow *window,
* the same as the position being changed by the window
* manager.
*/
- gdk_window_move (_gtk_widget_get_window (GTK_WIDGET (window)), x, y);
+ gdk_surface_move (_gtk_widget_get_surface (GTK_WIDGET (window)), x, y);
}
else
{
@@ -5734,13 +5734,13 @@ gtk_window_get_position (GtkWindow *window,
{
GtkWindowPrivate *priv;
GtkWidget *widget;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
g_return_if_fail (GTK_IS_WINDOW (window));
priv = window->priv;
widget = GTK_WIDGET (window);
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
if (priv->gravity == GDK_GRAVITY_STATIC)
{
@@ -5748,12 +5748,12 @@ gtk_window_get_position (GtkWindow *window,
{
/* This does a server round-trip, which is sort of wrong;
* but a server round-trip is inevitable for
- * gdk_window_get_frame_extents() in the usual
+ * gdk_surface_get_frame_extents() in the usual
* NorthWestGravity case below, so not sure what else to
* do. We should likely be consistent about whether we get
* the client-side info or the server-side info.
*/
- gdk_window_get_origin (gdk_window, root_x, root_y);
+ gdk_surface_get_origin (gdk_surface, root_x, root_y);
}
else
{
@@ -5777,7 +5777,7 @@ gtk_window_get_position (GtkWindow *window,
if (_gtk_widget_get_mapped (widget))
{
- gdk_window_get_frame_extents (gdk_window, &frame_extents);
+ gdk_surface_get_frame_extents (gdk_surface, &frame_extents);
x = frame_extents.x;
y = frame_extents.y;
gtk_window_get_size (window, &w, &h);
@@ -5974,7 +5974,7 @@ gtk_window_finalize (GObject *object)
G_OBJECT_CLASS (gtk_window_parent_class)->finalize (object);
}
-/* copied from gdkwindow-x11.c */
+/* copied from gdksurface-x11.c */
static const gchar *
get_default_title (void)
{
@@ -6175,7 +6175,7 @@ gtk_window_map (GtkWidget *widget)
GtkWidget *child;
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
if (!_gtk_widget_is_toplevel (widget))
{
@@ -6194,36 +6194,36 @@ gtk_window_map (GtkWidget *widget)
gtk_widget_get_child_visible (priv->title_box))
gtk_widget_map (priv->title_box);
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
if (priv->maximize_initially)
- gdk_window_maximize (gdk_window);
+ gdk_surface_maximize (gdk_surface);
else
- gdk_window_unmaximize (gdk_window);
+ gdk_surface_unmaximize (gdk_surface);
if (priv->stick_initially)
- gdk_window_stick (gdk_window);
+ gdk_surface_stick (gdk_surface);
else
- gdk_window_unstick (gdk_window);
+ gdk_surface_unstick (gdk_surface);
if (priv->iconify_initially)
- gdk_window_iconify (gdk_window);
+ gdk_surface_iconify (gdk_surface);
else
- gdk_window_deiconify (gdk_window);
+ gdk_surface_deiconify (gdk_surface);
if (priv->fullscreen_initially)
{
if (priv->initial_fullscreen_monitor)
- gdk_window_fullscreen_on_monitor (gdk_window, priv->initial_fullscreen_monitor);
+ gdk_surface_fullscreen_on_monitor (gdk_surface, priv->initial_fullscreen_monitor);
else
- gdk_window_fullscreen (gdk_window);
+ gdk_surface_fullscreen (gdk_surface);
}
else
- gdk_window_unfullscreen (gdk_window);
+ gdk_surface_unfullscreen (gdk_surface);
- gdk_window_set_keep_above (gdk_window, priv->above_initially);
+ gdk_surface_set_keep_above (gdk_surface, priv->above_initially);
- gdk_window_set_keep_below (gdk_window, priv->below_initially);
+ gdk_surface_set_keep_below (gdk_surface, priv->below_initially);
if (priv->type == GTK_WINDOW_TOPLEVEL)
gtk_window_set_theme_variant (window);
@@ -6232,7 +6232,7 @@ gtk_window_map (GtkWidget *widget)
priv->need_default_size = FALSE;
priv->need_default_position = FALSE;
- gdk_window_show (gdk_window);
+ gdk_surface_show (gdk_surface);
if (!disable_startup_notification &&
priv->type != GTK_WINDOW_POPUP)
@@ -6276,8 +6276,8 @@ gtk_window_unmap (GtkWidget *widget)
GtkWindowPrivate *priv = window->priv;
GtkWidget *child;
GtkWindowGeometryInfo *info;
- GdkWindow *gdk_window;
- GdkWindowState state;
+ GdkSurface *gdk_surface;
+ GdkSurfaceState state;
if (!_gtk_widget_is_toplevel (GTK_WIDGET (widget)))
{
@@ -6285,15 +6285,15 @@ gtk_window_unmap (GtkWidget *widget)
return;
}
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget);
- gdk_window_withdraw (gdk_window);
+ gdk_surface_withdraw (gdk_surface);
while (priv->configure_request_count > 0)
{
priv->configure_request_count--;
- gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget));
+ gdk_surface_thaw_toplevel_updates (_gtk_widget_get_surface (widget));
}
priv->configure_notify_received = FALSE;
@@ -6310,12 +6310,12 @@ gtk_window_unmap (GtkWidget *widget)
info->position_constraints_changed = FALSE;
}
- state = gdk_window_get_state (gdk_window);
- priv->iconify_initially = (state & GDK_WINDOW_STATE_ICONIFIED) != 0;
- priv->maximize_initially = (state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
- priv->stick_initially = (state & GDK_WINDOW_STATE_STICKY) != 0;
- priv->above_initially = (state & GDK_WINDOW_STATE_ABOVE) != 0;
- priv->below_initially = (state & GDK_WINDOW_STATE_BELOW) != 0;
+ state = gdk_surface_get_state (gdk_surface);
+ priv->iconify_initially = (state & GDK_SURFACE_STATE_ICONIFIED) != 0;
+ priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
+ priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0;
+ priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0;
+ priv->below_initially = (state & GDK_SURFACE_STATE_BELOW) != 0;
if (priv->title_box != NULL)
gtk_widget_unmap (priv->title_box);
@@ -6347,17 +6347,17 @@ gtk_window_guess_default_size (GtkWindow *window,
{
GtkWidget *widget;
GdkDisplay *display;
- GdkWindow *gdkwindow;
+ GdkSurface *gdkwindow;
GdkMonitor *monitor;
GdkRectangle workarea;
int minimum, natural;
widget = GTK_WIDGET (window);
display = gtk_widget_get_display (widget);
- gdkwindow = _gtk_widget_get_window (widget);
+ gdkwindow = _gtk_widget_get_surface (widget);
if (gdkwindow)
- monitor = gdk_display_get_monitor_at_window (display, gdkwindow);
+ monitor = gdk_display_get_monitor_at_surface (display, gdkwindow);
else
monitor = gdk_display_get_monitor (display, 0);
@@ -6400,16 +6400,16 @@ gtk_window_get_remembered_size (GtkWindow *window,
int *height)
{
GtkWindowGeometryInfo *info;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
*width = 0;
*height = 0;
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
- if (gdk_window)
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
+ if (gdk_surface)
{
- *width = gdk_window_get_width (gdk_window);
- *height = gdk_window_get_height (gdk_window);
+ *width = gdk_surface_get_width (gdk_surface);
+ *height = gdk_surface_get_height (gdk_surface);
return;
}
@@ -6674,12 +6674,12 @@ static void
update_shadow_width (GtkWindow *window,
GtkBorder *border)
{
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
- if (gdk_window)
- gdk_window_set_shadow_width (gdk_window,
+ if (gdk_surface)
+ gdk_surface_set_shadow_width (gdk_surface,
border->left,
border->right,
border->top,
@@ -6765,7 +6765,7 @@ update_opaque_region (GtkWindow *window,
opaque_region = NULL;
}
- gdk_window_set_opaque_region (_gtk_widget_get_window (widget), opaque_region);
+ gdk_surface_set_opaque_region (_gtk_widget_get_surface (widget), opaque_region);
cairo_region_destroy (opaque_region);
}
@@ -6793,7 +6793,7 @@ gtk_window_realize (GtkWidget *widget)
GtkAllocation allocation;
GtkAllocation child_allocation;
GtkWindow *window;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
GtkBorder window_border;
GtkWindowPrivate *priv;
@@ -6829,9 +6829,9 @@ gtk_window_realize (GtkWidget *widget)
if (priv->hardcoded_window)
{
- gdk_window = priv->hardcoded_window;
+ gdk_surface = priv->hardcoded_window;
_gtk_widget_get_allocation (widget, &allocation);
- gdk_window_resize (gdk_window, allocation.width, allocation.height);
+ gdk_surface_resize (gdk_surface, allocation.width, allocation.height);
}
else
{
@@ -6840,7 +6840,7 @@ gtk_window_realize (GtkWidget *widget)
switch (priv->type)
{
case GTK_WINDOW_TOPLEVEL:
- gdk_window = gdk_window_new_toplevel (gtk_widget_get_display (widget),
+ gdk_surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget),
allocation.width,
allocation.height);
break;
@@ -6849,13 +6849,13 @@ gtk_window_realize (GtkWidget *widget)
if (priv->use_subsurface &&
GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
{
- gdk_window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (widget),
+ gdk_surface = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (widget),
&allocation);
}
else
#endif
{
- gdk_window = gdk_window_new_popup (gtk_widget_get_display (widget),
+ gdk_surface = gdk_surface_new_popup (gtk_widget_get_display (widget),
&allocation);
}
break;
@@ -6865,78 +6865,78 @@ gtk_window_realize (GtkWidget *widget)
}
}
- gtk_widget_set_window (widget, gdk_window);
- g_signal_connect_swapped (gdk_window, "notify::state", G_CALLBACK (window_state_changed), widget);
- gtk_widget_register_window (widget, gdk_window);
+ gtk_widget_set_surface (widget, gdk_surface);
+ g_signal_connect_swapped (gdk_surface, "notify::state", G_CALLBACK (surface_state_changed), widget);
+ gtk_widget_register_surface (widget, gdk_surface);
gtk_widget_set_realized (widget, TRUE);
if (priv->renderer == NULL)
- priv->renderer = gsk_renderer_new_for_window (gdk_window);
+ priv->renderer = gsk_renderer_new_for_surface (gdk_surface);
if (priv->transient_parent &&
_gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))
- gdk_window_set_transient_for (gdk_window,
- _gtk_widget_get_window (GTK_WIDGET (priv->transient_parent)));
+ gdk_surface_set_transient_for (gdk_surface,
+ _gtk_widget_get_surface (GTK_WIDGET (priv->transient_parent)));
- gdk_window_set_type_hint (gdk_window, priv->type_hint);
+ gdk_surface_set_type_hint (gdk_surface, priv->type_hint);
if (priv->title)
- gdk_window_set_title (gdk_window, priv->title);
+ gdk_surface_set_title (gdk_surface, priv->title);
if (priv->wm_role)
- gdk_window_set_role (gdk_window, priv->wm_role);
+ gdk_surface_set_role (gdk_surface, priv->wm_role);
if (!priv->decorated || priv->client_decorated)
- gdk_window_set_decorations (gdk_window, 0);
+ gdk_surface_set_decorations (gdk_surface, 0);
#ifdef GDK_WINDOWING_WAYLAND
- if (priv->client_decorated && GDK_IS_WAYLAND_WINDOW (gdk_window))
- gdk_wayland_window_announce_csd (gdk_window);
+ if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (gdk_surface))
+ gdk_wayland_surface_announce_csd (gdk_surface);
#endif
if (!priv->deletable)
- gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_CLOSE);
+ gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE);
if (gtk_window_get_skip_pager_hint (window))
- gdk_window_set_skip_pager_hint (gdk_window, TRUE);
+ gdk_surface_set_skip_pager_hint (gdk_surface, TRUE);
if (gtk_window_get_skip_taskbar_hint (window))
- gdk_window_set_skip_taskbar_hint (gdk_window, TRUE);
+ gdk_surface_set_skip_taskbar_hint (gdk_surface, TRUE);
if (gtk_window_get_accept_focus (window))
- gdk_window_set_accept_focus (gdk_window, TRUE);
+ gdk_surface_set_accept_focus (gdk_surface, TRUE);
else
- gdk_window_set_accept_focus (gdk_window, FALSE);
+ gdk_surface_set_accept_focus (gdk_surface, FALSE);
if (gtk_window_get_focus_on_map (window))
- gdk_window_set_focus_on_map (gdk_window, TRUE);
+ gdk_surface_set_focus_on_map (gdk_surface, TRUE);
else
- gdk_window_set_focus_on_map (gdk_window, FALSE);
+ gdk_surface_set_focus_on_map (gdk_surface, FALSE);
if (priv->modal)
- gdk_window_set_modal_hint (gdk_window, TRUE);
+ gdk_surface_set_modal_hint (gdk_surface, TRUE);
else
- gdk_window_set_modal_hint (gdk_window, FALSE);
+ gdk_surface_set_modal_hint (gdk_surface, FALSE);
if (priv->startup_id)
{
#ifdef GDK_WINDOWING_X11
- if (GDK_IS_X11_WINDOW (gdk_window))
+ if (GDK_IS_X11_SURFACE (gdk_surface))
{
guint32 timestamp = extract_time_from_startup_id (priv->startup_id);
if (timestamp != GDK_CURRENT_TIME)
- gdk_x11_window_set_user_time (gdk_window, timestamp);
+ gdk_x11_surface_set_user_time (gdk_surface, timestamp);
}
#endif
if (!startup_id_is_fake (priv->startup_id))
- gdk_window_set_startup_id (gdk_window, priv->startup_id);
+ gdk_surface_set_startup_id (gdk_surface, priv->startup_id);
}
#ifdef GDK_WINDOWING_X11
if (priv->initial_timestamp != GDK_CURRENT_TIME)
{
- if (GDK_IS_X11_WINDOW (gdk_window))
- gdk_x11_window_set_user_time (gdk_window, priv->initial_timestamp);
+ if (GDK_IS_X11_SURFACE (gdk_surface))
+ gdk_x11_surface_set_user_time (gdk_surface, priv->initial_timestamp);
}
#endif
@@ -7001,8 +7001,8 @@ gtk_window_unrealize (GtkWidget *widget)
gsk_renderer_unrealize (priv->renderer);
g_clear_object (&priv->renderer);
- g_signal_handlers_disconnect_by_func (_gtk_widget_get_window (widget),
- G_CALLBACK (window_state_changed),
+ g_signal_handlers_disconnect_by_func (_gtk_widget_get_surface (widget),
+ G_CALLBACK (surface_state_changed),
widget);
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
@@ -7029,22 +7029,22 @@ update_window_style_classes (GtkWindow *window)
}
else
{
- if (edge_constraints & GDK_WINDOW_STATE_TOP_TILED)
+ if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED)
gtk_style_context_add_class (context, "tiled-top");
else
gtk_style_context_remove_class (context, "tiled-top");
- if (edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED)
+ if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED)
gtk_style_context_add_class (context, "tiled-right");
else
gtk_style_context_remove_class (context, "tiled-right");
- if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED)
+ if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED)
gtk_style_context_add_class (context, "tiled-bottom");
else
gtk_style_context_remove_class (context, "tiled-bottom");
- if (edge_constraints & GDK_WINDOW_STATE_LEFT_TILED)
+ if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED)
gtk_style_context_add_class (context, "tiled-left");
else
gtk_style_context_remove_class (context, "tiled-left");
@@ -7162,7 +7162,7 @@ _gtk_window_set_allocation (GtkWindow *window,
if (!_gtk_widget_is_toplevel (widget) && _gtk_widget_get_realized (widget))
{
- gdk_window_move_resize (_gtk_widget_get_window (widget),
+ gdk_surface_move_resize (_gtk_widget_get_surface (widget),
allocation->x, allocation->y,
allocation->width, allocation->height);
}
@@ -7207,7 +7207,7 @@ gtk_window_configure_event (GtkWidget *widget,
if (!_gtk_widget_is_toplevel (widget))
return FALSE;
- if (_gtk_widget_get_window (widget) != event->any.window)
+ if (_gtk_widget_get_surface (widget) != event->any.surface)
return TRUE;
/* If this is a gratuitous ConfigureNotify that's already
@@ -7242,7 +7242,7 @@ gtk_window_configure_event (GtkWidget *widget,
{
priv->configure_request_count -= 1;
- gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget));
+ gdk_surface_thaw_toplevel_updates (_gtk_widget_get_surface (widget));
}
/*
@@ -7264,59 +7264,59 @@ gtk_window_configure_event (GtkWidget *widget,
static void
update_edge_constraints (GtkWindow *window,
- GdkWindowState state)
+ GdkSurfaceState state)
{
GtkWindowPrivate *priv = window->priv;
- priv->edge_constraints = (state & GDK_WINDOW_STATE_TOP_TILED) |
- (state & GDK_WINDOW_STATE_TOP_RESIZABLE) |
- (state & GDK_WINDOW_STATE_RIGHT_TILED) |
- (state & GDK_WINDOW_STATE_RIGHT_RESIZABLE) |
- (state & GDK_WINDOW_STATE_BOTTOM_TILED) |
- (state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) |
- (state & GDK_WINDOW_STATE_LEFT_TILED) |
- (state & GDK_WINDOW_STATE_LEFT_RESIZABLE);
+ priv->edge_constraints = (state & GDK_SURFACE_STATE_TOP_TILED) |
+ (state & GDK_SURFACE_STATE_TOP_RESIZABLE) |
+ (state & GDK_SURFACE_STATE_RIGHT_TILED) |
+ (state & GDK_SURFACE_STATE_RIGHT_RESIZABLE) |
+ (state & GDK_SURFACE_STATE_BOTTOM_TILED) |
+ (state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) |
+ (state & GDK_SURFACE_STATE_LEFT_TILED) |
+ (state & GDK_SURFACE_STATE_LEFT_RESIZABLE);
- priv->tiled = (state & GDK_WINDOW_STATE_TILED) ? 1 : 0;
+ priv->tiled = (state & GDK_SURFACE_STATE_TILED) ? 1 : 0;
}
static void
-window_state_changed (GtkWidget *widget)
+surface_state_changed (GtkWidget *widget)
{
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
- GdkWindowState new_window_state;
- GdkWindowState changed_mask;
+ GdkSurfaceState new_surface_state;
+ GdkSurfaceState changed_mask;
- new_window_state = gdk_window_get_state (_gtk_widget_get_window (widget));
- changed_mask = new_window_state ^ priv->state;
- priv->state = new_window_state;
+ new_surface_state = gdk_surface_get_state (_gtk_widget_get_surface (widget));
+ changed_mask = new_surface_state ^ priv->state;
+ priv->state = new_surface_state;
- if (changed_mask & GDK_WINDOW_STATE_FOCUSED)
+ if (changed_mask & GDK_SURFACE_STATE_FOCUSED)
ensure_state_flag_backdrop (widget);
- if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
+ if (changed_mask & GDK_SURFACE_STATE_FULLSCREEN)
{
priv->fullscreen =
- (new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? 1 : 0;
+ (new_surface_state & GDK_SURFACE_STATE_FULLSCREEN) ? 1 : 0;
}
- if (changed_mask & GDK_WINDOW_STATE_MAXIMIZED)
+ if (changed_mask & GDK_SURFACE_STATE_MAXIMIZED)
{
priv->maximized =
- (new_window_state & GDK_WINDOW_STATE_MAXIMIZED) ? 1 : 0;
+ (new_surface_state & GDK_SURFACE_STATE_MAXIMIZED) ? 1 : 0;
g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_IS_MAXIMIZED]);
}
- update_edge_constraints (window, new_window_state);
+ update_edge_constraints (window, new_surface_state);
- if (changed_mask & (GDK_WINDOW_STATE_FULLSCREEN |
- GDK_WINDOW_STATE_MAXIMIZED |
- GDK_WINDOW_STATE_TILED |
- GDK_WINDOW_STATE_TOP_TILED |
- GDK_WINDOW_STATE_RIGHT_TILED |
- GDK_WINDOW_STATE_BOTTOM_TILED |
- GDK_WINDOW_STATE_LEFT_TILED))
+ if (changed_mask & (GDK_SURFACE_STATE_FULLSCREEN |
+ GDK_SURFACE_STATE_MAXIMIZED |
+ GDK_SURFACE_STATE_TILED |
+ GDK_SURFACE_STATE_TOP_TILED |
+ GDK_SURFACE_STATE_RIGHT_TILED |
+ GDK_SURFACE_STATE_BOTTOM_TILED |
+ GDK_SURFACE_STATE_LEFT_TILED))
{
update_window_style_classes (window);
update_window_buttons (window);
@@ -7610,7 +7610,7 @@ gtk_window_event (GtkWidget *widget,
* the window being unmapped. more details can be found in:
* http://bugzilla.gnome.org/show_bug.cgi?id=316180
*/
- gdk_window_hide (_gtk_widget_get_window (widget));
+ gdk_surface_hide (_gtk_widget_get_surface (widget));
}
}
else if (event_type == GDK_CONFIGURE)
@@ -7652,21 +7652,21 @@ do_focus_change (GtkWidget *widget,
{
GdkDevice *dev = d->data;
GdkEvent *fevent;
- GdkWindow *window;
+ GdkSurface *window;
/* Skip non-master keyboards that haven't
* selected for events from this window
*/
- window = _gtk_widget_get_window (widget);
+ window = _gtk_widget_get_surface (widget);
if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER &&
- window && !gdk_window_get_device_events (window, dev))
+ window && !gdk_surface_get_device_events (window, dev))
continue;
fevent = gdk_event_new (GDK_FOCUS_CHANGE);
gdk_event_set_display (fevent, gtk_widget_get_display (widget));
fevent->any.type = GDK_FOCUS_CHANGE;
- fevent->any.window = window;
+ fevent->any.surface = window;
if (window)
g_object_ref (window);
fevent->focus_change.in = in;
@@ -7697,7 +7697,7 @@ gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window)
GdkDevice *dev = gdk_seat_get_pointer (s->data);
GdkModifierType mask;
- gdk_device_get_state (dev, _gtk_widget_get_window (GTK_WIDGET (window)),
+ gdk_device_get_state (dev, _gtk_widget_get_surface (GTK_WIDGET (window)),
NULL, &mask);
if (window->priv->mnemonic_modifier == (mask & gtk_accelerator_get_default_mod_mask ()))
{
@@ -7991,7 +7991,7 @@ gtk_window_real_set_focus (GtkWindow *window,
}
static void
-gtk_window_state_flags_changed (GtkWidget *widget,
+gtk_surface_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state)
{
GtkWindow *window = GTK_WINDOW (widget);
@@ -8066,18 +8066,18 @@ popup_menu_detach (GtkWidget *widget,
GTK_WINDOW (widget)->priv->popup_menu = NULL;
}
-static GdkWindowState
+static GdkSurfaceState
gtk_window_get_state (GtkWindow *window)
{
- GdkWindowState state;
- GdkWindow *gdk_window;
+ GdkSurfaceState state;
+ GdkSurface *gdk_surface;
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
state = 0;
- if (gdk_window)
- state = gdk_window_get_state (gdk_window);
+ if (gdk_surface)
+ state = gdk_surface_get_state (gdk_surface);
return state;
}
@@ -8088,7 +8088,7 @@ restore_window_clicked (GtkMenuItem *menuitem,
{
GtkWindow *window = GTK_WINDOW (user_data);
GtkWindowPrivate *priv = window->priv;
- GdkWindowState state;
+ GdkSurfaceState state;
if (priv->maximized)
{
@@ -8099,7 +8099,7 @@ restore_window_clicked (GtkMenuItem *menuitem,
state = gtk_window_get_state (window);
- if (state & GDK_WINDOW_STATE_ICONIFIED)
+ if (state & GDK_SURFACE_STATE_ICONIFIED)
gtk_window_deiconify (window);
}
@@ -8147,11 +8147,11 @@ maximize_window_clicked (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWindow *window = GTK_WINDOW (user_data);
- GdkWindowState state;
+ GdkSurfaceState state;
state = gtk_window_get_state (window);
- if (state & GDK_WINDOW_STATE_ICONIFIED)
+ if (state & GDK_SURFACE_STATE_ICONIFIED)
gtk_window_deiconify (window);
gtk_window_maximize (window);
@@ -8181,7 +8181,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
{
GtkWindowPrivate *priv = window->priv;
GtkWidget *menuitem;
- GdkWindowState state;
+ GdkSurfaceState state;
gboolean maximized, iconified;
if (priv->popup_menu)
@@ -8189,7 +8189,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
state = gtk_window_get_state (window);
- iconified = (state & GDK_WINDOW_STATE_ICONIFIED) == GDK_WINDOW_STATE_ICONIFIED;
+ iconified = (state & GDK_SURFACE_STATE_ICONIFIED) == GDK_SURFACE_STATE_ICONIFIED;
maximized = priv->maximized && !iconified;
priv->popup_menu = gtk_menu_new ();
@@ -8212,7 +8212,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
if ((gtk_widget_is_visible (GTK_WIDGET (window)) &&
!(maximized || iconified)) ||
(!iconified && !priv->resizable) ||
- priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
+ priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "activate",
G_CALLBACK (restore_window_clicked), window);
@@ -8237,7 +8237,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_menu_item_new_with_label (_("Minimize"));
gtk_widget_show (menuitem);
if (iconified ||
- priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
+ priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "activate",
G_CALLBACK (minimize_window_clicked), window);
@@ -8247,7 +8247,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
gtk_widget_show (menuitem);
if (maximized ||
!priv->resizable ||
- priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
+ priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "activate",
G_CALLBACK (maximize_window_clicked), window);
@@ -8284,7 +8284,7 @@ static void
gtk_window_do_popup (GtkWindow *window,
GdkEventButton *event)
{
- if (!gdk_window_show_window_menu (_gtk_widget_get_window (GTK_WIDGET (window)),
+ if (!gdk_surface_show_window_menu (_gtk_widget_get_surface (GTK_WIDGET (window)),
(GdkEvent *) event))
gtk_window_do_popup_fallback (window, event);
}
@@ -8535,17 +8535,17 @@ gtk_window_compute_configure_request (GtkWindow *window,
case GTK_WIN_POS_CENTER_ON_PARENT:
{
GtkAllocation allocation;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
GdkMonitor *monitor;
GdkRectangle area;
gint ox, oy;
g_assert (_gtk_widget_get_mapped (parent_widget)); /* established earlier */
- gdk_window = _gtk_widget_get_window (parent_widget);
- monitor = gdk_display_get_monitor_at_window (priv->display, gdk_window);
+ gdk_surface = _gtk_widget_get_surface (parent_widget);
+ monitor = gdk_display_get_monitor_at_surface (priv->display, gdk_surface);
- gdk_window_get_origin (gdk_window, &ox, &oy);
+ gdk_surface_get_origin (gdk_surface, &ox, &oy);
_gtk_widget_get_allocation (parent_widget, &allocation);
x = ox + (allocation.width - w) / 2;
@@ -8672,7 +8672,7 @@ gtk_window_move_resize (GtkWindow *window)
GtkWidget *widget;
GtkWindowGeometryInfo *info;
GdkGeometry new_geometry;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
guint new_flags;
GdkRectangle new_request;
gboolean configure_request_size_changed;
@@ -8683,7 +8683,7 @@ gtk_window_move_resize (GtkWindow *window)
widget = GTK_WIDGET (window);
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
info = gtk_window_get_geometry_info (window, TRUE);
configure_request_size_changed = FALSE;
@@ -8851,12 +8851,12 @@ gtk_window_move_resize (GtkWindow *window)
/* Set hints if necessary
*/
if (hints_changed)
- gdk_window_set_geometry_hints (gdk_window,
+ gdk_surface_set_geometry_hints (gdk_surface,
&new_geometry,
new_flags);
- current_width = gdk_window_get_width (gdk_window);
- current_height = gdk_window_get_height (gdk_window);
+ current_width = gdk_surface_get_width (gdk_surface);
+ current_height = gdk_surface_get_height (gdk_surface);
/* handle resizing/moving and widget tree allocation
*/
@@ -8952,13 +8952,13 @@ gtk_window_move_resize (GtkWindow *window)
/* Now send the configure request */
if (configure_request_pos_changed)
{
- gdk_window_move_resize (gdk_window,
+ gdk_surface_move_resize (gdk_surface,
new_request.x, new_request.y,
new_request.width, new_request.height);
}
else /* only size changed */
{
- gdk_window_resize (gdk_window,
+ gdk_surface_resize (gdk_surface,
new_request.width, new_request.height);
}
@@ -8980,7 +8980,7 @@ gtk_window_move_resize (GtkWindow *window)
/* Increment the number of have-not-yet-received-notify requests */
priv->configure_request_count += 1;
- gdk_window_freeze_toplevel_updates (gdk_window);
+ gdk_surface_freeze_toplevel_updates (gdk_surface);
/* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new
* configure event in response to our resizing request.
@@ -9008,7 +9008,7 @@ gtk_window_move_resize (GtkWindow *window)
*/
if (configure_request_pos_changed)
{
- gdk_window_move (gdk_window,
+ gdk_surface_move (gdk_surface,
new_request.x, new_request.y);
}
@@ -9100,7 +9100,7 @@ gtk_window_constrain_size (GtkWindow *window,
else
geometry_flags = flags;
- gdk_window_constrain_size (geometry, geometry_flags, width, height,
+ gdk_surface_constrain_size (geometry, geometry_flags, width, height,
new_width, new_height);
}
@@ -9354,7 +9354,7 @@ gtk_window_present_with_time (GtkWindow *window,
{
GtkWindowPrivate *priv;
GtkWidget *widget;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -9363,17 +9363,17 @@ gtk_window_present_with_time (GtkWindow *window,
if (gtk_widget_get_visible (widget))
{
- gdk_window = _gtk_widget_get_window (widget);
+ gdk_surface = _gtk_widget_get_surface (widget);
- g_assert (gdk_window != NULL);
+ g_assert (gdk_surface != NULL);
- gdk_window_show (gdk_window);
+ gdk_surface_show (gdk_surface);
/* Translate a timestamp of GDK_CURRENT_TIME appropriately */
if (timestamp == GDK_CURRENT_TIME)
{
#ifdef GDK_WINDOWING_X11
- if (GDK_IS_X11_WINDOW(gdk_window))
+ if (GDK_IS_X11_SURFACE(gdk_surface))
{
GdkDisplay *display;
@@ -9385,7 +9385,7 @@ gtk_window_present_with_time (GtkWindow *window,
timestamp = gtk_get_current_event_time ();
}
- gdk_window_focus (gdk_window, timestamp);
+ gdk_surface_focus (gdk_surface, timestamp);
}
else
{
@@ -9410,21 +9410,21 @@ gtk_window_present_with_time (GtkWindow *window,
* in which case the window will be iconified before it ever appears
* onscreen.
*
- * You can track iconification via the #GdkWindow::state property.
+ * You can track iconification via the #GdkSurface::state property.
*/
void
gtk_window_iconify (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->iconify_initially = TRUE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_iconify (toplevel);
+ gdk_surface_iconify (toplevel);
}
/**
@@ -9437,21 +9437,21 @@ gtk_window_iconify (GtkWindow *window)
* [window manager][gtk-X11-arch])) could iconify it
* again before your code which assumes deiconification gets to run.
*
- * You can track iconification via the #GdkWindow::state property.
+ * You can track iconification via the #GdkSurface::state property.
**/
void
gtk_window_deiconify (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->iconify_initially = FALSE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_deiconify (toplevel);
+ gdk_surface_deiconify (toplevel);
}
/**
@@ -9468,21 +9468,21 @@ gtk_window_deiconify (GtkWindow *window)
*
* It’s permitted to call this function before showing a window.
*
- * You can track iconification via the #GdkWindow::state property.
+ * You can track iconification via the #GdkSurface::state property.
**/
void
gtk_window_stick (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->stick_initially = TRUE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_stick (toplevel);
+ gdk_surface_stick (toplevel);
}
/**
@@ -9496,21 +9496,21 @@ gtk_window_stick (GtkWindow *window)
* stick it again. But normally the window will
* end up stuck. Just don’t write code that crashes if not.
*
- * You can track iconification via the #GdkWindow::state property.
+ * You can track iconification via the #GdkSurface::state property.
**/
void
gtk_window_unstick (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->stick_initially = FALSE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_unstick (toplevel);
+ gdk_surface_unstick (toplevel);
}
/**
@@ -9529,22 +9529,22 @@ gtk_window_unstick (GtkWindow *window)
* in which case the window will be maximized when it appears onscreen
* initially.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
* or by listening to notifications on the #GtkWindow:is-maximized property.
**/
void
gtk_window_maximize (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->maximize_initially = TRUE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_maximize (toplevel);
+ gdk_surface_maximize (toplevel);
}
/**
@@ -9558,21 +9558,21 @@ gtk_window_maximize (GtkWindow *window)
* managers honor requests to unmaximize. But normally the window will
* end up unmaximized. Just don’t write code that crashes if not.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
**/
void
gtk_window_unmaximize (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->maximize_initially = FALSE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_unmaximize (toplevel);
+ gdk_surface_unmaximize (toplevel);
}
/**
@@ -9587,21 +9587,21 @@ gtk_window_unmaximize (GtkWindow *window)
* windows. But normally the window will end up fullscreen. Just
* don’t write code that crashes if not.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
**/
void
gtk_window_fullscreen (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
window->priv->fullscreen_initially = TRUE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_fullscreen (toplevel);
+ gdk_surface_fullscreen (toplevel);
}
static void
@@ -9625,7 +9625,7 @@ unset_fullscreen_monitor (GtkWindow *window)
* Asks to place @window in the fullscreen state. Note that you shouldn't assume
* the window is definitely full screen afterward.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
*/
void
gtk_window_fullscreen_on_monitor (GtkWindow *window,
@@ -9633,7 +9633,7 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window,
{
GtkWindowPrivate *priv;
GtkWidget *widget;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (GDK_IS_MONITOR (monitor));
@@ -9652,10 +9652,10 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window,
priv->fullscreen_initially = TRUE;
- toplevel = _gtk_widget_get_window (widget);
+ toplevel = _gtk_widget_get_surface (widget);
if (toplevel != NULL)
- gdk_window_fullscreen_on_monitor (toplevel, monitor);
+ gdk_surface_fullscreen_on_monitor (toplevel, monitor);
}
/**
@@ -9670,22 +9670,22 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window,
* windows. But normally the window will end up restored to its normal
* state. Just don’t write code that crashes if not.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
**/
void
gtk_window_unfullscreen (GtkWindow *window)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
unset_fullscreen_monitor (window);
window->priv->fullscreen_initially = FALSE;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_unfullscreen (toplevel);
+ gdk_surface_unfullscreen (toplevel);
}
/**
@@ -9705,7 +9705,7 @@ gtk_window_unfullscreen (GtkWindow *window)
* in which case the window will be kept above when it appears onscreen
* initially.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
*
* Note that, according to the
* [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
@@ -9717,7 +9717,7 @@ void
gtk_window_set_keep_above (GtkWindow *window,
gboolean setting)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -9726,10 +9726,10 @@ gtk_window_set_keep_above (GtkWindow *window,
window->priv->above_initially = setting;
window->priv->below_initially &= !setting;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_set_keep_above (toplevel, setting);
+ gdk_surface_set_keep_above (toplevel, setting);
}
/**
@@ -9749,7 +9749,7 @@ gtk_window_set_keep_above (GtkWindow *window,
* in which case the window will be kept below when it appears onscreen
* initially.
*
- * You can track iconification via the #GdkWindow::state property
+ * You can track iconification via the #GdkSurface::state property
*
* Note that, according to the
* [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
@@ -9761,7 +9761,7 @@ void
gtk_window_set_keep_below (GtkWindow *window,
gboolean setting)
{
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -9770,10 +9770,10 @@ gtk_window_set_keep_below (GtkWindow *window,
window->priv->below_initially = setting;
window->priv->above_initially &= !setting;
- toplevel = _gtk_widget_get_window (GTK_WIDGET (window));
+ toplevel = _gtk_widget_get_surface (GTK_WIDGET (window));
if (toplevel != NULL)
- gdk_window_set_keep_below (toplevel, setting);
+ gdk_surface_set_keep_below (toplevel, setting);
}
/**
@@ -9893,22 +9893,22 @@ gtk_window_get_gravity (GtkWindow *window)
*/
void
gtk_window_begin_resize_drag (GtkWindow *window,
- GdkWindowEdge edge,
+ GdkSurfaceEdge edge,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
GtkWidget *widget;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
widget = GTK_WIDGET (window);
g_return_if_fail (gtk_widget_get_visible (widget));
- toplevel = _gtk_widget_get_window (widget);
+ toplevel = _gtk_widget_get_surface (widget);
- gdk_window_begin_resize_drag (toplevel,
+ gdk_surface_begin_resize_drag (toplevel,
edge, button,
root_x, root_y,
timestamp);
@@ -9937,15 +9937,15 @@ gtk_window_begin_move_drag (GtkWindow *window,
guint32 timestamp)
{
GtkWidget *widget;
- GdkWindow *toplevel;
+ GdkSurface *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
widget = GTK_WIDGET (window);
g_return_if_fail (gtk_widget_get_visible (widget));
- toplevel = _gtk_widget_get_window (widget);
+ toplevel = _gtk_widget_get_surface (widget);
- gdk_window_begin_move_drag (toplevel,
+ gdk_surface_begin_move_drag (toplevel,
button,
root_x, root_y,
timestamp);
@@ -10017,17 +10017,17 @@ static void
gtk_window_set_theme_variant (GtkWindow *window)
{
#ifdef GDK_WINDOWING_X11
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
gboolean dark_theme_requested;
g_object_get (gtk_settings_get_for_display (window->priv->display),
"gtk-application-prefer-dark-theme", &dark_theme_requested,
NULL);
- gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
+ gdk_surface = _gtk_widget_get_surface (GTK_WIDGET (window));
- if (GDK_IS_X11_WINDOW (gdk_window))
- gdk_x11_window_set_theme_variant (gdk_window,
+ if (GDK_IS_X11_SURFACE (gdk_surface))
+ gdk_x11_surface_set_theme_variant (gdk_surface,
dark_theme_requested ? "dark" : NULL);
#endif
}
@@ -10655,12 +10655,12 @@ gtk_window_set_has_user_ref_count (GtkWindow *window,
static void
ensure_state_flag_backdrop (GtkWidget *widget)
{
- GdkWindow *window;
+ GdkSurface *window;
gboolean window_focused = TRUE;
- window = _gtk_widget_get_window (widget);
+ window = _gtk_widget_get_surface (widget);
- window_focused = gdk_window_get_state (window) & GDK_WINDOW_STATE_FOCUSED;
+ window_focused = gdk_surface_get_state (window) & GDK_SURFACE_STATE_FOCUSED;
if (!window_focused)
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE);
@@ -11074,14 +11074,14 @@ gtk_window_set_use_subsurface (GtkWindow *window,
void
gtk_window_set_hardcoded_window (GtkWindow *window,
- GdkWindow *gdk_window)
+ GdkSurface *gdk_surface)
{
GtkWindowPrivate *priv = window->priv;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (!_gtk_widget_get_realized (GTK_WIDGET (window)));
- g_set_object (&priv->hardcoded_window, gdk_window);
+ g_set_object (&priv->hardcoded_window, gdk_surface);
}
#ifdef GDK_WINDOWING_WAYLAND
@@ -11089,14 +11089,14 @@ typedef struct {
GtkWindow *window;
GtkWindowHandleExported callback;
gpointer user_data;
-} WaylandWindowHandleExportedData;
+} WaylandSurfaceHandleExportedData;
static void
-wayland_window_handle_exported (GdkWindow *window,
+wayland_surface_handle_exported (GdkSurface *window,
const char *wayland_handle_str,
gpointer user_data)
{
- WaylandWindowHandleExportedData *data = user_data;
+ WaylandSurfaceHandleExportedData *data = user_data;
char *handle_str;
handle_str = g_strdup_printf ("wayland:%s", wayland_handle_str);
@@ -11114,9 +11114,9 @@ gtk_window_export_handle (GtkWindow *window,
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
{
- GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
char *handle_str;
- guint32 xid = (guint32) gdk_x11_window_get_xid (gdk_window);
+ guint32 xid = (guint32) gdk_x11_surface_get_xid (gdk_surface);
handle_str = g_strdup_printf ("x11:%x", xid);
callback (window, handle_str, user_data);
@@ -11127,16 +11127,16 @@ gtk_window_export_handle (GtkWindow *window,
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
{
- GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- WaylandWindowHandleExportedData *data;
+ GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
+ WaylandSurfaceHandleExportedData *data;
- data = g_new0 (WaylandWindowHandleExportedData, 1);
+ data = g_new0 (WaylandSurfaceHandleExportedData, 1);
data->window = window;
data->callback = callback;
data->user_data = user_data;
- if (!gdk_wayland_window_export_handle (gdk_window,
- wayland_window_handle_exported,
+ if (!gdk_wayland_surface_export_handle (gdk_surface,
+ wayland_surface_handle_exported,
data,
g_free))
{
@@ -11161,9 +11161,9 @@ gtk_window_unexport_handle (GtkWindow *window)
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
{
- GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ GdkSurface *gdk_surface = gtk_widget_get_surface (GTK_WIDGET (window));
- gdk_wayland_window_unexport_handle (gdk_window);
+ gdk_wayland_surface_unexport_handle (gdk_surface);
}
#endif
}
@@ -11397,7 +11397,7 @@ update_cursor (GtkWindow *toplevel,
break;
}
- gdk_window_set_device_cursor (gtk_widget_get_window (GTK_WIDGET (toplevel)),
+ gdk_surface_set_device_cursor (gtk_widget_get_surface (GTK_WIDGET (toplevel)),
device, cursor);
g_list_free (widgets);
}
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 89547fb0a4..7d8e589486 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -196,9 +196,9 @@ GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_window_get_attached_to (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_set_type_hint (GtkWindow *window,
- GdkWindowTypeHint hint);
+ GdkSurfaceTypeHint hint);
GDK_AVAILABLE_IN_ALL
-GdkWindowTypeHint gtk_window_get_type_hint (GtkWindow *window);
+GdkSurfaceTypeHint gtk_window_get_type_hint (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_set_skip_taskbar_hint (GtkWindow *window,
gboolean setting);
@@ -381,7 +381,7 @@ void gtk_window_set_keep_below (GtkWindow *window, gboolean setting);
GDK_AVAILABLE_IN_ALL
void gtk_window_begin_resize_drag (GtkWindow *window,
- GdkWindowEdge edge,
+ GdkSurfaceEdge edge,
gint button,
gint root_x,
gint root_y,
diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h
index d82d876f91..95f80f1acd 100644
--- a/gtk/gtkwindowprivate.h
+++ b/gtk/gtkwindowprivate.h
@@ -116,7 +116,7 @@ GdkTexture * gtk_window_get_icon_for_size (GtkWindow *window,
void gtk_window_set_use_subsurface (GtkWindow *window,
gboolean use_subsurface);
void gtk_window_set_hardcoded_window (GtkWindow *window,
- GdkWindow *gdk_window);
+ GdkSurface *gdk_surface);
GdkDisplay *gtk_window_get_display (GtkWindow *window);
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
index 6ccde9bc9a..4db6523296 100644
--- a/gtk/inspector/general.c
+++ b/gtk/inspector/general.c
@@ -95,7 +95,7 @@ init_version (GtkInspectorGeneral *gen)
{
const char *backend;
GdkDisplay *display;
- GdkWindow *window;
+ GdkSurface *window;
GskRenderer *gsk_renderer;
const char *renderer;
@@ -128,8 +128,8 @@ init_version (GtkInspectorGeneral *gen)
#endif
backend = "Unknown";
- window = gdk_window_new_toplevel (display, 10, 10);
- gsk_renderer = gsk_renderer_new_for_window (window);
+ window = gdk_surface_new_toplevel (display, 10, 10);
+ gsk_renderer = gsk_renderer_new_for_surface (window);
if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskVulkanRenderer") == 0)
renderer = "Vulkan";
else if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskGLRenderer") == 0)
@@ -141,7 +141,7 @@ init_version (GtkInspectorGeneral *gen)
gsk_renderer_unrealize (gsk_renderer);
g_object_unref (gsk_renderer);
- gdk_window_destroy (window);
+ gdk_surface_destroy (window);
gtk_label_set_text (GTK_LABEL (gen->priv->gtk_version), GTK_VERSION);
gtk_label_set_text (GTK_LABEL (gen->priv->gdk_backend), backend);
@@ -384,13 +384,13 @@ static void
init_vulkan (GtkInspectorGeneral *gen)
{
#ifdef GDK_RENDERING_VULKAN
- GdkWindow *window;
+ GdkSurface *window;
GdkVulkanContext *context;
GdkDisplay *display = gdk_display_get_default ();
- window = gdk_window_new_toplevel (display, 10, 10);
- context = gdk_window_create_vulkan_context (window, NULL);
- gdk_window_destroy (window);
+ window = gdk_surface_new_toplevel (display, 10, 10);
+ context = gdk_surface_create_vulkan_context (window, NULL);
+ gdk_surface_destroy (window);
if (context)
{
diff --git a/gtk/inspector/gtkstackcombo.c b/gtk/inspector/gtkstackcombo.c
index 7bbaa1b8cd..a5a257ed36 100644
--- a/gtk/inspector/gtkstackcombo.c
+++ b/gtk/inspector/gtkstackcombo.c
@@ -48,7 +48,7 @@ G_DEFINE_TYPE (GtkStackCombo, gtk_stack_combo, GTK_TYPE_WIDGET)
static void
gtk_stack_combo_init (GtkStackCombo *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->stack = NULL;
self->combo = GTK_COMBO_BOX (gtk_combo_box_text_new ());
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c
index 85a0c17e78..0097433526 100644
--- a/gtk/inspector/inspect-button.c
+++ b/gtk/inspector/inspect-button.c
@@ -80,28 +80,28 @@ static GtkWidget *
find_widget_at_pointer (GdkDevice *device)
{
GtkWidget *widget = NULL;
- GdkWindow *pointer_window;
+ GdkSurface *pointer_window;
- pointer_window = gdk_device_get_window_at_position (device, NULL, NULL);
+ pointer_window = gdk_device_get_surface_at_position (device, NULL, NULL);
if (pointer_window)
{
gpointer widget_ptr;
- gdk_window_get_user_data (pointer_window, &widget_ptr);
+ gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr;
if (!GTK_IS_WINDOW (widget))
{
while (TRUE)
{
- GdkWindow *parent = gdk_window_get_parent (pointer_window);
+ GdkSurface *parent = gdk_surface_get_parent (pointer_window);
if (!parent)
break;
pointer_window = parent;
- gdk_window_get_user_data (pointer_window, &widget_ptr);
+ gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr;
if (GTK_IS_WINDOW (widget))
@@ -115,7 +115,7 @@ find_widget_at_pointer (GdkDevice *device)
{
double x, y;
- gdk_window_get_device_position_double (gtk_widget_get_window (widget),
+ gdk_surface_get_device_position_double (gtk_widget_get_surface (widget),
device, &x, &y, NULL);
widget = inspector_pick (widget, x, y);
@@ -175,7 +175,7 @@ on_inspect_widget (GtkWidget *button,
{
GtkWidget *widget;
- gdk_window_raise (gtk_widget_get_window (GTK_WIDGET (iw)));
+ gdk_surface_raise (gtk_widget_get_surface (GTK_WIDGET (iw)));
clear_flash (iw);
@@ -234,7 +234,7 @@ deemphasize_window (GtkWidget *window)
cairo_region_destroy (region);
}
else
- gdk_window_lower (gtk_widget_get_window (window));
+ gdk_surface_lower (gtk_widget_get_surface (window));
}
static void
@@ -249,7 +249,7 @@ reemphasize_window (GtkWidget *window)
gtk_widget_input_shape_combine_region (window, NULL);
}
else
- gdk_window_raise (gtk_widget_get_window (window));
+ gdk_surface_raise (gtk_widget_get_surface (window));
}
static gboolean
@@ -295,10 +295,10 @@ property_query_event (GtkWidget *widget,
static void
prepare_inspect_func (GdkSeat *seat,
- GdkWindow *window,
+ GdkSurface *window,
gpointer user_data)
{
- gdk_window_show (window);
+ gdk_surface_show (window);
}
@@ -320,7 +320,7 @@ gtk_inspector_on_inspect (GtkWidget *button,
display = gdk_display_get_default ();
cursor = gdk_cursor_new_from_name ("crosshair", NULL);
status = gdk_seat_grab (gdk_display_get_default_seat (display),
- gtk_widget_get_window (iw->invisible),
+ gtk_widget_get_surface (iw->invisible),
GDK_SEAT_CAPABILITY_ALL_POINTING, TRUE,
cursor, NULL, prepare_inspect_func, NULL);
g_object_unref (cursor);
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 9ea5ff93a2..470f47ff05 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -1066,7 +1066,7 @@ void
gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder,
GtkWidget *widget,
GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
const cairo_region_t *region,
GdkDrawingContext *context,
GskRenderNode *node)
@@ -1084,8 +1084,8 @@ gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder,
recording = gtk_inspector_render_recording_new (gdk_frame_clock_get_frame_time (frame_clock),
gsk_renderer_get_profiler (renderer),
&(GdkRectangle) { 0, 0,
- gdk_window_get_width (window),
- gdk_window_get_height (window) },
+ gdk_surface_get_width (window),
+ gdk_surface_get_height (window) },
region,
clip,
node);
diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h
index 7515bdce46..585046aa68 100644
--- a/gtk/inspector/recorder.h
+++ b/gtk/inspector/recorder.h
@@ -54,7 +54,7 @@ void gtk_inspector_recorder_set_debug_nodes (GtkInspectorRec
void gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder,
GtkWidget *widget,
GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
const cairo_region_t *region,
GdkDrawingContext *context,
GskRenderNode *node);
diff --git a/gtk/inspector/rendernodeview.c b/gtk/inspector/rendernodeview.c
index 51e7e0edfd..cbd5d2ec3f 100644
--- a/gtk/inspector/rendernodeview.c
+++ b/gtk/inspector/rendernodeview.c
@@ -337,7 +337,7 @@ gtk_render_node_view_class_init (GtkRenderNodeViewClass *klass)
static void
gtk_render_node_view_init (GtkRenderNodeView *view)
{
- gtk_widget_set_has_window (GTK_WIDGET (view), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (view), FALSE);
}
GtkWidget *
diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c
index 663702234e..8e3506d47b 100644
--- a/gtk/inspector/visual.c
+++ b/gtk/inspector/visual.c
@@ -584,7 +584,7 @@ scale_changed (GtkAdjustment *adjustment, GtkInspectorVisual *vis)
scale = gtk_adjustment_get_value (adjustment);
display = gdk_display_get_default ();
- gdk_x11_display_set_window_scale (display, scale);
+ gdk_x11_display_set_surface_scale (display, scale);
}
#endif
diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c
index 15b38e91e5..fb4bdcb392 100644
--- a/gtk/inspector/window.c
+++ b/gtk/inspector/window.c
@@ -372,7 +372,7 @@ gtk_inspector_window_get_for_display (GdkDisplay *display)
void
gtk_inspector_record_render (GtkWidget *widget,
GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
const cairo_region_t *region,
GdkDrawingContext *context,
GskRenderNode *node)
diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h
index e0504a784c..3919114729 100644
--- a/gtk/inspector/window.h
+++ b/gtk/inspector/window.h
@@ -109,7 +109,7 @@ void gtk_inspector_window_rescan (GtkWidget *iw);
gboolean gtk_inspector_is_recording (GtkWidget *widget);
void gtk_inspector_record_render (GtkWidget *widget,
GskRenderer *renderer,
- GdkWindow *window,
+ GdkSurface *window,
const cairo_region_t *region,
GdkDrawingContext *context,
GskRenderNode *node);
diff --git a/tests/motion-compression.c b/tests/motion-compression.c
index 81ff7c27aa..f869bcfeb4 100644
--- a/tests/motion-compression.c
+++ b/tests/motion-compression.c
@@ -9,7 +9,7 @@ event_cb (GtkWidget *window,
GdkEvent *event)
{
if (gdk_event_get_event_type (event) == GDK_MOTION_NOTIFY &&
- gdk_event_get_window (event) == gtk_widget_get_window (window))
+ gdk_event_get_surface (event) == gtk_widget_get_surface (window))
{
gdouble x, y;
float processing_ms = gtk_adjustment_get_value (adjustment);
diff --git a/tests/rendernode.c b/tests/rendernode.c
index f56d0880d1..e0f5e1f9ec 100644
--- a/tests/rendernode.c
+++ b/tests/rendernode.c
@@ -114,11 +114,11 @@ main(int argc, char **argv)
else
{
GskRenderer *renderer;
- GdkWindow *window;
+ GdkSurface *window;
GdkTexture *texture = NULL;
- window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
- renderer = gsk_renderer_new_for_window (window);
+ window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
+ renderer = gsk_renderer_new_for_surface (window);
for (run = 0; run < runs; run++)
{
diff --git a/tests/showrendernode.c b/tests/showrendernode.c
index d4de840c50..e0b2210ef3 100644
--- a/tests/showrendernode.c
+++ b/tests/showrendernode.c
@@ -94,7 +94,7 @@ gtk_node_view_finalize (GObject *object)
static void
gtk_node_view_init (GtkNodeView *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
}
static void
@@ -165,8 +165,8 @@ main (int argc, char **argv)
if (write_to_filename != NULL)
{
- GdkWindow *window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
- GskRenderer *renderer = gsk_renderer_new_for_window (window);
+ GdkSurface *window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
+ GskRenderer *renderer = gsk_renderer_new_for_surface (window);
GdkTexture *texture = gsk_renderer_render_texture (renderer, GTK_NODE_VIEW (nodeview)->node, NULL);
cairo_surface_t *rendered_surface;
@@ -194,8 +194,8 @@ main (int argc, char **argv)
if (compare_node)
{
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
- GdkWindow *gdk_window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
- GskRenderer *renderer = gsk_renderer_new_for_window (gdk_window);
+ GdkSurface *gdk_surface = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
+ GskRenderer *renderer = gsk_renderer_new_for_surface (gdk_surface);
GdkTexture *texture = gsk_renderer_render_texture (renderer, GTK_NODE_VIEW (nodeview)->node, NULL);
GtkWidget *image = gtk_image_new_from_paintable (GDK_PAINTABLE (texture));
@@ -206,7 +206,7 @@ main (int argc, char **argv)
gsk_renderer_unrealize (renderer);
g_object_unref (texture);
g_object_unref (renderer);
- g_object_unref (gdk_window);
+ g_object_unref (gdk_surface);
}
else
{
diff --git a/tests/testfullscreen.c b/tests/testfullscreen.c
index 7dbfbd4fba..acdbd15bb0 100644
--- a/tests/testfullscreen.c
+++ b/tests/testfullscreen.c
@@ -23,20 +23,20 @@ static void
set_fullscreen_monitor_cb (GtkWidget *widget, gpointer user_data)
{
GdkFullscreenMode mode = (GdkFullscreenMode) GPOINTER_TO_INT (user_data);
- GdkWindow *window;
+ GdkSurface *window;
- window = gtk_widget_get_parent_window (widget);
- gdk_window_set_fullscreen_mode (window, mode);
- gdk_window_fullscreen (window);
+ window = gtk_widget_get_parent_surface (widget);
+ gdk_surface_set_fullscreen_mode (window, mode);
+ gdk_surface_fullscreen (window);
}
static void
remove_fullscreen_cb (GtkWidget *widget, gpointer user_data)
{
- GdkWindow *window;
+ GdkSurface *window;
- window = gtk_widget_get_parent_window (widget);
- gdk_window_unfullscreen (window);
+ window = gtk_widget_get_parent_surface (widget);
+ gdk_surface_unfullscreen (window);
}
int
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 2561a8b966..01f2f409f3 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -223,7 +223,7 @@ on_composited_changed (GdkDisplay *display,
else
gtk_label_set_text (label, "Not composited");
- /* We draw a different background on the GdkWindow */
+ /* We draw a different background on the GdkSurface */
gtk_widget_queue_draw (gtk_widget_get_toplevel (GTK_WIDGET (label)));
}
@@ -760,7 +760,7 @@ create_button_box (GtkWidget *widget)
static GtkWidget*
new_pixbuf (char *filename,
- GdkWindow *window)
+ GdkSurface *window)
{
GtkWidget *widget;
GdkPixbuf *pixbuf;
@@ -1381,7 +1381,7 @@ configure_event (GtkWidget *window)
lx = g_object_get_data (G_OBJECT (window), "x");
ly = g_object_get_data (G_OBJECT (window), "y");
- gdk_window_get_root_origin (gtk_widget_get_window (window),
+ gdk_surface_get_root_origin (gtk_widget_get_surface (window),
&upositionx, &upositiony);
sprintf (buffer, "%d", upositionx);
gtk_label_set_text (lx, buffer);
@@ -1512,7 +1512,7 @@ create_pixbuf (GtkWidget *widget)
GtkWidget *label;
GtkWidget *separator;
GtkWidget *pixbufwid;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
if (!window)
{
@@ -1537,9 +1537,9 @@ create_pixbuf (GtkWidget *widget)
button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (box2), button);
- gdk_window = gtk_widget_get_window (window);
+ gdk_surface = gtk_widget_get_surface (window);
- pixbufwid = new_pixbuf ("test.xpm", gdk_window);
+ pixbufwid = new_pixbuf ("test.xpm", gdk_surface);
label = gtk_label_new ("Pixbuf\ntest");
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -1550,7 +1550,7 @@ create_pixbuf (GtkWidget *widget)
button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (box2), button);
- pixbufwid = new_pixbuf ("test.xpm", gdk_window);
+ pixbufwid = new_pixbuf ("test.xpm", gdk_surface);
label = gtk_label_new ("Pixbuf\ntest");
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -5546,7 +5546,7 @@ create_wmhints (GtkWidget *widget)
GtkWidget *button;
GtkWidget *box1;
GtkWidget *box2;
- GdkWindow *gdk_window;
+ GdkSurface *gdk_surface;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
GList *list;
@@ -5566,7 +5566,7 @@ create_wmhints (GtkWidget *widget)
gtk_widget_realize (window);
- gdk_window = gtk_widget_get_window (window);
+ gdk_surface = gtk_widget_get_surface (window);
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile);
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
@@ -5579,10 +5579,10 @@ create_wmhints (GtkWidget *widget)
cairo_surface_destroy (surface);
g_object_unref (pixbuf);
- gdk_window_set_icon_name (gdk_window, "WMHints Test Icon");
+ gdk_surface_set_icon_name (gdk_surface, "WMHints Test Icon");
- gdk_window_set_decorations (gdk_window, GDK_DECOR_ALL | GDK_DECOR_MENU);
- gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_RESIZE);
+ gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL | GDK_DECOR_MENU);
+ gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_RESIZE);
box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
@@ -5627,28 +5627,28 @@ create_wmhints (GtkWidget *widget)
*/
static void
-window_state_callback (GdkWindow *window,
+surface_state_callback (GdkSurface *window,
GParamSpec *pspec,
GtkWidget *label)
{
gchar *msg;
- GdkWindowState new_state;
+ GdkSurfaceState new_state;
- new_state = gdk_window_get_state (window);
+ new_state = gdk_surface_get_state (window);
msg = g_strconcat ((const char *)g_object_get_data (G_OBJECT (label), "title"), ": ",
- (new_state & GDK_WINDOW_STATE_WITHDRAWN) ?
+ (new_state & GDK_SURFACE_STATE_WITHDRAWN) ?
"withdrawn" : "not withdrawn", ", ",
- (new_state & GDK_WINDOW_STATE_ICONIFIED) ?
+ (new_state & GDK_SURFACE_STATE_ICONIFIED) ?
"iconified" : "not iconified", ", ",
- (new_state & GDK_WINDOW_STATE_STICKY) ?
+ (new_state & GDK_SURFACE_STATE_STICKY) ?
"sticky" : "not sticky", ", ",
- (new_state & GDK_WINDOW_STATE_MAXIMIZED) ?
+ (new_state & GDK_SURFACE_STATE_MAXIMIZED) ?
"maximized" : "not maximized", ", ",
- (new_state & GDK_WINDOW_STATE_FULLSCREEN) ?
+ (new_state & GDK_SURFACE_STATE_FULLSCREEN) ?
"fullscreen" : "not fullscreen", ", ",
- (new_state & GDK_WINDOW_STATE_ABOVE) ?
+ (new_state & GDK_SURFACE_STATE_ABOVE) ?
"above" : "not above", ", ",
- (new_state & GDK_WINDOW_STATE_BELOW) ?
+ (new_state & GDK_SURFACE_STATE_BELOW) ?
"below" : "not below", ", ",
NULL);
@@ -5677,8 +5677,8 @@ tracking_label (GtkWidget *window)
gtk_box_pack_start (GTK_BOX (hbox), label);
g_object_set_data (G_OBJECT (label), "title", (gpointer)gtk_window_get_title (GTK_WINDOW (window)));
- g_signal_connect (gtk_widget_get_window (window), "notify::state",
- G_CALLBACK (window_state_callback),
+ g_signal_connect (gtk_widget_get_surface (window), "notify::state",
+ G_CALLBACK (surface_state_callback),
label);
button = gtk_button_new_with_label ("Deiconify");
@@ -5856,7 +5856,7 @@ get_state_controls (GtkWidget *window)
}
void
-create_window_states (GtkWidget *widget)
+create_surface_states (GtkWidget *widget)
{
static GtkWidget *window = NULL;
GtkWidget *label;
@@ -6629,7 +6629,7 @@ find_widget (GtkWidget *widget, FindWidgetData *data)
* but within the allocation are not counted. This is consistent
* with the way we highlight drag targets.
*/
- if (gtk_widget_get_has_window (widget))
+ if (gtk_widget_get_has_surface (widget))
{
new_allocation.x = 0;
new_allocation.y = 0;
@@ -6637,13 +6637,13 @@ find_widget (GtkWidget *widget, FindWidgetData *data)
if (gtk_widget_get_parent (widget) && !data->first)
{
- GdkWindow *window = gtk_widget_get_window (widget);
- while (window != gtk_widget_get_window (gtk_widget_get_parent (widget)))
+ GdkSurface *window = gtk_widget_get_surface (widget);
+ while (window != gtk_widget_get_surface (gtk_widget_get_parent (widget)))
{
gint tx, ty, twidth, theight;
- twidth = gdk_window_get_width (window);
- theight = gdk_window_get_height (window);
+ twidth = gdk_surface_get_width (window);
+ theight = gdk_surface_get_height (window);
if (new_allocation.x < 0)
{
@@ -6660,13 +6660,13 @@ find_widget (GtkWidget *widget, FindWidgetData *data)
if (new_allocation.y + new_allocation.height > theight)
new_allocation.height = theight - new_allocation.y;
- gdk_window_get_position (window, &tx, &ty);
+ gdk_surface_get_position (window, &tx, &ty);
new_allocation.x += tx;
x_offset += tx;
new_allocation.y += ty;
y_offset += ty;
- window = gdk_window_get_parent (window);
+ window = gdk_surface_get_parent (window);
}
}
@@ -6711,23 +6711,23 @@ static GtkWidget *
find_widget_at_pointer (GdkDevice *device)
{
GtkWidget *widget = NULL;
- GdkWindow *pointer_window;
+ GdkSurface *pointer_window;
gint x, y;
FindWidgetData data;
- pointer_window = gdk_device_get_window_at_position (device, NULL, NULL);
+ pointer_window = gdk_device_get_surface_at_position (device, NULL, NULL);
if (pointer_window)
{
gpointer widget_ptr;
- gdk_window_get_user_data (pointer_window, &widget_ptr);
+ gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr;
}
if (widget)
{
- gdk_window_get_device_position (gtk_widget_get_window (widget),
+ gdk_surface_get_device_position (gtk_widget_get_surface (widget),
device,
&x, &y, NULL);
@@ -6846,7 +6846,7 @@ snapshot_widget (GtkButton *button,
data->cursor = gdk_cursor_new_from_name ("crosshair", NULL);
gdk_seat_grab (gdk_device_get_seat (device),
- gtk_widget_get_window (widget),
+ gtk_widget_get_surface (widget),
GDK_SEAT_CAPABILITY_ALL_POINTING,
TRUE, data->cursor, NULL, NULL, NULL);
@@ -6974,7 +6974,7 @@ scroll_test_configure (GtkWidget *widget, GdkEventConfigure *event,
static void
scroll_test_adjustment_changed (GtkAdjustment *adjustment, GtkWidget *widget)
{
- GdkWindow *window;
+ GdkSurface *window;
gint dy;
dy = scroll_test_pos - (int)gtk_adjustment_get_value (adjustment);
@@ -6983,8 +6983,8 @@ scroll_test_adjustment_changed (GtkAdjustment *adjustment, GtkWidget *widget)
if (!gtk_widget_is_drawable (widget))
return;
- window = gtk_widget_get_window (widget);
- gdk_window_scroll (window, 0, dy);
+ window = gtk_widget_get_surface (widget);
+ gdk_surface_scroll (window, 0, dy);
}
@@ -7780,7 +7780,7 @@ struct {
{ "tooltips", create_tooltips },
{ "WM hints", create_wmhints },
{ "window sizing", create_window_sizing },
- { "window states", create_window_states }
+ { "window states", create_surface_states }
};
int nbuttons = sizeof (buttons) / sizeof (buttons[0]);
diff --git a/tests/testinput.c b/tests/testinput.c
index 69b1230159..101e3e59c5 100644
--- a/tests/testinput.c
+++ b/tests/testinput.c
@@ -45,11 +45,11 @@ size_allocate (GtkWidget *widget,
surface = NULL;
}
- if (gtk_widget_get_window (widget))
+ if (gtk_widget_get_surface (widget))
{
cairo_t *cr;
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget));
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 6feda3f950..f464a3142b 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -363,7 +363,7 @@ main (int argc, char *argv[])
gtk_widget_set_tooltip_window (button, GTK_WINDOW (tooltip_window));
gtk_window_set_type_hint (GTK_WINDOW (tooltip_window),
- GDK_WINDOW_TYPE_HINT_TOOLTIP);
+ GDK_SURFACE_TYPE_HINT_TOOLTIP);
gtk_window_set_transient_for (GTK_WINDOW (tooltip_window),
GTK_WINDOW (window));
diff --git a/tests/testwidgetfocus.c b/tests/testwidgetfocus.c
index 3aed9e7376..5d33302bdc 100644
--- a/tests/testwidgetfocus.c
+++ b/tests/testwidgetfocus.c
@@ -238,7 +238,7 @@ gtk_focus_widget_finalize (GObject *object)
static void
gtk_focus_widget_init (GtkFocusWidget *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE);
self->child1 = gtk_button_new_with_label ("1");
gtk_widget_set_parent (self->child1, GTK_WIDGET (self));
diff --git a/tests/testxinerama.c b/tests/testxinerama.c
index 37a9c5126f..8701124cfc 100644
--- a/tests/testxinerama.c
+++ b/tests/testxinerama.c
@@ -48,8 +48,8 @@ request (GtkWidget *widget,
gpointer user_data)
{
GdkDisplay *display = gtk_widget_get_display (widget);
- GdkMonitor *monitor = gdk_display_get_monitor_at_window (display,
- gtk_widget_get_window (widget));
+ GdkMonitor *monitor = gdk_display_get_monitor_at_surface (display,
+ gtk_widget_get_surface (widget));
if (monitor == NULL)
gtk_label_set_markup (GTK_LABEL (user_data),
diff --git a/testsuite/gsk/compare-render.c b/testsuite/gsk/compare-render.c
index f83e4e0650..01b26c9bf2 100644
--- a/testsuite/gsk/compare-render.c
+++ b/testsuite/gsk/compare-render.c
@@ -67,7 +67,7 @@ main (int argc, char **argv)
cairo_surface_t *diff_surface = NULL;
GdkTexture *texture;
GskRenderer *renderer;
- GdkWindow *window;
+ GdkSurface *window;
GskRenderNode *node;
const char *node_file;
const char *png_file;
@@ -79,8 +79,8 @@ main (int argc, char **argv)
node_file = argv[1];
png_file = argv[2];
- window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
- renderer = gsk_renderer_new_for_window (window);
+ window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
+ renderer = gsk_renderer_new_for_surface (window);
g_test_message ("Node file: '%s'\n", node_file);
g_test_message ("PNG file: '%s'\n", png_file);
diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c
index 2f89f2a6eb..6f8a6c69eb 100644
--- a/testsuite/gsk/test-render-nodes.c
+++ b/testsuite/gsk/test-render-nodes.c
@@ -667,7 +667,7 @@ load_node_file (GFile *file, gboolean generate)
GBytes *bytes;
GskRenderNode *node;
GskRenderer *renderer;
- GdkWindow *window;
+ GdkSurface *window;
GdkTexture *texture = NULL;
cairo_surface_t *surface;
char *png_file;
@@ -696,8 +696,8 @@ load_node_file (GFile *file, gboolean generate)
return;
}
- window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
- renderer = gsk_renderer_new_for_window (window);
+ window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
+ renderer = gsk_renderer_new_for_surface (window);
texture = gsk_renderer_render_texture (renderer, node, NULL);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
@@ -721,7 +721,7 @@ load_node_file (GFile *file, gboolean generate)
g_object_unref (window);
gsk_renderer_unrealize (renderer);
g_object_unref (renderer);
- gdk_window_destroy (window);
+ gdk_surface_destroy (window);
gsk_render_node_unref (node);
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index f011682fc4..4b4c89f9d8 100644
--- a/testsuite/gtk/defaultvalue.c
+++ b/testsuite/gtk/defaultvalue.c
@@ -104,9 +104,9 @@ test_type (gconstpointer data)
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
instance = g_object_ref (gtk_settings_get_default ());
- else if (g_type_is_a (type, GDK_TYPE_WINDOW))
+ else if (g_type_is_a (type, GDK_TYPE_SURFACE))
{
- instance = g_object_ref (gdk_window_new_popup (gdk_display_get_default (),
+ instance = g_object_ref (gdk_surface_new_popup (gdk_display_get_default (),
0,
&(GdkRectangle) { 0, 0, 100, 100 }));
}
@@ -354,8 +354,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
g_free (pspecs);
- if (g_type_is_a (type, GDK_TYPE_WINDOW))
- gdk_window_destroy (GDK_WINDOW (instance));
+ if (g_type_is_a (type, GDK_TYPE_SURFACE))
+ gdk_surface_destroy (GDK_SURFACE (instance));
else
g_object_unref (instance);
diff --git a/testsuite/gtk/gestures.c b/testsuite/gtk/gestures.c
index 78331c8af3..dd38ffa136 100644
--- a/testsuite/gtk/gestures.c
+++ b/testsuite/gtk/gestures.c
@@ -35,7 +35,7 @@ point_press (PointState *point,
if (point == &mouse_state)
{
ev = gdk_event_new (GDK_BUTTON_PRESS);
- ev->any.window = g_object_ref (gtk_widget_get_window (widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (widget));
ev->button.time = GDK_CURRENT_TIME;
ev->button.x = point->x;
ev->button.y = point->y;
@@ -47,7 +47,7 @@ point_press (PointState *point,
else
{
ev = gdk_event_new (GDK_TOUCH_BEGIN);
- ev->any.window = g_object_ref (gtk_widget_get_window (widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (widget));
ev->touch.time = GDK_CURRENT_TIME;
ev->touch.x = point->x;
ev->touch.y = point->y;
@@ -87,7 +87,7 @@ point_update (PointState *point,
if (point == &mouse_state)
{
ev = gdk_event_new (GDK_MOTION_NOTIFY);
- ev->any.window = g_object_ref (gtk_widget_get_window (widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (widget));
ev->button.time = GDK_CURRENT_TIME;
ev->motion.x = x;
ev->motion.y = y;
@@ -99,7 +99,7 @@ point_update (PointState *point,
return;
ev = gdk_event_new (GDK_TOUCH_UPDATE);
- ev->any.window = g_object_ref (gtk_widget_get_window (widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (widget));
ev->touch.time = GDK_CURRENT_TIME;
ev->touch.x = x;
ev->touch.y = y;
@@ -142,7 +142,7 @@ point_release (PointState *point,
return;
ev = gdk_event_new (GDK_BUTTON_RELEASE);
- ev->any.window = g_object_ref (gtk_widget_get_window (point->widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (point->widget));
ev->button.time = GDK_CURRENT_TIME;
ev->button.x = point->x;
ev->button.y = point->y;
@@ -153,7 +153,7 @@ point_release (PointState *point,
else
{
ev = gdk_event_new (GDK_TOUCH_END);
- ev->any.window = g_object_ref (gtk_widget_get_window (point->widget));
+ ev->any.surface = g_object_ref (gtk_widget_get_surface (point->widget));
ev->touch.time = GDK_CURRENT_TIME;
ev->touch.x = point->x;
ev->touch.y = point->y;
diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c
index 3f922a2cbe..846a0ed52a 100644
--- a/testsuite/gtk/notify.c
+++ b/testsuite/gtk/notify.c
@@ -402,9 +402,9 @@ test_type (gconstpointer data)
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
- else if (g_type_is_a (type, GDK_TYPE_WINDOW))
+ else if (g_type_is_a (type, GDK_TYPE_SURFACE))
{
- instance = G_OBJECT (g_object_ref (gdk_window_new_popup (display,
+ instance = G_OBJECT (g_object_ref (gdk_surface_new_popup (display,
&(GdkRectangle) { 0, 0, 100, 100 })));
}
else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
@@ -644,8 +644,8 @@ test_type (gconstpointer data)
}
g_free (pspecs);
- if (g_type_is_a (type, GDK_TYPE_WINDOW))
- gdk_window_destroy (GDK_WINDOW (instance));
+ if (g_type_is_a (type, GDK_TYPE_SURFACE))
+ gdk_surface_destroy (GDK_SURFACE (instance));
else
g_object_unref (instance);
diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c
index afbe9fda98..7939b59e56 100644
--- a/testsuite/gtk/object.c
+++ b/testsuite/gtk/object.c
@@ -58,7 +58,7 @@ list_ignore_properties (gboolean buglist)
{ "GtkCList", "selection-mode", (void*) GTK_SELECTION_NONE, },
{ "GtkWidget", "has-default", (void*) TRUE, }, /* conflicts with toplevel-less widgets */
{ "GtkWidget", "display", (void*) MATCH_ANY_VALUE },
- { "GtkWindow", "type-hint", (void*) GDK_WINDOW_TYPE_HINT_DND, }, /* conflicts with ::visible=TRUE */
+ { "GtkWindow", "type-hint", (void*) GDK_SURFACE_TYPE_HINT_DND, }, /* conflicts with ::visible=TRUE */
{ "GtkCellView", "background", (void*) "", }, /* "" is not a valid background color */
{ "GtkColorButton", "color", (void*) NULL, }, /* not a valid boxed color */
{ "GtkInputDialog", "has-separator", (void*) MATCH_ANY_VALUE, }, /* property disabled */
diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c
index d08c42619c..077783c023 100644
--- a/testsuite/gtk/objects-finalize.c
+++ b/testsuite/gtk/objects-finalize.c
@@ -107,7 +107,7 @@ main (int argc, char **argv)
G_TYPE_IS_INSTANTIATABLE (all_types[i]) &&
!G_TYPE_IS_ABSTRACT (all_types[i]) &&
#ifdef GDK_WINDOWING_X11
- all_types[i] != GDK_TYPE_X11_WINDOW &&
+ all_types[i] != GDK_TYPE_X11_SURFACE &&
all_types[i] != GDK_TYPE_X11_SCREEN &&
all_types[i] != GDK_TYPE_X11_DISPLAY &&
all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_CORE &&
diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c
index 712bf3e6aa..4b73e94c12 100644
--- a/testsuite/gtk/templates.c
+++ b/testsuite/gtk/templates.c
@@ -48,10 +48,10 @@ test_dialog_override_property (void)
GtkWidget *dialog;
dialog = g_object_new (GTK_TYPE_DIALOG,
- "type-hint", GDK_WINDOW_TYPE_HINT_UTILITY,
+ "type-hint", GDK_SURFACE_TYPE_HINT_UTILITY,
NULL);
g_assert (GTK_IS_DIALOG (dialog));
- g_assert (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_UTILITY);
+ g_assert (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_SURFACE_TYPE_HINT_UTILITY);
gtk_widget_destroy (dialog);
}
diff --git a/testsuite/reftests/reftest-snapshot.c b/testsuite/reftests/reftest-snapshot.c
index ec7f90fcfe..d875fec1d4 100644
--- a/testsuite/reftests/reftest-snapshot.c
+++ b/testsuite/reftests/reftest-snapshot.c
@@ -98,33 +98,33 @@ check_for_draw (GdkEvent *event, gpointer data)
}
static void
-snapshot_window_native (GdkWindow *window,
+snapshot_window_native (GdkSurface *window,
cairo_t *cr)
{
#ifdef GDK_WINDOWING_X11
- if (GDK_IS_X11_WINDOW (window))
+ if (GDK_IS_X11_SURFACE (window))
{
cairo_surface_t *surface;
XWindowAttributes attrs;
- if (gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL ||
- gdk_window_get_window_type (window) == GDK_WINDOW_TEMP ||
- gdk_window_get_window_type (window) == GDK_WINDOW_FOREIGN)
+ if (gdk_surface_get_surface_type (window) == GDK_SURFACE_TOPLEVEL ||
+ gdk_surface_get_surface_type (window) == GDK_SURFACE_TEMP ||
+ gdk_surface_get_surface_type (window) == GDK_SURFACE_FOREIGN)
{
/* give the WM/server some time to sync. They need it.
* Also, do use popups instead of toplevels in your tests
* whenever you can.
*/
- gdk_display_sync (gdk_window_get_display (window));
+ gdk_display_sync (gdk_surface_get_display (window));
g_timeout_add (500, quit_when_idle, loop);
g_main_loop_run (loop);
}
- XGetWindowAttributes (gdk_x11_display_get_xdisplay (gdk_window_get_display (window)),
- gdk_x11_window_get_xid (window),
+ XGetWindowAttributes (gdk_x11_display_get_xdisplay (gdk_surface_get_display (window)),
+ gdk_x11_surface_get_xid (window),
&attrs);
- surface = cairo_xlib_surface_create (gdk_x11_display_get_xdisplay (gdk_window_get_display (window)),
- gdk_x11_window_get_xid (window),
+ surface = cairo_xlib_surface_create (gdk_x11_display_get_xdisplay (gdk_surface_get_display (window)),
+ gdk_x11_surface_get_xid (window),
attrs.visual,
attrs.width,
attrs.height);
@@ -159,7 +159,7 @@ snapshot_widget (GtkWidget *widget, SnapshotMode mode)
gdk_event_handler_set (check_for_draw, NULL, NULL);
g_main_loop_run (loop);
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
CAIRO_CONTENT_COLOR,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
@@ -169,7 +169,7 @@ snapshot_widget (GtkWidget *widget, SnapshotMode mode)
switch (mode)
{
case SNAPSHOT_WINDOW:
- snapshot_window_native (gtk_widget_get_window (widget), cr);
+ snapshot_window_native (gtk_widget_get_surface (widget), cr);
break;
case SNAPSHOT_DRAW:
gtk_widget_draw (widget, cr);