Skip to content

Commit 3c0a6ca

Browse files
committed
fix: use consistent Q_OS_WIN macro for Windows platform detection
1 parent 2c9acd2 commit 3c0a6ca

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/qt/bitcoingui.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ BitcoinGUI::~BitcoinGUI()
253253
delete m_app_nap_inhibitor;
254254
MacDockIconHandler::cleanup();
255255
#endif
256+
#ifdef BITCOIN_QT_WIN_TASKBAR
257+
delete m_taskbar_progress;
258+
#endif
256259

257260
delete NetWatch;
258261
delete rpcConsole;
@@ -1442,6 +1445,13 @@ void BitcoinGUI::showEvent(QShowEvent *event)
14421445
showMempoolStatsAction->setEnabled(true);
14431446
aboutAction->setEnabled(true);
14441447
optionsAction->setEnabled(true);
1448+
1449+
#ifdef BITCOIN_QT_WIN_TASKBAR
1450+
// If window handle wasn't available during construction, set it now
1451+
if (m_taskbar_progress && !m_taskbar_progress->window() && windowHandle()) {
1452+
m_taskbar_progress->setWindow(windowHandle());
1453+
}
1454+
#endif
14451455
}
14461456

14471457
#ifdef ENABLE_WALLET

src/qt/wintaskbarprogress.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef BITCOIN_QT_WINTASKBARPROGRESS_H
66
#define BITCOIN_QT_WINTASKBARPROGRESS_H
77

8-
#ifdef WIN32
8+
#ifdef Q_OS_WIN
99
#include <QWindow>
1010

1111
#include <windows.h>
@@ -27,6 +27,9 @@ class WinTaskbarProgress
2727
/** Set the window handle to attach progress to */
2828
void setWindow(QWindow* window);
2929

30+
/** Get the window handle */
31+
QWindow* window() const { return m_window; }
32+
3033
/** Set progress value (0-100) */
3134
void setValue(int value);
3235

@@ -46,6 +49,6 @@ class WinTaskbarProgress
4649
void releaseTaskbar();
4750
};
4851

49-
#endif // WIN32
52+
#endif // Q_OS_WIN
5053

5154
#endif // BITCOIN_QT_WINTASKBARPROGRESS_H

0 commit comments

Comments
 (0)