GNOME Bugzilla – Bug 763284
[Wayland] Add system bell support
Last modified: 2016-03-14 14:13:23 UTC
Attached to this bug are patches that adds system bell protocol support to gtk_shell and an implementation. The two first patches are only preparatory patches that don't have anything to do with system bells.
Created attachment 323342 [details] [review] wayland: Don't invent our own unstable protocol semantics The gtk_shell protocol used some half baked unstable protocol semantics that worked by only allowing binding the exact version of the interface. This hack is a bit too confusing and it makes it impossible to do any compatible changes without breaking things. So, instead rename it to include a number in the interface names. This way we can add requests and events without causing compatibility issues, and we can later remove requests and events by bumping the number in the interface names.
Created attachment 323343 [details] [review] wayland: Namespace gtk_shell request handlers
Created attachment 323344 [details] [review] bell: Let the X11 caller deal with the X11 fallback To support invoking the system bell on Wayland we shouldn't have paths that fallback to X11. Let the X11 caller deal with the absence of libcanberra, and change API to not take any X events.
Created attachment 323345 [details] [review] 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.
Created attachment 323346 [details] [review] bell: Flash whole window if the window had no frame CSD X11 clients and Wayland clients don't have a window frame drawn by the compositor to flash. So instead of flashing the whole screen when configured to just flash the window, flash just the window region.
Review of attachment 323346 [details] [review]: looks, feel free to ignore the nits below ::: src/compositor/compositor-private.h @@ +61,3 @@ gint64 monotonic_time); +void meta_compositor_flash_window (MetaCompositor *compositor, For consistency, this could go into meta/compositor.h with the fullscreen method ::: src/compositor/compositor.c @@ +1287,3 @@ + + g_signal_connect (transition, "stopped", + G_CALLBACK (window_flash_out_completed), flash); nit: could use a g_signal_connect_swapped(transition, "stopped", G_CALLBACK (clutter_actor_destroy), flash) to avoid having to declare a single line function (I know the fullscreen method doesn't do this either)
Review of attachment 323345 [details] [review]: fine
Review of attachment 323344 [details] [review]: fine, just a couple of doc nits, feel free to push as is though ::: src/core/bell.h @@ +26,3 @@ * meta_bell_notify: * @display: The display the bell event came in on + * @window: The window the bell event as received on s/as/was/ @@ +30,3 @@ + * Gives the user some kind of aural or visual feedback, such as a bell sound + * or flash. What type of feedback is invoked depends on the configuration. + * If the feedback could not be invoked, FALSE is returned. The visual feedback might still be invoked even if FALSE is returned though
Review of attachment 323343 [details] [review]: ok
Review of attachment 323342 [details] [review]: ++
Attachment 323342 [details] pushed as fea1ddc - wayland: Don't invent our own unstable protocol semantics Attachment 323343 [details] pushed as 9f1d115 - wayland: Namespace gtk_shell request handlers Attachment 323344 [details] pushed as 417cb2b - bell: Let the X11 caller deal with the X11 fallback Attachment 323345 [details] pushed as 4af908a - wayland: Add system bell support via gtk_shell Attachment 323346 [details] pushed as 99bba9e - bell: Flash whole window if the window had no frame
*** Bug 756289 has been marked as a duplicate of this bug. ***