[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    Patch for QApplication::winEventFilter
From:       Andreas Hausladen <Andreas.Hausladen () gmx ! de>
Date:       2005-04-17 14:30:02
Message-ID: 426272EA.7050402 () gmx ! de
[Download RAW message or body]

QApplication::winEventFilter is never called.
The attached patch calls winEventFilter from qt_windows_procedure.


Regards,
Andreas Hausladen

["qapplication_win.cpp.patch" (text/plain)]

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<VFPTR> 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 )


_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic