From kde-cygwin Sun Apr 17 14:30:02 2005 From: Andreas Hausladen Date: Sun, 17 Apr 2005 14:30:02 +0000 To: kde-cygwin Subject: Patch for QApplication::winEventFilter Message-Id: <426272EA.7050402 () gmx ! de> X-MARC-Message: https://marc.info/?l=kde-cygwin&m=111374820903155 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------070305010003080302090003" This is a multi-part message in MIME format. --------------070305010003080302090003 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit QApplication::winEventFilter is never called. The attached patch calls winEventFilter from qt_windows_procedure. Regards, Andreas Hausladen --------------070305010003080302090003 Content-Type: text/plain; name="qapplication_win.cpp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qapplication_win.cpp.patch" Index: src/kernel/qapplication_win.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-3/src/kernel/Attic/qapplication_win.cpp,v retrieving revision 1.1.2.30.2.60 diff -u -r1.1.2.30.2.60 qapplication_win.cpp --- src/kernel/qapplication_win.cpp 14 Apr 2005 17:21:31 -0000 1.1.2.30.2.60 +++ src/kernel/qapplication_win.cpp 17 Apr 2005 14:18:52 -0000 @@ -193,27 +193,26 @@ typedef QValueList QVFuncList; //static QVFuncList *postRList = 0; // list of post routines -/*typedef int (*QX11EventFilter) (XEvent*); -QX11EventFilter qt_set_x11_event_filter (QX11EventFilter filter); - -static QX11EventFilter qt_x11_event_filter = 0; -QX11EventFilter qt_set_x11_event_filter (QX11EventFilter filter) +typedef int (*QwinEventFilter) (MSG*); +QwinEventFilter qt_set_win_event_filter (QwinEventFilter filter); + +static QwinEventFilter qt_win_event_filter = 0; +QwinEventFilter qt_set_win_event_filter (QwinEventFilter filter) { #ifdef DEBUG_QAPPLICATION - qDebug("qapplication_win.cpp: qt_x11_event_filter"); + qDebug("qapplication_win.cpp: qt_win_event_filter"); #endif - QX11EventFilter old_filter = qt_x11_event_filter; - qt_x11_event_filter = filter; + QwinEventFilter old_filter = qt_win_event_filter; + qt_win_event_filter = filter; return old_filter; } - -static bool qt_x11EventFilter( XEvent* ev ) + +static bool qt_winEventFilter( MSG* msg ) { - if ( qt_x11_event_filter && qt_x11_event_filter( ev ) ) - return TRUE; - return qApp->x11EventFilter( ev ); + if ( qt_win_event_filter && qt_win_event_filter( msg ) ) + return TRUE; + return qApp->winEventFilter( msg ); } -*/ #ifdef DEBUG_QAPPLICATION char* getMsgName( UINT msgID ); @@ -3463,6 +3462,18 @@ } } + // invoke winEventFilter + MSG message; + message.hwnd = hWnd; + message.message = uMsg; + message.wParam = wParam; + message.lParam = lParam; + message.time = 0; // not used + message.pt.x = 0; // not used + message.pt.y = 0; // not used + if ( qt_winEventFilter( &message ) ) + return 1; + switch ( uMsg ) { case WM_CLOSE: if ( widget ) --------------070305010003080302090003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-cygwin mailing list kde-cygwin@kde.org https://mail.kde.org/mailman/listinfo/kde-cygwin --------------070305010003080302090003--