Never start fullscreen, and let the cookie dialog open
Two regressions from 5.5.0, both mine. Fullscreen became a state of the main window, which is what stopped it destroying the player's GL context -- but the window's geometry is saved on exit and restoreGeometry() replays the state it was saved with. Quitting while fullscreen therefore brought the app back fullscreen: no title bar, no close button, and nothing able to leave it, because the player's F and Escape are scoped to the player and the Watch tab need not even be visible. Fullscreen is no longer restored at startup, it is left before the geometry is saved, and F11/Escape are now window-level shortcuts so there is always a way out. The controller also trusts the window rather than its own flag, so a fullscreen it did not set is still escapable. "Sign in with cookies" and the account button both call show_cookie_login_dialog, which selects the Cookies tab by index before showing the dialog. CustomOptionsDialog builds its tabs on SmoothTabWidget, which stands in for a QTabWidget and says so in its docstring, but implemented only set_current_index -- so setCurrentIndex raised and the dialog never opened. That line had never run before: the method had no callers until 5.5.0 wired it up. SmoothTabWidget now provides the Qt-compatible API it claimed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,14 @@ class FullscreenController(QObject):
|
||||
return self._active
|
||||
|
||||
def toggle(self) -> None:
|
||||
self.exit() if self._active else self.enter()
|
||||
# Trust the window, not just the flag. If something else put the
|
||||
# window into fullscreen -- a restored geometry, the window manager,
|
||||
# the user's own shortcut -- toggling must get *out* of it rather than
|
||||
# trying to enter a state it is already in and appearing to do nothing.
|
||||
if self._active or self._window.isFullScreen():
|
||||
self.exit()
|
||||
else:
|
||||
self.enter()
|
||||
|
||||
# ------------------------------------------------------------ transitions
|
||||
|
||||
@@ -97,7 +104,9 @@ class FullscreenController(QObject):
|
||||
self.exit()
|
||||
|
||||
def exit(self) -> None:
|
||||
if not self._active and self._prev_window_state is None:
|
||||
# Also runs when the controller was never active but the window is
|
||||
# fullscreen anyway, so restoring the chrome is unconditional.
|
||||
if not self._active and self._prev_window_state is None and not self._window.isFullScreen():
|
||||
return
|
||||
try:
|
||||
tab_bar = getattr(self._tabs, "tab_bar", None)
|
||||
@@ -116,9 +125,12 @@ class FullscreenController(QObject):
|
||||
layout.setContentsMargins(self._prev_margins)
|
||||
|
||||
if self._prev_window_state is not None:
|
||||
self._window.setWindowState(self._prev_window_state)
|
||||
# Never restore *into* fullscreen: that is what we are leaving.
|
||||
self._window.setWindowState(self._prev_window_state & ~Qt.WindowState.WindowFullScreen)
|
||||
else:
|
||||
self._window.showNormal()
|
||||
if self._window.isFullScreen():
|
||||
self._window.showNormal()
|
||||
except Exception as e:
|
||||
logger.exception(f"Leaving fullscreen failed: {e}")
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user