windowstrayicon.cpp
// this function needs to be below ROWindowsTrayIconPrivate class declaration

this function needs to be below ROWindowsTrayIconPrivate class declaration
this function needs to be below ROWindowsTrayIconPrivate class declaration
void WindowsTrayMessageFilter::call_handler(uint iconId, MSG *msg) {
    if (!handlers.contains(iconId)) {
        qWarning() << "No handler for icon id: " << iconId;
        return;
    }
    WindowsTrayIconPrivate *handler = handlers[iconId];
    if (!handler) return; 
    uint notify_event = LOWORD(msg->lParam);
    int x = GET_X_LPARAM(msg->wParam);
    int y = GET_Y_LPARAM(msg->wParam);
    switch (notify_event) {
    case WM_MOUSEMOVE:
        handler->on_mouseMove(x, y);
        break;
    case WM_LBUTTONUP:
        handler->on_activate(QSystemTrayIcon::Trigger);
        break;
    case WM_CONTEXTMENU:
        handler->on_activate(QSystemTrayIcon::Context);
        break;
    case WM_MBUTTONUP:
        handler->on_activate(QSystemTrayIcon::MiddleClick);
        break;
    case WM_LBUTTONDBLCLK:
        handler->on_activate(QSystemTrayIcon::DoubleClick);
        break;
    }
}
void WindowsTrayMessageFilter :: call_handler ( uint iconId , MSG * msg ) { if ( ! handlers . contains ( iconId ) ) { qWarning ( ) << " " << iconId ; return ; } WindowsTrayIconPrivate * handler = handlers [ iconId ] ; if ( ! handler ) return ; uint notify_event = LOWORD ( msg -> lParam ) ; int x = GET_X_LPARAM ( msg -> wParam ) ; int y = GET_Y_LPARAM ( msg -> wParam ) ; switch ( notify_event ) { case WM_MOUSEMOVE : handler -> on_mouseMove ( x , y ) ; break ; case WM_LBUTTONUP : handler -> on_activate ( QSystemTrayIcon :: Trigger ) ; break ; case WM_CONTEXTMENU : handler -> on_activate ( QSystemTrayIcon :: Context ) ; break ; case WM_MBUTTONUP : handler -> on_activate ( QSystemTrayIcon :: MiddleClick ) ; break ; case WM_LBUTTONDBLCLK : handler -> on_activate ( QSystemTrayIcon :: DoubleClick ) ; break ; } }
this function needs to be below ROWindowsTrayIconPrivate class declaration
this function needs to be below ROWindowsTrayIconPrivate class declaration
// first, find handler for this tray icon
 // avoid dereference nullptr
 //
 // code below was for testing and it does not work :(
 //case NIN_POPUPOPEN:
 //    qDebug() << "NIN_POPUPOPEN";
 //    break;
 //case NIN_POPUPCLOSE:
 //    qDebug() << "NIN_POPUPOPEN";
 //    break;
 //case NIN_BALLOONSHOW:
 //    qDebug() << "NIN_BALLOONSHOW";
 //    break;
 //case NIN_BALLOONHIDE:
 //    qDebug() << "NIN_BALLOONHIDE";
 //    break;
