[gnome-screensaver] Properly turn off capslock warning
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screensaver] Properly turn off capslock warning
- Date: Tue, 21 Feb 2012 19:34:11 +0000 (UTC)
commit 372b4d024b367d2fa6a868a272fd994745f92fac
Author: Marc Deslauriers <marc deslauriers ubuntu com>
Date: Thu Feb 9 14:07:18 2012 -0500
Properly turn off capslock warning
capslock turns off when the key is released, so updating the
message on key press events doesn't work properly. Instead, use a
proper handler.
https://bugzilla.gnome.org/show_bug.cgi?id=669769
src/gs-lock-plug.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index fe53437..b33a9c0 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -415,6 +415,13 @@ run_destroy_handler (GSLockPlug *plug,
ri->destroyed = TRUE;
}
+static void
+run_keymap_handler (GdkKeymap *keymap,
+ GSLockPlug *plug)
+{
+ kbd_lock_mode_update (plug, get_kbd_lock_mode ());
+}
+
/* adapted from GTK+ gtkdialog.c */
int
gs_lock_plug_run (GSLockPlug *plug)
@@ -425,6 +432,8 @@ gs_lock_plug_run (GSLockPlug *plug)
gulong unmap_handler;
gulong destroy_handler;
gulong delete_handler;
+ gulong keymap_handler;
+ GdkKeymap *keymap;
g_return_val_if_fail (GS_IS_LOCK_PLUG (plug), -1);
@@ -439,6 +448,14 @@ gs_lock_plug_run (GSLockPlug *plug)
gtk_widget_show (GTK_WIDGET (plug));
}
+ keymap = gdk_keymap_get_for_display (gtk_widget_get_display (GTK_WIDGET (plug)));
+
+ keymap_handler =
+ g_signal_connect (keymap,
+ "state-changed",
+ G_CALLBACK (run_keymap_handler),
+ plug);
+
response_handler =
g_signal_connect (plug,
"response",
@@ -482,6 +499,7 @@ gs_lock_plug_run (GSLockPlug *plug)
g_signal_handler_disconnect (plug, unmap_handler);
g_signal_handler_disconnect (plug, delete_handler);
g_signal_handler_disconnect (plug, destroy_handler);
+ g_signal_handler_disconnect (plug, keymap_handler);
}
g_object_unref (plug);
@@ -1296,8 +1314,6 @@ entry_key_press (GtkWidget *widget,
{
restart_cancel_timeout (plug);
- kbd_lock_mode_update (plug, get_kbd_lock_mode ());
-
/* if the input widget is visible and ready for input
* then just carry on as usual
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]