-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Restore open sketches on startup #780
Conversation
Hi @msujew
I'm not sure whether I understood correctly. Is the current build from this PR expected to work on Windows? |
@per1234 Yes, it definitely works on Windows, since it is the OS on my dev machine. On the other hand, it needs some testing to confirm it works on posix systems from your side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on MacOS. Looks very good to me! 🚀
@silvanocerza would you please give it a try on Linux? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine for me on Linux. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not working for me on Windows 10
To reproduce
- Start the Arduino IDE.
You now have a sketch open (I'll refer to it as "sketch a"). - Open another sketch (I'll refer to it as "sketch b").
You now have two sketches open. - Select File > Quit from the Arduino IDE menus.
- Start the Arduino IDE
🐛 I now have two windows, each of which has "sketch b" open.
Expected behavior
Starting IDE opens "sketch a" in one window and "sketch b" in the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The procedure I described above works correctly for me on Linux, however, I experienced a different problem on Linux:
To reproduce
- Start the Arduino IDE.
You now have a sketch open (I'll refer to it as "sketch a"). - Select File > New from the Arduino IDE menus.
You now have a second sketch open, staged in a temporary folder (I'll refer to it as "new sketch"). - Select File > Quit from the Arduino IDE menus.
- Start the Arduino IDE
🐛 I now have two windows, each of which has "sketch a" open.
Expected behavior
Starting IDE opens only a single window, containing "sketch a".
afab6bf
to
d9a937c
Compare
@per1234 Thanks for the throughout review! I was able to reproduce both issues. The Windows one had some specific conditions: I was able to reproduce the issue by saving the sketch to a different drive. The Linux issue stems from the OS deleting the temp folder. We now check for that before opening the window. Both issues should now be hopefully fixed. |
I confirm the issue on Linux reported by @per1234 is fixed, even creating multiple sketches and not saving them works with no issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything working perfectly for me now on both Windows and Linux.
And indeed I did happen to have sketches "a" and "b" saved on a different drive from the IDE when I encountered the Windows issue I reported previously.
Thanks @msujew!
@msujew , it works on Mac OS Monterey, any chance we can save the windows state including positioning and size? |
d9a937c
to
6c749f6
Compare
@ubidefeo Didn't think about that, I added that as well 👍 |
awesome! |
@msujew |
What happens if I close the IDE on a secondary monitor, disconnect it and then open the IDE again? 👀 |
6c749f6
to
2387156
Compare
@ubidefeo Do you mind retesting it? I believe the offset was introduced by a incorrect call to |
Arduino IDE 1.x has had problems with this sort of thing: |
@msujew |
@per1234 @AlbyIanna I would merge this if that's alright with you? Having this PR in would make working on #72 and #370 easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the latest build out on both Windows and Linux and everything is still working perfectly for me.
So merging it is alright with me.
Closes #384
Stores sketches which were closed immediately before the application closed in the
electronStore
of the main app. When restarting the application, the sketches are loaded and a dedicated window is launched for each of them.The fix needs some special treatment for Windows. Due to my local setup, I was not able to test this on a POSIX system. although I'm quite certain it should work there as well.