]> git.sesse.net Git - vlc/commitdiff
QT4 wineventfilter for Win32, allows WM_APPCOMMAND stuff
authorKaarlo Raiha <kaarlo.raiha@tut.fi>
Sun, 5 Oct 2008 14:35:00 +0000 (17:35 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 5 Oct 2008 14:54:53 +0000 (17:54 +0300)
Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
modules/gui/qt4/qt4.cpp [changed mode: 0644->0755]
modules/gui/qt4/qt4.hpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b6c95f4..9132468
@@ -220,6 +220,19 @@ vlc_module_begin();
 #endif
 vlc_module_end();
 
+#if defined(Q_WS_WIN)
+bool WinQtApp::winEventFilter( MSG *msg, long *result )
+{
+    switch( msg->message )
+    {
+        case 0x0319: /* WM_APPCOMMAND 0x0319 */
+        DefWindowProc( msg->hwnd, msg->message, msg->wParam, msg->lParam );
+        break;
+    }
+    return false;
+}
+#endif /* Q_WS_WIN */
+
 /*****************************************************************************
  * Module callbacks
  *****************************************************************************/
@@ -334,7 +347,11 @@ static void *Init( vlc_object_t *obj )
 #endif
 
     /* Start the QApplication here */
+#ifdef WIN32
+    WinQtApp *app = new WinQtApp( argc, argv , true );
+#else
     QApplication *app = new QApplication( argc, argv , true );
+#endif
     p_intf->p_sys->p_app = app;
 
     p_intf->p_sys->mainSettings = new QSettings(
old mode 100644 (file)
new mode 100755 (executable)
index 2a0e004..f9a4663
@@ -48,6 +48,19 @@ class DialogsProvider;
 class VideoWidget;
 class QSettings;
 
+#if defined(Q_WS_WIN)
+#include <QApplication>
+
+class WinQtApp : public QApplication
+{
+public:
+    WinQtApp ( int & argc, char ** argv, bool GUIenabled ) : QApplication( argc, argv, GUIenabled ) {}
+    ~WinQtApp() {}
+protected:
+    bool winEventFilter(MSG *msg, long *result);
+};
+#endif /* Q_WS_WIN */
+
 struct intf_sys_t
 {
     QApplication *p_app;