Use screens()->geometry() in Workspace::desktopResized

It used to get the individual screen geometries from QDesktopWidget.
We don't need to go through QDesktopWidget any more as Screens
contains all the information we need in a more reliable way.
This commit is contained in:
Martin Gräßlin 2014-11-25 08:34:10 +01:00
parent 2eb876743c
commit cc98c5d9c7

View file

@ -41,7 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screenedge.h" #include "screenedge.h"
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QDebug>
#include <QDesktopWidget>
#include <QVarLengthArray> #include <QVarLengthArray>
#include "outline.h" #include "outline.h"
@ -65,12 +64,7 @@ extern bool is_multihead;
*/ */
void Workspace::desktopResized() void Workspace::desktopResized()
{ {
QRect geom; QRect geom = screens()->geometry();
for (int i = 0; i < screens()->count(); i++) {
//do NOT use - QApplication::desktop()->screenGeometry(i) there could be a virtual geometry
// see bug #302783
geom |= QApplication::desktop()->screen(i)->geometry();
}
NETSize desktop_geometry; NETSize desktop_geometry;
desktop_geometry.width = geom.width(); desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height(); desktop_geometry.height = geom.height();