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

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

Closed
billv923 opened this issue Apr 23, 2022 · 5 comments
Closed

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

billv923 opened this issue Apr 23, 2022 · 5 comments
Labels
Help Wanted We have very little time and would like some help Windows

Comments

@billv923
Copy link

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

@benfry benfry changed the title Unexpected Blank Sketch Opens When Double Clicking on An Existing .pde File (Sketch) Double-clicking a .pde file on Windows also opens an untitled/empty sketch Apr 24, 2022
@benfry benfry added Help Wanted We have very little time and would like some help Windows labels Apr 24, 2022
@ExpandingS
Copy link

@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.

@benfry
Copy link
Owner

benfry commented Apr 24, 2022

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?

@guilhermesilveira
Copy link
Contributor

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.

@benfry benfry closed this as completed in d8dc99e Apr 27, 2022
@benfry benfry changed the title Double-clicking a .pde file on Windows also opens an untitled/empty sketch Double-clicking a .pde file also opens an untitled/empty sketch Apr 27, 2022
@benfry
Copy link
Owner

benfry commented Apr 27, 2022

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

@github-actions
Copy link

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 May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted We have very little time and would like some help Windows
Projects
None yet
Development

No branches or pull requests

4 participants