mirror of https://github.com/microsoft/WSL
Resolve issue with buttons on notifications not working correctly (#13921)
* Resolve issue with buttons on notifications not working correctly * pr feedback --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
This commit is contained in:
parent
180d811099
commit
e24df7e0d1
|
|
@ -86,8 +86,8 @@ try
|
|||
</binding>
|
||||
</visual>
|
||||
<actions>
|
||||
<action arguments='--{}' content='{}'/>
|
||||
<action arguments='--{}' content='{}'/>
|
||||
<action arguments='{}' content='{}'/>
|
||||
<action arguments='{}' content='{}'/>
|
||||
</actions>
|
||||
</toast>)",
|
||||
Localization::MessageNewWslVersionAvailable(Localization::Options::DontImpersonate),
|
||||
|
|
@ -118,8 +118,8 @@ try
|
|||
</binding>
|
||||
</visual>
|
||||
<actions>
|
||||
<action arguments='--{} {}' content='{}'/>
|
||||
<action arguments='--{} {}' content="{}"/>
|
||||
<action arguments='{} {}' content='{}'/>
|
||||
<action arguments='{} {}' content="{}"/>
|
||||
</actions>
|
||||
</toast>)",
|
||||
Localization::MessagePerformanceTip(Localization::Options::DontImpersonate),
|
||||
|
|
@ -151,7 +151,7 @@ try
|
|||
</binding>
|
||||
</visual>
|
||||
<actions>
|
||||
<action arguments='--{}' content='{}'/>
|
||||
<action arguments='{}' content='{}'/>
|
||||
</actions>
|
||||
</toast>)",
|
||||
Localization::MessageWarningDuringStartup(),
|
||||
|
|
@ -176,7 +176,7 @@ try
|
|||
</binding>
|
||||
</visual>
|
||||
<actions>
|
||||
<action arguments='--{}' content='{}'/>
|
||||
<action arguments='{}' content='{}'/>
|
||||
</actions>
|
||||
</toast>)",
|
||||
Localization::MessageMissingOptionalComponents(),
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ LPCWSTR const handle_option = L"--handle";
|
|||
LPCWSTR const event_option = L"--event";
|
||||
LPCWSTR const parent_option = L"--parent";
|
||||
LPCWSTR const vm_id_option = L"--vm-id";
|
||||
LPCWSTR const embedding_option = L"--Embedding";
|
||||
LPCWSTR const embedding_option = L"-Embedding";
|
||||
} // namespace wslhost
|
||||
|
|
@ -2172,13 +2172,22 @@ HRESULT LxssUserSessionImpl::Shutdown(_In_ bool PreventNewInstances, ShutdownBeh
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
void LxssUserSessionImpl::TelemetryWorker(_In_ wil::unique_socket&& socket, _In_ bool drvFsNotifications) const
|
||||
void LxssUserSessionImpl::TelemetryWorker(_In_ wil::unique_socket&& socket) const
|
||||
try
|
||||
{
|
||||
wsl::windows::common::wslutil::SetThreadDescription(L"Telemetry");
|
||||
|
||||
wsl::shared::SocketChannel channel(std::move(socket), "Telemetry", m_vmTerminating.get());
|
||||
|
||||
// Check if drvfs notifications are enabled for the user.
|
||||
bool drvFsNotifications{};
|
||||
{
|
||||
auto impersonate = wil::impersonate_token(m_userToken.get());
|
||||
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
|
||||
drvFsNotifications =
|
||||
wsl::windows::common::registry::ReadDword(lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
|
||||
}
|
||||
|
||||
// Aggregate information about what is running inside the VM. This is logged
|
||||
// periodically because logging each event individually would be too noisy.
|
||||
for (;;)
|
||||
|
|
@ -2852,17 +2861,9 @@ void LxssUserSessionImpl::_CreateVm()
|
|||
// If the telemetry is enabled, launch the telemetry agent inside the VM.
|
||||
if (m_utilityVm->GetConfig().EnableTelemetry && TraceLoggingProviderEnabled(g_hTraceLoggingProvider, WINEVENT_LEVEL_INFO, 0))
|
||||
{
|
||||
bool drvFsNotifications = false;
|
||||
{
|
||||
auto impersonate = wil::impersonate_token(m_userToken.get());
|
||||
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
|
||||
drvFsNotifications = wsl::windows::common::registry::ReadDword(
|
||||
lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
|
||||
}
|
||||
|
||||
LPCSTR Arguments[] = {LX_INIT_TELEMETRY_AGENT, nullptr};
|
||||
auto socket = m_utilityVm->CreateRootNamespaceProcess(LX_INIT_PATH, Arguments);
|
||||
m_telemetryThread = std::thread(&LxssUserSessionImpl::TelemetryWorker, this, std::move(socket), drvFsNotifications);
|
||||
m_telemetryThread = std::thread(&LxssUserSessionImpl::TelemetryWorker, this, std::move(socket));
|
||||
}
|
||||
|
||||
m_pluginManager.OnVmStarted(&m_session, &userSettings);
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ public:
|
|||
/// <summary>
|
||||
/// Worker thread for logging telemetry about processes running inside of WSL.
|
||||
/// </summary>
|
||||
void TelemetryWorker(_In_ wil::unique_socket&& socket, _In_ bool drvFsNotifications) const;
|
||||
void TelemetryWorker(_In_ wil::unique_socket&& socket) const;
|
||||
|
||||
/// <summary>
|
||||
/// Terminates a distribution by it's client identifier.
|
||||
|
|
|
|||
|
|
@ -74,12 +74,7 @@ public:
|
|||
// Log telemetry when a WSL notification is activated, used to determine user engagement for notifications
|
||||
WSL_LOG_TELEMETRY("NotificationActivate", PDT_ProductAndServicePerformance, TraceLoggingValue(invokedArgs, "Arguments"));
|
||||
|
||||
// Prepend the executable name to the arguments so getopt can be used to parse the arguments.
|
||||
auto commandLine = wil::GetModuleFileNameW<std::wstring>(wil::GetModuleInstanceHandle());
|
||||
commandLine += L" ";
|
||||
commandLine += invokedArgs;
|
||||
|
||||
ArgumentParser parser(GetCommandLineW(), wslhost::binary_name);
|
||||
ArgumentParser parser(invokedArgs, wslhost::binary_name, 0);
|
||||
parser.AddArgument(
|
||||
[]() {
|
||||
std::wstring path;
|
||||
|
|
|
|||
Loading…
Reference in New Issue