[gnome-photos] embed: Don't keep the searchbar active merely because it has the focus



commit b40e16e33a8d38ee29af537cff5bdb7020b2156b
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Aug 25 16:44:30 2017 +0200

    embed: Don't keep the searchbar active merely because it has the focus
    
    The searchbar shouldn't get yanked out (or hidden) when the user is
    actively changing the search constraints, but that's not the same as
    having the focus. The searchbar might still be focused when the user
    is using the GtkStackSwitcher to change the modes.
    
    Fallout from 770366286115c2c8155ae9cb71a2033fc6f0cd05
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786936

 src/photos-embed.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 5e76e82..4e687a7 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -86,6 +86,7 @@ struct _PhotosEmbed
   PhotosModeController *mode_cntrlr;
   PhotosSearchController *srch_cntrlr;
   PhotosTrackerController *trk_ovrvw_cntrlr;
+  gboolean search_changed;
   guint load_show_id;
 };
 
@@ -469,6 +470,8 @@ photos_embed_search_changed (PhotosEmbed *self)
    * collections, favorites or overview.
    */
 
+  self->search_changed = TRUE;
+
   object = photos_base_manager_get_active_object (self->src_mngr);
   source_id = photos_filterable_get_id (PHOTOS_FILTERABLE (object));
 
@@ -483,6 +486,8 @@ photos_embed_search_changed (PhotosEmbed *self)
     photos_mode_controller_go_back (self->mode_cntrlr);
   else
     photos_mode_controller_set_window_mode (self->mode_cntrlr, PHOTOS_WINDOW_MODE_SEARCH);
+
+  self->search_changed = FALSE;
 }
 
 
@@ -564,7 +569,7 @@ photos_embed_window_mode_changed (PhotosModeController *mode_cntrlr,
     case PHOTOS_WINDOW_MODE_COLLECTIONS:
     case PHOTOS_WINDOW_MODE_FAVORITES:
     case PHOTOS_WINDOW_MODE_OVERVIEW:
-      if (!photos_main_toolbar_is_focus (PHOTOS_MAIN_TOOLBAR (self->toolbar)))
+      if (!self->search_changed)
         {
           GVariant *state;
 


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