Commit a1f8504f authored by Jan-Peter Nilsson's avatar Jan-Peter Nilsson Committed by Albert Astals Cid

Make unpause on restore work for maximized window

For a maximied window the oldState will also contain Qt::WindowMaximized
so we need to filter out just the bit flag we are interested in.

As there is several problems described in bug 332656 this is just a partial correction.

CCBUG: 332656
parent c73ca049
......@@ -339,10 +339,11 @@ void KMahjongg::timerReset()
void KMahjongg::changeEvent(QEvent *event)
{
if (event->type() == QEvent::WindowStateChange) {
QWindowStateChangeEvent *stateEvent = (QWindowStateChangeEvent *) event;
const QWindowStateChangeEvent *stateEvent = (QWindowStateChangeEvent *) event;
const Qt::WindowStates oldMinimizedState = stateEvent->oldState() & Qt::WindowMinimized;
if ((isMinimized() && stateEvent->oldState() != Qt::WindowMinimized)
|| (!isMinimized() && stateEvent->oldState() == Qt::WindowMinimized)) {
if ((isMinimized() && oldMinimizedState != Qt::WindowMinimized)
|| (!isMinimized() && oldMinimizedState == Qt::WindowMinimized)) {
pause();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment