[PR #9977] [MERGED] Add property to control dropdown speed of global summon #27842

Open
opened 2026-01-31 09:24:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9977
Author: @zadjii-msft
Created: 4/28/2021
Status: Merged
Merged: 5/17/2021
Merged by: @zadjii-msft

Base: mainHead: dev/migrie/f/quake-dropdown-final


📝 Commits (10+)

  • 3bef7bb Get all the projects created and hooked up to the sln
  • 1f52d35 Yank all the M/P files, this builds?!
  • 5a9cdc8 Shockingly, this works, it works elevated, and it works unpackaged
  • 36539cf This won't work, but I'm committing this becaus I finally got it to compile a String[]
  • 27ace16 whoop, we pass the commandline from the peasant, to the monarch, and then back!
  • 9a41647 HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • 5cabcfb add a note to future me
  • 03bfc6e This works as a unittest, but not a local test. That's batty
  • 590b9ff this macro makes me feel dirty
  • 0579b24 LocalTests_Remoting -> UnitTests_Remoting

📊 Changes

8 files changed (+174 additions, -28 deletions)

View changed files

📝 .github/actions/spelling/allow/apis.txt (+1 -0)
📝 src/cascadia/Remoting/Peasant.idl (+1 -0)
📝 src/cascadia/Remoting/SummonWindowBehavior.h (+2 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.h (+8 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.idl (+1 -0)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+3 -2)
📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+152 -23)
📝 src/cascadia/WindowsTerminal/IslandWindow.h (+6 -3)

📄 Description

Summary of the Pull Request

Adds the dropdownDuration property to globalSummon. This controls how fast the window appears on the screen when summoned from minimized. It similarly controls the speed for sliding out of view when the window is dismissed with "toggleVisibility": true.

dropdownDuration specifies the duration in milliseconds. This defaults to 0 for globalSummon, and defaults to 200 for quakeMode. 200 was picked because, according to AnimateWindow:

Typically, an animation takes 200 milliseconds to play.

Do note that you won't be able to interact with the window during the animation! Input sent during the dropdown will arrive at the end of the animation, but input sent during the slide-up won't. Avoid setting this to large values!

The gifs are in Teams.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

I had the following previously in the doc comments, but it feels better in the PR body:

  • This was chosen because it was easier to implement and generally nicer than:
    • AnimateWindow, which would show the window borders for the duration of
      the animation, and occasionally just plain not work. Additionally, for
      AnimateWindow to work, the window much not be visible, so we'd need to
      first restore the window, then hide it, then animate it. That would flash
      the taskbar.
    • SetWindowRgn on the root HWND, which caused the xaml content to shift to
      the left, and caused a black bar to be drawn on the right of the window.
      Presumably, SetWindowRgn and DwmExtendFrameIntoClientArea did not play
      well with each other.
    • SetWindowPos(..., SWP_NOSENDCHANGING), which worked the absolute best for
      longer animations, and is the closest to the actual implementation of
      AnimateWindow. This would resize the ROOT window, without sending resizes
      to the XAML island, allowing the content to not reflow. but for a
      duration of 200ms, would only ever display ~2 frames. That's basically
      not even animation anymore, it's now just an "appear". Since that's how
      long the default animation is, if felt silly to have it basically not
      work by default.
  • If a future reader would like to implement this better, they should feel
    free to
    , and not mistake my notes here as expertise. These are research
    notes into the dark and terrible land that is Win32 programming. I'm no expert.

Validation Steps Performed

This is the blob of json I'm testing with these days:

        { "keys": "ctrl+`", "command": { "action": "quakeMode" } },
        { "keys": "ctrl+1", "command": { "action": "globalSummon" } },
        // { "keys": "ctrl+2", "command": { "action": "globalSummon", "desktop": "toCurrent" } },
        // { "keys": "ctrl+2", "command": { "action": "globalSummon", "toggleVisibility": false } },
        { "keys": "ctrl+2", "command": { "action": "globalSummon", "dropdownDuration": 2000 } },
        { "keys": "ctrl+3", "command": { "action": "globalSummon", "desktop": "onCurrent" } },
        { "keys": "ctrl+4", "command": { "action": "globalSummon", "desktop": "any" } },
  • ctrl+` will summon the quake window with a quick animation
  • ctrl+2 will summon the window with a s l o w animation

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9977 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 4/28/2021 **Status:** ✅ Merged **Merged:** 5/17/2021 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `dev/migrie/f/quake-dropdown-final` --- ### 📝 Commits (10+) - [`3bef7bb`](https://github.com/microsoft/terminal/commit/3bef7bbb389f7b048983bac8dda32af0e662a9fb) Get all the projects created and hooked up to the sln - [`1f52d35`](https://github.com/microsoft/terminal/commit/1f52d3583390e300b8253d605b5f79adac5e921b) Yank all the M/P files, this builds?! - [`5a9cdc8`](https://github.com/microsoft/terminal/commit/5a9cdc8b0bfda790a70368d8381559628eba554f) Shockingly, this works, it works elevated, and it works unpackaged - [`36539cf`](https://github.com/microsoft/terminal/commit/36539cfa47d1b5f3a3b0bf44f7bdcb057aa08e95) This won't work, but I'm committing this becaus I finally got it to compile a String[] - [`27ace16`](https://github.com/microsoft/terminal/commit/27ace166529367171fc81cef12aa4812e6ff8e13) whoop, we pass the commandline from the peasant, to the monarch, and then back! - [`9a41647`](https://github.com/microsoft/terminal/commit/9a41647ffe00d973f11478fb937221239d6ac81a) HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - [`5cabcfb`](https://github.com/microsoft/terminal/commit/5cabcfb45229f686d424c6d5a2fdfca7dd446639) add a note to future me - [`03bfc6e`](https://github.com/microsoft/terminal/commit/03bfc6e8a93c901ef00b34310c4e1c313019e720) This works as a unittest, but not a local test. That's batty - [`590b9ff`](https://github.com/microsoft/terminal/commit/590b9ff0c73487720a110213c4b19a2f4a00be8e) this macro makes me feel dirty - [`0579b24`](https://github.com/microsoft/terminal/commit/0579b2417bcdd74814ea05d7eb64723542584764) LocalTests_Remoting -> UnitTests_Remoting ### 📊 Changes **8 files changed** (+174 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/apis.txt` (+1 -0) 📝 `src/cascadia/Remoting/Peasant.idl` (+1 -0) 📝 `src/cascadia/Remoting/SummonWindowBehavior.h` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.h` (+8 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.idl` (+1 -0) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+3 -2) 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+152 -23) 📝 `src/cascadia/WindowsTerminal/IslandWindow.h` (+6 -3) </details> ### 📄 Description ## Summary of the Pull Request Adds the `dropdownDuration` property to `globalSummon`. This controls how fast the window appears on the screen when summoned from minimized. It similarly controls the speed for sliding out of view when the window is dismissed with `"toggleVisibility": true`. `dropdownDuration` specifies the duration in **milliseconds**. This defaults to `0` for `globalSummon`, and defaults to `200` for `quakeMode`. 200 was picked because, according to [`AnimateWindow`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-animatewindow): > Typically, an animation takes 200 milliseconds to play. Do note that you won't be able to interact with the window during the animation! Input sent during the dropdown will arrive at the end of the animation, but input sent during the slide-up _won't_. Avoid setting this to large values! The gifs are in Teams. ## References * Original thread: #653 * Spec: #9274 * megathread: #8888 ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/projects/5#card-59030824 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments I had the following previously in the doc comments, but it feels better in the PR body: - This was chosen because it was easier to implement and generally nicer than: * `AnimateWindow`, which would show the window borders for the duration of the animation, and occasionally just plain not work. Additionally, for `AnimateWindow` to work, the window much not be visible, so we'd need to first restore the window, then hide it, then animate it. That would flash the taskbar. * `SetWindowRgn` on the root HWND, which caused the xaml content to shift to the left, and caused a black bar to be drawn on the right of the window. Presumably, `SetWindowRgn` and `DwmExtendFrameIntoClientArea` did not play well with each other. * `SetWindowPos(..., SWP_NOSENDCHANGING)`, which worked the absolute best for longer animations, and is the closest to the actual implementation of `AnimateWindow`. This would resize the ROOT window, without sending resizes to the XAML island, allowing the content to _not_ reflow. but for a duration of 200ms, would only ever display ~2 frames. That's basically not even animation anymore, it's now just an "appear". Since that's how long the default animation is, if felt silly to have it basically not work by default. - If a future reader would like to implement this better, **they should feel free to**, and not mistake my notes here as expertise. These are research notes into the dark and terrible land that is Win32 programming. I'm no expert. ## Validation Steps Performed This is the blob of json I'm testing with these days: ```jsonc { "keys": "ctrl+`", "command": { "action": "quakeMode" } }, { "keys": "ctrl+1", "command": { "action": "globalSummon" } }, // { "keys": "ctrl+2", "command": { "action": "globalSummon", "desktop": "toCurrent" } }, // { "keys": "ctrl+2", "command": { "action": "globalSummon", "toggleVisibility": false } }, { "keys": "ctrl+2", "command": { "action": "globalSummon", "dropdownDuration": 2000 } }, { "keys": "ctrl+3", "command": { "action": "globalSummon", "desktop": "onCurrent" } }, { "keys": "ctrl+4", "command": { "action": "globalSummon", "desktop": "any" } }, ``` * <kbd>ctrl+\`</kbd> will summon the quake window with a _quick_ animation * <kbd>ctrl+2</kbd> will summon the window with a s l o w animation --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:24:36 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27842