Skip to content

Commit 6ed286d

Browse files
committed
Post WM_SETCURSOR after WM_ACTIVATE to workaround XAML island busy cursor
1 parent 694db4c commit 6ed286d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/cascadia/WindowsTerminal/IslandWindow.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,15 @@ void IslandWindow::_OnGetMinMaxInfo(const WPARAM /*wParam*/, const LPARAM lParam
518518
const bool activated = LOWORD(wparam) != 0;
519519
WindowActivated.raise(activated);
520520

521+
// GH#18662: After raising WindowActivated, XAML may be busy processing
522+
// the activation (focus, layout, rendering). During this time, WM_SETCURSOR
523+
// may go unanswered, causing Windows to show a busy cursor until the next
524+
// mouse move. Post a WM_SETCURSOR to force re-evaluation once XAML is idle.
525+
if (activated)
526+
{
527+
PostMessageW(GetHandle(), WM_SETCURSOR, 0, MAKELPARAM(HTCLIENT, WM_MOUSEMOVE));
528+
}
529+
521530
if (_autoHideWindow && !activated)
522531
{
523532
if (_isQuakeWindow || _minimizeToNotificationArea)

0 commit comments

Comments
 (0)