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

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