diff --git a/ftl/core/actions.ftl b/ftl/core/actions.ftl index f2f3bc0b4..6252c2955 100644 --- a/ftl/core/actions.ftl +++ b/ftl/core/actions.ftl @@ -53,6 +53,7 @@ actions-previous-card-info = Previous Card Info # By convention, the name of a menu action is suffixed with "..." if additional # input is required before it can be performed. E.g. "Export..." vs. "Delete". actions-with-ellipsis = { $action }... +actions-currently-unsupported = This action is currently not supported on your system. ## Flags diff --git a/proto/anki/links.proto b/proto/anki/links.proto index a8b4f2021..f74bdea21 100644 --- a/proto/anki/links.proto +++ b/proto/anki/links.proto @@ -30,6 +30,7 @@ message HelpPageLinkRequest { CUSTOMIZING_FIELDS = 14; DECK_OPTIONS = 15; EDITING_FEATURES = 16; + FULL_SCREEN_ISSUE = 17; } HelpPage page = 1; } diff --git a/qt/aqt/main.py b/qt/aqt/main.py index fcddb0ec9..4040a7722 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -66,6 +66,7 @@ from aqt.utils import ( checkInvalidFilename, current_window, disable_help_button, + disallow_full_screen, getFile, getOnlyText, openHelp, @@ -1273,8 +1274,17 @@ title="{}" {}>{}""".format( ########################################################################## def on_toggle_full_screen(self) -> None: - window = self.app.activeWindow() - window.setWindowState(window.windowState() ^ Qt.WindowState.WindowFullScreen) + if disallow_full_screen(): + showWarning( + tr.actions_currently_unsupported(), + parent=self, + help=HelpPage.FULL_SCREEN_ISSUE, + ) + else: + window = self.app.activeWindow() + window.setWindowState( + window.windowState() ^ Qt.WindowState.WindowFullScreen + ) # Auto update ########################################################################## diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 1723e7777..88dfc5764 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -852,6 +852,23 @@ def qtMenuShortcutWorkaround(qmenu: QMenu) -> None: ###################################################################### +def disallow_full_screen() -> bool: + """Test for OpenGl on Windows, which is known to cause issues with full screen mode. + On Qt6, the driver is not detectable, so check if it has been set explicitly. + """ + from aqt import mw + from aqt.profiles import VideoDriver + + return is_win and ( + (qtmajor == 5 and mw.pm.video_driver() == VideoDriver.OpenGL) + or ( + qtmajor == 6 + and not os.environ.get("ANKI_SOFTWAREOPENGL") + and os.environ.get("QT_OPENGL") != "software" + ) + ) + + def add_ellipsis_to_action_label(*actions: QAction) -> None: """Pass actions to add '...' to their labels, indicating that more input is required before they can be performed. diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 306a895ad..739bc2ee4 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -29,6 +29,7 @@ impl HelpPage { HelpPage::CustomizingFields => "editing.html#customizing-fields", HelpPage::DeckOptions => "deck-options.html", HelpPage::EditingFeatures => "editing.html#editing-features", + HelpPage::FullScreenIssue => "platform/windows/display-issues.html#full-screen", } } }