Hard code freeze break request [gcalctool]



Hi,

A bug [1] has been reported against gcalctool 5.27.92 showing that
keyboard accessibility does not work.  This is a regression from
previous stable gcalctool releases.

The attached patch fixes this problem by stopping the keyboard event
for spacebar from being consumed when the buttons are in focus.  I am
the maintainer of gcalctool and I approve this patch.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=595337

Thanks,
--Robert Ancell
GCalctool Maintainer
From c54766dd82ce1d77de050855d24e6cd5c68fc445 Mon Sep 17 00:00:00 2001
From: Robert Ancell <robert ancell gmail com>
Date: Thu, 17 Sep 2009 11:43:13 +1000
Subject: [PATCH] Don't override space bar when buttons are focussed as this stops keyboard control (Robert Ancell, Bug #595337)

---
 ChangeLog |    5 +++++
 src/gtk.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6276c71..bb620cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,11 @@
 gcalctool change history.
 =========================
 
+2009-09-17 Robert Ancell <robert ancell gmail com>
+
+    * Don't override space bar when buttons are focussed as this stops keyboard control
+      (Robert Ancell, Bug #595337)
+
 2009-09-07 Robert Ancell <robert ancell gmail com>
 
     * README:
diff --git a/src/gtk.c b/src/gtk.c
index 25155a6..f91fec4 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -2188,13 +2188,13 @@ main_window_key_press_cb(GtkWidget *widget, GdkEventKey *event)
             return TRUE;
         }
     }
-    
-    /* Whitespace */
-    if (event->keyval == GDK_space && state == 0) {
+
+    /* Whitespace (but don't override activating buttons from the keyboard) */
+    if (gtk_widget_is_focus(X.display_item) && event->keyval == GDK_space && state == 0) {
         do_button(FN_SPACE, 0);
         return TRUE;
     }
-    
+
     /* Absolute value */
     /*if (event->keyval == GDK_bar && state == 0) {
         do_button(FN_ABSOLUTE_VALUE, 0);
-- 
1.6.3.3



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