From c2400db19ef23e66ef3eefc8611a50e9db7ab85a Mon Sep 17 00:00:00 2001 From: m4ko Date: Tue, 1 Sep 2026 22:06:00 +0200 Subject: [PATCH] Changed how borderless setting works. --- ptlinux/settings.py | 23 +++++++++++++++++++++-- ptlinux/ui.py | 10 ++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ptlinux/settings.py b/ptlinux/settings.py index 30c2533..f21f4fd 100644 --- a/ptlinux/settings.py +++ b/ptlinux/settings.py @@ -15,6 +15,7 @@ from .paths import AppPaths SETTINGS_SCHEMA = 1 +_TITLE_FRAME_DEFAULT_MIGRATION_KEY = "title_frame_default_migrated" @dataclass(frozen=True) @@ -26,7 +27,7 @@ class Settings: output_height: int = 900 refresh_rate: int = 60 fullscreen: bool = False - borderless: bool = True + borderless: bool = False suppress_unresponsive_warnings: bool = True scaler: str = "fit" filter: str = "linear" @@ -141,7 +142,7 @@ def _settings_from_object(value: dict[str, object]) -> Settings: output_height=_integer(value, "output_height", 900), refresh_rate=_integer(value, "refresh_rate", 60), fullscreen=_boolean(value, "fullscreen", False), - borderless=_boolean(value, "borderless", True), + borderless=_migrated_borderless(value), suppress_unresponsive_warnings=_boolean( value, "suppress_unresponsive_warnings", @@ -158,6 +159,22 @@ def _settings_from_object(value: dict[str, object]) -> Settings: return settings +def _migrated_borderless(value: dict[str, object]) -> bool: + """Retire the old implicit borderless default exactly once. + + Older releases wrote ``borderless=true`` for every default installation, so + they cannot distinguish an inherited value from an explicit choice. The + migration marker keeps schema 1 backward compatible while letting users opt + back into Borderless after the decorated default has been applied. + """ + + borderless = _boolean(value, "borderless", False) + migrated = _boolean(value, _TITLE_FRAME_DEFAULT_MIGRATION_KEY, False) + if not migrated: + return False + return borderless + + def _decode_settings(content: bytes) -> str: """Accept native UTF-8 plus settings saved by common Windows editors.""" @@ -174,6 +191,7 @@ def _settings_need_migration(value: dict[str, object]) -> bool: return ( value.get("schema") != SETTINGS_SCHEMA or not _SETTINGS_FIELD_NAMES.issubset(value) + or value.get(_TITLE_FRAME_DEFAULT_MIGRATION_KEY) is not True ) @@ -185,6 +203,7 @@ def _write_settings( payload = dict(existing or {}) payload.update(asdict(settings)) payload["schema"] = SETTINGS_SCHEMA + payload[_TITLE_FRAME_DEFAULT_MIGRATION_KEY] = True temporary = paths.settings_file.with_name( f".{paths.settings_file.name}.{os.getpid()}.{threading.get_ident()}." f"{secrets.token_hex(8)}.tmp" diff --git a/ptlinux/ui.py b/ptlinux/ui.py index bffb2eb..f372056 100644 --- a/ptlinux/ui.py +++ b/ptlinux/ui.py @@ -3411,12 +3411,14 @@ def run_dashboard(paths: AppPaths) -> None: speed_text.set("") progress_bar.stop() close_game_preloader() - root.deiconify() + if not ready: + root.deiconify() set_busy(False) refresh_primary_action(update_activity=False) if ready: status.set("Ready for another account.") progress_text.set("Click Play to open another game window.") + dashboard_chrome.minimize() elif cancelled: root.lift() status.set("Game launch cancelled.") @@ -4093,8 +4095,8 @@ def run_dashboard(paths: AppPaths) -> None: ttk.Label( display_card, text=( - "The launcher uses the proven client resolution and can remove the " - "new game window's host decorations." + "The launcher keeps the game window's title bar by default. Enable " + "Borderless only when you want to remove its host decorations." ), style="SettingsHint.TLabel", wraplength=360, @@ -4103,7 +4105,7 @@ def run_dashboard(paths: AppPaths) -> None: presentation.grid(row=1, column=0, columnspan=2, sticky="w") ttk.Checkbutton( presentation, - text="Borderless", + text="Remove title bar and borders (Borderless)", variable=borderless_value, style="Settings.TCheckbutton", ).pack(anchor="w")