Blame SOURCES/0001-window-list-Invalid-current-mode-selected-in-Prefere.patch

8dc235
From b4eeaf7ea12fa7d9713e80371490d8060396b3cb Mon Sep 17 00:00:00 2001
8dc235
From: Milan Crha <mcrha@redhat.com>
8dc235
Date: Fri, 17 Apr 2020 09:21:42 +0200
8dc235
Subject: [PATCH] window-list: Invalid current mode selected in Preferences
8dc235
8dc235
It seems that gtk+ resets the active radio whenever a new radio button
8dc235
is added into the group, thus rather restore the current mode after
8dc235
the group is fully populated.
8dc235
8dc235
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/119
8dc235
---
8dc235
 extensions/window-list/prefs.js | 9 ++++++++-
8dc235
 1 file changed, 8 insertions(+), 1 deletion(-)
8dc235
8dc235
diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js
8dc235
index 78792b5..17e9799 100644
8dc235
--- a/extensions/window-list/prefs.js
8dc235
+++ b/extensions/window-list/prefs.js
8dc235
@@ -50,6 +50,7 @@ class WindowListPrefsWidget extends Gtk.Grid {
8dc235
         };
8dc235
 
8dc235
         let radio = null;
8dc235
+        let currentRadio = null;
8dc235
         for (let i = 0; i < modes.length; i++) {
8dc235
             let mode = modes[i];
8dc235
             let label = modeLabels[mode];
8dc235
@@ -59,18 +60,24 @@ class WindowListPrefsWidget extends Gtk.Grid {
8dc235
             }
8dc235
 
8dc235
             radio = new Gtk.RadioButton({
8dc235
-                active: currentMode == mode,
8dc235
+                active: !i,
8dc235
                 label: label,
8dc235
                 group: radio
8dc235
             });
8dc235
             grid.add(radio);
8dc235
 
8dc235
+            if (currentMode === mode)
8dc235
+                currentRadio = radio;
8dc235
+
8dc235
             radio.connect('toggled', button => {
8dc235
                 if (button.active)
8dc235
                     this._settings.set_string('grouping-mode', mode);
8dc235
             });
8dc235
         }
8dc235
 
8dc235
+        if (currentRadio)
8dc235
+            currentRadio.active = true;
8dc235
+
8dc235
         let check = new Gtk.CheckButton({
8dc235
             label: _('Show on all monitors'),
8dc235
             margin_top: 6
8dc235
-- 
8dc235
2.26.2
8dc235