From 48095f857cf8410a38d3b757b4b1422719179191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20J=C3=A4ger?= Date: Sat, 18 Nov 2023 21:04:19 +0100 Subject: [PATCH] Fix fullscreen issue when setting width or height in config for non-desktop machines (#1177) * Fix fullscreen issue when setting width or height in config for non-desktop machines Setting width and height in the config should result in a windowed screen, but it is only the case for desktop users. Fixes https://github.com/KlipperScreen/KlipperScreen/issues/1176 introduced via 8f07f21 * add warnings --------- Co-authored-by: alfrix --- screen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/screen.py b/screen.py index 35d7e490..8a7cb73c 100755 --- a/screen.py +++ b/screen.py @@ -127,10 +127,13 @@ class KlipperScreen(Gtk.Window): self.width = self._config.get_main_config().getint("width", None) self.height = self._config.get_main_config().getint("height", None) if 'XDG_CURRENT_DESKTOP' in os.environ: + logging.warning("Running inside a desktop environment is not recommended") if not self.width: self.width = max(int(monitor.get_geometry().width * .5), 480) if not self.height: self.height = max(int(monitor.get_geometry().height * .5), 320) + if self.width or self.height: + logging.info("Setting windowed mode") self.set_resizable(True) self.windowed = True else: