Skip to content

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

Open
@Xorgon

Description

@Xorgon

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.

Activity

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[/+] on Mar 18, 2017
facchinm

facchinm commented on Mar 20, 2017

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

Xorgon

Xorgon commented on Mar 20, 2017

@Xorgon
Author

@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

facchinm commented on Mar 20, 2017

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

facchinm commented on Mar 20, 2017

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

Xorgon commented on Mar 20, 2017

@Xorgon
Author

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

removed
Waiting for feedbackMore information must be provided before we can proceed
on Aug 4, 2017
ckunta

ckunta commented on Apr 22, 2018

@ckunta

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Sketch doesn't always refresh when the Arduino IDE is refocused · Issue #6088 · arduino/Arduino