Skip to content

Some window decorations missing on macOS when window background_opacity < 1 #2827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
evanheller opened this issue Jul 2, 2020 · 7 comments
Closed

Comments

@evanheller
Copy link

It looks like some window decorations are missing on macOS when the background opacity is set to < 1: the title bar is drawn, but outside borders and shadows between the window and the rest of the OS are not displayed. (When the window is opaque, window decorations appear normally.)

This is an example of the expected window decorations when a window is positioned over Kitty:
Screen Shot 2020-07-02 at 12 11 08 PM

However, when Kitty is positioned over another window, you can see that there are no borders or shadows, and the Kitty window just blends in with the other window. (Window borders between terminals within Kitty itself are fine.):
Screen Shot 2020-07-02 at 12 11 38 PM

This is in v0.18.1 on macOS Catalina 10.15.5

@kovidgoyal
Copy link
Owner

Presumably, that's what macOS chooses to do with semi-transparent
windows. The window decorations/shadow are drawn by the system not by
kitty. See for example: https://stackoverflow.com/questions/9519009/transparent-nswindow-but-with-standard-border-and-shadow

@evanheller
Copy link
Author

I see! Sorry, I had noticed that apps like Terminal.app and MacVim (for example) that support window transparency keep these decorations, so I assumed it was the default behavior.

@kovidgoyal
Copy link
Owner

No it isn't. If there is a way to keep them, patches are most welcome!!

@lilyball
Copy link

GLFW appears to call [window setHasShadow:NO] when creating the NSWindow if the framebuffer config includes transparent. What happens if you just call [window setHasShadow:YES] again afterwards?

Personally, I really want semi-transparent terminal windows, I've been using that in Terminal.app for almost 2 decades, but losing the shadow is a dealbreaker. Terminal.app also supports blurring the background, which is something that would be extremely nice to have as well, but it's less obvious how to do that (which is to say, there are macOS APIs for producing blurred semi-transparent window backgrounds, but I don't know how to use those with a GLFW window as I believe they require setting up the content view hierarchy in a particular way).

@albertz
Copy link

albertz commented Jan 4, 2023

In the linked StackOverflow question, it sounds as if you just need to do:

[aWindow setOpaque:NO];
[aWindow setBackgroundColor:[NSColor clearColor]];

@kovidgoyal
Copy link
Owner

Like I said, patches that achieve it are most welcome. I dont develop on
macOS so trial and error there is too high cost for me for this.

@albertz
Copy link

albertz commented Jan 4, 2023

I reported that upstream for glfw here: glfw/glfw#2245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants