summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-03-07 12:47:48 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-03-10 12:34:56 +0800
commit4af908a9705c28df2625500ef73a0009ce4620ea (patch)
tree46714ae433a268340ef84c671bfe1fc657051067
parent417cb2b213f8aed41865cd64fc9248667f5e2b2a (diff)
downloadmutter-4af908a9705c28df2625500ef73a0009ce4620ea.tar.gz
wayland: Add system bell support via gtk_shell
Add a system_bell request to gtk_shell. A client can use this to invoke the system bell, be it aural, visual or none at all. Currently per window visual bell support is not implemented. https://bugzilla.gnome.org/show_bug.cgi?id=763284
-rw-r--r--src/wayland/meta-wayland-surface.c25
-rw-r--r--src/wayland/protocol/gtk-shell.xml4
2 files changed, 29 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 91ee76f34..1a5948401 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -48,6 +48,7 @@
#include "display-private.h"
#include "window-private.h"
#include "meta-window-wayland.h"
+#include "bell.h"
#include "compositor/region-utils.h"
@@ -2057,9 +2058,33 @@ gtk_shell_set_startup_id (struct wl_client *client,
startup_id);
}
+static void
+gtk_shell_system_bell (struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *gtk_surface_resource)
+{
+ MetaDisplay *display = meta_get_display ();
+
+ if (gtk_surface_resource)
+ {
+ MetaWaylandSurface *surface =
+ wl_resource_get_user_data (gtk_surface_resource);
+
+ if (!surface->window)
+ return;
+
+ meta_bell_notify (display, surface->window);
+ }
+ else
+ {
+ meta_bell_notify (display, NULL);
+ }
+}
+
static const struct gtk_shell1_interface meta_wayland_gtk_shell_interface = {
gtk_shell_get_gtk_surface,
gtk_shell_set_startup_id,
+ gtk_shell_system_bell,
};
static void
diff --git a/src/wayland/protocol/gtk-shell.xml b/src/wayland/protocol/gtk-shell.xml
index 1dc06a0a9..aa9993d66 100644
--- a/src/wayland/protocol/gtk-shell.xml
+++ b/src/wayland/protocol/gtk-shell.xml
@@ -24,6 +24,10 @@
<request name="set_startup_id">
<arg name="startup_id" type="string" allow-null="true"/>
</request>
+
+ <request name="system_bell">
+ <arg name="surface" type="object" interface="gtk_surface1" allow-null="true"/>
+ </request>
</interface>
<interface name="gtk_surface1" version="1">