[gnome-shell] StButton: fix handling of Space/Enter -> click



commit e886a3d8914b99ba70da3800a76927ab9020fe26
Author: Dan Winship <danw gnome org>
Date:   Mon Mar 21 08:21:18 2011 -0400

    StButton: fix handling of Space/Enter -> click
    
    StButton was mistakenly considering any Space/Enter KEY_RELEASE to be
    a click, when in fact it should only count as a click if it also got
    the corresponding KEY_PRESS as well. This meant that when typing in a
    chat notification, any Space/Enter keypress would dismiss the
    notification, since the StEntry would take the PRESS event but ignore
    the RELEASE, allowing it to propagate to the notification itself,
    which would treat it as a click.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645243

 src/st/st-button.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/st/st-button.c b/src/st/st-button.c
index 5684267..47647cf 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -232,7 +232,10 @@ st_button_key_release (ClutterActor    *actor,
       if (event->keyval == CLUTTER_KEY_space ||
           event->keyval == CLUTTER_KEY_Return)
         {
-          st_button_release (button, ST_BUTTON_ONE, 1);
+          gboolean is_click;
+
+          is_click = (button->priv->pressed & ST_BUTTON_ONE);
+          st_button_release (button, ST_BUTTON_ONE, is_click ? 1 : 0);
           return TRUE;
         }
     }



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