summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2017-01-30 11:07:06 (GMT)
committerKai Uwe Broulik <kde@privat.broulik.de>2017-01-30 14:09:33 (GMT)
commitb0b31dee60defe4d7e9de8abc1dbbadfbced2783 (patch)
treec3862a3ee98f6d70299ee906af1aed1f5982888d
parent6f99f0dd99efd2d913f18f6911e35c4f4a96d74d (diff)
[KRunner] In doubt use primary screen for view position
Seems this logic of screen with cursor may break with XRandR scaling. BUG: 375574 FIXED-IN: 5.8.6
-rw-r--r--krunner/view.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/krunner/view.cpp b/krunner/view.cpp
index 5c2567a..1d8c04e 100644
--- a/krunner/view.cpp
+++ b/krunner/view.cpp
@@ -286,18 +286,14 @@ void View::resetScreenPos()
void View::positionOnScreen()
{
- QScreen* shownOnScreen = 0;
- if (QGuiApplication::screens().count() <= 1) {
- shownOnScreen = QGuiApplication::primaryScreen();
- } else {
- Q_FOREACH (QScreen* screen, QGuiApplication::screens()) {
- if (screen->geometry().contains(QCursor::pos(screen))) {
- shownOnScreen = screen;
- break;
- }
+ QScreen *shownOnScreen = QGuiApplication::primaryScreen();
+
+ Q_FOREACH (QScreen* screen, QGuiApplication::screens()) {
+ if (screen->geometry().contains(QCursor::pos(screen))) {
+ shownOnScreen = screen;
+ break;
}
}
- Q_ASSERT(shownOnScreen);
setScreen(shownOnScreen);
const QRect r = shownOnScreen->availableGeometry();