Skip to content
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

Improve transparency on macOS #7965

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link

@madsmtm madsmtm commented May 10, 2024

Extension upon #7928, see that for discussion. I've improved a bit on the window background, by setting the alpha channel to follow the window opacity.

When window.opacity < 1, we do two things:

  • Set the title bar as transparent (new).
  • Disable window border shadows (existing behaviour).

Copy link
Member

@chrisduerr chrisduerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing changelog entry.

alacritty/src/display/window.rs Outdated Show resolved Hide resolved
alacritty/src/display/window.rs Outdated Show resolved Hide resolved
alacritty/src/display/window.rs Outdated Show resolved Hide resolved
alacritty/src/display/window.rs Outdated Show resolved Hide resolved
alacritty/src/display/window.rs Outdated Show resolved Hide resolved
alacritty/src/display/window.rs Outdated Show resolved Hide resolved
@sfsam
Copy link

sfsam commented May 10, 2024

I'm seeing the same thing I observed in the discussion of #7928: No borders and a white title bar even though decorations_theme_variant = "Dark" is set. I think this is due to something that was changed in the move to winit 0.3.0. I'm on MacOS Sonoma 14.4.1. FWIW, my window config:

[window]
decorations_theme_variant = "Dark"
decorations = "full"
option_as_alt = "OnlyLeft"
resize_increments = true
dimensions = { columns = 100, lines = 24 }

@nixpulvis
Copy link
Contributor

nixpulvis commented May 14, 2024

Set the title bar as transparent (new)

Seems to me this may be undesired. I hate to think we need yet another macOS specific configuration for it though.

Screenshot 2024-05-14 at 9 47 41 AM

@kchibisov
Copy link
Member

The end window opacity is not as it should be, it's just generally more opaque compared to what it was before or glitches.

Window has opaque title bar and real border when
config.window_opacity == 1.
We set the transparency explicitly using `Window::set_transparent`
further below, so this is no longer needed on macOS after:
rust-windowing/winit#3657
@madsmtm
Copy link
Author

madsmtm commented Jun 6, 2024

I've updated the PR and reverted some of the changes I probably mistakenly thought were for the better, though I'm too unsure of what the desired behaviour is (I don't like transparent windows myself, and don't use Alacritty).

The first two commits should bring Alacritty back in line with what it was pre winit 0.30.

Would be happy if someone else would take over for the rest.

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

Successfully merging this pull request may close these issues.

None yet

5 participants