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
This commit is contained in:
Jonas Ådahl 2016-03-07 12:47:48 +08:00
parent 417cb2b213
commit 4af908a970
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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">