Insomnia: [Bug] Multiscreen change puts client off screen

Created on 9 Nov 2018  路  11Comments  路  Source: Kong/insomnia

[Bug] Multiscreen change puts client off screen

upon changing docks, rest client tries to stick to 1st screen or previously placed screen.

accepted good first issue help wanted owindows

Most helpful comment

workaround if your window is offscreen:

edit the "bounds" file in %APPDATA%/Insomnia/localStorage

this is how mine looked like when insmonia was off-screen

{"x":-1928,"y":-8,"width":1920,"height":1040}

i changed it to

{"x":0,"y":0,"width":1920,"height":1040}

and i could recover the window

hope this is helpfull to anyone
best regards

All 11 comments

馃憢 Thanks for opening your first issue! If you're reporting a 馃悶 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 馃巵, please provide real
use cases that would benefit. 馃應

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

This has been a known problem for a little while but I do not have the correct setup to be able to reproduce it.

If someone wants to take a crack at fixing it, there is already logic to _try_ and prevent the app from launching off screen but doesn't seem to always work on Windows.

https://github.com/getinsomnia/insomnia/blob/d0652a5b918564e19980afe6905027f7c8fda522/packages/insomnia-app/app/main/window-utils.js#L34-L45

Unable to recreate. Recreation steps would certainly help.

I also was unable to replicate the issue. I tried a number of steps to attempt to recreate this:

  • Have application running on monitor 2, and then detach dock
  • Have application running on monitor 2, and then Win+P to PC only display
  • Have application running on monitor 2, close, detach, reopen
  • Have application running on monitor 2, close, Win+P to PC only display, reopen
  • Have application running on monitor 2 with ~5 px bleed to 1, detach
  • Have application running on monitor 2 with ~5 px bleed to 1, Win+P to PC only display
  • Have application running on monitor 1, and then Win+P to Second Screen only display
  • Have application running on monitor 1 (in extend), close, switch to Second screen only display, reopen

The only scenario to have an issue for me was the last. In this case, Insomnia opened on the second monitor, but on the far edge of it closest to monitor 1, and only about 50 px of it. Without confirmation from @CtrlNull , I believe that this may be the issue that they were encountering? From the source code though, this is actually the intended operation. The application will open and move itself so that it is 50px on to an active monitor.

If however the issue is happening WHILE the application is open and they are changing their monitor/dock configuration, then I would think that that may be a driver issue, as Windows by default handles window configuration during monitor state changes and moving application windows to active monitors (as I was able to replicate with all of the previous replication scenarios).

At this point, I basically have two questions:

1 - @CtrlNull , can you elaborate on the issue that you're facing some more so that we can confirm the steps to reproduce it? Is it one of the scenarios I listed above?

2 - @gschier , as for the final scenario where the application reopens with only 50px horizontal application viewable, I partly feel that this should be changed to reposition the application fully within the bounds of the active display. Have any thoughts/feelings on this? If you agree, I can do a PR pretty easily to center the application or move it so that it is at least fully visible within the bounds of the active display.

@tostringtheory a PR for that would be great!

Also, thanks for the very thorough write up!

@gschier - I'll try and get a PR for that in the next couple days.

workaround if your window is offscreen:

edit the "bounds" file in %APPDATA%/Insomnia/localStorage

this is how mine looked like when insmonia was off-screen

{"x":-1928,"y":-8,"width":1920,"height":1040}

i changed it to

{"x":0,"y":0,"width":1920,"height":1040}

and i could recover the window

hope this is helpfull to anyone
best regards

Hey, for my pc the file bounds was located at AppData\Roaming\Insomnia\localStorage

workaround if your window is offscreen:

edit the "bounds" file in %APPDATA%/Insomnia/localStorage

Another way to get the window back onscreen without having to edit the bounds file (mine was also in AppDataRoamingInsomnialocalStorage)

  • Click on the Insomnia Client icon in the task bar
  • Press Alt+Space to bring up the context menu for the application
  • Select 'Move' in the context menu
  • Use the keyboard arrow keys to move the window back onto the screen (After pressing an arrow key once, you can then use the mouse cursor to quickly move the window back onto the screen!)

A quick work around if your Insomnia app is loading off screen
Ensure it is the active app by clicking on the app Icon in the task bar and press F11

Was this page helpful?
0 / 5 - 0 ratings