From 0aa2dcc2d2e8920f751a76bf8c676745923beb31 Mon Sep 17 00:00:00 2001 From: Andrew Bruce Date: Sun, 25 May 2025 13:50:27 +0100 Subject: [PATCH] Revert "refactor: simplify the windowed flag" (#1581) This reverts commit e01acf8edce2c8f7e97c7bbb7b5460d621b7150a. Fixes https://github.com/KlipperScreen/KlipperScreen/issues/1564 --- ks_includes/KlippyGtk.py | 2 +- ks_includes/widgets/prompts.py | 2 +- screen.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index ecabc807..f6e09f0c 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -211,7 +211,7 @@ class KlippyGtk: dialog = Gtk.Dialog(title=title, modal=True, transient_for=self.screen, default_width=self.width, default_height=self.height) dialog.set_size_request(self.width, self.height) - if not self.screen.get_resizable(): + if not self.screen.windowed: dialog.fullscreen() if buttons: diff --git a/ks_includes/widgets/prompts.py b/ks_includes/widgets/prompts.py index 1c7cf905..57288c63 100644 --- a/ks_includes/widgets/prompts.py +++ b/ks_includes/widgets/prompts.py @@ -114,7 +114,7 @@ class Prompt: scroll.add(self.scroll_box) content = Gtk.Grid() - if not self.screen.get_resizable(): + if not self.screen.windowed: content.attach(title, 0, 0, 1, 1) content.attach(close, 1, 0, 1, 1) content.attach(scroll, 0, 1, 2, 1) diff --git a/screen.py b/screen.py index 1a026de5..366ea463 100755 --- a/screen.py +++ b/screen.py @@ -70,10 +70,10 @@ class KlipperScreen(Gtk.Window): _ws = None reinit_count = 0 max_retries = 4 - initialized = False - initializing = False + initialized = initializing = False popup_timeout = None wayland = False + windowed = False notification_log = [] prompt = None tempstore_timeout = None @@ -134,6 +134,7 @@ class KlipperScreen(Gtk.Window): if mon_n > 0: logging.error("Monitor selection is only supported for fullscreen") self.set_resizable(True) + self.windowed = True else: self.width = monitor.get_geometry().width self.height = monitor.get_geometry().height