[gcalctool] Don't override space bar when buttons are focussed as this stops keyboard control (Robert Ancell, Bu



commit 2f82c88b4da54c0176447b921c352892cd56d8cc
Author: Robert Ancell <robert ancell gmail com>
Date:   Thu Sep 17 11:43:13 2009 +1000

    Don't override space bar when buttons are focussed as this stops keyboard control (Robert Ancell, Bug #595337) (Hard code freeze break approved by Andre Klapper and Frederic Peters)

 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);



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