[gnome-photos] main-window: Handle the back key before everything else



commit 9e834906652b64ba58167149b8044b469b29b65d
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Sep 21 13:33:14 2014 +0200

    main-window: Handle the back key before everything else
    
    Determining whether a key press event should be handled as a back key
    is straightforward. Let's do it before checking if the event should be
    handled by the search entry, which is more involved and depends on the
    state of the widgets and who has the current focus. This way we can
    guarantee that the back key is never going to be eaten up by the
    toolbar or something else.
    
    Other than that this keeps the code in sync with gnome-documents.

 src/photos-main-window.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-main-window.c b/src/photos-main-window.c
index bc9434b..a2dfbf1 100644
--- a/src/photos-main-window.c
+++ b/src/photos-main-window.c
@@ -271,12 +271,12 @@ photos_main_window_key_press_event (GtkWidget *widget, GdkEventKey *event)
   PhotosWindowMode mode;
   gboolean handled = GDK_EVENT_PROPAGATE;
 
-  toolbar = photos_embed_get_main_toolbar (PHOTOS_EMBED (priv->embed));
-  handled = photos_main_toolbar_handle_event (toolbar, event);
+  handled = photos_main_window_handle_back_key (self, event);
   if (handled)
     goto out;
 
-  handled = photos_main_window_handle_back_key (self, event);
+  toolbar = photos_embed_get_main_toolbar (PHOTOS_EMBED (priv->embed));
+  handled = photos_main_toolbar_handle_event (toolbar, event);
   if (handled)
     goto out;
 


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