r23576 by jghali - Make ScribusMainWindow::getScreenData() safer

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 8 22:38:14 UTC 2020


Author: jghali
Date: Wed Apr  8 22:38:14 2020
New Revision: 23576

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23576
Log:
Make ScribusMainWindow::getScreenData() safer

Modified:
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23576&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Wed Apr  8 22:38:14 2020
@@ -507,7 +507,7 @@
 void ScribusMainWindow::getScreenData(int& screenNumber, int& xPos, int& yPos)
 {
 	QList<QScreen*> screens = QGuiApplication::screens();
-	screenNumber = 0;
+	screenNumber = -1;
 	xPos = 0;
 	yPos = 0;
 
@@ -515,8 +515,6 @@
 	QWindow* w = ScCore->primaryMainWindow()->windowHandle();
 	if (w != nullptr)
 		screenNumber = screens.indexOf(w->screen());
-	else
-		screenNumber = screens.indexOf(QGuiApplication::primaryScreen());
 #else
 	QScreen* s = ScCore->primaryMainWindow()->screen();
 	screenNumber = screens.indexOf(s);




More information about the scribus-commit mailing list