From 2573062f8b833f39b2d528617bf52f0ed77125fc Mon Sep 17 00:00:00 2001 From: Kaarlo Raiha Date: Sun, 5 Oct 2008 17:35:00 +0300 Subject: [PATCH] QT4 wineventfilter for Win32, allows WM_APPCOMMAND stuff MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Denis-Courmont --- modules/gui/qt4/qt4.cpp | 17 +++++++++++++++++ modules/gui/qt4/qt4.hpp | 13 +++++++++++++ 2 files changed, 30 insertions(+) mode change 100644 => 100755 modules/gui/qt4/qt4.cpp mode change 100644 => 100755 modules/gui/qt4/qt4.hpp diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp old mode 100644 new mode 100755 index b6c95f4f53..9132468496 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -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( diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp old mode 100644 new mode 100755 index 2a0e004205..f9a46636ca --- a/modules/gui/qt4/qt4.hpp +++ b/modules/gui/qt4/qt4.hpp @@ -48,6 +48,19 @@ class DialogsProvider; class VideoWidget; class QSettings; +#if defined(Q_WS_WIN) +#include + +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; -- 2.39.2