Skip to content
Permalink
Browse files

Fix crash on Windows on idle/usb notifications

Fixes #20312, #20319, #20312, #20307, #20299, #20297, #20280
(maybe others)
  • Loading branch information
nyalldawson committed Nov 1, 2018
1 parent c782f27 commit fd5a1c82ec212c58c446ccb13e537484d44b6862
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/native/win/qgswinnative.cpp
@@ -163,9 +163,18 @@ QgsNative::NotificationResult QgsWinNative::showDesktopNotification( const QStri
return result;
}

bool QgsWinNativeEventFilter::nativeEventFilter( const QByteArray &, void *message, long * )
bool QgsWinNativeEventFilter::nativeEventFilter( const QByteArray &eventType, void *message, long * )
{
static const QByteArray sWindowsGenericMSG{ "windows_generic_MSG" };
if ( eventType != sWindowsGenericMSG )
return false;

MSG *pWindowsMessage = static_cast<MSG *>( message );
if ( pWindowsMessage->message != WM_DEVICECHANGE )
{
return false;
}

unsigned int wParam = pWindowsMessage->wParam;
if ( wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE )
{

0 comments on commit fd5a1c8

Please sign in to comment.
You can’t perform that action at this time.