Skip to content

Sketch doesn't always refresh when the Arduino IDE is refocused #6088

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

Open
Xorgon opened this issue Mar 18, 2017 · 6 comments
Open

Sketch doesn't always refresh when the Arduino IDE is refocused #6088

Xorgon opened this issue Mar 18, 2017 · 6 comments
Labels

Comments

@Xorgon
Copy link

Xorgon commented Mar 18, 2017

When using the Arduino IDE on Windows with an external editor (set as such in the preferences) simply clicking back onto the window doesn't refresh the sketch that is open. As far as I am aware, it must be reopened by clicking on its icon in the toolbar to get it to refresh the sketch.

@Xorgon Xorgon changed the title Sketch doesn't always refresh when the Arduino IDE from an external editor Sketch doesn't always refresh when the Arduino IDE is refocused Mar 18, 2017
@facchinm
Copy link
Member

Hi @Xorgon ,
would you mind testing #6074 ? It should reload the sketch also when you are not in "external editor mode" when you refocus the IDE window.

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label Mar 20, 2017
@Xorgon
Copy link
Author

Xorgon commented Mar 20, 2017

@facchinm I've had a go using that build. It has improved the problem, but there's still at least one situation where it doesn't reload correctly, although from my observation of its behavior I think it may now be limited by the editor saving it at certain points. I've recorded what happens, (time-stamped links are also below):
https://youtu.be/GWvs3CixWI4

The behaviors that the video demonstrates are as follows:

  • At 0:06: Adding to a file does not cause Arduino to reload the file, unless the Arduino window is clicked into at least twice (an improvement from having to minimize and maximize the window).
  • At 0:22: Removing from a file does cause Arduino to reload the file (with an error).
  • At 0:28: Adding to a file will cause Arduino to reload the file if the toolbar is clicked (hence my thoughts on it now being a limitation on the editor side). This also throws errors.

The stacktrace text is here.

@facchinm
Copy link
Member

PR #6074 doesn't handle the full file wipe ATM, and I think it shouldn't (or it should show an informative popup). The double click behaviour is quite strange (it doesn't happen on Linux so it deserves more investigation).
After this roundup, it looks like the problem is related with how Windows10 implements the "reacquire focus" action, since the code is shared with platforms that work consistently.

@facchinm
Copy link
Member

Mmmmh, I just tested on a Win10 VM and I can't reproduce your behaviour with plain 1.8.1... Could it be a Java bug related with the particular video card (like Nvidia's bug some times ago)?

@Xorgon
Copy link
Author

Xorgon commented Mar 20, 2017

Hmmm, odd, the only other factor I can think of would be the save behavior of CLion (the Jetbrains IDE for C/C++).

@per1234 per1234 removed the Waiting for feedback More information must be provided before we can proceed label Aug 4, 2017
@ckunta
Copy link

ckunta commented Apr 22, 2018

I found out that the behavior of not refreshing still being exhibited in Arduino 1.8.5. I'm in Windows 10 and use Emacs as external editor. Although, "Fix Encoding and Reload" in Tools seems a reasonable workaround to manually reload it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants