[shotwell] Fix double-click maximize artifacts on Wayland



commit 6031f8a285c1599fa692905eaa0475faced08415
Author: Jens Georg <mail jensge org>
Date:   Mon Oct 8 13:29:52 2018 +0200

    Fix double-click maximize artifacts on Wayland
    
    Listen to the double-click on the window contents rather than the whole
    window. This makes the maximize functionality work on Wayland as
    expected and fixes the screen artifacts.
    
    Fixes #26

 src/direct/DirectPhotoPage.vala |  6 ++++++
 src/direct/DirectWindow.vala    | 15 +++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala
index 14b54bca..8b31503f 100644
--- a/src/direct/DirectPhotoPage.vala
+++ b/src/direct/DirectPhotoPage.vala
@@ -218,6 +218,12 @@ public class DirectPhotoPage : EditingHostPage {
             fs.close();
             
             return true;
+        } else {
+            if (get_container() is DirectWindow) {
+                (get_container() as DirectWindow).do_fullscreen();
+
+                return true;
+            }
         }
         
         return base.on_double_click(event);
diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala
index e1cbf759..1f33a761 100644
--- a/src/direct/DirectWindow.vala
+++ b/src/direct/DirectWindow.vala
@@ -42,6 +42,11 @@ public class DirectWindow : AppWindow {
             get_display_pathname(file.get_parent()), Resources.APP_TITLE);
     }
     
+    // Expose on_fullscreen publicly so we can call it from the DirectPhotoPage
+    public void do_fullscreen() {
+        on_fullscreen();
+    }
+
     protected override void on_fullscreen() {
         File file = get_direct_page().get_current_file();
         
@@ -74,16 +79,6 @@ public class DirectWindow : AppWindow {
         return (base.delete_event != null) ? base.delete_event(event) : false;
     }
 
-    public override bool button_press_event(Gdk.EventButton event) {
-        if (event.type == Gdk.EventType.2BUTTON_PRESS) {
-            on_fullscreen();
-
-            return true;
-        }
-        
-        return false;
-    }
-
     public override bool key_press_event(Gdk.EventKey event) {
         // check for an escape
         if (Gdk.keyval_name(event.keyval) == "Escape") {


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