Check for nullptr screen to avoid crash
BUG: 345173 REVIEW: 125528
This commit is contained in:
parent
2f9aadcb43
commit
3f9109a265
@ -152,7 +152,7 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
|
||||
// we simply iterate over the virtual screens and pick the one our QWindow
|
||||
// says it's at.
|
||||
QRect avail;
|
||||
Q_FOREACH (QScreen *screen, q->screen()->virtualSiblings()) {
|
||||
Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
|
||||
//we check geometry() but then take availableGeometry()
|
||||
//to reliably check in which screen a position is, we need the full
|
||||
//geometry, including areas for panels
|
||||
@ -168,8 +168,10 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
|
||||
* 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)
|
||||
*
|
||||
* imporant: screen can be a nullptr... see bug 345173
|
||||
*/
|
||||
if (avail.isEmpty()) {
|
||||
if (avail.isEmpty() && q->screen()) {
|
||||
avail = q->screen()->availableGeometry();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user