Emit windowStateChanged in QGuiApplicationPrivate instead of QWindow
When the visual state of a QWindow changed, QGuiApplicationPrivate sent an event to QWindow, where the visibility was updated and the signal was emitted. Following the pricinple of other visual updates, these actions have been moved to QGuiApplicationPrivate. Task-number: QTBUG-102478 Change-Id: I94f2f5b7570580ce422ca9dc03013742f6a9baba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
0b382080c2
commit
b1df84b9d8
@ -2507,9 +2507,13 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
|
|||||||
|
|
||||||
void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse)
|
void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse)
|
||||||
{
|
{
|
||||||
if (QWindow *window = wse->window.data()) {
|
if (QWindow *window = wse->window.data()) {
|
||||||
|
QWindowPrivate *windowPrivate = qt_window_private(window);
|
||||||
|
const auto newEffectiveState = QWindowPrivate::effectiveState(windowPrivate->windowState);
|
||||||
QWindowStateChangeEvent e(wse->oldState);
|
QWindowStateChangeEvent e(wse->oldState);
|
||||||
window->d_func()->windowState = wse->newState;
|
windowPrivate->windowState = wse->newState;
|
||||||
|
emit window->windowStateChanged(newEffectiveState);
|
||||||
|
windowPrivate->updateVisibility();
|
||||||
QGuiApplication::sendSpontaneousEvent(window, &e);
|
QGuiApplication::sendSpontaneousEvent(window, &e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2501,13 +2501,6 @@ bool QWindow::event(QEvent *ev)
|
|||||||
setIcon(icon());
|
setIcon(icon());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::WindowStateChange: {
|
|
||||||
Q_D(QWindow);
|
|
||||||
emit windowStateChanged(QWindowPrivate::effectiveState(d->windowState));
|
|
||||||
d->updateVisibility();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if QT_CONFIG(tabletevent)
|
#if QT_CONFIG(tabletevent)
|
||||||
case QEvent::TabletPress:
|
case QEvent::TabletPress:
|
||||||
case QEvent::TabletMove:
|
case QEvent::TabletMove:
|
||||||
|
Loading…
Reference in New Issue
Block a user