src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 31 Jan 2024 10:37:53 +0000 (18:37 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 31 Jan 2024 10:37:53 +0000 (18:37 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index a7af691..c180f54 100644 (file)
                "* prop" : "model",
                "bool autoselect" : false,
                "bool can_unselect" : true,
+               "bool selecting" : false,
                "id" : "winsel",
                "items" : [
                 {
                "listeners" : {
                 "notify[\"selected\"]" : [
                  "() => {",
-                 "\tif (_this.winloading) {",
+                 "\tif (_this.winloading || this.selecting) {",
                  "\t\treturn;",
                  "\t}",
                  "\tvar ws = this.el.selected_item as WindowState;",
index 7291c45..63e47c8 100644 (file)
@@ -1856,6 +1856,7 @@ public class Xcls_MainWindow : Object
 
 
                        // my vars (def)
+               public bool selecting;
 
                // ctor
                public Xcls_winsel(Xcls_MainWindow _owner )
@@ -1867,6 +1868,7 @@ public class Xcls_MainWindow : Object
                        this.el = new Gtk.SingleSelection( child_1.el );
 
                        // my vars (dec)
+                       this.selecting = false;
 
                        // set gobject values
                        this.el.can_unselect = true;
@@ -1874,7 +1876,7 @@ public class Xcls_MainWindow : Object
 
                        //listeners
                        this.el.notify["selected"].connect( () => {
-                               if (_this.winloading) {
+                               if (_this.winloading || this.selecting) {
                                        return;
                                }
                                var ws = this.el.selected_item as WindowState;