terminal/src/cascadia/Remoting/WindowActivatedArgs.h
Dustin L. Howett 3029bb8a68
Update C++/WinRT to 2.0.210309.3 (#9437)
This update shrinks our binaries a little bit.

From a representative build on VS 16.8:

       | App     | Control | Connection | TSE     | WT     | Total   | msix (zip) |
       | --      | --      | --         | --      | --     | --      | --         |
Before | 2610176 | 1006592 | 433152     | 1352192 | 321536 | 5723648 | 8336910    |
After  | 2532352 | 986624  | 431104     | 1312768 | 313344 | 5576192 | 8287648    |
Delta  | 77824   | 19968   | 2048       | 39424   | 8192   | 147456  | 49262      |
%Delta | 2.98%   | 1.98%   | 0.47%      | 2.92%   | 2.55%  | 2.58%   | 0.59%      |
2021-03-10 16:04:59 -06:00

62 lines
2.1 KiB
C++

/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Class Name:
- WindowActivatedArgs.h
Abstract:
- This is a helper class for encapsulating all the information about when and
where a window was activated. This will be used by the Monarch to determine
who the most recent peasant is.
--*/
#pragma once
#include "WindowActivatedArgs.g.h"
#include "../cascadia/inc/cppwinrt_utils.h"
namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct CompareWindowActivatedArgs
{
bool operator()(const Remoting::WindowActivatedArgs& lhs, const Remoting::WindowActivatedArgs& rhs) const
{
return lhs.ActivatedTime() > rhs.ActivatedTime();
}
};
struct WindowActivatedArgs : public WindowActivatedArgsT<WindowActivatedArgs>
{
WINRT_PROPERTY(uint64_t, PeasantID, 0);
WINRT_PROPERTY(winrt::guid, DesktopID);
WINRT_PROPERTY(winrt::Windows::Foundation::DateTime, ActivatedTime, {});
WINRT_PROPERTY(uint64_t, Hwnd, 0);
public:
WindowActivatedArgs(uint64_t peasantID,
uint64_t hwnd,
winrt::guid desktopID,
winrt::Windows::Foundation::DateTime timestamp) :
_PeasantID{ peasantID },
_Hwnd{ hwnd },
_DesktopID{ desktopID },
_ActivatedTime{ timestamp } {};
WindowActivatedArgs(uint64_t peasantID,
winrt::guid desktopID,
winrt::Windows::Foundation::DateTime timestamp) :
WindowActivatedArgs(peasantID, 0, desktopID, timestamp){};
WindowActivatedArgs(const Remoting::WindowActivatedArgs& other) :
_PeasantID{ other.PeasantID() },
_Hwnd{ other.Hwnd() },
_DesktopID{ other.DesktopID() },
_ActivatedTime{ other.ActivatedTime() } {};
};
}
namespace winrt::Microsoft::Terminal::Remoting::factory_implementation
{
BASIC_FACTORY(WindowActivatedArgs);
}