Bug 469522

Summary: Minimizing a subwindow in windows mode does not activate the next window
Product: [Applications] krita Reporter: Halla Rempt <halla>
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal    
Priority: NOR    
Version: 5.1.4   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Halla Rempt 2023-05-09 08:02:06 UTC
* Open two images
* Select the second one
* Press the minimize button
* The first image is shown
* But the second one is still active

Note: QMDIArea, argh.
Comment 1 Halla Rempt 2023-05-09 08:51:25 UTC
Hm, Qt's internal processing suggests it might actually be intentional?

void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState,
                                                   Qt::WindowStates newState)
{
    if (ignoreWindowStateChange)
        return;

    Q_Q(QMdiArea);
    QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(q->sender());
    if (!child)
        return;

    // windowActivated
    if (!(oldState & Qt::WindowActive) && (newState & Qt::WindowActive))
        emitWindowActivated(child);
    // windowDeactivated
    else if ((oldState & Qt::WindowActive) && !(newState & Qt::WindowActive))
        resetActiveWindow(child);

    // windowMinimized
    if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized)) {
        isSubWindowsTiled = false;
        arrangeMinimizedSubWindows();
    // windowMaximized
    } else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized)) {
        internalRaise(child);
    // windowRestored
    } else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized))) {
        internalRaise(child);
        if (oldState & Qt::WindowMinimized)
            arrangeMinimizedSubWindows();
    }
}