From ba202f67c13f960bd35ffb531f5b7e26ebb15ffb Mon Sep 17 00:00:00 2001 From: Joe R Date: Wed, 30 Oct 2024 18:49:08 -0400 Subject: [PATCH] Move fullscreen logic to wm_map method --- pysollib/game/__init__.py | 8 ++++---- pysollib/kivy/tkutil.py | 2 +- pysollib/pysolgtk/tkutil.py | 2 +- pysollib/ui/tktile/tkutil.py | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index 2731b3d9..6e7831a6 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -827,8 +827,8 @@ class Game(object): reset_solver_dialog() # unhide toplevel when we use a progress bar if not self.preview: - wm_map(self.top, maximized=self.app.opt.wm_maximized) - self.top.attributes('-fullscreen', self.app.opt.wm_fullscreen) + wm_map(self.top, maximized=self.app.opt.wm_maximized, + fullscreen=self.app.opt.wm_fullscreen) self.top.busyUpdate() if TOOLKIT == 'gtk': # FIXME @@ -910,8 +910,8 @@ class Game(object): stats=self.app.stats.getStats(self.app.opt.player, self.id)) if not self.preview: self.updateMenus() - wm_map(self.top, maximized=self.app.opt.wm_maximized) - self.top.attributes('-fullscreen', self.app.opt.wm_fullscreen) + wm_map(self.top, maximized=self.app.opt.wm_maximized, + fullscreen=self.app.opt.wm_fullscreen) self.setCursor(cursor=self.app.top_cursor) self.stats.update_time = time.time() self.busy = old_busy diff --git a/pysollib/kivy/tkutil.py b/pysollib/kivy/tkutil.py index da93a725..c550bdac 100644 --- a/pysollib/kivy/tkutil.py +++ b/pysollib/kivy/tkutil.py @@ -46,7 +46,7 @@ def wm_withdraw(window): window.wm_withdraw() -def wm_map(window, maximized=0): +def wm_map(window, maximized=0, fullscreen=0): return diff --git a/pysollib/pysolgtk/tkutil.py b/pysollib/pysolgtk/tkutil.py index 57827207..d21c630e 100644 --- a/pysollib/pysolgtk/tkutil.py +++ b/pysollib/pysolgtk/tkutil.py @@ -43,7 +43,7 @@ def wm_deiconify(window): window.present() -def wm_map(window, maximized=None): +def wm_map(window, maximized=None, fullscreen=None): window.show() diff --git a/pysollib/ui/tktile/tkutil.py b/pysollib/ui/tktile/tkutil.py index edda18e4..89811794 100644 --- a/pysollib/ui/tktile/tkutil.py +++ b/pysollib/ui/tktile/tkutil.py @@ -43,12 +43,13 @@ def wm_deiconify(window): window.wm_deiconify() -def wm_map(window, maximized=0): +def wm_map(window, maximized=0, fullscreen=0): if window.wm_state() != "iconic": if maximized and WIN_SYSTEM == "win32": window.wm_state("zoomed") else: wm_deiconify(window) + window.attributes('-fullscreen', fullscreen) __wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$")