diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-11-22 18:48:08 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-11-23 17:05:26 +0300 |
commit | ce52b2e5a4888db9f8b27ad769acc4d679740359 (patch) | |
tree | a25480f1c56f4a60a38dc87f4590925195df3848 /src/gui/guiutility.cpp | |
parent | 2e4bf1d8c640a512996e9236645369c440c12b4b (diff) |
Enable dependency to QtWinExtras
Diffstat (limited to 'src/gui/guiutility.cpp')
-rw-r--r-- | src/gui/guiutility.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/guiutility.cpp b/src/gui/guiutility.cpp index 8414d0c5c..7608d6aaa 100644 --- a/src/gui/guiutility.cpp +++ b/src/gui/guiutility.cpp @@ -25,6 +25,9 @@ #ifdef Q_OS_WIN #include <QMetaMethod> +#include <QtWinExtras/qwinfunctions.h> +#include <qt_windows.h> + #include <chrono> #include <thread> @@ -63,11 +66,9 @@ void startShutdownWatcher() WNDCLASS wc = {}; wc.hInstance = GetModuleHandle(nullptr); wc.lpszClassName = L"ocWindowMessageWatcher"; -#if MIRALL_VERSION_MINOR > 9 -// TODO: for now we won't display a proper icon -#error "Please add the QtWinExtras dependency" - wc.hIcon = QtWin::toHICON(Theme::instance()->applicationIcon().pixmap(64, 64)); -#endif + if (qobject_cast<QGuiApplication *>(qApp)) { + wc.hIcon = QtWin::toHICON(Theme::instance()->applicationIcon().pixmap(64, 64)); + } wc.lpfnWndProc = [](HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -> LRESULT { // qDebug() << MSG { hwnd, msg, wParam, lParam, 0, {} }; if (msg == WM_QUERYENDSESSION) { |