[Development] Detecting full-screen mode on the Mac

Ben Medina ben.medina at gmail.com
Tue Jun 24 00:28:36 CEST 2014


Hello all,
I'm attempting a fix for this bug:
https://bugreports.qt-project.org/browse/QTBUG-39403

Our app currently uses 5.2.1, so that's the context. As you can see from my
post, using the qt_mac_app_fullscreen Boolean seems to no longer work. So I
attempted to look at the QWindow's visibility property, like this:

QRect QScreen::availableGeometry() const
{
    Q_D(const QScreen);
#ifdef Q_OS_MAC
    foreach (QWindow* window, QGuiApplication::allWindows())
    {
        // If we're in fullscreen mode on the Mac, we don't have to account
for space
        // taken up by the Dock and menu bar, so we can use the full screen
geometry.
        if (window->visibility() == QWindow::FullScreen)
            return d->geometry;
    }
#endif
    return d->availableGeometry;
}

But even when in full-screen mode, I never get QWindow::FullScreen. Does
anyone know how to detect if the application is in fullscreen mode on the
Mac?

Thanks,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140623/d5921c03/attachment.html>


More information about the Development mailing list