X Tutup
The Wayback Machine - https://web.archive.org/web/20250813083920/https://github.com/processing/processing/pull/4808
Skip to content

Avoid missing check when gaining focus from a Sketch Disappeared popup #4808

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

Conversation

joelmoniz
Copy link
Member

This PR resolves #4805, which was happening because the ensureExistence() method was called each time the window gained focus: since closing the popup causes the window gains focus, this check and the accompanying warning dialogs would repeat ad infinitum.

In detail, what caused the bug is as follows:

  1. The "Sketch Disappeared" popup appears and is closed.
  2. Closing it gives the sketch window the focus, calling ensureExistence()
  3. In the meanwhile, Processing realizes that it can't save the sketch, throwing the "Could not re-save sketch" popup
  4. Closing the popup opened in 3 and then the one opened in 2 gives the sketch the focus again...

PS: I used the name of the JDialog since it seemed liked the simplest option- to avoid making changes to the structure of ensureExistence() (such as by returning false or re-throwing the error if the sketch does not exist), since several other methods call it, and I'll be happy to update this PR if another way of doing this might be better.

@benfry
Copy link
Contributor

benfry commented Jan 29, 2017

@JakubValtar another to review for the ChangeDetector.

@benfry
Copy link
Contributor

benfry commented Jan 18, 2019

Fixed with b3763a8

@benfry benfry closed this Jan 18, 2019
benfry added a commit that referenced this pull request Jan 18, 2019
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Sketch disappeared" infinite pop up dialogs
2 participants
X Tutup