Skip to content

Double-clicking a .pde file also opens an untitled/empty sketch #477

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

Closed
processing-bot opened this issue Apr 23, 2022 · 5 comments
Closed
Labels
help wanted Extra attention is needed windows

Comments

@processing-bot
Copy link
Collaborator

Created by: billv923

Current Behavior

Double clicking on a .pde sketch file launches the Processing IDE and opens the selected sketch as expected but also opens a second blank sketch. This started happening in Version 4 beta7. Doesn't happen in Version 4 beta6. See attached video.

Processing4_Anomaly.mov

Steps to Reproduce

  1. Double click on any .pde sketch file

Your Environment

Windows 10 w/ Processing4 beta7

Possible Causes / Solutions

Unknown

@processing-bot
Copy link
Collaborator Author

Created by: ExpandingS

@benfry This was introduced in 59aa860, with:

Line 1493:
-      if (props != null) {
+      if (!props.isEmpty()) {

Changing it back fixes it, but I don't understand enough about this file to know if that's a reasonable solution, or if isEmpty() should be changed.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Thanks @ExpandingS… Though I think that might be a red herring. 3.5.4 does this too (at least on macOS). I may have fixed it in the 4.x series, then removed the code that allowed a file being opened to take over (or at least close) the untitled window that's opened by default, because it's a little trickier than one might expect to determine user intent there.

This is only happening when Processing is not already running, correct?

@processing-bot
Copy link
Collaborator Author

Created by: guilhermesilveira

The handleOpen method was returning null by default after dealing with exceptions. This allowed the Java compilation phase to accept a handleOpenInternal invocation without an explicit return. The commits solve the issue by adding the missing return and avoids further errors by moving the return null statement to inside the exception handler.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Thanks all, @guilhermesilveira has found the fix for us. Appreciate the help!

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed windows
Projects
None yet
Development

No branches or pull requests

1 participant