Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Modals cancelled when app is minimised #1315

Closed
1 task done
quickiwiki opened this issue Dec 12, 2023 · 1 comment
Closed
1 task done

[Bug]: Modals cancelled when app is minimised #1315

quickiwiki opened this issue Dec 12, 2023 · 1 comment

Comments

@quickiwiki
Copy link

Detailed steps on how to reproduce the bug

I have seen an odd behaviour in the model component manager (ModalComponentManager::ModalItem) that doesn’t seem to be right and causes the modals to be cancelled when the JUCE application is minimised. At its core, componentVisibilityChanged() is called when the application is minimised, and it looks like this:

void componentVisibilityChanged() override
{
if (! component->isShowing())
cancel();
}

The code above would cancel any modal.

What is the expected behaviour?

Modal windows should not be cancelled on minimise.

Such behaviour can be fixed with an easy change, which might resemble the code below.

void componentVisibilityChanged() override
{
const auto peer = component->getPeer();
if (! component->isShowing() && !(peer && peer->isMinimised()))
cancel();
}

Operating systems

macOS

What versions of the operating systems?

macOS Monterey 12.6.7

Architectures

ARM

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
@quickiwiki quickiwiki changed the title [Bug]: [Bug]: Modals cancelled when app is minimised Dec 12, 2023
@szarvas
Copy link
Member

szarvas commented Jan 18, 2024

Thank you for reporting. While the proposed change is a fix, we opted to go for a different change. The general thinking behind the cancel() implementation, is that the user interface shouldn't become unresponsive due to a modal component in a way, that is not easily visible/discoverable by the user.

The Windows implementation sidesteps this issue, by ignoring close and minimise request during modal activity. A change has been released on develop, which mimicks the Windows behaviour.

fb14118

@szarvas szarvas closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants