mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 21:54:10 +00:00
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:
parent
417cb2b213
commit
4af908a970
@ -48,6 +48,7 @@
|
|||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "meta-window-wayland.h"
|
#include "meta-window-wayland.h"
|
||||||
|
#include "bell.h"
|
||||||
|
|
||||||
#include "compositor/region-utils.h"
|
#include "compositor/region-utils.h"
|
||||||
|
|
||||||
@ -2057,9 +2058,33 @@ gtk_shell_set_startup_id (struct wl_client *client,
|
|||||||
startup_id);
|
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 = {
|
static const struct gtk_shell1_interface meta_wayland_gtk_shell_interface = {
|
||||||
gtk_shell_get_gtk_surface,
|
gtk_shell_get_gtk_surface,
|
||||||
gtk_shell_set_startup_id,
|
gtk_shell_set_startup_id,
|
||||||
|
gtk_shell_system_bell,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
<request name="set_startup_id">
|
<request name="set_startup_id">
|
||||||
<arg name="startup_id" type="string" allow-null="true"/>
|
<arg name="startup_id" type="string" allow-null="true"/>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
|
<request name="system_bell">
|
||||||
|
<arg name="surface" type="object" interface="gtk_surface1" allow-null="true"/>
|
||||||
|
</request>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<interface name="gtk_surface1" version="1">
|
<interface name="gtk_surface1" version="1">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user