382 void QDesktopWidget::resizeEvent(QResizeEvent *event) |
382 void QDesktopWidget::resizeEvent(QResizeEvent *event) |
383 { |
383 { |
384 Q_D(QDesktopWidget); |
384 Q_D(QDesktopWidget); |
385 int oldScreenCount = d->screenCount; |
385 int oldScreenCount = d->screenCount; |
386 QVector<QRect> oldRects(oldScreenCount); |
386 QVector<QRect> oldRects(oldScreenCount); |
387 QVector<QRect> oldWorks(oldScreenCount); |
|
388 for (int i = 0; i < oldScreenCount; ++i) { |
387 for (int i = 0; i < oldScreenCount; ++i) { |
389 oldRects[i] = d->rects[i]; |
388 oldRects[i] = d->rects[i]; |
390 oldWorks[i] = d->workareas[i]; |
|
391 } |
389 } |
392 |
390 |
393 d->init(); |
391 d->init(); |
394 |
392 |
395 for (int i = 0; i < qMin(oldScreenCount, d->screenCount); ++i) { |
393 for (int i = 0; i < qMin(oldScreenCount, d->screenCount); ++i) { |
396 if (oldRects.at(i) != d->rects[i]) |
394 if (oldRects.at(i) != d->rects[i]) |
397 emit resized(i); |
395 emit resized(i); |
398 } |
396 } |
399 |
397 |
400 // ### workareas are just reset by init, not filled with new values |
|
401 // ### so this will not work correctly |
|
402 for (int j = 0; j < qMin(oldScreenCount, d->screenCount); ++j) { |
|
403 if (oldWorks.at(j) != d->workareas[j]) |
|
404 emit workAreaResized(j); |
|
405 } |
|
406 |
|
407 if (oldScreenCount != d->screenCount) { |
398 if (oldScreenCount != d->screenCount) { |
408 emit screenCountChanged(d->screenCount); |
399 emit screenCountChanged(d->screenCount); |
409 } |
400 } |
410 |
401 |
411 qt_desktopwidget_workarea_dirty = true; |
402 qt_desktopwidget_workarea_dirty = true; |