Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash on Windows on idle/usb notifications
Fixes #20312, #20319, #20312, #20307, #20299, #20297, #20280
(maybe others)

(cherry picked from commit fd5a1c8)
  • Loading branch information
nyalldawson committed Nov 1, 2018
1 parent 132688e commit 4659e69
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/native/win/qgswinnative.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 4659e69

Please sign in to comment.