[shotwell] Destroy toolbar when leaving fullscreen via double-click: Bug #739498



commit d6c25c58225b0f3ac803878d7ff3224151f49ee1
Author: Jim Nelson <jim yorba org>
Date:   Wed Dec 3 12:32:41 2014 -0800

    Destroy toolbar when leaving fullscreen via double-click: Bug #739498
    
    Double-clicking to exit fullscreen-mode has a slightly different code
    path than the accelerators, and some legacy code was taking a route
    that didn't destroy the FS toolbar at exit.

 src/PhotoPage.vala              |   12 +++++-------
 src/direct/DirectPhotoPage.vala |    9 +++++++--
 2 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala
index 8db84a1..b86a35a 100644
--- a/src/PhotoPage.vala
+++ b/src/PhotoPage.vala
@@ -3029,15 +3029,13 @@ public class LibraryPhotoPage : EditingHostPage {
     }
     
     protected override bool on_double_click(Gdk.EventButton event) {
-        if (!(get_container() is FullscreenWindow)) {
+        FullscreenWindow? fs = get_container() as FullscreenWindow;
+        if (fs == null)
             return_to_collection_on_release = true;
-            
-            return true;
-        }
-        
-        AppWindow.get_instance().end_fullscreen();
+        else
+            fs.close();
         
-        return base.on_double_click(event);
+        return true;
     }
     
     protected override bool on_left_released(Gdk.EventButton event) {
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala
index 4dfd520..7b265c2 100644
--- a/src/direct/DirectPhotoPage.vala
+++ b/src/direct/DirectPhotoPage.vala
@@ -324,10 +324,15 @@ public class DirectPhotoPage : EditingHostPage {
     }
     
     protected override bool on_double_click(Gdk.EventButton event) {
-        AppWindow.get_instance().end_fullscreen();
+        FullscreenWindow? fs = get_container() as FullscreenWindow;
+        if (fs != null) {
+            fs.close();
+            
+            return true;
+        }
         
         return base.on_double_click(event);
-    }    
+    }
     
     protected override void update_ui(bool missing) {
         bool sensitivity = !missing;


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