From 547872462c3f7b52c92120b9481c6b5cacec4686 Mon Sep 17 00:00:00 2001 From: shadeyg56 Date: Mon, 14 Aug 2023 00:05:53 -0500 Subject: [PATCH] gui: fix pkexec on launch --- auto_cpufreq/gui/objects.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/auto_cpufreq/gui/objects.py b/auto_cpufreq/gui/objects.py index 60eaa9f..af0901a 100644 --- a/auto_cpufreq/gui/objects.py +++ b/auto_cpufreq/gui/objects.py @@ -51,8 +51,6 @@ def get_version(): class RadioButtonView(Gtk.Box): def __init__(self): super().__init__(orientation=Gtk.Orientation.HORIZONTAL) - # this keeps track of whether or not the button was toggled by the app or the user to prompt for authorization - self.set_by_app = True self.set_hexpand(True) self.hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) @@ -69,6 +67,9 @@ class RadioButtonView(Gtk.Box): self.performance.connect("toggled", self.on_button_toggled, "performance") self.performance.set_halign(Gtk.Align.END) + + # this keeps track of whether or not the button was toggled by the app or the user to prompt for authorization + self.set_by_app = True self.set_selected() self.pack_start(self.label, False, False, 0) @@ -98,6 +99,9 @@ class RadioButtonView(Gtk.Box): case "performance": self.performance.set_active(True) case "default": + # because this is the default button, it does not trigger the callback when set by the app + if self.set_by_app: + self.set_by_app = False self.default.set_active(True) class CurrentGovernorBox(Gtk.Box):