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
47.8k stars 2.8k forks source link

Empty window on macOS 15 beta #12930

Open TeamPuzel opened 3 months ago

TeamPuzel commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Zed opens but the window is completely blank (but the icon is visible in mission control, the surface appears to have no size)

Screenshot 2024-06-12 at 13 16 46

Console errors (sorry for the screenshot, I don't believe there is an export feature...)

image

Terminal output:

13:20 ~ > /Applications/Zed\ Preview.app/Contents/MacOS/zed
CoreGraphics PDF has logged an error. Set environment variable "CG_PDF_VERBOSE" to learn more.

With the variable:

13:22 ~ > export CG_PDF_VERBOSE=true && /Applications/Zed\ Preview.app/Contents/MacOS/zed
Invalid value for entitlement: com.apple.coregraphics.disablepdf. Must be CFBooleanRef
Invalid value for entitlement: com.apple.coregraphics.disableinmemoryfonts. Must be CFBooleanRef

Environment

N/A (Can't access palette) It is an M2 Max 32GB MacBook Pro on the first macOS 15 Developer Beta

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

N/A

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

N/A

TeamPuzel commented 3 months ago

It worked fine for a while so this must have been a recent automatic update

d1y commented 3 months ago

You are also a warrior

I found out that it was the new tiling mode of macos that caused the problem I haven't studied it, but I suspect it's just missing some default values?

ctrl + cmd + f enter full-screen it show window

Workaround

fn + control + c

image

TeamPuzel commented 3 months ago

That workaround does work, thanks, I was worried I'd have to fall back to nvim :) Does this also happen to other apps or is it specific to something Zed is doing? The only other app I had issues with is Steam, but they're just completely misusing the windowing APIs.

Aaron-212 commented 3 months ago

Did you have Loop or similar Window Management software installed? I uninstalled Loop and it solves the issue.

TeamPuzel commented 3 months ago

No, I never used any window management software on macOS.

Aaron-212 commented 3 months ago

I think the problem here might related to that Zed does not have a limit on how small the window could be.

image

Maybe adding a limit could help.

Aaron-212 commented 3 months ago

Just found a possible way to reproduce the bug. Fullscreen Zed, quit, reopen, exit fullscreen and it shrinks to void.

sleetdrop commented 3 months ago

I am using macOS 14.5 and Zed 0.139.3, have the same issue

TeamPuzel commented 3 months ago

Just found a possible way to reproduce the bug. Fullscreen Zed, quit, reopen, exit fullscreen and it shrinks to void.

Is Zed restoring windows using the Cocoa APIs? It doesn't seem to be doing that:

image

I have this enabled, windows should only reopen if the checkbox is set on reboot or the app was closed with option-command-Q — but Zed is always reopening, so it's definitely not using the window restoration API correctly (or is not using it at all). There isn't even a Quit and Keep Windows alternative menu item.

In a way this is also a different but related bug


Normally windows don't always reopen in fullscreen, they reopen on the desktop even if they were fullscreen before. This might be related too. Although sometimes they do reopen in fullscreen? Very confusing; Apple apps reopen in fullscreen but fail to switch to the correct space, and reopen on the desktop on reboot.

On top of that some of the apps remember their state separately to window state, but they seem to be low quality ported iOS apps (like iMessage) so not sure if that's intentional. Older apps like Calendar do remember state based on how the app was closed.

I guess even Apple doesn't care about this feature being consistent anymore.

mijailr commented 3 months ago

I'm facing the same issue on MacOS 14.5 and Zed 0.139.3

Aaron-212 commented 3 months ago

Just found a possible way to reproduce the bug. Fullscreen Zed, quit, reopen, exit fullscreen and it shrinks to void.

Is Zed restoring windows using the Cocoa APIs? It doesn't seem to be doing that:

image

I have this enabled, windows should only reopen if the checkbox is set on reboot or the app was closed with option-command-Q — but Zed is always reopening, so it's definitely not using the window restoration API correctly (or is not using it at all). There isn't even a Quit and Keep Windows alternative menu item.

In a way this is also a different but related bug

Normally windows don't always reopen in fullscreen, they reopen on the desktop even if they were fullscreen before. This might be related too. Although sometimes they do reopen in fullscreen? Very confusing; Apple apps reopen in fullscreen but fail to switch to the correct space, and reopen on the desktop on reboot.

On top of that some of the apps remember their state separately to window state, but they seem to be low quality ported iOS apps (like iMessage) so not sure if that's intentional. Older apps like Calendar do remember state based on how the app was closed.

I guess even Apple doesn't care about this feature being consistent anymore.

image

Servo's rust AppKit cannot handle window restoration

chronark commented 3 months ago

~Happens on macos 14.5 and zed 0.141.3 too~

Edit: this was unrelated, I had a corrupted db file, removing it and restarting solved it

See https://x.com/thorstenball/status/1807055768950092253