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

Enable tearing out tabs to create new windows #14935

Merged
merged 316 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from 250 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 Feb 8, 2023
4db381e
not totally happy with this, but I understand why. 29 TODOs left
zadjii-msft Feb 8, 2023
64257d8
This straight up isn't even used in main anymore, 26 TODOs left
zadjii-msft Feb 8, 2023
3026922
Fix the window name not updating as it changed. Added some notes, so,…
zadjii-msft Feb 8, 2023
84e228f
Start to move window restoration into the Emperor
zadjii-msft Feb 8, 2023
dc1ae9a
Starting to move these things to the right places
zadjii-msft Feb 8, 2023
8bb8391
move more window persist code around.
zadjii-msft Feb 8, 2023
0f4c4d8
It persists, but it doesn't restore yet.
zadjii-msft Feb 8, 2023
a5a9930
Hey look I brought two windows back into existence!...
zadjii-msft Feb 8, 2023
6e6d14e
We're getting closer to loading up the previous state, but it doesn't…
zadjii-msft Feb 8, 2023
3fb8e8c
Hey this worked!
zadjii-msft Feb 8, 2023
4d5f6d2
cleanup. 18 TODOs remain
zadjii-msft Feb 8, 2023
a7379ca
It so SO works
zadjii-msft Feb 9, 2023
0b79e81
Summoning works, except for making new windows, but DANG
zadjii-msft Feb 9, 2023
950ce6c
make pane brushes a member variable, which is good enough
zadjii-msft Feb 7, 2023
055da35
Readd ShouldImmediatelyHandoffToElevated
zadjii-msft Feb 9, 2023
b0726c2
Handle Quit actions
zadjii-msft Feb 9, 2023
e214624
Re-add support for the notification icon.
zadjii-msft Feb 9, 2023
c69f0bc
Quake logic seems to work again.
zadjii-msft Feb 9, 2023
7e91bdb
This actually seems to make the lifetime management worse - we just d…
zadjii-msft Feb 9, 2023
0395dc4
Revert "This actually seems to make the lifetime management worse - w…
zadjii-msft Feb 9, 2023
f904e5d
I give up and am moving on to the next TODOs. 8 TODOs remain
zadjii-msft Feb 10, 2023
4548729
Some additional cleanup of the WindowManager code
zadjii-msft Feb 10, 2023
7660937
and with that, we're ready to cleanup for review.
zadjii-msft Feb 10, 2023
0ad5b59
I think it's ready for review
zadjii-msft Feb 10, 2023
cfa6108
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Feb 10, 2023
e40575b
let's do it
zadjii-msft Feb 10, 2023
dffb416
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 10, 2023
a769933
merges are hard some times
zadjii-msft Feb 10, 2023
c065897
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Feb 11, 2023
0ce6309
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 13, 2023
65084c8
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Feb 13, 2023
33685d9
bwahahahahaha
zadjii-msft Feb 13, 2023
a4f19a9
spel
zadjii-msft Feb 13, 2023
1ec8c0d
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 13, 2023
2621519
cleanup for review
zadjii-msft Feb 13, 2023
603a2ce
spel
zadjii-msft Feb 13, 2023
a9ac218
runformat
zadjii-msft Feb 13, 2023
82224bc
this was usnused
zadjii-msft Feb 13, 2023
d9d4d2e
get the tests to build, at least
zadjii-msft Feb 13, 2023
3f9deca
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 13, 2023
0f0316f
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Feb 13, 2023
68fad33
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 13, 2023
f080261
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Feb 13, 2023
4eba01f
[valaquenta] Lifetime manage controls
zadjii-msft Feb 13, 2023
7d903de
[silmarillion] Fix moving a tab with panes. Now, the non-first panes …
zadjii-msft Feb 13, 2023
7734600
[valaquenta] Lifetime manage controls
zadjii-msft Feb 13, 2023
2262f55
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 14, 2023
3988a1c
[silmarillion] Fix moving a tab with panes. Now, the non-first panes …
zadjii-msft Feb 13, 2023
83da057
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Feb 14, 2023
2873511
Don't add multiple event handlers for the core
zadjii-msft Feb 7, 2023
855a79d
Add auto_revokers to all TermControl ev handlers, but that wasn't wha…
zadjii-msft Feb 7, 2023
4b22963
notes
zadjii-msft Feb 14, 2023
d06ad8b
spel
zadjii-msft Feb 14, 2023
8cac90f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 14, 2023
e5f9880
cleanup to get ready for review
zadjii-msft Feb 14, 2023
f10dfac
some reliability when moving tabs that currently have output across t…
zadjii-msft Feb 14, 2023
118bffa
fix the tests
zadjii-msft Feb 14, 2023
aa8b0c5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 14, 2023
bc80943
the tests all...pass?
zadjii-msft Feb 14, 2023
667b658
I'm committing everything just in case, but I'm gonna revert and just…
zadjii-msft Feb 15, 2023
2bc578b
Revert "I'm committing everything just in case, but I'm gonna revert …
zadjii-msft Feb 15, 2023
62a4ee0
https://media.tenor.com/knFWHfkiwoUAAAAC/im-fine-hades.gif
zadjii-msft Feb 15, 2023
091f32c
a comment to go with the parent commit
zadjii-msft Feb 15, 2023
ecab57f
that was quite silly
zadjii-msft Feb 16, 2023
13257da
0 TODOs remain
zadjii-msft Feb 16, 2023
f9caf19
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Feb 16, 2023
9da1192
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 16, 2023
0e0d857
Select the right tab before spliting it; movePane with a single pane …
zadjii-msft Feb 17, 2023
091660e
cleanup and comments before the PR
zadjii-msft Feb 17, 2023
1f8766e
shockingly few spel
zadjii-msft Feb 17, 2023
951ece1
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Feb 17, 2023
c2a2caf
Fixes for a bad merge
zadjii-msft Feb 21, 2023
b41ae71
Everything-is-awful.wav
zadjii-msft Feb 21, 2023
c6cce0f
Revert "Everything-is-awful.wav"
zadjii-msft Feb 21, 2023
2537342
On drop, ask the sender to send content to us.
zadjii-msft Feb 22, 2023
0cf13d8
Notes, cleanup. 6 TODOs remain
zadjii-msft Feb 22, 2023
6586c4a
Use the correct tab when dragging ; check the PID too
zadjii-msft Feb 22, 2023
d67815b
Try to drag/drop to the rigt place in the tab row, only to discover t…
zadjii-msft Feb 23, 2023
b5dbae9
OMEGA BODGE
zadjii-msft Feb 23, 2023
9ec9da3
ACTUALLY put the tab in the right place after dropping
zadjii-msft Feb 23, 2023
70450af
0 TODOs left
zadjii-msft Feb 23, 2023
614ec58
spel? I think that's it?
zadjii-msft Feb 23, 2023
b1a867d
[silmarillion] Disable the UIA renderer before detaching
zadjii-msft Feb 23, 2023
7649725
[ainulindale] The Terminal shouldn't crash on a WM_SETTINGCHANGE
zadjii-msft Feb 23, 2023
9a47396
[ainulindale] The Terminal shouldn't crash on a WM_SETTINGCHANGE
zadjii-msft Feb 23, 2023
d2a5a4a
[silmarillion] Disable the UIA renderer before detaching
zadjii-msft Feb 23, 2023
273f2a8
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Feb 23, 2023
c79f27c
std::vectors are better
zadjii-msft Feb 27, 2023
b75fb24
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 27, 2023
cacb822
Dustin wanted a setting to opt-in to isolated mode, and this seems to…
zadjii-msft Feb 27, 2023
6934bc8
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Feb 27, 2023
34bc66f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Feb 27, 2023
257fe33
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Feb 27, 2023
055cdfe
moveTab to a nonexistent window creates that window.
zadjii-msft Feb 27, 2023
b9dc8c3
Really, I did it on the first try
zadjii-msft Feb 27, 2023
e147209
events aren't really scaled correctly, but it does work
zadjii-msft Feb 27, 2023
fa1140d
better scaling
zadjii-msft Feb 27, 2023
01388c9
some todo notes
zadjii-msft Feb 28, 2023
74260ce
some gross dead code
zadjii-msft Feb 28, 2023
b589d09
Lots of PR nits
zadjii-msft Feb 28, 2023
0199aba
the last nits, I think
zadjii-msft Feb 28, 2023
5e23a72
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 28, 2023
ada3f42
well that is an underwhelming codeformat commit. Thanks VS
zadjii-msft Feb 28, 2023
5164bff
hey that's a good point carlos
zadjii-msft Feb 28, 2023
4f8d64e
non-client borders accounted for: [X]
zadjii-msft Feb 28, 2023
08acc90
I'm amazing. Say it. I'm amazing
zadjii-msft Feb 28, 2023
17dbc7b
That's it. Ship the PR
zadjii-msft Feb 28, 2023
7e2eb0d
Apply suggestions from code review
zadjii-msft Mar 2, 2023
5c852c3
some smaller nits
zadjii-msft Mar 2, 2023
1e331a0
Merge branch 'dev/migrie/oop/3/ainulindale' of https://github.com/mic…
zadjii-msft Mar 2, 2023
8e2c7a7
some cleanup
zadjii-msft Mar 2, 2023
08f6a53
This is gross but reduces the number of redundant copies of these bru…
zadjii-msft Mar 2, 2023
8803324
spelling is hard
zadjii-msft Mar 2, 2023
fda1663
Fix a UiaEngine race that would absolutely block self-host
zadjii-msft Mar 2, 2023
b983c69
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 2, 2023
48aa555
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Mar 2, 2023
2c15f97
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 2, 2023
7591b0f
Fix a UiaEngine race that would absolutely block self-host
zadjii-msft Mar 2, 2023
59d6ff2
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 2, 2023
8c5bfb5
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 2, 2023
3aa083b
sure. It doesn't matter'
zadjii-msft Mar 2, 2023
491fa62
I'm not dead yet
zadjii-msft Mar 2, 2023
796a02e
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 2, 2023
35c7474
[ainulindale] Prevent a race between the Emperor and the window logic…
zadjii-msft Mar 6, 2023
9a9fa43
[ainulindale] Prevent a race between the Emperor and the window logic…
zadjii-msft Mar 6, 2023
11ef8ef
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Mar 6, 2023
d545c4b
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 6, 2023
230d68b
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 6, 2023
0efa5a9
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 6, 2023
b24cf61
some of the more minor cleanup elements
zadjii-msft Mar 7, 2023
3fa1017
one fewer IReference, thank gods
zadjii-msft Mar 7, 2023
5fe3fa5
some cleanup around expanding commands
zadjii-msft Mar 8, 2023
b0ca581
.detach so we don't std::explode()
zadjii-msft Mar 8, 2023
74af809
mmmm fresh cut code
zadjii-msft Mar 8, 2023
547b2c9
you never get used either
zadjii-msft Mar 8, 2023
6f6880c
this is more idomatic locking cause it's actually locking
zadjii-msft Mar 8, 2023
1dc2436
weak refs for fun and profit
zadjii-msft Mar 8, 2023
6e4b2e1
Guess what's LOAD BEARING
zadjii-msft Mar 9, 2023
7721813
pr nits
zadjii-msft Mar 9, 2023
6dead99
PR nits
zadjii-msft Mar 9, 2023
434abc2
Remove the need for TerminalPage to know the number of open windows
zadjii-msft Mar 9, 2023
1b59eb9
save this for later, we should only need ot look it up once
zadjii-msft Mar 9, 2023
39a9450
to wit, also make sure that there is a tablayout
zadjii-msft Mar 9, 2023
44b238e
Redo how ownership of WindowProperties works. This is cleaner by a go…
zadjii-msft Mar 9, 2023
073350e
fix the tests too
zadjii-msft Mar 10, 2023
ca511c9
this is why I don't use VS
zadjii-msft Mar 10, 2023
f70775a
I don't trust you phyllis
zadjii-msft Mar 10, 2023
81140a5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 10, 2023
339972e
tests build and pass again
zadjii-msft Mar 10, 2023
6d04353
yea we can fold this in
zadjii-msft Mar 10, 2023
1138416
hey let's make sure it still works
zadjii-msft Mar 10, 2023
9957e5c
I think that's the last of the nits
zadjii-msft Mar 10, 2023
c8ce5b4
Merge branch 'dev/migrie/oop/3/ainulindale' into dev/migrie/oop/3/val…
zadjii-msft Mar 10, 2023
514556f
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 10, 2023
e23980c
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 10, 2023
492c894
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 10, 2023
6aec80b
A hotfix for the selfhost build
zadjii-msft Mar 13, 2023
9316f5b
These are pretty minor for what is a pretty minor PR
zadjii-msft Mar 13, 2023
b72ef73
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 13, 2023
6107495
minor pr nits
zadjii-msft Mar 13, 2023
d886c65
This actually can't be const
zadjii-msft Mar 13, 2023
1cc3100
halt, explain yourself
zadjii-msft Mar 13, 2023
e41c835
[an unexpected party] This was a bad merge conflict that resulted in …
zadjii-msft Mar 14, 2023
3bc25ab
*shakes fist* VS
zadjii-msft Mar 14, 2023
0808f94
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Mar 17, 2023
5b3dc08
last nits, let's do this
zadjii-msft Mar 17, 2023
59b07f1
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 17, 2023
7142ae8
[ainulindale] fix defterm
zadjii-msft Mar 16, 2023
d55bb43
[ainulindale] windows should get activated when they're created
zadjii-msft Mar 16, 2023
f60c6d2
[party] tear out of maximized doesn't open maximized
zadjii-msft Mar 16, 2023
dea194d
[party] actually DON'T respect the launch mode during tearout
zadjii-msft Mar 17, 2023
11f9957
[ainulindale] Friendship ended with callbacks
zadjii-msft Mar 17, 2023
55ee49b
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft Mar 17, 2023
fe2ee91
Merge remote-tracking branch 'origin/dev/migrie/oop/3/ainulindale' in…
zadjii-msft Mar 17, 2023
a201c18
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 17, 2023
d607ede
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 17, 2023
0178690
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 17, 2023
1e4cc33
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft Mar 17, 2023
5a420d8
Merge remote-tracking branch 'origin/dev/migrie/oop/3/ainulindale' in…
zadjii-msft Mar 20, 2023
24da827
Merge branch 'main' into dev/migrie/oop/3/valaquenta
zadjii-msft Mar 20, 2023
4950382
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 20, 2023
279bd31
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 20, 2023
8a9d248
some nits
zadjii-msft Mar 20, 2023
b02b935
easier nits
zadjii-msft Mar 21, 2023
f73ec9a
fix the tests
zadjii-msft Mar 21, 2023
3659744
why not just use uints?
zadjii-msft Mar 21, 2023
e334bfb
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 21, 2023
3af4d94
I don't know how to stl
zadjii-msft Mar 21, 2023
56c12ab
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 21, 2023
87e5283
all my homies love numeric ids
zadjii-msft Mar 21, 2023
f2b2c74
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 22, 2023
697b420
notes from PR
zadjii-msft Mar 22, 2023
2984502
Merge branch 'dev/migrie/oop/3/valaquenta' into dev/migrie/oop/3/quen…
zadjii-msft Mar 22, 2023
cf89ce3
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft Mar 22, 2023
9179992
Fix `wt -w _quake` by not throwing when setting the window name
zadjii-msft Mar 22, 2023
3626795
runformat
zadjii-msft Mar 22, 2023
e9f2a34
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft Mar 23, 2023
697201e
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 23, 2023
b842ef1
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 23, 2023
f898d39
this was a lot of nits
zadjii-msft Mar 23, 2023
8677169
classic
zadjii-msft Mar 23, 2023
7ecf006
seriously, fixed for real this time
zadjii-msft Mar 23, 2023
8b1b458
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 23, 2023
d20694b
hey they still pass
zadjii-msft Mar 23, 2023
923cb24
wip
lhecker Mar 24, 2023
1591df0
yea that was a typo
zadjii-msft Mar 24, 2023
240ecad
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft Mar 24, 2023
0cc0cb6
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 24, 2023
f24c709
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 24, 2023
70fd182
Smaller PR nits
zadjii-msft Mar 27, 2023
b034378
null out _interactivity when a control detaches
zadjii-msft Mar 28, 2023
ec0fe79
This is safe now? @lhecker to sanity check
zadjii-msft Mar 28, 2023
6b8c54f
spel
zadjii-msft Mar 28, 2023
56c83d0
yea this'll work - warn if the user tries to get cheeky and put __con…
zadjii-msft Mar 28, 2023
45374e8
wrap these bits up as a method so it's a wee bit more sane
zadjii-msft Mar 28, 2023
31e904a
There's no reason that this should have entirely broken moving panes.…
zadjii-msft Mar 28, 2023
a86fd20
Revert "There's no reason that this should have entirely broken movin…
zadjii-msft Mar 28, 2023
56a52d9
This is a real low point. Yea this one hurts
zadjii-msft Mar 28, 2023
0391a26
Revert "Revert "There's no reason that this should have entirely brok…
zadjii-msft Mar 28, 2023
4184a18
this was a crash
zadjii-msft Mar 28, 2023
b1043f5
just nits
zadjii-msft Mar 28, 2023
ecaca16
sure
zadjii-msft Mar 28, 2023
20628ad
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 28, 2023
ae74565
Merge remote-tracking branch 'origin/dev/migrie/oop/3/quenta-silmaril…
zadjii-msft Mar 29, 2023
b4769b9
Merge branch 'dev/migrie/oop/3/akallabeth' of https://github.com/micr…
zadjii-msft Mar 29, 2023
85795b1
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 29, 2023
ef4651a
[alkallabeth] I got distracted and totally botched that, didn't I
zadjii-msft Mar 29, 2023
3152ff9
[silmarillion] Yikes I've really had a hard time with this.
zadjii-msft Mar 29, 2023
3f5a559
[silmarillion] Wow, we didn't need _recentlyDetached at all, did we
zadjii-msft Mar 29, 2023
1f0b958
[silmarillion] Yikes I've really had a hard time with this.
zadjii-msft Mar 29, 2023
08732fe
[silmarillion] Wow, we didn't need _recentlyDetached at all, did we
zadjii-msft Mar 29, 2023
a9b591f
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' of https://github…
zadjii-msft Mar 29, 2023
8ce6752
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 29, 2023
8344c01
[alkallabeth] I got distracted and totally botched that, didn't I
zadjii-msft Mar 29, 2023
e02637d
Fix the positioning of the dropped tab
zadjii-msft Mar 29, 2023
1bb89ed
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 29, 2023
0c6eb35
tiny const ref nits
zadjii-msft Mar 29, 2023
bf5d6c3
shuffle some code into helpers
zadjii-msft Mar 30, 2023
07ee7d6
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/quen…
zadjii-msft Mar 30, 2023
721a0ec
spell?
zadjii-msft Mar 30, 2023
982fa5a
Merge branch 'dev/migrie/oop/3/quenta-silmarillion' into dev/migrie/o…
zadjii-msft Mar 30, 2023
d019f32
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 30, 2023
c606439
more dedupes and nits
zadjii-msft Mar 30, 2023
a77ea00
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/akal…
zadjii-msft Mar 30, 2023
ce35e8a
Merge branch 'dev/migrie/oop/3/akallabeth' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 30, 2023
ac5c8fa
last nits
zadjii-msft Mar 30, 2023
53a9b18
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/an-u…
zadjii-msft Mar 30, 2023
ced78fb
derp
zadjii-msft Mar 30, 2023
94865b8
cammants
zadjii-msft Mar 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/cascadia/Remoting/Monarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation

void Monarch::RequestMoveContent(winrt::hstring window,
winrt::hstring content,
uint32_t tabIndex)
uint32_t tabIndex,
const Windows::Foundation::IReference<Windows::Foundation::Rect>& windowBounds)
{
TraceLoggingWrite(g_hRemotingProvider,
"Monarch_MoveContent_Requested",
Expand Down Expand Up @@ -1102,11 +1103,14 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
TraceLoggingKeyword(TIL_KEYWORD_TRACE));

// TODO GH#5000
//
// In the case where window couldn't be found, then create a window
// for that name / ID. Do this as a part of tear-out (different than
// drag/drop)
// for that name / ID.
//
// Don't let the window literally be named "-1", because that's silly
auto request = winrt::make_self<implementation::WindowRequestedArgs>(window == L"-1" ? L"" : window,
content,
windowBounds);
_RequestNewWindowHandlers(*this, *request);
}
}

Expand All @@ -1132,16 +1136,14 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
}
else
{
// We couldn't find the peasant that started the drag. Well that
Copy link
Member

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?

Copy link
Member Author

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.

// sure is weird, but that would indicate that the sender closed
// after starting the drag. No matter. We can just do nothing.

TraceLoggingWrite(g_hRemotingProvider,
"Monarch_SendContent_NoWindow",
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
TraceLoggingKeyword(TIL_KEYWORD_TRACE));

// TODO GH#5000
//
// In the case where window couldn't be found, then create a window
// for that name / ID. Do this as a part of tear-out (different than
// drag/drop)
}
}
}
12 changes: 11 additions & 1 deletion src/cascadia/Remoting/Monarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,22 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
_args{ command.Commandline() },
_CurrentDirectory{ command.CurrentDirectory() } {};

WindowRequestedArgs(const winrt::hstring& window, const winrt::hstring& content, const Windows::Foundation::IReference<Windows::Foundation::Rect>& bounds) :
_Id{ 0u },
_WindowName{ window },
_args{},
_CurrentDirectory{},
_Content{ content },
_InitialBounds{ bounds } {};

void Commandline(const winrt::array_view<const winrt::hstring>& value) { _args = { value.begin(), value.end() }; };
winrt::com_array<winrt::hstring> Commandline() { return winrt::com_array<winrt::hstring>{ _args.begin(), _args.end() }; }

WINRT_PROPERTY(uint64_t, Id);
WINRT_PROPERTY(winrt::hstring, WindowName);
WINRT_PROPERTY(winrt::hstring, CurrentDirectory);
WINRT_PROPERTY(winrt::hstring, Content);
WINRT_PROPERTY(Windows::Foundation::IReference<Windows::Foundation::Rect>, InitialBounds);

private:
winrt::com_array<winrt::hstring> _args;
Expand Down Expand Up @@ -81,7 +91,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Terminal::Remoting::PeasantInfo> GetPeasantInfos();
Windows::Foundation::Collections::IVector<winrt::hstring> GetAllWindowLayouts();

void RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex);
void RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex, const Windows::Foundation::IReference<Windows::Foundation::Rect>& windowBounds);
void RequestSendContent(const Remoting::RequestReceiveContentArgs& args);

TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);
Expand Down
5 changes: 4 additions & 1 deletion src/cascadia/Remoting/Monarch.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ namespace Microsoft.Terminal.Remoting

String[] Commandline { get; };
String CurrentDirectory { get; };

String Content { get; };
Windows.Foundation.IReference<Windows.Foundation.Rect> InitialBounds { get; };
}

[default_interface] runtimeclass SummonWindowSelectionArgs {
Expand Down Expand Up @@ -69,7 +72,7 @@ namespace Microsoft.Terminal.Remoting
Windows.Foundation.Collections.IVectorView<PeasantInfo> GetPeasantInfos { get; };
Windows.Foundation.Collections.IVector<String> GetAllWindowLayouts();

void RequestMoveContent(String window, String content, UInt32 tabIndex);
void RequestMoveContent(String window, String content, UInt32 tabIndex, Windows.Foundation.IReference<Windows.Foundation.Rect> bounds);
void RequestSendContent(RequestReceiveContentArgs args);

event Windows.Foundation.TypedEventHandler<Object, FindTargetWindowArgs> FindTargetWindowRequested;
Expand Down
5 changes: 3 additions & 2 deletions src/cascadia/Remoting/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,11 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation

winrt::fire_and_forget WindowManager::RequestMoveContent(winrt::hstring window,
winrt::hstring content,
uint32_t tabIndex)
uint32_t tabIndex,
Windows::Foundation::IReference<Windows::Foundation::Rect> windowBounds)
{
co_await winrt::resume_background();
_monarch.RequestMoveContent(window, content, tabIndex);
_monarch.RequestMoveContent(window, content, tabIndex, windowBounds);
}

winrt::fire_and_forget WindowManager::RequestSendContent(Remoting::RequestReceiveContentArgs args)
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/Remoting/WindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
Windows::Foundation::Collections::IVector<winrt::hstring> GetAllWindowLayouts();
bool DoesQuakeWindowExist();

winrt::fire_and_forget RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex);
winrt::fire_and_forget RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex, Windows::Foundation::IReference<Windows::Foundation::Rect> windowBounds);
winrt::fire_and_forget RequestSendContent(Remoting::RequestReceiveContentArgs args);

TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/Remoting/WindowManager.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Microsoft.Terminal.Remoting

Boolean DoesQuakeWindowExist();

void RequestMoveContent(String window, String content, UInt32 tabIndex);
void RequestMoveContent(String window, String content, UInt32 tabIndex, Windows.Foundation.IReference<Windows.Foundation.Rect> bounds);
void RequestSendContent(RequestReceiveContentArgs args);

event Windows.Foundation.TypedEventHandler<Object, FindTargetWindowArgs> FindTargetWindowRequested;
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ namespace winrt::TerminalApp::implementation
_mruTabs.RemoveAt(mruIndex);
}

if (_stashedDraggedTab && *_stashedDraggedTab == tab)
if (_stashed.draggedTab && *_stashed.draggedTab == tab)
{
_stashedDraggedTab = nullptr;
_stashed.draggedTab = nullptr;
}

_tabs.RemoveAt(tabIndex);
Expand Down
108 changes: 84 additions & 24 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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() };
Expand All @@ -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.
}
}

Expand Down Expand Up @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The 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;
}
Expand All @@ -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);
}

}
18 changes: 15 additions & 3 deletions src/cascadia/TerminalApp/TerminalPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ namespace winrt::TerminalApp::implementation
WINRT_PROPERTY(winrt::hstring, Window);
WINRT_PROPERTY(winrt::hstring, Content);
WINRT_PROPERTY(uint32_t, TabIndex);
WINRT_PROPERTY(Windows::Foundation::IReference<Windows::Foundation::Point>, WindowPosition);

public:
RequestMoveContentArgs(const winrt::hstring window, const winrt::hstring content, uint32_t tabIndex) :
Expand Down Expand Up @@ -162,9 +163,11 @@ namespace winrt::TerminalApp::implementation

bool OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down);

winrt::fire_and_forget AttachContent(winrt::hstring content, uint32_t tabIndex);
winrt::fire_and_forget AttachContent(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::ActionAndArgs> args, uint32_t tabIndex);
winrt::fire_and_forget SendContentToOther(winrt::TerminalApp::RequestReceiveContentArgs args);

uint32_t NumberOfTabs() const;

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);

// -------------------------------- WinRT Events ---------------------------------
Expand Down Expand Up @@ -263,7 +266,11 @@ namespace winrt::TerminalApp::implementation

TerminalApp::ContentManager _manager{ nullptr };

winrt::com_ptr<winrt::TerminalApp::implementation::TabBase> _stashedDraggedTab{ nullptr };
struct StashedDragData
{
winrt::com_ptr<winrt::TerminalApp::implementation::TabBase> draggedTab{ nullptr };
til::point dragOffset{ 0, 0 };
} _stashed;

winrt::Microsoft::Terminal::TerminalConnection::ConptyConnection::NewConnection_revoker _newConnectionRevoker;

Expand Down Expand Up @@ -503,10 +510,15 @@ namespace winrt::TerminalApp::implementation
void _onTabDragStarting(const winrt::Microsoft::UI::Xaml::Controls::TabView& sender, const winrt::Microsoft::UI::Xaml::Controls::TabViewTabDragStartingEventArgs& e);
void _onTabStripDragOver(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::DragEventArgs& e);
winrt::fire_and_forget _onTabStripDrop(winrt::Windows::Foundation::IInspectable sender, winrt::Windows::UI::Xaml::DragEventArgs e);
winrt::fire_and_forget _onTabDroppedOutside(winrt::Windows::Foundation::IInspectable sender, winrt::Microsoft::UI::Xaml::Controls::TabViewTabDroppedOutsideEventArgs e);

void _DetachPaneFromWindow(std::shared_ptr<Pane> pane);
void _DetachTabFromWindow(const winrt::com_ptr<TabBase>& terminalTab);
void _MoveContent(std::vector<winrt::Microsoft::Terminal::Settings::Model::ActionAndArgs>&& actions, const winrt::hstring& windowName, const uint32_t tabIndex);
void _MoveContent(std::vector<winrt::Microsoft::Terminal::Settings::Model::ActionAndArgs>&& actions,
const winrt::hstring& windowName,
const uint32_t tabIndex,
const std::optional<til::point>& dragPoint = std::nullopt);
void _sendDraggedTabToWindow(const winrt::hstring& windowId, const uint32_t tabIndex, std::optional<til::point> dragPoint);

void _ContextMenuOpened(const IInspectable& sender, const IInspectable& args);
void _SelectionMenuOpened(const IInspectable& sender, const IInspectable& args);
Expand Down
Loading