zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.48k stars 3.13k forks source link

Window can get stuck offscreen if changing monitor setup #12521

Open anselanza opened 5 months ago

anselanza commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

If a window was last opened on second monitor, which is now detached, it is stuck offscreen.

I work on a MacBook Pro which is sometimes connected to a secondary display, sometimes used without. I had a few projects in Zed which were opened on the secondary display. When I tried to open them without the display attached, the windows were completely inaccessible - apparently still "there" (they appeared in the list under the Window menu) but invisible and therefore unusable.

The only workaround was to close everything, create a New Window and re-open each project.

It's great that the window position/size is being saved along with the project, but I think some care needs to be exercised restoring the position onto a monitor that may no longer be attached!

Environment

Zed: v0.137.5 (Zed) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

huperniketes commented 5 months ago

I believe this is similar to the issue. I'm currently experiencing NZ. When I open a particular project, the window remains hidden. I can make the window visible using the View > Enter Full Screen menu item but then it disappears again when you exit full screen. (There's an animation showing the window shrinking away to the upper left corner.)

The solution for me has been to zoom the window with the Window > Zoom menu item, then resizing it manually.

If I knew where this setting is stored, I could report its value or change it when necessary.