Fix Blanking (#1546)

* fix: always disable blanking

* fix: explicitly disable dpms when set to false
This commit is contained in:
Alfredo Monclus authored and GitHub committed 2025-02-16 13:58:50 -03:00
1 parent 8ec1b91be5
commit c10f9b8838
1 file changed
+4 -4
+4 -4
View File
@@ -646,6 +646,7 @@ class KlipperScreen(Gtk.Window):
if self.check_dpms_timeout is not None:
GLib.source_remove(self.check_dpms_timeout)
self.check_dpms_timeout = None
os.system(f"xset -display {self.display_number} -dpms")
self.use_dpms = use_dpms
self._config.set("main", "use_dpms", use_dpms)
self._config.save_user_config_options()
@@ -657,10 +658,6 @@ class KlipperScreen(Gtk.Window):
def set_dpms_timeout(self):
try:
subprocess.run(
f"xset -display {self.display_number} s off",
shell=True, check=True
)
subprocess.run(
f"xset -display {self.display_number} dpms 0 {self.blanking_time} 0",
shell=True, check=True
@@ -678,6 +675,9 @@ class KlipperScreen(Gtk.Window):
self.set_screenblanking_timeout(time)
def set_screenblanking_timeout(self, time):
# disable screensaver we have our own
os.system(f"xset -display {self.display_number} s off")
os.system(f"xset -display {self.display_number} s noblank")
if time == "off":
self.blanking_time = 0
else: