Commit ed430dc0 authored by Jonas Ådahl's avatar Jonas Ådahl

wayland: Add system bell support via gtk_shell

Invoke the system bell by calling the request added to the gtk_shell
protocol.

https://bugzilla.gnome.org/show_bug.cgi?id=763001
parent f68cf698
......@@ -519,7 +519,16 @@ gdk_wayland_display_get_default_screen (GdkDisplay *display)
static void
gdk_wayland_display_beep (GdkDisplay *display)
{
GdkWaylandDisplay *display_wayland;
g_return_if_fail (GDK_IS_DISPLAY (display));
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (!display_wayland->gtk_shell)
return;
gtk_shell1_system_bell (display_wayland->gtk_shell, NULL);
}
static void
......
......@@ -858,6 +858,22 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
}
}
static gboolean
gdk_window_impl_wayland_beep (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
if (!display_wayland->gtk_shell)
return FALSE;
gtk_shell1_system_bell (display_wayland->gtk_shell,
impl->display_server.gtk_surface);
return TRUE;
}
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
......@@ -2787,7 +2803,7 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->get_input_shape = gdk_wayland_window_get_input_shape;
impl_class->begin_paint = gdk_window_impl_wayland_begin_paint;
impl_class->end_paint = gdk_window_impl_wayland_end_paint;
/* impl_class->beep */
impl_class->beep = gdk_window_impl_wayland_beep;
impl_class->focus = gdk_wayland_window_focus;
impl_class->set_type_hint = gdk_wayland_window_set_type_hint;
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment