-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Enable tearing out tabs to create new windows #14935
Merged
Merged
Changes from all commits
Commits
Show all changes
316 commits
Select commit
Hold shift + click to select a range
40fdbc1
Hey this comment was TODOne, 29 TODOs left
zadjii-msft 4db381e
not totally happy with this, but I understand why. 29 TODOs left
zadjii-msft 64257d8
This straight up isn't even used in main anymore, 26 TODOs left
zadjii-msft 3026922
Fix the window name not updating as it changed. Added some notes, so,…
zadjii-msft 84e228f
Start to move window restoration into the Emperor
zadjii-msft dc1ae9a
Starting to move these things to the right places
zadjii-msft 8bb8391
move more window persist code around.
zadjii-msft 0f4c4d8
It persists, but it doesn't restore yet.
zadjii-msft a5a9930
Hey look I brought two windows back into existence!...
zadjii-msft 6e6d14e
We're getting closer to loading up the previous state, but it doesn't…
zadjii-msft 3fb8e8c
Hey this worked!
zadjii-msft 4d5f6d2
cleanup. 18 TODOs remain
zadjii-msft a7379ca
It so SO works
zadjii-msft 0b79e81
Summoning works, except for making new windows, but DANG
zadjii-msft 950ce6c
make pane brushes a member variable, which is good enough
zadjii-msft 055da35
Readd ShouldImmediatelyHandoffToElevated
zadjii-msft b0726c2
Handle Quit actions
zadjii-msft e214624
Re-add support for the notification icon.
zadjii-msft c69f0bc
Quake logic seems to work again.
zadjii-msft 7e91bdb
This actually seems to make the lifetime management worse - we just d…
zadjii-msft 0395dc4
Revert "This actually seems to make the lifetime management worse - w…
zadjii-msft f904e5d
I give up and am moving on to the next TODOs. 8 TODOs remain
zadjii-msft 4548729
Some additional cleanup of the WindowManager code
zadjii-msft 7660937
and with that, we're ready to cleanup for review.
zadjii-msft 0ad5b59
I think it's ready for review
zadjii-msft cfa6108
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft e40575b
let's do it
zadjii-msft dffb416
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft a769933
merges are hard some times
zadjii-msft c065897
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 0ce6309
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 65084c8
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 33685d9
bwahahahahaha
zadjii-msft a4f19a9
spel
zadjii-msft 1ec8c0d
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft 2621519
cleanup for review
zadjii-msft 603a2ce
spel
zadjii-msft a9ac218
runformat
zadjii-msft 82224bc
this was usnused
zadjii-msft d9d4d2e
get the tests to build, at least
zadjii-msft 3f9deca
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft 0f0316f
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 68fad33
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft f080261
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 4eba01f
[valaquenta] Lifetime manage controls
zadjii-msft 7d903de
[silmarillion] Fix moving a tab with panes. Now, the non-first panes …
zadjii-msft 7734600
[valaquenta] Lifetime manage controls
zadjii-msft 2262f55
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 3988a1c
[silmarillion] Fix moving a tab with panes. Now, the non-first panes …
zadjii-msft 83da057
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 2873511
Don't add multiple event handlers for the core
zadjii-msft 855a79d
Add auto_revokers to all TermControl ev handlers, but that wasn't wha…
zadjii-msft 4b22963
notes
zadjii-msft d06ad8b
spel
zadjii-msft 8cac90f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft e5f9880
cleanup to get ready for review
zadjii-msft f10dfac
some reliability when moving tabs that currently have output across t…
zadjii-msft 118bffa
fix the tests
zadjii-msft aa8b0c5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft bc80943
the tests all...pass?
zadjii-msft 667b658
I'm committing everything just in case, but I'm gonna revert and just…
zadjii-msft 2bc578b
Revert "I'm committing everything just in case, but I'm gonna revert …
zadjii-msft 62a4ee0
https://media.tenor.com/knFWHfkiwoUAAAAC/im-fine-hades.gif
zadjii-msft 091f32c
a comment to go with the parent commit
zadjii-msft ecab57f
that was quite silly
zadjii-msft 13257da
0 TODOs remain
zadjii-msft f9caf19
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 9da1192
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 0e0d857
Select the right tab before spliting it; movePane with a single pane …
zadjii-msft 091660e
cleanup and comments before the PR
zadjii-msft 1f8766e
shockingly few spel
zadjii-msft 951ece1
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft c2a2caf
Fixes for a bad merge
zadjii-msft b41ae71
Everything-is-awful.wav
zadjii-msft c6cce0f
Revert "Everything-is-awful.wav"
zadjii-msft 2537342
On drop, ask the sender to send content to us.
zadjii-msft 0cf13d8
Notes, cleanup. 6 TODOs remain
zadjii-msft 6586c4a
Use the correct tab when dragging ; check the PID too
zadjii-msft d67815b
Try to drag/drop to the rigt place in the tab row, only to discover t…
zadjii-msft b5dbae9
OMEGA BODGE
zadjii-msft 9ec9da3
ACTUALLY put the tab in the right place after dropping
zadjii-msft 70450af
0 TODOs left
zadjii-msft 614ec58
spel? I think that's it?
zadjii-msft b1a867d
[silmarillion] Disable the UIA renderer before detaching
zadjii-msft 7649725
[ainulindale] The Terminal shouldn't crash on a WM_SETTINGCHANGE
zadjii-msft 9a47396
[ainulindale] The Terminal shouldn't crash on a WM_SETTINGCHANGE
zadjii-msft d2a5a4a
[silmarillion] Disable the UIA renderer before detaching
zadjii-msft 273f2a8
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft c79f27c
std::vectors are better
zadjii-msft b75fb24
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft cacb822
Dustin wanted a setting to opt-in to isolated mode, and this seems to…
zadjii-msft 6934bc8
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 34bc66f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 257fe33
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 055cdfe
moveTab to a nonexistent window creates that window.
zadjii-msft b9dc8c3
Really, I did it on the first try
zadjii-msft e147209
events aren't really scaled correctly, but it does work
zadjii-msft fa1140d
better scaling
zadjii-msft 01388c9
some todo notes
zadjii-msft 74260ce
some gross dead code
zadjii-msft b589d09
Lots of PR nits
zadjii-msft 0199aba
the last nits, I think
zadjii-msft 5e23a72
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft ada3f42
well that is an underwhelming codeformat commit. Thanks VS
zadjii-msft 5164bff
hey that's a good point carlos
zadjii-msft 4f8d64e
non-client borders accounted for: [X]
zadjii-msft 08acc90
I'm amazing. Say it. I'm amazing
zadjii-msft 17dbc7b
That's it. Ship the PR
zadjii-msft 7e2eb0d
Apply suggestions from code review
zadjii-msft 5c852c3
some smaller nits
zadjii-msft 1e331a0
Merge branch 'dev/migrie/oop/3/ainulindale' of https://github.com/mic…
zadjii-msft 8e2c7a7
some cleanup
zadjii-msft 08f6a53
This is gross but reduces the number of redundant copies of these bru…
zadjii-msft 8803324
spelling is hard
zadjii-msft fda1663
Fix a UiaEngine race that would absolutely block self-host
zadjii-msft b983c69
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft 48aa555
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 2c15f97
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 7591b0f
Fix a UiaEngine race that would absolutely block self-host
zadjii-msft 59d6ff2
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 8c5bfb5
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 3aa083b
sure. It doesn't matter'
zadjii-msft 491fa62
I'm not dead yet
zadjii-msft 796a02e
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 35c7474
[ainulindale] Prevent a race between the Emperor and the window logic…
zadjii-msft 9a9fa43
[ainulindale] Prevent a race between the Emperor and the window logic…
zadjii-msft 11ef8ef
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft d545c4b
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 230d68b
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 0efa5a9
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft b24cf61
some of the more minor cleanup elements
zadjii-msft 3fa1017
one fewer IReference, thank gods
zadjii-msft 5fe3fa5
some cleanup around expanding commands
zadjii-msft b0ca581
.detach so we don't std::explode()
zadjii-msft 74af809
mmmm fresh cut code
zadjii-msft 547b2c9
you never get used either
zadjii-msft 6f6880c
this is more idomatic locking cause it's actually locking
zadjii-msft 1dc2436
weak refs for fun and profit
zadjii-msft 6e4b2e1
Guess what's LOAD BEARING
zadjii-msft 7721813
pr nits
zadjii-msft 6dead99
PR nits
zadjii-msft 434abc2
Remove the need for TerminalPage to know the number of open windows
zadjii-msft 1b59eb9
save this for later, we should only need ot look it up once
zadjii-msft 39a9450
to wit, also make sure that there is a tablayout
zadjii-msft 44b238e
Redo how ownership of WindowProperties works. This is cleaner by a go…
zadjii-msft 073350e
fix the tests too
zadjii-msft ca511c9
this is why I don't use VS
zadjii-msft f70775a
I don't trust you phyllis
zadjii-msft 81140a5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft 339972e
tests build and pass again
zadjii-msft 6d04353
yea we can fold this in
zadjii-msft 1138416
hey let's make sure it still works
zadjii-msft 9957e5c
I think that's the last of the nits
zadjii-msft c8ce5b4
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft 514556f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft e23980c
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 492c894
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 6aec80b
A hotfix for the selfhost build
zadjii-msft 9316f5b
These are pretty minor for what is a pretty minor PR
zadjii-msft b72ef73
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 6107495
minor pr nits
zadjii-msft d886c65
This actually can't be const
zadjii-msft 1cc3100
halt, explain yourself
zadjii-msft e41c835
[an unexpected party] This was a bad merge conflict that resulted in …
zadjii-msft 3bc25ab
*shakes fist* VS
zadjii-msft 0808f94
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft 5b3dc08
last nits, let's do this
zadjii-msft 59b07f1
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft 7142ae8
[ainulindale] fix defterm
zadjii-msft d55bb43
[ainulindale] windows should get activated when they're created
zadjii-msft f60c6d2
[party] tear out of maximized doesn't open maximized
zadjii-msft dea194d
[party] actually DON'T respect the launch mode during tearout
zadjii-msft 11f9957
[ainulindale] Friendship ended with callbacks
zadjii-msft 55ee49b
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft fe2ee91
Merge remote-tracking branch 'origin/dev/migrie/oop/3/ainulindale' in…
zadjii-msft a201c18
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft d607ede
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 0178690
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 1e4cc33
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft 5a420d8
Merge remote-tracking branch 'origin/dev/migrie/oop/3/ainulindale' in…
zadjii-msft 24da827
Merge branch 'main' into dev/migrie/oop/3/valaquenta
zadjii-msft 4950382
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 279bd31
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 8a9d248
some nits
zadjii-msft b02b935
easier nits
zadjii-msft f73ec9a
fix the tests
zadjii-msft 3659744
why not just use uints?
zadjii-msft e334bfb
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 3af4d94
I don't know how to stl
zadjii-msft 56c12ab
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft 87e5283
all my homies love numeric ids
zadjii-msft f2b2c74
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 697b420
notes from PR
zadjii-msft 2984502
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft cf89ce3
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft 9179992
Fix `wt -w _quake` by not throwing when setting the window name
zadjii-msft 3626795
runformat
zadjii-msft e9f2a34
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft 697201e
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft b842ef1
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft f898d39
this was a lot of nits
zadjii-msft 8677169
classic
zadjii-msft 7ecf006
seriously, fixed for real this time
zadjii-msft 8b1b458
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft d20694b
hey they still pass
zadjii-msft 923cb24
wip
lhecker 1591df0
yea that was a typo
zadjii-msft 240ecad
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft 0cc0cb6
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft f24c709
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 70fd182
Smaller PR nits
zadjii-msft b034378
null out _interactivity when a control detaches
zadjii-msft ec0fe79
This is safe now? @lhecker to sanity check
zadjii-msft 6b8c54f
spel
zadjii-msft 56c83d0
yea this'll work - warn if the user tries to get cheeky and put __con…
zadjii-msft 45374e8
wrap these bits up as a method so it's a wee bit more sane
zadjii-msft 31e904a
There's no reason that this should have entirely broken moving panes.…
zadjii-msft a86fd20
Revert "There's no reason that this should have entirely broken movin…
zadjii-msft 56a52d9
This is a real low point. Yea this one hurts
zadjii-msft 0391a26
Revert "Revert "There's no reason that this should have entirely brok…
zadjii-msft 4184a18
this was a crash
zadjii-msft b1043f5
just nits
zadjii-msft ecaca16
sure
zadjii-msft 20628ad
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft ae74565
Merge remote-tracking branch 'origin/dev/migrie/oop/3/quenta-silmaril…
zadjii-msft b4769b9
Merge branch 'dev/migrie/oop/3/akallabeth' of https://github.com/micr…
zadjii-msft 85795b1
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft ef4651a
[alkallabeth] I got distracted and totally botched that, didn't I
zadjii-msft 3152ff9
[silmarillion] Yikes I've really had a hard time with this.
zadjii-msft 3f5a559
[silmarillion] Wow, we didn't need _recentlyDetached at all, did we
zadjii-msft 1f0b958
[silmarillion] Yikes I've really had a hard time with this.
zadjii-msft 08732fe
[silmarillion] Wow, we didn't need _recentlyDetached at all, did we
zadjii-msft a9b591f
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' of https://github…
zadjii-msft 8ce6752
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft 8344c01
[alkallabeth] I got distracted and totally botched that, didn't I
zadjii-msft e02637d
Fix the positioning of the dropped tab
zadjii-msft 1bb89ed
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft 0c6eb35
tiny const ref nits
zadjii-msft bf5d6c3
shuffle some code into helpers
zadjii-msft 07ee7d6
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft 721a0ec
spell?
zadjii-msft 982fa5a
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft d019f32
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft c606439
more dedupes and nits
zadjii-msft a77ea00
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/akal…
zadjii-msft ce35e8a
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft ac5c8fa
last nits
zadjii-msft 53a9b18
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/an-u…
zadjii-msft ced78fb
derp
zadjii-msft 94865b8
cammants
zadjii-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,6 +250,7 @@ namespace winrt::TerminalApp::implementation | |
_tabView.TabDragStarting({ this, &TerminalPage::_onTabDragStarting }); | ||
_tabView.TabStripDragOver({ this, &TerminalPage::_onTabStripDragOver }); | ||
_tabView.TabStripDrop({ this, &TerminalPage::_onTabStripDrop }); | ||
_tabView.TabDroppedOutside({ this, &TerminalPage::_onTabDroppedOutside }); | ||
|
||
_CreateNewTabFlyout(); | ||
|
||
|
@@ -1985,13 +1986,18 @@ namespace winrt::TerminalApp::implementation | |
// and should be expected to be empty after this call. | ||
void TerminalPage::_MoveContent(std::vector<Settings::Model::ActionAndArgs>&& actions, | ||
const winrt::hstring& windowName, | ||
const uint32_t tabIndex) | ||
const uint32_t tabIndex, | ||
const std::optional<til::point>& dragPoint) | ||
{ | ||
const auto winRtActions{ winrt::single_threaded_vector<ActionAndArgs>(std::move(actions)) }; | ||
const auto str{ ActionAndArgs::Serialize(winRtActions) }; | ||
const auto request = winrt::make_self<RequestMoveContentArgs>(windowName, | ||
str, | ||
tabIndex); | ||
if (dragPoint.has_value()) | ||
{ | ||
request->WindowPosition(dragPoint->to_winrt_point()); | ||
} | ||
_RequestMoveContentHandlers(*this, *request); | ||
} | ||
|
||
|
@@ -2026,6 +2032,11 @@ namespace winrt::TerminalApp::implementation | |
return true; | ||
} | ||
|
||
uint32_t TerminalPage::NumberOfTabs() const | ||
{ | ||
return _tabs.Size(); | ||
} | ||
|
||
// Method Description: | ||
// - Called when it is determined that an existing tab or pane should be | ||
// attached to our window. content represents a blob of JSON describing | ||
|
@@ -2036,11 +2047,9 @@ namespace winrt::TerminalApp::implementation | |
// reattach instead of create new content, so this method simply needs to | ||
// parse the JSON and pump it into our action handler. Almost the same as | ||
// doing something like `wt -w 0 nt`. | ||
winrt::fire_and_forget TerminalPage::AttachContent(winrt::hstring content, | ||
winrt::fire_and_forget TerminalPage::AttachContent(IVector<Settings::Model::ActionAndArgs> args, | ||
uint32_t tabIndex) | ||
{ | ||
auto args = ActionAndArgs::Deserialize(content); | ||
|
||
if (args == nullptr || | ||
args.Size() == 0) | ||
{ | ||
|
@@ -2064,18 +2073,6 @@ namespace winrt::TerminalApp::implementation | |
{ | ||
_SelectTab(tabIndex); | ||
} | ||
else | ||
{ | ||
if (firstIsSplitPane) | ||
{ | ||
// Create the equivalent NewTab action. | ||
const auto newAction = Settings::Model::ActionAndArgs{ Settings::Model::ShortcutAction::NewTab, | ||
Settings::Model::NewTabArgs(firstAction.Args() ? | ||
firstAction.Args().try_as<Settings::Model::SplitPaneArgs>().TerminalArgs() : | ||
nullptr) }; | ||
args.SetAt(0, newAction); | ||
} | ||
} | ||
|
||
for (const auto& action : args) | ||
{ | ||
|
@@ -4611,7 +4608,23 @@ namespace winrt::TerminalApp::implementation | |
{ | ||
// First: stash the tab we started dragging. | ||
// We're going to be asked for this. | ||
_stashedDraggedTab = tabImpl; | ||
_stashed.draggedTab = tabImpl; | ||
|
||
// Stash the offset from where we started the drag to the | ||
// tab's origin. We'll use that offset in the future to help | ||
// position the dropped window. | ||
|
||
// First, the position of the pointer, from the CoreWindow | ||
const til::point pointerPosition{ til::math::rounding, CoreWindow::GetForCurrentThread().PointerPosition() }; | ||
// Next, the position of the tab itself: | ||
const til::point tabPosition{ til::math::rounding, eventTab.TransformToVisual(nullptr).TransformPoint({ 0, 0 }) }; | ||
// Now, we need to add the origin of our CoreWindow to the tab | ||
// position. | ||
const auto& coreWindowBounds{ CoreWindow::GetForCurrentThread().Bounds() }; | ||
const til::point windowOrigin{ til::math::rounding, coreWindowBounds.X, coreWindowBounds.Y }; | ||
const auto realTabPosition = windowOrigin + tabPosition; | ||
// Subtract the two to get the offset. | ||
_stashed.dragOffset = til::point{ pointerPosition - realTabPosition }; | ||
|
||
// Into the DataPackage, let's stash our own window ID. | ||
const auto id{ _WindowProperties.WindowId() }; | ||
|
@@ -4630,7 +4643,8 @@ namespace winrt::TerminalApp::implementation | |
// to ask us to send our content to them. | ||
// * We'll get a TabDroppedOutside to indicate that this tab was | ||
// dropped _not_ on a TabView. | ||
// * This we can't handle yet, and is the last point of TODO GH#5000 | ||
// * This will be handled by _onTabDroppedOutside, which will | ||
// raise a MoveContent (to a new window) event. | ||
} | ||
} | ||
|
||
|
@@ -4736,7 +4750,36 @@ namespace winrt::TerminalApp::implementation | |
{ | ||
co_return; | ||
} | ||
if (!_stashedDraggedTab) | ||
if (!_stashed.draggedTab) | ||
{ | ||
co_return; | ||
} | ||
|
||
// must do the work of adding/removing tabs on the UI thread. | ||
auto weakThis{ get_weak() }; | ||
co_await wil::resume_foreground(Dispatcher(), CoreDispatcherPriority::Normal); | ||
if (const auto& page{ weakThis.get() }) | ||
{ | ||
// `this` is safe to use in here. | ||
|
||
_sendDraggedTabToWindow(winrt::hstring{ fmt::format(L"{}", args.TargetWindow()) }, | ||
args.TabIndex(), | ||
std::nullopt); | ||
} | ||
} | ||
|
||
winrt::fire_and_forget TerminalPage::_onTabDroppedOutside(winrt::IInspectable sender, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you remind me why we have to stash for this? this seems totally selfcontained There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. apart from the position, but that's not the whole tab! |
||
winrt::MUX::Controls::TabViewTabDroppedOutsideEventArgs e) | ||
{ | ||
// Get the current pointer point from the CoreWindow | ||
const auto& pointerPoint{ CoreWindow::GetForCurrentThread().PointerPosition() }; | ||
|
||
// This is called when a tab FROM OUR WINDOW was dropped outside the | ||
// tabview. We already know which tab was being dragged. We'll just | ||
// invoke a moveTab action with the target window being -1. That will | ||
// force the creation of a new window. | ||
|
||
if (!_stashed.draggedTab) | ||
{ | ||
co_return; | ||
} | ||
|
@@ -4747,12 +4790,29 @@ namespace winrt::TerminalApp::implementation | |
if (const auto& page{ weakThis.get() }) | ||
{ | ||
// `this` is safe to use in here. | ||
auto startupActions = _stashedDraggedTab->BuildStartupActions(true); | ||
_DetachTabFromWindow(_stashedDraggedTab); | ||
_MoveContent(std::move(startupActions), winrt::hstring{ fmt::format(L"{}", args.TargetWindow()) }, args.TabIndex()); | ||
// _RemoveTab will make sure to null out the _stashedDraggedTab | ||
_RemoveTab(*_stashedDraggedTab); | ||
|
||
// We need to convert the pointer point to a point that we can use | ||
// to position the new window. We'll use the drag offset from before | ||
// so that the tab in the new window is positioned so that it's | ||
// basically still directly under the cursor. | ||
|
||
// -1 is the magic number for "new window" | ||
// 0 as the tab index, because we don't care. It's making a new window. It'll be the only tab. | ||
const til::point adjusted = til::point{ til::math::rounding, pointerPoint } - _stashed.dragOffset; | ||
_sendDraggedTabToWindow(winrt::hstring{ L"-1" }, 0, adjusted); | ||
} | ||
} | ||
|
||
void TerminalPage::_sendDraggedTabToWindow(const winrt::hstring& windowId, | ||
const uint32_t tabIndex, | ||
std::optional<til::point> dragPoint) | ||
{ | ||
auto startupActions = _stashed.draggedTab->BuildStartupActions(true); | ||
_DetachTabFromWindow(_stashed.draggedTab); | ||
|
||
_MoveContent(std::move(startupActions), windowId, tabIndex, dragPoint); | ||
// _RemoveTab will make sure to null out the _stashed.draggedTab | ||
_RemoveTab(*_stashed.draggedTab); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious: this wouldn't occur when you try and drag the last tab in a window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah cause the originating terminal tab doesn't actually close until the drag is completed. Once the drag is accepted, the original window detaches from the old content and closes the tab, and at that point the new window already has a reference to the content it wants to open.