[gnome-control-center] universal-access: Specify a window when testing visual bell



commit 87bf4cc06e2a6480b692ab4031e1b4ea4af7fdd2
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Apr 7 17:26:06 2016 +0200

    universal-access: Specify a window when testing visual bell
    
    When testing the window title flash, we should make sure that there
    is a window to flash instead of relying on the compositor to pick
    one for us.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754810

 panels/universal-access/cc-ua-panel.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index 0a138f9..477a689 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -519,6 +519,14 @@ visual_bell_type_toggle_cb (GtkWidget *button,
 }
 
 static void
+test_flash (GtkButton *button,
+            gpointer   data)
+{
+  GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
+  gdk_window_beep (gtk_widget_get_window (toplevel));
+}
+
+static void
 cc_ua_panel_init_hearing (CcUaPanel *self)
 {
   CcUaPanelPrivate *priv = self->priv;
@@ -568,7 +576,7 @@ cc_ua_panel_init_hearing (CcUaPanel *self)
                     G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
   g_signal_connect (WID ("visual_alerts_test_button"),
-                    "clicked", G_CALLBACK (gdk_beep), NULL);
+                    "clicked", G_CALLBACK (test_flash), NULL);
 }
 
 /* typing/keyboard section */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]