Description
Describe the problem
We use electron-store
to store data such as the coordinates of the Arduino IDE window position on the user's screen. For example:
{
"windowstate": {
"isMaximized": false,
"width": 968,
"height": 781,
"x": -20,
"y": 1394
}
}
The window is positioned at the stored coordinates when it is opened in subsequent IDE sessions. This is done blindly without any validation of whether the coordinates are within the actual dimensions of the display.
🐛 If the stored window coordinates are at a position outside the current display's dimensions, the IDE window will not be visible to the user.
To reproduce
- Select File > Quit from the Arduino IDE menus if it is running.
- Use any text editor to open the file at the following path:
- If you are using Windows:
C:\Users\<username>\AppData\Roaming\arduino-ide\config.json
- If you are using Linux:
/home/<username>/.config/arduino-ide/config.json
- If you are using macOS:
/Users/<username>/Library/Application Support/arduino-ide/config.json
- If you are using Windows:
- Delete the
workspaces
key and all the data it contained.
ⓘ This is done for the sake of making the demonstration easier to perform, but the fault will also occur if the data in theworkspaces
contains invalid coordinate data. - Change the value of
isMaximized
tofalse
- Change the value of
windowstate.x
to9999
- Change the value of
windowstate.y
to9999
- Save the file.
- Start Arduino IDE.
🐛 The IDE window is not visible.
Expected behavior
Arduino IDE window is always placed at a location within the active display dimensions on startup.
Arduino IDE version
Original report
Arduino Pro IDE 0.1.4
Last verified with
Operating system
Windows 10
Additional context
It is not known how the invalid configuration is produced in real world usage. It might occur if the user changes their display configuration in a way that makes a previously valid window coordinate no longer valid. That might either be caused by a reduction of the display resolution:
- Changing the resolution setting (e.g., change magnification as described here)
- Changing to a lower resolution monitor (e.g., switching from using a large external monitor to the built-in monitor of a laptop)
- Switching from using multiple monitors to using a single monitor
Originally reported at arduino/arduino-pro-ide#444 (comment)
Workaround
Delete the file at the following location (where <username>
is the username of your operating system account):
- If you are using Windows:
C:\Users\<username>\AppData\Roaming\arduino-ide\config.json
- If you are using Linux:
/home/<username>/.config/arduino-ide/config.json
- If you are using macOS:
/Users/<username>/Library/Application Support/arduino-ide/config.json
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details### Describe the problem