diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 6ca7b92e..92df0152 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -286,8 +286,10 @@ class KlippyGtk: if show: window.set_cursor( Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW)) - os.system("xsetroot -cursor_name arrow") + if not self.screen.wayland: + os.system("xsetroot -cursor_name arrow") else: window.set_cursor( Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.BLANK_CURSOR)) - os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm") + if not self.screen.wayland: + os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm") diff --git a/panels/settings.py b/panels/settings.py index d05d661d..55435c1f 100644 --- a/panels/settings.py +++ b/panels/settings.py @@ -27,6 +27,8 @@ class Panel(ScreenPanel): self.labels['settings_menu'].add(self.labels['settings']) for option in options: name = list(option)[0] + if name == "use_dpms" and screen.wayland: + continue self.add_option('settings', self.settings, name, option[name]) self.labels['lang_menu'] = self._gtk.ScrolledWindow() diff --git a/screen.py b/screen.py index 1df7cc33..6ecaa88a 100755 --- a/screen.py +++ b/screen.py @@ -90,7 +90,6 @@ class KlipperScreen(Gtk.Window): raise RuntimeError from e GLib.set_prgname('KlipperScreen') self.blanking_time = 600 - self.use_dpms = True self.apiclient = None self.dialogs = [] self.confirm = None @@ -177,7 +176,7 @@ class KlipperScreen(Gtk.Window): self.show_error_modal("Invalid config file", self._config.get_errors()) return self.base_panel.activate() - self.use_dpms = self._config.get_main_config().getboolean("use_dpms", fallback=True) + self.use_dpms = self._config.get_main_config().getboolean("use_dpms", fallback=(not self.wayland)) self.use_dpms &= functions.dpms_loaded self.set_dpms(self.use_dpms) self.lock_screen = LockScreen(self) @@ -633,6 +632,8 @@ class KlipperScreen(Gtk.Window): return True def wake_screen(self): + if self.wayland: + return # Wake the screen (it will go to standby as configured) if not self.use_dpms: logging.debug("DPMS is disabled cannot wake the screen") @@ -650,6 +651,12 @@ class KlipperScreen(Gtk.Window): return def set_dpms(self, use_dpms): + if self.wayland: + self.use_dpms = False + self._config.set("main", "use_dpms", False) + self._config.save_user_config_options() + logging.debug("DPMS handling not supported on Wayland") + return if not use_dpms: if self.check_dpms_timeout is not None: GLib.source_remove(self.check_dpms_timeout) @@ -697,8 +704,9 @@ class KlipperScreen(Gtk.Window): 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 not self.wayland: + 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: @@ -706,11 +714,11 @@ class KlipperScreen(Gtk.Window): self.blanking_time = abs(int(time)) except Exception as exc: logging.exception(exc) - if self.use_dpms: + if self.use_dpms and not self.wayland: self.set_dpms_timeout() else: self.screensaver.reset_timeout() - logging.debug(f"Blanking timeout: {time} DPMS:{self.use_dpms}") + logging.debug(f"Blanking timeout: {time}") def show_printer_select(self, widget=None): self.base_panel.show_heaters(False)