@@ -27,16 +27,6 @@ using VirtualKeyModifiers = winrt::Windows::System::VirtualKeyModifiers;
2727#define XAML_HOSTING_WINDOW_CLASS_NAME L" CASCADIA_HOSTING_WINDOW_CLASS"
2828#define IDM_SYSTEM_MENU_BEGIN 0x1000
2929
30- void _trace (const wchar_t * const pwsz)
31- {
32- TraceLoggingWrite (g_hWindowsTerminalProvider,
33- " TraceMessage" ,
34- TraceLoggingDescription (" debug print messages" ),
35- TraceLoggingWideString (pwsz, " message" , " the message" ),
36- TraceLoggingLevel (WINEVENT_LEVEL_VERBOSE),
37- TraceLoggingKeyword (TIL_KEYWORD_TRACE));
38- }
39-
4030IslandWindow::IslandWindow () noexcept :
4131 _interopWindowHandle{ nullptr },
4232 _rootGrid{ nullptr },
@@ -1532,7 +1522,6 @@ void IslandWindow::_globalActivateWindow(const uint32_t dropdownDuration,
15321522 // restore-down the window.
15331523 if (IsIconic (_window.get ()))
15341524 {
1535- _trace (L" window was iconic" );
15361525 if (dropdownDuration > 0 )
15371526 {
15381527 _dropdownWindow (dropdownDuration, toMonitor);
@@ -1545,47 +1534,16 @@ void IslandWindow::_globalActivateWindow(const uint32_t dropdownDuration,
15451534 // able to properly set this as the foreground window.
15461535 if (!IsWindowVisible (GetHandle ()))
15471536 {
1548- _trace (L" window wasn't visible" );
15491537 ShowWindow (_window.get (), SW_SHOW);
15501538 }
15511539 ShowWindow (_window.get (), SW_RESTORE);
1552- if (!SetForegroundWindow (_window.get ()))
1553- {
1554- const auto gle = GetLastError ();
1555- _trace (fmt::format (L" SetForegroundWindow failed: {}" , gle).c_str ());
1556-
1557- const auto fg = GetForegroundWindow ();
1558- std::wstring title (GetWindowTextLength (fg) + 1 , L' \0 ' );
1559- GetWindowTextW (fg, &title[0 ], (DWORD)title.size ());
1560- DWORD fgPid = 0 ;
1561- GetWindowThreadProcessId (fg, &fgPid);
1562- _trace (fmt::format (L" Foreground Window is: [{}]={}" , (uint64_t )fgPid, title).c_str ());
1563-
1564- SwitchToThisWindow (_window.get (), false );
1565- }
1566- else
1567- {
1568- _trace (L" got fg?" );
1569- }
1570-
1571- // LOG_IF_WIN32_BOOL_FALSE(BringWindowToTop(_window.get()));
1572- if (!BringWindowToTop (_window.get ()))
1573- {
1574- const auto gle = GetLastError ();
1575- _trace (fmt::format (L" BringWindowToTop failed: {}" , gle).c_str ());
1576- }
1577- else
1578- {
1579- _trace (L" brought to top?" );
1580- }
15811540
15821541 // Once we've been restored, throw us on the active monitor.
15831542 _moveToMonitor (oldForegroundWindow, toMonitor);
15841543 }
15851544 }
15861545 else
15871546 {
1588- _trace (L" window wasn't iconic" );
15891547 // Try first to send a message to the current foreground window. If it's not responding, it may
15901548 // be waiting on us to finish launching. Passing SMTO_NOTIMEOUTIFNOTHUNG means that we get the same
15911549 // behavior as before--that is, waiting for the message loop--but we've done an early return if
@@ -1611,10 +1569,6 @@ void IslandWindow::_globalActivateWindow(const uint32_t dropdownDuration,
16111569 // Throw us on the active monitor.
16121570 _moveToMonitor (oldForegroundWindow, toMonitor);
16131571 }
1614- else
1615- {
1616- _trace (L" huh" );
1617- }
16181572 }
16191573}
16201574
0 commit comments