Disable plugin transparency on Qt5 (#3934)
This commit is contained in:
committed by
Hyunjin Song
parent
0dbbdd9f4c
commit
7ed9bea9fb
@@ -31,15 +31,26 @@
|
||||
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
#include <windows.h>
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LMMS_BUILD_WIN32) && QT_VERSION >= 0x050000
|
||||
class MainApplication : public QApplication, public QAbstractNativeEventFilter
|
||||
#else
|
||||
class MainApplication : public QApplication
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
MainApplication(int& argc, char** argv);
|
||||
bool event(QEvent* event);
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
bool winEventFilter(MSG* msg, long* result);
|
||||
#if QT_VERSION >= 0x050000
|
||||
bool nativeEventFilter(const QByteArray& eventType, void* message,
|
||||
long* result);
|
||||
#endif
|
||||
#endif
|
||||
inline QString& queuedFile()
|
||||
{
|
||||
|
||||
@@ -33,7 +33,12 @@
|
||||
|
||||
MainApplication::MainApplication(int& argc, char** argv) :
|
||||
QApplication(argc, argv),
|
||||
m_queuedFile() {}
|
||||
m_queuedFile()
|
||||
{
|
||||
#if defined(LMMS_BUILD_WIN32) && QT_VERSION >= 0x050000
|
||||
installNativeEventFilter(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool MainApplication::event(QEvent* event)
|
||||
{
|
||||
@@ -64,6 +69,7 @@ bool MainApplication::event(QEvent* event)
|
||||
}
|
||||
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
// This can be moved into nativeEventFilter once Qt4 support has been dropped
|
||||
bool MainApplication::winEventFilter(MSG* msg, long* result)
|
||||
{
|
||||
switch(msg->message)
|
||||
@@ -85,4 +91,16 @@ bool MainApplication::winEventFilter(MSG* msg, long* result)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
bool MainApplication::nativeEventFilter(const QByteArray& eventType,
|
||||
void* message, long* result)
|
||||
{
|
||||
if(eventType == "windows_generic_MSG")
|
||||
{
|
||||
return winEventFilter(static_cast<MSG *>(message), result);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user