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

Lag when switching between Stage manager tasks (macOS Ventura) #2669

Open
noefroidevaux opened this issue Oct 26, 2022 · 14 comments
Open

Lag when switching between Stage manager tasks (macOS Ventura) #2669

noefroidevaux opened this issue Oct 26, 2022 · 14 comments
Labels
bug Something isn't working macOS Issue applies to Apple macOS

Comments

@noefroidevaux
Copy link
Contributor

noefroidevaux commented Oct 26, 2022

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

-

WezTerm version

20220905-102802-7d4b8249

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When I switch between State manager tasks on macOS Ventrua, the animation is fluid... but when I switch from/to WezTerm, the animation is very laggy. The lag is more visible when the window of WezTerm is bigger.

To Reproduce

Use State manager on macOS Ventura and switch between tasks (including the one which has WezTerm).

Configuration

local wezterm = require 'wezterm'

return {
  font = wezterm.font "Iosevka Nerd Font Mono",
  font_size = 15.0,
  color_scheme = 'Dracula (Official)',
  window_decorations = "RESIZE",
  enable_tab_bar = false,
}

Expected Behavior

No lag when switching from/to WezTerm using macOS Ventura Stage manager

Logs

Many WARN wezterm_term::terminalstate > unhandled SetMode(Unspecified(34))

Anything else?

No response

@noefroidevaux noefroidevaux added the bug Something isn't working label Oct 26, 2022
@wez wez added the macOS Issue applies to Apple macOS label Oct 26, 2022
@noefroidevaux
Copy link
Contributor Author

Maybe it helps someone: my current workaround is to deactivate all macOS animations by activating System Settings > Accessibility > Reduce motion.

@wez wez changed the title Lag when switching between State manager tasks (macOS Ventura) Lag when switching between Stage manager tasks (macOS Ventura) Nov 19, 2022
@zasdaym
Copy link

zasdaym commented Jan 12, 2023

MacOS's poor OpenGL support likely causes this. Adding window_background_opacity = 0.999 in the config fixed the issue for me.

@wez
Copy link
Owner

wez commented Jan 12, 2023

Those that are experiencing this: are you on Intel or Apple Silicon?

You may wish to try adding:

front_end = "WebGpu"

to your config to use Metal rather than OpenGL. WebGPU is currently experimental:

@zasdaym
Copy link

zasdaym commented Jan 12, 2023

Those that are experiencing this: are you on Intel or Apple Silicon?

You may wish to try adding:

front_end = "WebGpu"

to your config to use Metal rather than OpenGL. WebGPU is currently experimental:

Apple Silicon here. Using front_end = "WebGpu" has no effect, still lagging.

@noefroidevaux
Copy link
Contributor Author

Also Apple Silicon here. I have also tried front_end = "WebGpu" without success.

@wez
Copy link
Owner

wez commented Jan 28, 2023

Can you try setting window_background_opacity = 0.9 to see if that influences this issue?

@noefroidevaux
Copy link
Contributor Author

noefroidevaux commented Jan 30, 2023

Can you try setting window_background_opacity = 0.9 to see if that influences this issue?

Yes, it's the case: with this setting, it seems smooth.

wez added a commit that referenced this issue Feb 1, 2023
Evidence:
* #310 (comment)
* #2669 (comment)
* #2669 (comment)

seems to suggest that window shadows hurt performance,
so add a way to disable them independently from window opacity.

You may use:

```
config.window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"
```

for this.

refs: #2669
@wez
Copy link
Owner

wez commented Feb 1, 2023

Ok, I think we've re-discovered the findings from:

at that time we turned off window shadows on macOS to improve performance after troubleshooting some ghostly artifacts when using transparent windows and discovering that shadows always hurt performance.

Subsequently, shadows were restored for opqaue windows by:

I just pushed a commit that allows you to do:

   window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"

to force them to be disabled independently from the window_background_opacity. You can also use MACOS_FORCE_ENABLE_SHADOW if you wish.

I haven't put too much thought into whether the default behavior should change for this. I'm leaning towards making it fast by default, but I'm open to hearing input from others before committing to a change.

@fanzeyi: do you have strong feelings about this?

@fanzeyi
Copy link
Sponsor Contributor

fanzeyi commented Feb 1, 2023

Thanks for checking with me. Personally I feel a window looks weird on macOS if the drop shadow is not there, but I think it's largely just my preference.

So yeah as long as there is a way to get it back. I don't have strong feelings about what default it should be.

imsnif pushed a commit to imsnif/wezterm that referenced this issue Feb 11, 2023
Evidence:
* wez#310 (comment)
* wez#2669 (comment)
* wez#2669 (comment)

seems to suggest that window shadows hurt performance,
so add a way to disable them independently from window opacity.

You may use:

```
config.window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"
```

for this.

refs: wez#2669
@noefroidevaux
Copy link
Contributor Author

   window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"

@wez I confirm that the lag is not here anymore with this config (version 20230320). As I use the term full screen, it's not a problem to not have the shadow. Thank you so much!

@noefroidevaux
Copy link
Contributor Author

But now I have another problem 🙂 By adding MACOS_FORCE_DISABLE_SHADOW to RESIZE for window_decorations, I have now a transparent window bar.

With window_decorations = "RESIZE|MACOS_FORCE_DISABLE_SHADOW":

Screenshot 2023-03-21 at 18 06 29

With window_decorations = "RESIZE":

Screenshot 2023-03-21 at 18 06 11

Did I do something wrong? Or should I open a new issue?

@wez
Copy link
Owner

wez commented Mar 21, 2023

@noefroidevaux please open a separate issue for that!

@noefroidevaux
Copy link
Contributor Author

@wez it's done :) => #3313

@martin-braun
Copy link

martin-braun commented Jan 23, 2024

Bless you all, this issue was driving me nuts, because it didn't just affect the stage manager, but also Mission Control. Everything slowed down on any window animation until I added

window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"

(But I also removed the TITLE for some nice headless window.)

Here is a visual comparison between iTerm and wezterm without the setting above, in case someone need something to relate to:

2024-01-23.12.10.57.mp4

With the above setting I can see there is no shadow on the window anymore, but it's finally snappy and all. I tradeoff worth making, but it would be great if this could be fixed for people in the future. It wasn't so easy to find this issue.

3DRX added a commit to 3DRX/dotfiles that referenced this issue May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS Issue applies to Apple macOS
Projects
None yet
Development

No branches or pull requests

5 participants