69318d3ba1
Adds support for the `windowingBehavior` global setting. This setting controls how mutiple instances of `wt` behave in the absence of the `-w` parameter. This setting has three values: * `"useNew"`: (default) Multiple `wt` invocations (without the `-w` param) always create new windows. * `"useAnyExisting"`: When starting a new `wt`, we'll instead default to any existing windows. `wt -w -1` will still create new windows. * `"useExisting"`: Similar to `useAnyExisting`, but limits to windows on the current desktop. The IVirtualDesktopManager interface is _very_ limited. Hence why we have to track the HWNDs manually, and ask if they're on the current desktop. ## Validation Steps Performed I've been playing with it for a week now. References #5000 References projects/5 References #8898 Spec'd in #8135 Closes #2227 Closes https://github.com/microsoft/terminal/projects/5#card-51431448 Closes https://github.com/microsoft/terminal/projects/5#card-51431433
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
/*++
|
|
Copyright (c) Microsoft Corporation
|
|
Licensed under the MIT license.
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
// Block minwindef.h min/max macros to prevent <algorithm> conflict
|
|
#define NOMINMAX
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#define NOMCX
|
|
#define NOHELP
|
|
#define NOCOMM
|
|
|
|
#include <unknwn.h>
|
|
#include <ShObjIdl.h>
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
#define BLOCK_TIL
|
|
// This includes support libraries from the CRT, STL, WIL, and GSL
|
|
#include "LibraryIncludes.h"
|
|
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
|
|
// SDK definition of this function, so the only fix is to undef it.
|
|
// from WinBase.h
|
|
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
|
|
#ifdef GetCurrentTime
|
|
#undef GetCurrentTime
|
|
#endif
|
|
|
|
#include <wil/cppwinrt.h>
|
|
#include <unknwn.h>
|
|
#include <hstring.h>
|
|
|
|
#include <WexTestClass.h>
|
|
#include "consoletaeftemplates.hpp"
|
|
|
|
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
|
#include <winrt/Windows.system.h>
|
|
#include <winrt/Windows.Foundation.h>
|
|
#include <winrt/Windows.Foundation.Collections.h>
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
#include "til.h"
|
|
|
|
// Common includes for most tests:
|
|
#include "../../inc/argb.h"
|
|
#include "../../inc/conattrs.hpp"
|
|
#include "../../types/inc/utils.hpp"
|
|
#include "../../inc/DefaultSettings.h"
|