Skip to content

fix: save window state before withdraw in _windows_set_titlebar_color when window not yet shown#2811

Open
BRUNO1993-CIBER wants to merge 1 commit into
TomSchimansky:masterfrom
BRUNO1993-CIBER:fix/windows-titlebar-color-restores-state
Open

fix: save window state before withdraw in _windows_set_titlebar_color when window not yet shown#2811
BRUNO1993-CIBER wants to merge 1 commit into
TomSchimansky:masterfrom
BRUNO1993-CIBER:fix/windows-titlebar-color-restores-state

Conversation

@BRUNO1993-CIBER

Copy link
Copy Markdown

Fixes #2810

Problem

When withdraw() is called before mainloop(), _state_before_windows_set_titlebar_color
was never assigned in the else branch of _windows_set_titlebar_color(), remaining None.

The restore block then executed self.state(None) which is a no-op (query only),
leaving the window permanently hidden after the titlebar color change.

Fix

Save self.state() before calling super().withdraw() in the else branch,
mirroring what the if self._window_exists branch already does correctly.

Change

1 line added in _windows_set_titlebar_color() — no behavior change for existing working paths.

… when window not yet shown

When withdraw() is called before mainloop(), _state_before_windows_set_titlebar_color
was never set in the else branch, remaining None. The restore block then called
self.state(None) which is a no-op query, leaving the window permanently hidden.

Fixes TomSchimansky#2810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant