[shotwell/wip/gtk4] Listen to size changes of toplevel window



commit 310f8f7275b3bcf15718a8b5c07677e906461e2c
Author: Jens Georg <mail jensge org>
Date:   Wed Apr 20 14:40:45 2022 +0200

    Listen to size changes of toplevel window

 src/CheckerboardPage.vala | 6 ++++++
 src/Page.vala             | 9 ---------
 2 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/CheckerboardPage.vala b/src/CheckerboardPage.vala
index 6ed2edd0..66bcd86b 100644
--- a/src/CheckerboardPage.vala
+++ b/src/CheckerboardPage.vala
@@ -76,6 +76,12 @@ public abstract class CheckerboardPage : Page {
         add_controller (key_controller);
     }
 
+    protected override bool on_configure(Gdk.Rectangle rect) {
+        layout.on_viewport_resized();
+
+        return false;
+    }
+
     public void init_item_context_menu(string path) {
         item_context_menu_path = path;
     }
diff --git a/src/Page.vala b/src/Page.vala
index 8d7d24b1..4de4d912 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -200,15 +200,6 @@ public abstract class Page : Gtk.Box {
             | Gtk.EventControllerScrollFlags.DISCRETE);
         scroll.scroll.connect(on_mousewheel_internal);
         event_source.add_controller(scroll);
-
-#if 0
-        // interested in mouse button and motion events on the event source
-        event_source.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK
-            | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK
-            | Gdk.EventMask.BUTTON_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK
-            | Gdk.EventMask.SCROLL_MASK | Gdk.EventMask.SMOOTH_SCROLL_MASK);
-        event_source.realize.connect(on_event_source_realize);
-        #endif 
     }
     
     private void detach_event_source() {


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