# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1591914113 0 # Node ID 665d87a50eacc4fa04e75fa39756bd0295490668 # Parent 6608fc7f64653c145430042635864349617de986 Win: Test that the OS is compatible for WinToast before returning supported. diff -r 6608fc7f6465 -r 665d87a50eac win/dw.c --- a/win/dw.c Thu Jun 11 18:02:29 2020 +0000 +++ b/win/dw.c Thu Jun 11 22:21:53 2020 +0000 @@ -324,6 +324,7 @@ void _dw_toast_init(LPWSTR AppName, LPWSTR AppID); void *_dw_notification_new(LPWSTR title, LPWSTR image, LPWSTR description); int _dw_notification_send(void *notification); +BOOL _dw_toast_is_compatible(void); #endif LRESULT CALLBACK _colorwndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); void _resize_notebook_page(HWND handle, int pageid); @@ -13369,12 +13370,17 @@ case DW_FEATURE_HTML: case DW_FEATURE_HTML_RESULT: #endif -#ifdef BUILD_TOAST - case DW_FEATURE_NOTIFICATION: -#endif case DW_FEATURE_CONTAINER_STRIPE: case DW_FEATURE_MDI: return DW_FEATURE_ENABLED; +#ifdef BUILD_TOAST + case DW_FEATURE_NOTIFICATION: + { + if(_dw_toast_is_compatible()) + return DW_FEATURE_ENABLED; + return DW_FEATURE_UNSUPPORTED; + } +#endif #ifdef AEROGLASS case DW_FEATURE_WINDOW_TRANSPARENCY: { @@ -13419,12 +13425,17 @@ #ifdef AEROGLASS case DW_FEATURE_WINDOW_TRANSPARENCY: #endif -#ifdef BUILD_TOAST - case DW_FEATURE_NOTIFICATION: -#endif case DW_FEATURE_CONTAINER_STRIPE: case DW_FEATURE_MDI: return DW_ERROR_GENERAL; +#ifdef BUILD_TOAST + case DW_FEATURE_NOTIFICATION: + { + if(_dw_toast_is_compatible()) + return DW_ERROR_GENERAL; + return DW_FEATURE_UNSUPPORTED; + } +#endif /* These features are supported and configurable */ #ifdef AEROGLASS case DW_FEATURE_DARK_MODE: diff -r 6608fc7f6465 -r 665d87a50eac win/wintoast.cpp --- a/win/wintoast.cpp Thu Jun 11 18:02:29 2020 +0000 +++ b/win/wintoast.cpp Thu Jun 11 22:21:53 2020 +0000 @@ -88,4 +88,9 @@ } return -1; // DW_ERROR_UNKNOWN } + + BOOL _dw_toast_is_compatible(void) + { + return WinToast::isCompatible(); + } }