From 6563bec7e4fdde54e7defae1642d0075340f1967 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 15 Sep 2018 13:07:51 +0200 Subject: [PATCH] Remove builtin qtwin and use WinExtras, replace some macros --- 3rdparty/qtsingleapplication/CMakeLists.txt | 2 + 3rdparty/qtsingleapplication/qtlockedfile.h | 2 +- .../qtsingleapplication.cpp | 11 +- .../qtsingleapplication/qtsingleapplication.h | 15 +- .../qtsinglecoreapplication.h | 2 + 3rdparty/qtwin/CMakeLists.txt | 14 -- 3rdparty/qtwin/qtwin.cpp | 229 ------------------ 3rdparty/qtwin/qtwin.h | 38 --- 3rdparty/qxt/qxtglobalshortcut.cpp | 12 +- 3rdparty/qxt/qxtglobalshortcut_p.h | 4 +- CMakeLists.txt | 16 +- dist/windows/strawberry-debug.nsi.in | 2 + dist/windows/strawberry.nsi.in | 2 + src/CMakeLists.txt | 6 - src/core/qtsystemtrayicon.cpp | 2 +- src/widgets/osdpretty.cpp | 12 +- 16 files changed, 50 insertions(+), 319 deletions(-) delete mode 100644 3rdparty/qtwin/CMakeLists.txt delete mode 100644 3rdparty/qtwin/qtwin.cpp delete mode 100644 3rdparty/qtwin/qtwin.h diff --git a/3rdparty/qtsingleapplication/CMakeLists.txt b/3rdparty/qtsingleapplication/CMakeLists.txt index e3336e60..eda4df04 100644 --- a/3rdparty/qtsingleapplication/CMakeLists.txt +++ b/3rdparty/qtsingleapplication/CMakeLists.txt @@ -27,3 +27,5 @@ ADD_LIBRARY(qtsingleapplication STATIC ) target_link_libraries(qtsingleapplication Qt5::Core Qt5::Widgets Qt5::Network) + +include_directories(${CMAKE_BINARY_DIR}/src) diff --git a/3rdparty/qtsingleapplication/qtlockedfile.h b/3rdparty/qtsingleapplication/qtlockedfile.h index 5fd80260..1013442a 100644 --- a/3rdparty/qtsingleapplication/qtlockedfile.h +++ b/3rdparty/qtsingleapplication/qtlockedfile.h @@ -45,7 +45,7 @@ #include #endif -#if defined(Q_WS_WIN) || defined(Q_OS_WIN) +#if defined(Q_OS_WIN) # if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) # define QT_QTLOCKEDFILE_EXPORT # elif defined(QT_QTLOCKEDFILE_IMPORT) diff --git a/3rdparty/qtsingleapplication/qtsingleapplication.cpp b/3rdparty/qtsingleapplication/qtsingleapplication.cpp index 956cf86e..f9a92e04 100644 --- a/3rdparty/qtsingleapplication/qtsingleapplication.cpp +++ b/3rdparty/qtsingleapplication/qtsingleapplication.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include "config.h" #include "qtsingleapplication.h" @@ -44,6 +45,10 @@ #include #include +#ifdef HAVE_X11_ // FIXME +# include +#endif + #include "qtlocalpeer.h" /*! @@ -173,14 +178,14 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char * } -#if defined(Q_WS_X11) +#if defined(HAVE_X11_) // FIXME /*! Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be QCoreApplication::applicationFilePath(). \a dpy, \a visual, and \a cmap are passed on to the QApplication constructor. */ -QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE cmap) +QtSingleApplication::QtSingleApplication(Display *dpy, Qt::HANDLE visual, Qt::HANDLE cmap) : QApplication(dpy, visual, cmap) { sysInit(); @@ -206,7 +211,7 @@ QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Q argv, \a visual, and \a cmap are passed on to the QApplication constructor. */ -QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) +QtSingleApplication::QtSingleApplication(Display *dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) : QApplication(dpy, argc, argv, visual, cmap) { sysInit(appId); diff --git a/3rdparty/qtsingleapplication/qtsingleapplication.h b/3rdparty/qtsingleapplication/qtsingleapplication.h index 09607c43..96bc6a5e 100644 --- a/3rdparty/qtsingleapplication/qtsingleapplication.h +++ b/3rdparty/qtsingleapplication/qtsingleapplication.h @@ -40,14 +40,21 @@ #ifndef QTSINGLEAPPLICATION_H #define QTSINGLEAPPLICATION_H +#include "config.h" + #include #include #include #include #include + +#if defined(HAVE_X11_) // FIXME +# include +#endif + class QtLocalPeer; -#if defined(Q_WS_WIN) || defined(Q_OS_WIN32) +#if defined(Q_OS_WIN) || defined(Q_OS_WIN32) # if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT) # define QT_QTSINGLEAPPLICATION_EXPORT # elif defined(QT_QTSINGLEAPPLICATION_IMPORT) @@ -70,10 +77,10 @@ class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication public: QtSingleApplication(int &argc, char **argv, bool GUIenabled = true); QtSingleApplication(const QString &id, int &argc, char **argv); -#if defined(Q_WS_X11) - QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); +#if defined(HAVE_X11_) // FIXME + QtSingleApplication(Display *dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); - QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); + QtSingleApplication(Display *dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); #endif bool isRunning(); diff --git a/3rdparty/qtsingleapplication/qtsinglecoreapplication.h b/3rdparty/qtsingleapplication/qtsinglecoreapplication.h index c5c4a478..bb32fecf 100644 --- a/3rdparty/qtsingleapplication/qtsinglecoreapplication.h +++ b/3rdparty/qtsingleapplication/qtsinglecoreapplication.h @@ -40,6 +40,8 @@ #ifndef QTSINGLECOREAPPLICATION_H #define QTSINGLECOREAPPLICATION_H +#include "config.h" + #include #include #include diff --git a/3rdparty/qtwin/CMakeLists.txt b/3rdparty/qtwin/CMakeLists.txt deleted file mode 100644 index 1c2f2767..00000000 --- a/3rdparty/qtwin/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -set(CMAKE_CXX_STANDARD 11) - -set(QTWIN-SOURCES - qtwin.cpp -) - -ADD_LIBRARY(qtwin STATIC - ${QTWIN-SOURCES} -) - -target_link_libraries(qtwin - Qt5::Widgets -) diff --git a/3rdparty/qtwin/qtwin.cpp b/3rdparty/qtwin/qtwin.cpp deleted file mode 100644 index f393cd64..00000000 --- a/3rdparty/qtwin/qtwin.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Use, modification and distribution is allowed without limitation, -** warranty, liability or support of any kind. -** -****************************************************************************/ - -#include "qtwin.h" -#include -#include -#include -#include -#include - -#ifdef Q_WS_WIN - -#include - -// Blur behind data structures -#define DWM_BB_ENABLE 0x00000001 // fEnable has been specified -#define DWM_BB_BLURREGION 0x00000002 // hRgnBlur has been specified -#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004 // fTransitionOnMaximized has been specified -#define WM_DWMCOMPOSITIONCHANGED 0x031E // Composition changed window message - -typedef struct _DWM_BLURBEHIND -{ - DWORD dwFlags; - BOOL fEnable; - HRGN hRgnBlur; - BOOL fTransitionOnMaximized; -} DWM_BLURBEHIND, *PDWM_BLURBEHIND; - -typedef struct _MARGINS -{ - int cxLeftWidth; - int cxRightWidth; - int cyTopHeight; - int cyBottomHeight; -} MARGINS, *PMARGINS; - -typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL* pfEnabled); -typedef HRESULT (WINAPI *PtrDwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS* pMarInset); -typedef HRESULT (WINAPI *PtrDwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind); -typedef HRESULT (WINAPI *PtrDwmGetColorizationColor)(DWORD *pcrColorization, BOOL *pfOpaqueBlend); - -static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled= 0; -static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0; -static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0; -static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0; - - -/* - * Internal helper class that notifies windows if the - * DWM compositing state changes and updates the widget - * flags correspondingly. - */ -class WindowNotifier : public QWidget -{ -public: - WindowNotifier() { winId(); } - void addWidget(QWidget *widget) { widgets.append(widget); } - void removeWidget(QWidget *widget) { widgets.removeAll(widget); } - bool winEvent(MSG *message, long *result); - -private: - QWidgetList widgets; -}; - -static bool resolveLibs() -{ - if (!pDwmIsCompositionEnabled) { - QLibrary dwmLib(QString::toLatin1("dwmapi")); - pDwmIsCompositionEnabled =(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled"); - pDwmExtendFrameIntoClientArea = (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea"); - pDwmEnableBlurBehindWindow = (PtrDwmEnableBlurBehindWindow)dwmLib.resolve("DwmEnableBlurBehindWindow"); - pDwmGetColorizationColor = (PtrDwmGetColorizationColor)dwmLib.resolve("DwmGetColorizationColor"); - } - return pDwmIsCompositionEnabled != 0; -} - -#endif - -/*! - * Chekcs and returns true if Windows DWM composition - * is currently enabled on the system. - * - * To get live notification on the availability of - * this feature, you will currently have to - * reimplement winEvent() on your widget and listen - * for the WM_DWMCOMPOSITIONCHANGED event to occur. - * - */ -bool QtWin::isCompositionEnabled() -{ -#ifdef Q_WS_WIN - if (resolveLibs()) { - HRESULT hr = S_OK; - BOOL isEnabled = false; - hr = pDwmIsCompositionEnabled(&isEnabled); - if (SUCCEEDED(hr)) - return isEnabled; - } -#endif - return false; -} - -/*! - * Enables Blur behind on a Widget. - * - * \a enable tells if the blur should be enabled or not - */ -bool QtWin::enableBlurBehindWindow(QWidget *widget, bool enable, - const QRegion ®ion) -{ - Q_ASSERT(widget); - bool result = false; -#ifdef Q_WS_WIN - if (resolveLibs()) { - DWM_BLURBEHIND bb = {0}; - HRESULT hr = S_OK; - bb.fEnable = enable; - bb.dwFlags = DWM_BB_ENABLE; - bb.hRgnBlur = NULL; - - if (!region.isEmpty()) { - bb.dwFlags |= DWM_BB_BLURREGION; - bb.hRgnBlur = region.handle(); - } - - widget->setAttribute(Qt::WA_TranslucentBackground, enable); - widget->setAttribute(Qt::WA_NoSystemBackground, enable); - hr = pDwmEnableBlurBehindWindow(widget->winId(), &bb); - if (SUCCEEDED(hr)) { - result = true; - windowNotifier()->addWidget(widget); - } - } -#endif - return result; -} - -/*! - * ExtendFrameIntoClientArea. - * - * This controls the rendering of the frame inside the window. - * Note that passing margins of -1 (the default value) will completely - * remove the frame from the window. - * - * \note you should not call enableBlurBehindWindow before calling - * this functions - * - * \a enable tells if the blur should be enabled or not - */ -bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom) -{ - - Q_ASSERT(widget); - Q_UNUSED(left); - Q_UNUSED(top); - Q_UNUSED(right); - Q_UNUSED(bottom); - - bool result = false; -#ifdef Q_WS_WIN - if (resolveLibs()) { - QLibrary dwmLib(QString::toLatin1("dwmapi")); - HRESULT hr = S_OK; - MARGINS m = {left, top, right, bottom}; - hr = pDwmExtendFrameIntoClientArea(widget->winId(), &m); - if (SUCCEEDED(hr)) { - result = true; - windowNotifier()->addWidget(widget); - } - widget->setAttribute(Qt::WA_TranslucentBackground, result); - } -#endif - return result; -} - -/*! - * Returns the current colorizationColor for the window. - * - * \a enable tells if the blur should be enabled or not - */ -QColor QtWin::colorizatinColor() -{ - QColor resultColor = QApplication::palette().window().color(); - -#ifdef Q_WS_WIN - if (resolveLibs()) { - DWORD color = 0; - BOOL opaque = FALSE; - QLibrary dwmLib(QString::toLatin1("dwmapi")); - HRESULT hr = S_OK; - hr = pDwmGetColorizationColor(&color, &opaque); - if (SUCCEEDED(hr)) - resultColor = QColor(color); - } -#endif - return resultColor; -} - -#ifdef Q_WS_WIN -WindowNotifier *QtWin::windowNotifier() -{ - static WindowNotifier *windowNotifierInstance = 0; - if (!windowNotifierInstance) - windowNotifierInstance = new WindowNotifier; - return windowNotifierInstance; -} - - -/* Notify all enabled windows that the DWM state changed */ -bool WindowNotifier::winEvent(MSG *message, long *result) -{ - if (message && message->message == WM_DWMCOMPOSITIONCHANGED) { - bool compositionEnabled = QtWin::isCompositionEnabled(); - foreach(QWidget * widget, widgets) { - if (widget) { - widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled); - } - widget->update(); - } - } - return QWidget::winEvent(message, result); -} -#endif diff --git a/3rdparty/qtwin/qtwin.h b/3rdparty/qtwin/qtwin.h deleted file mode 100644 index a4018585..00000000 --- a/3rdparty/qtwin/qtwin.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Use, modification and distribution is allowed without limitation, -** warranty, liability or support of any kind. -** -****************************************************************************/ - -#ifndef QTWIN_H -#define QTWIN_H - -#include -#include -/** - * This is a helper class for using the Desktop Window Manager - * functionality on Windows 7 and Windows Vista. On other platforms - * these functions will simply not do anything. - */ - -class WindowNotifier; - -class QtWin -{ -public: - static bool enableBlurBehindWindow(QWidget *widget, bool enable = true, - const QRegion& region = QRegion()); - static bool extendFrameIntoClientArea(QWidget *widget, - int left = -1, int top = -1, - int right = -1, int bottom = -1); - static bool isCompositionEnabled(); - static QColor colorizatinColor(); - -private: - static WindowNotifier *windowNotifier(); -}; - -#endif // QTWIN_H diff --git a/3rdparty/qxt/qxtglobalshortcut.cpp b/3rdparty/qxt/qxtglobalshortcut.cpp index ba9a40e1..c2f0155f 100644 --- a/3rdparty/qxt/qxtglobalshortcut.cpp +++ b/3rdparty/qxt/qxtglobalshortcut.cpp @@ -38,36 +38,36 @@ #include "qxtglobalshortcut_p.h" bool QxtGlobalShortcutPrivate::error = false; -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC int QxtGlobalShortcutPrivate::ref = 0; #if QT_VERSION < QT_VERSION_CHECK(5,0,0) QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0; #endif -#endif // Q_WS_MAC +#endif // Q_OS_MAC QHash, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier) { -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC if (!ref++) #if QT_VERSION < QT_VERSION_CHECK(5,0,0) prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter); #else QAbstractEventDispatcher::instance()->installNativeEventFilter(this); #endif -#endif // Q_WS_MAC +#endif // Q_OS_MAC } QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() { -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC if (!--ref) #if QT_VERSION < QT_VERSION_CHECK(5,0,0) QAbstractEventDispatcher::instance()->setEventFilter(prevEventFilter); #else QAbstractEventDispatcher::instance()->removeNativeEventFilter(this); #endif -#endif // Q_WS_MAC +#endif // Q_OS_MAC } bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut) diff --git a/3rdparty/qxt/qxtglobalshortcut_p.h b/3rdparty/qxt/qxtglobalshortcut_p.h index 1a788852..14088c45 100644 --- a/3rdparty/qxt/qxtglobalshortcut_p.h +++ b/3rdparty/qxt/qxtglobalshortcut_p.h @@ -59,7 +59,7 @@ public: bool unsetShortcut(); static bool error; -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC static int ref; #if QT_VERSION < QT_VERSION_CHECK(5,0,0) static QAbstractEventDispatcher::EventFilter prevEventFilter; @@ -67,7 +67,7 @@ public: #else virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) -#endif // Q_WS_MAC +#endif // Q_OS_MAC static void activateShortcut(quint32 nativeKey, quint32 nativeMods); diff --git a/CMakeLists.txt b/CMakeLists.txt index 14cd2df7..57466aaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,6 +137,9 @@ endif() if(APPLE) find_package(Qt5 REQUIRED COMPONENTS MacExtras) endif() +if(WIN32) + find_package(Qt5 REQUIRED COMPONENTS WinExtras) +endif() set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql Qt5::OpenGL Qt5::Xml) @@ -149,11 +152,9 @@ endif() if(APPLE) set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::MacExtras) endif() - -# Don't try to use webkit if their include directories couldn't be found. -if (NOT QT_QTWEBKIT_INCLUDE_DIR) - set (QT_USE_QTWEBKIT 0) -endif (NOT QT_QTWEBKIT_INCLUDE_DIR) +if(WIN32) + set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::WinExtras) +endif() # TAGLIB pkg_check_modules(TAGLIB taglib) @@ -243,11 +244,6 @@ endif (USE_SYSTEM_QXT) set(QOCOA_LIBRARIES Qocoa) add_subdirectory(3rdparty/qocoa) -# Windows -if (WIN32) - add_subdirectory(3rdparty/qtwin) -endif (WIN32) - if (APPLE) find_library(SPARKLE Sparkle) add_subdirectory(3rdparty/SPMediaKeyTap) diff --git a/dist/windows/strawberry-debug.nsi.in b/dist/windows/strawberry-debug.nsi.in index 0725c58e..dd046fea 100644 --- a/dist/windows/strawberry-debug.nsi.in +++ b/dist/windows/strawberry-debug.nsi.in @@ -155,6 +155,7 @@ Section "Strawberry" Strawberry File "Qt5Sql.dll" File "Qt5Widgets.dll" File "Qt5Xml.dll" + File "Qt5WinExtras.dll" File "zlib1.dll" File "libxine-2.dll" File "libmpcdec-5.dll" @@ -396,6 +397,7 @@ Section "Uninstall" Delete "$INSTDIR\Qt5Sql.dll" Delete "$INSTDIR\Qt5Widgets.dll" Delete "$INSTDIR\Qt5Xml.dll" + Delete "$INSTDIR\Qt5WinExtras.dll" Delete "$INSTDIR\zlib1.dll" Delete "$INSTDIR\libxine-2.dll" Delete "$INSTDIR\libmpcdec-5.dll" diff --git a/dist/windows/strawberry.nsi.in b/dist/windows/strawberry.nsi.in index a3083239..cb424ab5 100644 --- a/dist/windows/strawberry.nsi.in +++ b/dist/windows/strawberry.nsi.in @@ -155,6 +155,7 @@ Section "Strawberry" Strawberry File "Qt5Sql.dll" File "Qt5Widgets.dll" File "Qt5Xml.dll" + File "Qt5WinExtras.dll" File "zlib1.dll" ;File "libmpcdec-5.dll" ;File "libtheora-0.dll" @@ -364,6 +365,7 @@ Section "Uninstall" Delete "$INSTDIR\Qt5Sql.dll" Delete "$INSTDIR\Qt5Widgets.dll" Delete "$INSTDIR\Qt5Xml.dll" + Delete "$INSTDIR\Qt5WinExtras.dll" Delete "$INSTDIR\zlib1.dll" ;Delete "$INSTDIR\libmpcdec-5.dll" ;Delete "$INSTDIR\libtheora-0.dll" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cff5d282..d4c84c52 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -74,11 +74,6 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common) include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-tagreader) include_directories(${CMAKE_BINARY_DIR}/ext/libstrawberry-tagreader) -# Windows -if (WIN32) - include_directories(../3rdparty/qtwin) -endif (WIN32) - set(SOURCES core/mainwindow.cpp core/application.cpp @@ -965,7 +960,6 @@ endif (APPLE) if (WIN32) target_link_libraries(strawberry_lib ${ZLIB_LIBRARIES} - qtwin dsound ${QT_QTGUI_LIBRARY} ) diff --git a/src/core/qtsystemtrayicon.cpp b/src/core/qtsystemtrayicon.cpp index d571fd27..180a34d0 100644 --- a/src/core/qtsystemtrayicon.cpp +++ b/src/core/qtsystemtrayicon.cpp @@ -217,7 +217,7 @@ void QtSystemTrayIcon::SetVisible(bool visible) { void QtSystemTrayIcon::SetNowPlaying(const Song &song, const QString &image_path) { -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN // Windows doesn't support HTML in tooltips, so just show something basic tray_->setToolTip(song.PrettyTitleWithArtist()); return; diff --git a/src/widgets/osdpretty.cpp b/src/widgets/osdpretty.cpp index 1e320909..aeb8f30c 100644 --- a/src/widgets/osdpretty.cpp +++ b/src/widgets/osdpretty.cpp @@ -49,15 +49,17 @@ #include #include #include -#ifdef Q_WS_X11 +#ifdef HAVE_X11 # include #endif +#ifdef Q_OS_WIN +# include +#endif #include "osdpretty.h" #include "ui_osdpretty.h" -#ifdef Q_OS_WIN32 -# include "qtwin.h" +#ifdef Q_OS_WIN # include #endif @@ -160,7 +162,7 @@ OSDPretty::~OSDPretty() { } bool OSDPretty::IsTransparencyAvailable() { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 return QX11Info::isCompositingManagerRunning(); #endif return true; @@ -366,7 +368,7 @@ void OSDPretty::Reposition() { #ifdef Q_OS_WIN32 // On windows, enable blurbehind on the masked area - QtWin::enableBlurBehindWindow(this, true, QRegion(mask)); + QtWin::enableBlurBehindWindow(this, QRegion(mask)); #endif }