Skip to content

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

Closed
joelmoniz wants to merge 1 commit into
processing:masterfrom
joelmoniz:bugfix-infinite-disappeared-popup
Closed

Avoid missing check when gaining focus from a Sketch Disappeared popup#4808
joelmoniz wants to merge 1 commit into
processing:masterfrom
joelmoniz:bugfix-infinite-disappeared-popup

Conversation

@joelmoniz

Copy link
Copy Markdown
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

benfry commented Jan 29, 2017

Copy link
Copy Markdown
Contributor

@JakubValtar another to review for the ChangeDetector.

@benfry

benfry commented Jan 18, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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