Top | ![]() |
![]() |
![]() |
![]() |
struct wl_seat * | gdk_wayland_seat_get_wl_seat () |
struct wl_keyboard * | gdk_wayland_device_get_wl_keyboard () |
struct wl_pointer * | gdk_wayland_device_get_wl_pointer () |
struct wl_seat * | gdk_wayland_device_get_wl_seat () |
struct wl_compositor * | gdk_wayland_display_get_wl_compositor () |
struct wl_display * | gdk_wayland_display_get_wl_display () |
gboolean | gdk_wayland_display_query_registry () |
struct wl_surface * | gdk_wayland_surface_get_wl_surface () |
void | (*GdkWaylandSurfaceExported) () |
gboolean | gdk_wayland_surface_export_handle () |
void | gdk_wayland_surface_unexport_handle () |
gboolean | gdk_wayland_surface_set_transient_for_exported () |
The functions in this section are specific to the GDK Wayland backend.
To use them, you need to include the <gdk/wayland/gdkwayland.h>
header and
use the Wayland-specific pkg-config gtk4-wayland
file to build your
application.
To make your code compile with other GDK backends, guard backend-specific
calls by an ifdef as follows. Since GDK may be built with multiple
backends, you should also check for the backend that is in use (e.g. by
using the GDK_IS_WAYLAND_DISPLAY()
macro).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (display)) { // make Wayland-specific calls here } else #endif #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (display)) { // make X11-specific calls here } else #endif g_error ("Unsupported GDK backend"); |
struct wl_seat *
gdk_wayland_seat_get_wl_seat (GdkSeat *seat
);
Returns the Wayland wl_seat of a GdkSeat.
struct wl_keyboard *
gdk_wayland_device_get_wl_keyboard (GdkDevice *device
);
Returns the Wayland wl_keyboard of a GdkDevice.
struct wl_pointer *
gdk_wayland_device_get_wl_pointer (GdkDevice *device
);
Returns the Wayland wl_pointer of a GdkDevice.
struct wl_seat *
gdk_wayland_device_get_wl_seat (GdkDevice *device
);
Returns the Wayland wl_seat of a GdkDevice.
struct wl_compositor *
gdk_wayland_display_get_wl_compositor (GdkDisplay *display
);
Returns the Wayland global singleton compositor of a GdkDisplay.
struct wl_display *
gdk_wayland_display_get_wl_display (GdkDisplay *display
);
Returns the Wayland wl_display of a GdkDisplay.
gboolean gdk_wayland_display_query_registry (GdkDisplay *display
,const gchar *global
);
Returns TRUE
if the the interface was found in the display
wl_registry.global handler.
struct wl_surface *
gdk_wayland_surface_get_wl_surface (GdkSurface *surface
);
Returns the Wayland surface of a GdkSurface.
void (*GdkWaylandSurfaceExported) (GdkSurface *surface
,const char *handle
,gpointer user_data
);
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 surfaces as transient for out-of-process surfaces.
surface |
the GdkSurface that is exported |
|
handle |
the handle |
|
user_data |
user data that was passed to |
gboolean gdk_wayland_surface_export_handle (GdkSurface *surface
,GdkWaylandSurfaceExported callback
,gpointer user_data
,GDestroyNotify destroy_func
);
Asynchronously obtains a handle for a surface that can be passed
to other processes. When the handle has been obtained, callback
will be called.
It is an error to call this function on a surface that is already exported.
When the handle is no longer needed, gdk_wayland_surface_unexport_handle()
should be called to clean up resources.
The main purpose for obtaining a handle is to mark a surface
from another 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.
surface |
the GdkSurface to obtain a handle for |
|
callback |
callback to call with the handle |
|
user_data |
user data for |
[closure] |
destroy_func |
destroy notify for |
void
gdk_wayland_surface_unexport_handle (GdkSurface *surface
);
Destroys the handle that was obtained with
gdk_wayland_surface_export_handle()
.
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.
gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface
,char *parent_handle_str
);
Marks surface
as transient for the surface to which the given
parent_handle_str
refers. Typically, the handle will originate
from a gdk_wayland_surface_export_handle()
call in another process.
Note that this API depends on an unstable Wayland protocol, and thus may require changes in the future.
surface |
the GdkSurface to make as transient |
|
parent_handle_str |
an exported handle for a surface |