From d621471eb27c4af1a09ce5326713ce28c5946835 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Mon, 11 Sep 2017 23:24:30 +0900 Subject: [PATCH] :checkered_flag: Set duration for Windows 7 notifications based on Control Panel --- brightray/browser/win/win32_desktop_notifications/toast.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/brightray/browser/win/win32_desktop_notifications/toast.cc b/brightray/browser/win/win32_desktop_notifications/toast.cc index cfe8ebf9a921..b7e318c923f5 100644 --- a/brightray/browser/win/win32_desktop_notifications/toast.cc +++ b/brightray/browser/win/win32_desktop_notifications/toast.cc @@ -641,7 +641,12 @@ void DesktopNotificationController::Toast::CancelDismiss() { } void DesktopNotificationController::Toast::ScheduleDismissal() { - SetTimer(hwnd_, TimerID_AutoDismiss, 4000, nullptr); + ULONG duration; + auto result = SystemParametersInfo(SPI_GETMESSAGEDURATION, 0, &duration, 0); + if (result == FALSE) { + duration = 5; + } + SetTimer(hwnd_, TimerID_AutoDismiss, duration * 1000, nullptr); } void DesktopNotificationController::Toast::ResetContents() {