[gnome-clocks] window: Don't use the "delete-event" signal



commit cb4626c26b053b37e58d0b7ade0b82ec415ff058
Author: Yetizone <andreii lisita gmail com>
Date:   Sun Feb 14 14:29:46 2021 +0200

    window: Don't use the "delete-event" signal
    
    This signal is no longer available in GTK4
    We're currently using it for calling settings.apply() and hide_on_delete()
    
    settings.apply() doesn't need to be called anymore because
    the window's properties get saved and applied via bindings
    
    Gtk.Window also now provides the hide_on_close property

 src/window.vala | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 5c23f1c2..4415cc88 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -158,6 +158,8 @@ public class Window : Adw.ApplicationWindow {
         var gesture_click = new Gtk.GestureClick ();
         gesture_click.button = BUTTON_BACK;
         gesture_click.released.connect (button_back_released);
+
+        this.hide_on_close = true;
     }
 
     [Signal (action = true)]
@@ -233,12 +235,6 @@ public class Window : Adw.ApplicationWindow {
         settings.apply ();
     }
 
-    public override bool delete_event (Gdk.EventAny event) {
-        settings.apply ();
-
-        return hide_on_delete ();
-    }
-
     private bool escape_key_pressed () {
         bool handled = false;
 


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