[ainulindale] windows should get activated when they're created

This commit is contained in:
Mike Griese
2023-03-16 10:33:40 -05:00
parent 7142ae88c9
commit d55bb43f47

View File

@@ -151,6 +151,19 @@ void WindowEmperor::_windowStartedHandler(const std::shared_ptr<WindowThread>& s
sender->Logic().IsQuakeWindowChanged({ this, &WindowEmperor::_windowIsQuakeWindowChanged });
sender->UpdateSettingsRequested({ this, &WindowEmperor::_windowRequestUpdateSettings });
// Summon the window to the foreground, since we might not _currently_ be in
// the foreground, but we should act like the new window is.
//
// TODO: GH#14957 - use AllowSetForeground from the original wt.exe instead
Remoting::SummonWindowSelectionArgs args{};
args.OnCurrentDesktop(false);
args.WindowID(sender->Peasant().GetID());
args.SummonBehavior().MoveToCurrentDesktop(false);
args.SummonBehavior().ToggleVisibility(false);
args.SummonBehavior().DropdownDuration(0);
args.SummonBehavior().ToMonitor(Remoting::MonitorBehavior::InPlace);
_manager.SummonWindow(args);
// Now that the window is ready to go, we can add it to our list of windows,
// because we know it will be well behaved.
//