Skip to content

Commit

Permalink
Fix crash on Windows on idle/usb notifications
Browse files Browse the repository at this point in the history
Fixes #20312, #20319, #20312, #20307, #20299, #20297, #20280
(maybe others)
  • Loading branch information
nyalldawson committed Nov 1, 2018
1 parent c782f27 commit fd5a1c8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/native/win/qgswinnative.cpp
Original file line number Diff line number Diff line change
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 fd5a1c8

Please sign in to comment.