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

Quake Mode reveal animation tears/flickers #12293

Open
mauve opened this issue Jan 30, 2022 · 7 comments · May be fixed by #15659
Open

Quake Mode reveal animation tears/flickers #12293

mauve opened this issue Jan 30, 2022 · 7 comments · May be fixed by #15659
Labels
Area-Windowing Window frame, quake mode, tearout good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@mauve
Copy link
Contributor

mauve commented 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.

quake-mode-tearing.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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jan 30, 2022
@zadjii-msft
Copy link
Member

zadjii-msft commented 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.

@zadjii-msft zadjii-msft added Area-Windowing Window frame, quake mode, tearout Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Jan 31, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Jan 31, 2022
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 1, 2022
@zadjii-msft zadjii-msft removed the Needs-Tag-Fix Doesn't match tag requirements label May 3, 2022
@zadjii-msft zadjii-msft added the good first issue This is a fix that might be easier for someone to do as a first contribution label Mar 1, 2023
@zadjii-msft zadjii-msft moved this to Walkthrough in issue in Terminal Walkthroughs Mar 1, 2023
@jihuayu
Copy link

jihuayu commented 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.

@zadjii-msft
Copy link
Member

zadjii-msft commented 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.

jihuayu added a commit to jihuayu/terminal that referenced this issue Jul 6, 2023
@jihuayu jihuayu linked a pull request Jul 6, 2023 that will close this issue
6 tasks
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Jul 6, 2023
@jihuayu
Copy link

jihuayu commented Jul 6, 2023

@zadjii-msft I have sent the PR #15659
Thanks for you help, but I always can't hide the border

@biesigrr
Copy link

biesigrr commented 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

@WamboOSX
Copy link

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
Copy link

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
Status: Walkthrough in issue
Development

Successfully merging a pull request may close this issue.

6 participants