[gnome-photos] mode-controller: Special case activation by search provider



commit 94cdfb4d568a5fba51a89e300d73855756e62ada
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Feb 27 11:07:49 2014 +0100

    mode-controller: Special case activation by search provider
    
    When a search provider result is activated, the application goes
    directly to preview. Normally the transition to preview would have
    happened from one of the other views. This leaves the "old mode" in an
    undefined state. Special case the "old mode" to overview in this
    situation.
    
    Fixes: https://bugzilla.gnome.org/725329

 src/photos-mode-controller.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-mode-controller.c b/src/photos-mode-controller.c
index f5122f7..5b1ec2e 100644
--- a/src/photos-mode-controller.c
+++ b/src/photos-mode-controller.c
@@ -208,6 +208,13 @@ photos_mode_controller_set_window_mode (PhotosModeController *self, PhotosWindow
   if (old_mode == mode)
     return;
 
+  /* Always go back to the overview when activated from the search
+   * provider. It is easier to special case it here instead of all
+   * over the code.
+   */
+  if (old_mode == PHOTOS_WINDOW_MODE_PREVIEW && mode == PHOTOS_WINDOW_MODE_NONE)
+    mode = PHOTOS_WINDOW_MODE_OVERVIEW;
+
   if (mode == PHOTOS_WINDOW_MODE_OVERVIEW
       || mode == PHOTOS_WINDOW_MODE_COLLECTIONS
       || mode == PHOTOS_WINDOW_MODE_FAVORITES


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