diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 2487f290a41..1f0ecc50af8 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -4504,6 +4504,10 @@ namespace winrt::TerminalApp::implementation // We're going to be asked for this. _stashedDraggedTab = tabImpl; + // TODO! 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. + // Into the DataPackage, let's stash our own window ID. const winrt::hstring id{ fmt::format(L"{}", _WindowProperties.WindowId()) }; diff --git a/src/cascadia/WindowsTerminal/AppHost.cpp b/src/cascadia/WindowsTerminal/AppHost.cpp index bcb19836dac..ae4726fa872 100644 --- a/src/cascadia/WindowsTerminal/AppHost.cpp +++ b/src/cascadia/WindowsTerminal/AppHost.cpp @@ -1214,18 +1214,20 @@ void AppHost::_handleMoveContent(const winrt::Windows::Foundation::IInspectable& // The WindowPosition is in DIPs. We need to convert it to pixels. const til::point dragPositionInDips{ til::math::rounding, args.WindowPosition().Value() }; const auto scale = _window->GetCurrentDpiScale(); - + const til::point dragPositionInPixels{ til::math::rounding, dragPositionInDips.x * scale, dragPositionInDips.y * scale, - }; + }; // Fortunately, the window position is already in pixels. const til::rect windowBoundsInPixels{ _window->GetWindowRect() }; + // TODO!: adjust for the non-client bounds + // Use the drag event as the new position, and the size of the actual window. winrt::Windows::Foundation::Rect rect{ static_cast(dragPositionInPixels.x), static_cast(dragPositionInPixels.y),