Quake Mode reveal animation tears/flickers #16545

Open
opened 2026-01-31 05:15:19 +00:00 by claunia · 7 comments
Owner

Originally created by @mauve on GitHub (Jan 30, 2022).

Windows Terminal version

1.11.3471.0

Windows build number

10.0.22543.0

Other Software

No response

Steps to reproduce

Reveal or hide the quake mode window

Expected Behavior

No tearing/flickering

Actual Behavior

Tearing/flickering, I have attached a video which somewhat shows the effect.

https://user-images.githubusercontent.com/795800/151700014-898799f7-9a9d-4f26-9c03-5c9b1be07308.mp4

I have a medium-beefy PC and tearing is not an issue anywhere else, so I assume this should work for the terminal as well.

Originally created by @mauve on GitHub (Jan 30, 2022). ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.22543.0 ### Other Software _No response_ ### Steps to reproduce Reveal or hide the quake mode window ### Expected Behavior No tearing/flickering ### Actual Behavior Tearing/flickering, I have attached a video which somewhat shows the effect. https://user-images.githubusercontent.com/795800/151700014-898799f7-9a9d-4f26-9c03-5c9b1be07308.mp4 I have a medium-beefy PC and tearing is not an issue anywhere else, so I assume this should work for the terminal as well.
Author
Owner

@zadjii-msft commented on GitHub (Jan 31, 2022):

Yea, that's just kind of a known issue at the moment. I have that as a bullet point in #8888 but we can use this to track it officially. We'd be happy to accept a contribution to help fix this!

Note

Walkthrough

#9977 has notes on what I tried and didn't work for me. I'd cross reference that when trying this again.

There's another project out there that accomplishes this effect by literally calling MoveWindow:
54cbccfbf2/windows-terminal-quake/Toggler.cs (L131)

This is probably the best solution TBH, and one I hadn't considered when originally implementing this. I was resizing the window which was always wack. But we don't need to resize it, right? We can just slide it in from the top...

Take a look at:

  • IslandWindow::_doSlideAnimation
  • IslandWindow::_dropdownWindow
  • IslandWindow::_slideUpWindow

Adjust those guys to move the root window instead of clipping the region of the _interopWindowHandle (which is the internal HWND hosting the content).

If we can prove that works nicely, then I'd say let's ship that and figure out the following in post:

I'd maybe be wary of a situation where there's another monitor above the monitor the window is dropping down onto. That would look a little weird - like, the window appears on the top one, then slides down onto the bottom. That's silly, but might be able to be fixed with clever use of SetWindowRgn to clip the window to the bottom monitor. Something to look into for sure.

@zadjii-msft commented on GitHub (Jan 31, 2022): Yea, that's just kind of a known issue at the moment. I have that as a bullet point in #8888 but we can use this to track it officially. We'd be happy to accept a contribution to help fix this! > **Note** > ## Walkthrough #9977 has notes on what I tried and didn't work for me. I'd cross reference that when trying this again. There's another project out there that accomplishes this effect by literally calling `MoveWindow`: https://github.com/flyingpie/windows-terminal-quake/blob/54cbccfbf2285fda81a880556a051c38de881e0d/windows-terminal-quake/Toggler.cs#L131 This is probably the best solution TBH, and one I hadn't considered when originally implementing this. I was _resizing_ the window which was always wack. But we don't _need_ to resize it, right? We can just slide it in from the top... Take a look at: * `IslandWindow::_doSlideAnimation` * `IslandWindow::_dropdownWindow` * `IslandWindow::_slideUpWindow` Adjust those guys to move the root window instead of clipping the region of the `_interopWindowHandle` (which is the internal HWND hosting the content). If we can prove that works nicely, then I'd say let's ship that and figure out the following in post: I'd maybe be wary of a situation where there's another monitor _above_ the monitor the window is dropping down onto. That would look a little weird - like, the window appears on the top one, then slides down onto the bottom. That's silly, but might be able to be fixed with clever use of `SetWindowRgn` to clip the window to the bottom monitor. Something to look into for sure.
Author
Owner

@jihuayu commented on GitHub (Jun 3, 2023):

Hello, I adjusted the animation duration to 5000ms and added a 1s sleep before and after the animation. This video can explain why there is a tearing sensation.
bug

  1. When we call the _dropdownWindow function, the window is fully displayed before playing the animation. When calling the _slideUpWindow function, the window is fully displayed again after playing the animation.
  2. Each time the window is modified for less than 1ms, causing the animation time to be interrupted before it is completed.
  3. The window has a border (maybe acrylic background or window shadow?)
    wb

I am fix 1st and 2nd.This is the animation after the fix.

animationDuration=5000ms
fix

animationDuration=100ms
100ms

But for 3rd, I don't know how to hide the border, could you tell me?

I will send a PR later.

@jihuayu commented on GitHub (Jun 3, 2023): Hello, I adjusted the animation duration to 5000ms and added a 1s sleep before and after the animation. This video can explain why there is a tearing sensation. ![bug](https://github.com/microsoft/terminal/assets/32858525/00468c83-26d1-452d-8a63-d40396fc8dd3) 1. When we call the `_dropdownWindow` function, the window is fully displayed before playing the animation. When calling the `_slideUpWindow` function, the window is fully displayed again after playing the animation. 2. Each time the window is modified for less than 1ms, causing the animation time to be interrupted before it is completed. 3. The window has a border (maybe acrylic background or window shadow?) ![wb](https://github.com/microsoft/terminal/assets/32858525/72761358-5f0e-4d7b-a255-8bfcf5389cb6) I am fix 1st and 2nd.This is the animation after the fix. > animationDuration=5000ms ![fix](https://github.com/microsoft/terminal/assets/32858525/a81f7624-16ab-4ba5-bb5d-2d896912cf3e) > animationDuration=100ms ![100ms](https://github.com/microsoft/terminal/assets/32858525/7cbd710b-359f-4dd3-80ca-b1fedcff14e5) But for 3rd, I don't know how to hide the border, could you tell me? I will send a PR later.
Author
Owner

@zadjii-msft commented on GitHub (Jul 5, 2023):

That's pretty slick! I'd love to see the PR and play around with it myself 😄

RE: hiding the border. Hmm. That's a good question. I'm trying to remember if there's an API that disables that - something like DwmExtendFrameIntoClientArea? Or maybe this is a WS_POPUP thing? I honestly can't remember. That's definitely just the standard border shadow that's typically provided to windows, but there's definitely a way to disable it.

@zadjii-msft commented on GitHub (Jul 5, 2023): That's pretty slick! I'd love to see the PR and play around with it myself 😄 RE: hiding the border. Hmm. That's a good question. I'm trying to remember if there's an API that disables that - something like `DwmExtendFrameIntoClientArea`? Or maybe this is a `WS_POPUP` thing? I honestly can't remember. That's definitely just the standard border shadow that's typically provided to windows, but there's definitely a way to disable it.
Author
Owner

@jihuayu commented on GitHub (Jul 6, 2023):

@zadjii-msft I have sent the PR https://github.com/microsoft/terminal/pull/15659
Thanks for you help, but I always can't hide the border

@jihuayu commented on GitHub (Jul 6, 2023): @zadjii-msft I have sent the PR https://github.com/microsoft/terminal/pull/15659 Thanks for you help, but I always can't hide the border
Author
Owner

@biesigrr commented on GitHub (Sep 18, 2023):

I suspect that the remaining drop shadow is caused by the parent window (CASCADIA_HOSTING_WINDOW_CLASS) still being fully visible until the animation completes. If I just change the animation to be done on the parent window (just using GetParent), the border disappears. There are other weird side effects with this though.

image

@biesigrr commented on GitHub (Sep 18, 2023): I suspect that the remaining drop shadow is caused by the parent window (*CASCADIA_HOSTING_WINDOW_CLASS*) still being fully visible until the animation completes. If I just change the animation to be done on the parent window (just using `GetParent`), the border disappears. There are other weird side effects with this though. ![image](https://github.com/microsoft/terminal/assets/15121567/93aa4d69-10fa-4ada-a06a-c0870e6bc21b)
Author
Owner

@WamboOSX commented on GitHub (Apr 24, 2024):

Workaround for Instant Animation

Where is a Action to open Windows Terminal itself gloablly:
image

You can just override quake mode with it.
By doing so, you can call quake mode without animation.
(quake mode is just a window named _quake)

Bind Terminal to instead of Quake Mode WIN+`

Add this to settings json:

    "actions": [
        {
            "command": {
                "action": "globalSummon"
            },
            "keys": "win+`"
        },

Start wt with a quake window and rescale it once:

wt -w _quake
@WamboOSX commented on GitHub (Apr 24, 2024): ## Workaround for Instant Animation Where is a Action to open Windows Terminal itself gloablly: ![image](https://github.com/microsoft/terminal/assets/12181840/41f58af0-4ebf-4522-9ac0-d4b788fb29d5) You can just override quake mode with it. By doing so, you can call quake mode without animation. (quake mode is just a window named _quake) **Bind Terminal to instead of Quake Mode **WIN+`**** Add this to settings json: ``` "actions": [ { "command": { "action": "globalSummon" }, "keys": "win+`" }, ``` Start wt with a quake window and rescale it once: ``` wt -w _quake ```
Author
Owner

@WamboOSX commented on GitHub (Apr 24, 2024):

Alternative: Use normal Terminal with with Quake Mode HotKey

AlwaysOnTop + Focus + Centered:
image

    "actions": [
        {
            "command": {
                "action": "globalSummon"
            },
            "keys": "win+`"
        },
    ],
    "alwaysOnTop": true,
    "initialCols": 160,
    "initialPosition": ",",
    "initialRows": 40,
    "launchMode": "focus",
    "centerOnLaunch": true,
@WamboOSX commented on GitHub (Apr 24, 2024): ### Alternative: Use normal Terminal with with Quake Mode HotKey **AlwaysOnTop + Focus + Centered:** ![image](https://github.com/microsoft/terminal/assets/12181840/f8a6c4aa-759e-4f43-a352-4bed1a57c891) ``` "actions": [ { "command": { "action": "globalSummon" }, "keys": "win+`" }, ], "alwaysOnTop": true, "initialCols": 160, "initialPosition": ",", "initialRows": 40, "launchMode": "focus", "centerOnLaunch": true, ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16545