From 2b076241736a2a857886445198ca1ff19a3a59d3 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 24 Oct 2014 12:33:29 +0200 Subject: [PATCH] make sure there is any screen geometry returned if the heuristic fails (because the topleft of the dialog is offscreen) use at least our screen() the screen should be correctly updated now on Qt 5.3+ so should be more reliable anyways (could be tried to remove the whole Q_FOREACH at this point) Change-Id: I29311f4767bde3e02ae7bcb54b400b72a8f190eb --- src/plasmaquick/dialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index eea10b681..e4afa720c 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -159,6 +159,17 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const } } + /* + * if the heuristic fails (because the topleft of the dialog is offscreen) + * use at least our screen() + * the screen should be correctly updated now on Qt 5.3+ so should be + * more reliable anyways (could be tried to remove the whole Q_FOREACH + * at this point) + */ + if (avail.isEmpty()) { + avail = q->screen()->availableGeometry(); + } + return avail; }