mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-11 12:14:53 +08:00
[AlwaysOnTop]Pinning/unpinning telemetry (#21970)
This commit is contained in:
parent
6d9d4a7112
commit
b8f1df776b
@ -8,9 +8,12 @@
|
|||||||
#include <common/utils/winapi_error.h>
|
#include <common/utils/winapi_error.h>
|
||||||
#include <common/utils/process_path.h>
|
#include <common/utils/process_path.h>
|
||||||
|
|
||||||
#include <WinHookEventIDs.h>
|
|
||||||
#include <interop/shared_constants.h>
|
#include <interop/shared_constants.h>
|
||||||
|
|
||||||
|
#include <trace.h>
|
||||||
|
#include <WinHookEventIDs.h>
|
||||||
|
|
||||||
|
|
||||||
namespace NonLocalizable
|
namespace NonLocalizable
|
||||||
{
|
{
|
||||||
const static wchar_t* TOOL_WINDOW_CLASS_NAME = L"AlwaysOnTopWindow";
|
const static wchar_t* TOOL_WINDOW_CLASS_NAME = L"AlwaysOnTopWindow";
|
||||||
@ -180,6 +183,8 @@ void AlwaysOnTop::ProcessCommand(HWND window)
|
|||||||
{
|
{
|
||||||
m_topmostWindows.erase(iter);
|
m_topmostWindows.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Trace::AlwaysOnTop::UnpinWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -188,6 +193,7 @@ void AlwaysOnTop::ProcessCommand(HWND window)
|
|||||||
{
|
{
|
||||||
soundType = Sound::Type::On;
|
soundType = Sound::Type::On;
|
||||||
AssignBorder(window);
|
AssignBorder(window);
|
||||||
|
Trace::AlwaysOnTop::PinWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#define LoggingProviderKey "Microsoft.PowerToys"
|
#define LoggingProviderKey "Microsoft.PowerToys"
|
||||||
|
|
||||||
#define EventEnableAlwaysOnTopKey "AlwaysOnTop_EnableAlwaysOnTop"
|
#define EventEnableAlwaysOnTopKey "AlwaysOnTop_EnableAlwaysOnTop"
|
||||||
|
#define EventPinWindowKey "AlwaysOnTop_PinWindow"
|
||||||
|
#define EventUnpinWindowKey "AlwaysOnTop_UnpinWindow"
|
||||||
#define EventEnabledKey "Enabled"
|
#define EventEnabledKey "Enabled"
|
||||||
|
|
||||||
TRACELOGGING_DEFINE_PROVIDER(
|
TRACELOGGING_DEFINE_PROVIDER(
|
||||||
@ -33,3 +35,21 @@ void Trace::AlwaysOnTop::Enable(bool enabled) noexcept
|
|||||||
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
|
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
|
||||||
TraceLoggingBoolean(enabled, EventEnabledKey));
|
TraceLoggingBoolean(enabled, EventEnabledKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Trace::AlwaysOnTop::PinWindow() noexcept
|
||||||
|
{
|
||||||
|
TraceLoggingWrite(
|
||||||
|
g_hProvider,
|
||||||
|
EventPinWindowKey,
|
||||||
|
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
||||||
|
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Trace::AlwaysOnTop::UnpinWindow() noexcept
|
||||||
|
{
|
||||||
|
TraceLoggingWrite(
|
||||||
|
g_hProvider,
|
||||||
|
EventUnpinWindowKey,
|
||||||
|
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
||||||
|
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
||||||
|
}
|
@ -10,5 +10,7 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void Enable(bool enabled) noexcept;
|
static void Enable(bool enabled) noexcept;
|
||||||
|
static void PinWindow() noexcept;
|
||||||
|
static void UnpinWindow() noexcept;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user