Surrounding white frame in fullscreen

Pavel Sanda sanda at lyx.org
Fri Nov 20 13:56:06 UTC 2020


On Fri, Nov 20, 2020 at 01:37:28PM +0100, Pavel Sanda wrote:
> Hi,
> 
> until (at least) Qt 5.7.1 fullscreen was over the whole screen, in newer Qt
> (tested 5.11.3) there is now two bright pixel frame around (well visible and
> annoying if you use dark color schemes).  This is because the former workaround
> trick with setContentsMargins(-2, -2, -2, -2); in fullscreen handler (or
> ui-toggle frame lfun) does not work anymore and negative values are not
> accepted now.
> 
> The margin might be coming from some child widget of QMainWindow, I just dont
> know which one. Anyone has idea how to fix that?

The following patch fixes the problem. 
Stephan/Yu can you test whether I did not break fullscreen border on mac/windows?

Pavel
-------------- next part --------------
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 0b3999d3e8..164215b832 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1412,6 +1412,8 @@ bool GuiView::event(QEvent * e)
 			}
 			for (int i = 0; i != d.splitter_->count(); ++i)
 				d.tabWorkArea(i)->setFullScreen(true);
+			//Qt's ba44cdae38406c safe area measures leaves us with white frame around fullscreen
+			setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, false);
 			setContentsMargins(-2, -2, -2, -2);
 			// bug 5274
 			hideDialogs("prefs", nullptr);
@@ -1431,6 +1433,7 @@ bool GuiView::event(QEvent * e)
 			}
 			for (int i = 0; i != d.splitter_->count(); ++i)
 				d.tabWorkArea(i)->setFullScreen(false);
+			setAttribute(Qt::WA_ContentsMarginsRespectsSafeArea, true);
 			setContentsMargins(0, 0, 0, 0);
 		}
 		return result;


More information about the lyx-devel mailing list