From 2866cae6b34237cb36f13e02787c0111373d2f10 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Fri, 31 Dec 2021 16:29:08 +1300 Subject: Support fullscreen requests on Qt6 QApplication.desktop() (And the QDesktopWidget that returns) has been deprecated since 5.11, we only support Qt 5.12+ (ref #3839). The recommended alternative is to use `QGuiApplication::screenAt(QPoint)`, but that doesn't support passing a widget. Stackoverflow [points out](https://stackoverflow.com/a/53490851) that you can get to the current screen of a widget, so that's what I'm using here. Once you get the screen there is both `geometry()` and `availableGeometry()` available. The later, sometimes, excludes window manager status bars and such, which fullscreen apps should cover. This approach works on both 5.15 and 6.2, so no version checks necessary. --- qutebrowser/misc/miscwidgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index aaf7d07de..e28fd0c01 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -309,7 +309,7 @@ class FullscreenNotification(QLabel): if config.val.content.fullscreen.window: geom = self.parentWidget().geometry() else: - geom = QApplication.desktop().screenGeometry(self) + geom = self.window().windowHandle().screen().geometry() self.move((geom.width() - self.sizeHint().width()) // 2, 30) def set_timeout(self, timeout): -- cgit v1.2.3-54-g00ecf