From 1ae510b6287d5c96c3f106909c1cc8b0711b6d57 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Sun, 22 Nov 2020 11:54:58 +0100 Subject: [PATCH] Erase white frame in fullscreen mode. Backport 4eb791ff187741. --- src/frontends/qt4/GuiView.cpp | 13 +++++++++++++ status.23x | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index b7102207ca..2a176be838 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -4395,8 +4395,14 @@ bool GuiView::lfunUiToggle(string const & ui_component) //are the frames in default state? d.current_work_area_->setFrameStyle(QFrame::NoFrame); if (l == 0) { +#if QT_VERSION > 0x050903 + setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, false); +#endif setContentsMargins(-2, -2, -2, -2); } else { +#if QT_VERSION > 0x050903 + setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, true); +#endif setContentsMargins(0, 0, 0, 0); } } else @@ -4413,6 +4419,9 @@ void GuiView::toggleFullScreen() if (isFullScreen()) { for (int i = 0; i != d.splitter_->count(); ++i) d.tabWorkArea(i)->setFullScreen(false); +#if QT_VERSION > 0x050903 + setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, true); +#endif setContentsMargins(0, 0, 0, 0); setWindowState(windowState() ^ Qt::WindowFullScreen); restoreLayout(); @@ -4423,6 +4432,10 @@ void GuiView::toggleFullScreen() hideDialogs("prefs", 0); for (int i = 0; i != d.splitter_->count(); ++i) d.tabWorkArea(i)->setFullScreen(true); +#if QT_VERSION > 0x050903 + //Qt's 5.9.4 ba44cdae38406c safe area measures won't allow us to go negative in margins + setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, false); +#endif setContentsMargins(-2, -2, -2, -2); saveLayout(); setWindowState(windowState() ^ Qt::WindowFullScreen); diff --git a/status.23x b/status.23x index 28559c54ee..1c26349120 100644 --- a/status.23x +++ b/status.23x @@ -124,6 +124,8 @@ What's new - Fix on-screen display of special math fonts (bug 11802). +- Fix white frame border in fullscreen mode. + * INTERNALS