Add property to control dropdown speed of global summon#9977
Add property to control dropdown speed of global summon#9977zadjii-msft merged 112 commits intomainfrom
Conversation
…ompile a String[]
…!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
…safely tear it down. It _seems_ like it.
…ndow should be. It just always says 0 for now, but in the future it could actually give us useful info.
…/quake-toggleVisibility
…quake-dropdown-final
04752e5 to
1032dbb
Compare
carlos-zamora
left a comment
There was a problem hiding this comment.
You know what, the two "issues" I had are minor and can just be fixed in post if we even want it. At this point, you've implemented everything according to the agreed upon spec, and any small design changes can be done before/during v1.9. Good work :)
|
@zadjii-msft Is it time to update the docs/schema now? haha |
DHowett
left a comment
There was a problem hiding this comment.
Signing off with changes requested because you have to do a conflict resolution anyway. The WINDOWPLACEMENT one can cause really weird behavior in the future depending on how the compiler is feeling.
| WINRT_PROPERTY(winrt::hstring, Name, L""); | ||
| WINRT_PROPERTY(Model::DesktopBehavior, Desktop, Model::DesktopBehavior::ToCurrent); | ||
| WINRT_PROPERTY(bool, ToggleVisibility, true); | ||
| WINRT_PROPERTY(uint32_t, DropdownDuration, 0); |
| const Remoting::SummonWindowBehavior& args) | ||
| { | ||
| _window->SummonWindow(args.ToggleVisibility()); | ||
| _window->SummonWindow(args.ToggleVisibility(), args.DropdownDuration()); |
There was a problem hiding this comment.
Please do not make IslandWindow more specific to Terminal. I'd prefer it to be less specific to Terminal IMO 😄
…10092) ####⚠️ this pr targets #9977 ## Summary of the Pull Request This adds support for part of the `monitor` property for `globalSummon`. It also goes a little off-spec: ```json "monitor": "any"|"toCurrent"|"toMouse" ``` * `monitor`: This controls the monitor that the window will be summoned from/to - `"any"`: Summon the MRU window, regardless of which monitor it's currently on. - `"toCurrent"`/omitted: (_default_): Summon the MRU window **TO** the monitor with the current **foreground** window. - [**NEW**] `"toMouse"`: Summon the MRU window **TO** the monitor where the **mouse** cursor is. When I was playing with this, It felt like `toMouse` was always what I wanted, not `toCurrent`. We can always just comment that out if we think that's contentious - I'm aware I didn't originally spec that. ## References * Original thread: #653 * Spec: #9274 * megathread: #8888 ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/projects/5#card-60325291 * [x] I work here * [ ] Tests added/passed * [ ] Requires documentation to be updated 😢 ## Detailed Description of the Pull Request / Additional comments I made `toMouse` the default because it felt better. fite-me.jpg ## Validation Steps Performed my ever evolving blob: ```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+2", "command": { "action": "globalSummon", "monitor": "any" } }, // { "keys": "ctrl+3", "command": { "action": "globalSummon", "desktop": "onCurrent" } }, { "keys": "ctrl+3", "command": { "action": "globalSummon", "monitor": "toMouse" } }, // { "keys": "ctrl+4", "command": { "action": "globalSummon", "desktop": "any" } }, { "keys": "ctrl+4", "command": { "action": "globalSummon", "monitor": "toMouse", "dropdownDuration": 500 } }, { "keys": "ctrl+5", "command": { "action": "globalSummon", "dropdownDuration": 500 } }, ```
|
🎉 Handy links: |
|
🎉 Handy links: |
Summary of the Pull Request
Adds the
dropdownDurationproperty toglobalSummon. 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.dropdownDurationspecifies the duration in milliseconds. This defaults to0forglobalSummon, and defaults to200forquakeMode. 200 was picked because, according toAnimateWindow: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:
AnimateWindow, which would show the window borders for the duration ofthe animation, and occasionally just plain not work. Additionally, for
AnimateWindowto work, the window much not be visible, so we'd need tofirst restore the window, then hide it, then animate it. That would flash
the taskbar.
SetWindowRgnon the root HWND, which caused the xaml content to shift tothe left, and caused a black bar to be drawn on the right of the window.
Presumably,
SetWindowRgnandDwmExtendFrameIntoClientAreadid not playwell with each other.
SetWindowPos(..., SWP_NOSENDCHANGING), which worked the absolute best forlonger animations, and is the closest to the actual implementation of
AnimateWindow. This would resize the ROOT window, without sending resizesto 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.
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" } },