summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-12 14:39:39 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-10-12 14:39:39 +0000
commit77d4729483e2ecbe373aa2697cb9b409caf418b9 (patch)
tree4ee7c78a3b7acf5b2806c7f444d5dabd2b6f8004
parent08fb8c1c2a841f6a772de7186914cfbd15cbf4d6 (diff)
parentdaac36ea4c18c4fbd3dec535148657a85b04008e (diff)
downloadgtk+-77d4729483e2ecbe373aa2697cb9b409caf418b9.tar.gz
Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master See merge request GNOME/gtk!2683
-rw-r--r--gdk/wayland/gdkdevice-wayland.c34
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c29
-rw-r--r--gdk/wayland/gdkmonitor-wayland.c2
-rw-r--r--gdk/wayland/gdksurface-wayland.c34
-rw-r--r--gtk/meson.build17
5 files changed, 92 insertions, 24 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index fbbceacb65..1fb60eadf8 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -942,7 +942,7 @@ gdk_wayland_device_pad_init (GdkWaylandDevicePad *pad)
}
/**
- * gdk_wayland_device_get_wl_seat:
+ * gdk_wayland_device_get_wl_seat: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_seat of a #GdkDevice.
@@ -961,7 +961,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
}
/**
- * gdk_wayland_device_get_wl_pointer:
+ * gdk_wayland_device_get_wl_pointer: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_pointer of a #GdkDevice.
@@ -980,7 +980,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
}
/**
- * gdk_wayland_device_get_wl_keyboard:
+ * gdk_wayland_device_get_wl_keyboard: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_keyboard of a #GdkDevice.
@@ -4971,6 +4971,12 @@ gdk_wayland_seat_set_drag (GdkSeat *seat,
g_set_object (&wayland_seat->drag, drag);
}
+/**
+ * gdk_wayland_device_get_data_device: (skip)
+ * @gdk_device: (type GdkWaylandDevice): a #GdkDevice
+ *
+ * ...
+ */
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
@@ -4982,6 +4988,13 @@ gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
return seat->data_device;
}
+/**
+ * gdk_wayland_device_set_selection: (skip)
+ * @gdk_device: (type GdkWaylandDevice): a #GdkDevice
+ * @source: the data source for the selection
+ *
+ * ...
+ */
void
gdk_wayland_device_set_selection (GdkDevice *gdk_device,
struct wl_data_source *source)
@@ -4999,8 +5012,8 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
}
/**
- * gdk_wayland_seat_get_wl_seat:
- * @seat: (type GdkWaylandSeat): a #GdkSeat
+ * gdk_wayland_seat_get_wl_seat: (skip)
+ * @seat: a #GdkSeat
*
* Returns the Wayland wl_seat of a #GdkSeat.
*
@@ -5016,9 +5029,10 @@ gdk_wayland_seat_get_wl_seat (GdkSeat *seat)
/**
* gdk_wayland_device_get_node_path:
- * @device: a #GdkDevice
+ * @device: (type GdkWaylandDevice): a #GdkDevice
+ *
+ * Returns the `/dev/input/event*` path of this device.
*
- * Returns the /dev/input/event* path of this device.
* For #GdkDevices that possibly coalesce multiple hardware
* devices (eg. mouse, keyboard, touch,...), this function
* will return %NULL.
@@ -5026,8 +5040,8 @@ gdk_wayland_seat_get_wl_seat (GdkSeat *seat)
* This is most notably implemented for devices of type
* %GDK_SOURCE_PEN, %GDK_SOURCE_TABLET_PAD.
*
- * Returns: the /dev/input/event* path of this device
- **/
+ * Returns: (nullable) (transfer none): the `/dev/input/event*` path of this device
+ */
const char *
gdk_wayland_device_get_node_path (GdkDevice *device)
{
@@ -5052,7 +5066,7 @@ gdk_wayland_device_get_node_path (GdkDevice *device)
/**
* gdk_wayland_device_pad_set_feedback:
- * @device: a %GDK_SOURCE_TABLET_PAD device
+ * @device: (type GdkWaylandDevice): a %GDK_SOURCE_TABLET_PAD device
* @feature: Feature to set the feedback label for
* @feature_idx: 0-indexed index of the feature to set the feedback label for
* @label: Feedback label
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 52dd6dcf5d..b2c182a884 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -384,6 +384,15 @@ static const struct org_kde_kwin_server_decoration_manager_listener server_decor
.default_mode = server_decoration_manager_default_mode
};
+/**
+ * gdk_wayland_display_prefers_ssd:
+ * @display: (type GdkWaylandDisplay): a #GdkDisplay
+ *
+ * Checks whether the Wayland compositor prefers to draw the window
+ * decorations or if it leaves decorations to the application.
+ *
+ * Returns: %TRUE if the compositor prefers server-side decorations
+ */
gboolean
gdk_wayland_display_prefers_ssd (GdkDisplay *display)
{
@@ -859,7 +868,7 @@ gdk_wayland_display_get_next_serial (GdkDisplay *display)
/**
* gdk_wayland_display_get_startup_notification_id:
- * @display: (type GdkX11Display): a #GdkDisplay
+ * @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Gets the startup notification ID for a Wayland display, or %NULL
* if no ID has been defined.
@@ -1064,10 +1073,16 @@ get_cursor_theme (GdkWaylandDisplay *display_wayland,
return wl_cursor_theme_create ("/usr/share/icons/default/cursors", size, display_wayland->shm);
}
+/**
+ * gdk_wayland_display_set_cursor_theme:
+ * @display: (type GdkWaylandDisplay): a #GdkDisplay
+ *
+ * Sets the cursor theme for the given @display.
+ */
void
-gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
+gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
const char *name,
- int size)
+ int size)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY(display);
struct wl_cursor_theme *theme;
@@ -1154,7 +1169,7 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
}
/**
- * gdk_wayland_display_get_wl_display:
+ * gdk_wayland_display_get_wl_display: (skip)
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland wl_display of a #GdkDisplay.
@@ -1170,7 +1185,7 @@ gdk_wayland_display_get_wl_display (GdkDisplay *display)
}
/**
- * gdk_wayland_display_get_wl_compositor:
+ * gdk_wayland_display_get_wl_compositor: (skip)
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland global singleton compositor of a #GdkDisplay.
@@ -2617,11 +2632,11 @@ gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland,
/**
* gdk_wayland_display_query_registry:
- * @display: a wayland #GdkDisplay
+ * @display: (type GdkWaylandDisplay): a #GdkDisplay
* @global: global interface to query in the registry
*
* Returns %TRUE if the the interface was found in the display
- * wl_registry.global handler.
+ * `wl_registry.global` handler.
*
* Returns: %TRUE if the global is offered by the compositor
**/
diff --git a/gdk/wayland/gdkmonitor-wayland.c b/gdk/wayland/gdkmonitor-wayland.c
index 7f73dd66a6..e13a686055 100644
--- a/gdk/wayland/gdkmonitor-wayland.c
+++ b/gdk/wayland/gdkmonitor-wayland.c
@@ -49,7 +49,7 @@ gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
}
/**
- * gdk_wayland_monitor_get_wl_output:
+ * gdk_wayland_monitor_get_wl_output: (skip)
* @monitor: (type GdkWaylandMonitor): a #GdkMonitor
*
* Returns the Wayland wl_output of a #GdkMonitor.
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 4a54185dcc..0d8fe2fe74 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -1694,6 +1694,13 @@ create_zxdg_toplevel_v6_resources (GdkSurface *surface)
surface);
}
+/**
+ * gdk_wayland_toplevel_set_application_id:
+ * @toplevel: (type GdkWaylandToplevel): a #GdkToplevel
+ * @application_id: the application id for the @toplevel
+ *
+ * Sets the application id on a #GdkToplevel.
+ */
void
gdk_wayland_toplevel_set_application_id (GdkToplevel *toplevel,
const char *application_id)
@@ -4033,7 +4040,7 @@ _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
}
/**
- * gdk_wayland_surface_get_wl_surface:
+ * gdk_wayland_surface_get_wl_surface: (skip)
* @surface: (type GdkWaylandSurface): a #GdkSurface
*
* Returns the Wayland surface of a #GdkSurface.
@@ -4225,12 +4232,12 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = {
/**
* GdkWaylandToplevelExported:
- * @toplevel: the #GdkToplevel that is exported
+ * @toplevel: (type GdkWaylandToplevel): the #GdkToplevel that is exported
* @handle: the handle
* @user_data: user data that was passed to gdk_wayland_toplevel_export_handle()
*
* Callback that gets called when the handle for a surface has been
- * obtained from the Wayland compositor. The handle can be passed
+ * 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.
*/
@@ -4243,7 +4250,7 @@ gdk_wayland_surface_is_exported (GdkWaylandSurface *impl)
/**
* gdk_wayland_toplevel_export_handle:
- * @toplevel: the #GdkToplevel to obtain a handle for
+ * @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to obtain a handle for
* @callback: callback to call with the handle
* @user_data: (closure): user data for @callback
* @destroy_func: destroy notify for @user_data
@@ -4307,7 +4314,7 @@ gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
/**
* gdk_wayland_toplevel_unexport_handle:
- * @toplevel: the #GdkToplevel to unexport
+ * @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to unexport
*
* Destroys the handle that was obtained with
* gdk_wayland_toplevel_export_handle().
@@ -4361,7 +4368,7 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = {
/**
* gdk_wayland_toplevel_set_transient_for_exported:
- * @toplevel: the #GdkToplevel to make as transient
+ * @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to make as transient
* @parent_handle_str: an exported handle for a surface
*
* Marks @toplevel as transient for the surface to which the given
@@ -4414,6 +4421,13 @@ gdk_wayland_surface_get_inhibitor (GdkWaylandSurface *impl,
return g_hash_table_lookup (impl->shortcuts_inhibitors, gdk_seat);
}
+/*
+ * gdk_wayland_surface_inhibit_shortcuts:
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
+ * @seat: the seat to inhibit
+ *
+ * Inhibits the shortcuts coming from the given @seat.
+ */
void
gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
@@ -4437,6 +4451,14 @@ gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
g_hash_table_insert (impl->shortcuts_inhibitors, gdk_seat, inhibitor);
}
+/*
+ * gdk_wayland_surface_restore_shortcuts:
+ * @surface: (type GdkWaylandSurface): a #GdkSurface
+ * @seat: the seat to inhibit
+ *
+ * Restores the shortcuts on the given @seat inhibited by calling
+ * gdk_wayland_surface_inhibit_shortcuts().
+ */
void
gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
diff --git a/gtk/meson.build b/gtk/meson.build
index e29f0d4fdd..006ac8f31e 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1165,6 +1165,23 @@ if build_gir
gtk_dep_sources += gdk_x11_gir
endif
+ if wayland_enabled
+ gdk_wayland_gir = gnome.generate_gir(libgtk,
+ sources: gdk_wayland_public_headers + gdk_wayland_sources,
+ namespace: 'GdkWayland',
+ nsversion: gtk_api_version,
+ identifier_prefix: 'Gdk',
+ symbol_prefix: 'gdk',
+ export_packages: 'gtk4-wayland',
+ includes: [ gdk_gir[0], ],
+ install: true,
+ dependencies: gdk_gir_dep,
+ header: 'gdk/gdkwayland.h',
+ extra_args: gir_args,
+ )
+ gtk_dep_sources += gdk_wayland_gir
+ endif
+
gsk_gir_inc = [ gdk_gir[0] ]
gsk_gir = gnome.generate_gir(libgtk,