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
|
// we simply iterate over the virtual screens and pick the one our QWindow
|
||||||
// says it's at.
|
// says it's at.
|
||||||
QRect avail;
|
QRect avail;
|
||||||
Q_FOREACH (QScreen *screen, q->screen()->virtualSiblings()) {
|
Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
|
||||||
//we check geometry() but then take availableGeometry()
|
//we check geometry() but then take availableGeometry()
|
||||||
//to reliably check in which screen a position is, we need the full
|
//to reliably check in which screen a position is, we need the full
|
||||||
//geometry, including areas for panels
|
//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
|
* 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
|
* more reliable anyways (could be tried to remove the whole Q_FOREACH
|
||||||
* at this point)
|
* at this point)
|
||||||
|
*
|
||||||
|
* imporant: screen can be a nullptr... see bug 345173
|
||||||
*/
|
*/
|
||||||
if (avail.isEmpty()) {
|
if (avail.isEmpty() && q->screen()) {
|
||||||
avail = q->screen()->availableGeometry();
|
avail = q->screen()->availableGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user