commit 4eb791ff18774153b9dad99fea377afc09712bc0
Author: Pavel Sanda <sa...@lyx.org>
Date:   Sat Nov 21 15:34:26 2020 +0100

    Erase white frame in fullscreen mode.
    
    Since Qt 5.9.4 one can't set negative margins unless explicitely
    allowed by a new flag. This brought back the white frame in
    fullscreen mode.
    
    https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg214002.html
---
 src/frontends/qt/GuiView.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 8753a63..d9e7fb2 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1399,6 +1399,10 @@ bool GuiView::event(QEvent * e)
                        }
                        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);
                        // bug 5274
                        hideDialogs("prefs", nullptr);
@@ -1417,6 +1421,9 @@ bool GuiView::event(QEvent * e)
                        }
                        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);
                }
                return result;
@@ -4652,8 +4659,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
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to