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

macOS: exiting fullscreen does not restore background-opacity #3553

Closed
HannesOlszewski opened this issue Dec 27, 2024 · 4 comments · Fixed by #3831
Closed

macOS: exiting fullscreen does not restore background-opacity #3553

HannesOlszewski opened this issue Dec 27, 2024 · 4 comments · Fixed by #3831
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos
Milestone

Comments

@HannesOlszewski
Copy link

When entering fullscreen mode with cmd-ctrl-f the background is not transparent anymore, as expected. But when I exit fullscreen mode the same way again, the original background-opacity value is not restored, or at least the background is not transparent anymore.

Screenshots:

Before fullscreen

Image

Fullscreen

Image

After exiting fullscreen

Image

Config

Device: MacBook Pro 13" M1
OS: Macos 15.2
Version: Ghostty 1.0.0

~/.config/ghostty/config:

background-opacity = 0.7
background-blur-radius = 20

window-padding-x = 8
window-padding-y = 8
window-colorspace = display-p3
macos-titlebar-style = hidden
macos-icon = custom-style
macos-icon-frame = plastic
macos-icon-ghost-color = ffffff
macos-icon-screen-color = 262335
command = /bin/zsh -c /opt/homebrew/bin/zellij

foreground = ffffff
background = 262335
cursor-color = ffffff
selection-foreground = ffffff
selection-background = 262335

palette = 0=#262335
palette = 1=#fe4450
palette = 2=#72f1b8
palette = 3=#f3e70f
palette = 4=#03edf9
palette = 5=#ff7edb
palette = 6=#03edf9
palette = 7=#ffffff
palette = 8=#614d85
palette = 9=#fe4450
palette = 10=#72f1b8
palette = 11=#fede5d
palette = 12=#03edf9
palette = 13=#ff7edb
palette = 14=#03edf9
palette = 15=#ffffff
@mitchellh mitchellh added os/linux contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) labels Dec 27, 2024
@mitchellh mitchellh changed the title Exiting fullscreen does not restore background-opacity GTK: exiting fullscreen does not restore background-opacity Dec 27, 2024
@tristan957
Copy link
Collaborator

@mitchellh this is not a GTK issue. It is only occurring on Mac. I wonder if it is a dupe of #3324.

@jay-dee7
Copy link
Collaborator

I can definitely reproduce this one Macos and I suspect background-opacity is being overwritten on fullscreen. This happens in both of the following scenarios:

  1. Builtin shortcut CTRL+CMD+f
  2. Using the fullscreen toggle button from title bar

Also, just reloading the config makes it blur again

@gigamonster256
Copy link
Contributor

gigamonster256 commented Dec 28, 2024

@mitchellh this is not a GTK issue. It is only occurring on Mac. I wonder if it is a dupe of #3324.

I just tried it with #3347 checked out and the opacity is not being restored when exiting native fullscreen.

Edit: after more troubleshooting, it seems that the didExitFullScreenNotification notification (which is needed to recompute the style for the surface) is not firing when using the toggle_fullscreen keymap to exit native fullscreen (even though the didEnterFullScreenNotification notification is triggered by entering native fullscreen), I'll keep investigating.

It seems that the *FullScreenNotification listeners are unregistered sometime during the toggle_fullscreen action firing for the first time since all subsequent resizings no longer fire the notifications until the config is reloaded

@mitchellh mitchellh changed the title GTK: exiting fullscreen does not restore background-opacity macOS: exiting fullscreen does not restore background-opacity Dec 29, 2024
@a7mdDev
Copy link

a7mdDev commented Dec 30, 2024

FWIW
It appears the fullscreen style is being nulled out when exiting fullscreen here. This happens before it receives the didExitFullscreenNotification thus never really handling it.

@gigamonster256's fix moves the ownership of listening to the fullscreen toggle from FullscreenStyles to TerminalController which I'm assuming is a more permanent thing, and is not really deinitialized in a similar manner.

@github-actions github-actions bot added this to the 1.0.1 milestone Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants