From c89671af04ed2c27866123004b1574c06a673f27 Mon Sep 17 00:00:00 2001 From: mjk Date: Sun, 21 Mar 2021 23:52:33 +0000 Subject: [PATCH] log SetCurrentProcessExplicitAppUserModelID errors --- plugins/windows-notification/api/src/win32.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/windows-notification/api/src/win32.cpp b/plugins/windows-notification/api/src/win32.cpp index 31bd9e09..02e2a47c 100644 --- a/plugins/windows-notification/api/src/win32.cpp +++ b/plugins/windows-notification/api/src/win32.cpp @@ -5,6 +5,8 @@ #include "converter.hpp" #include "ginvoke.hpp" +#include + win32_error::win32_error() noexcept : win32_error{::GetLastError()} {} @@ -73,10 +75,10 @@ std::wstring GetEnv(const wchar_t *const variable_name) } -static bool ImplSetProcessAumid(const std::string_view aumid) +static void ImplSetProcessAumid(const std::string_view aumid) { - const auto waumid = sview_to_wstr(aumid); - return SUCCEEDED(::SetCurrentProcessExplicitAppUserModelID(waumid.c_str())); + winrt::check_hresult(::SetCurrentProcessExplicitAppUserModelID( + sview_to_wstr(aumid).c_str())); } extern "C" @@ -97,6 +99,6 @@ extern "C" gboolean SetProcessAumid(const gchar *const aumid) noexcept { - return g_try_invoke(ImplSetProcessAumid, aumid).value_or(false); + return g_try_invoke(ImplSetProcessAumid, aumid).has_value(); } }