Skip to content

Commit

Permalink
Merge bitcoin#14594: qt: Fix minimized window bug on Linux
Browse files Browse the repository at this point in the history
a88640e Fix minimized window bug on Linux (Hennadii Stepanov)

Pull request description:

  Fix bitcoin#14591

  On some Linux systems the minimized to the taskbar (iconified) main window cannot be restored properly using actions from the systray icon menu when `QSystemTrayIcon::contextMenu()` is a child of the main window.

Tree-SHA512: 05c9f724fc2278d45dac6fe72b09859f12b5d71f54659bb779403c8cd81b55e610fb7b5aa912ac273d3cd19bf953b0405bbc6451feb00d1827c95dd9f0876aa4
  • Loading branch information
laanwj authored and Munkybooty committed Aug 21, 2021
1 parent 9c8420a commit 9749fb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/qt/bitcoingui.cpp
Expand Up @@ -36,6 +36,7 @@
#include <qt/masternodelist.h>

#include <iostream>
#include <memory>

#include <QAction>
#include <QApplication>
Expand All @@ -45,6 +46,7 @@
#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QListWidget>
#include <QMenu>
#include <QMenuBar>
#include <QMessageBox>
#include <QMimeData>
Expand All @@ -54,6 +56,7 @@
#include <QStackedWidget>
#include <QStatusBar>
#include <QStyle>
#include <QSystemTrayIcon>
#include <QTimer>
#include <QToolBar>
#include <QToolButton>
Expand All @@ -73,8 +76,9 @@ const std::string BitcoinGUI::DEFAULT_UIPLATFORM =

BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle, QWidget* parent) :
QMainWindow(parent),
m_node(node)
{
m_node(node),
trayIconMenu{new QMenu()},

GUIUtil::loadTheme(true);

QSettings settings;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/bitcoingui.h
Expand Up @@ -14,7 +14,6 @@
#include <QLabel>
#include <QMainWindow>
#include <QMap>
#include <QMenu>
#include <QPoint>
#include <QPushButton>
#include <QSystemTrayIcon>
Expand Down Expand Up @@ -46,6 +45,7 @@ QT_BEGIN_NAMESPACE
class QAction;
class QButtonGroup;
class QComboBox;
class QMenu;
class QProgressBar;
class QProgressDialog;
class QToolButton;
Expand Down Expand Up @@ -152,7 +152,7 @@ class BitcoinGUI : public QMainWindow
QComboBox* m_wallet_selector = nullptr;

QSystemTrayIcon* trayIcon = nullptr;
QMenu* trayIconMenu = nullptr;
const std::unique_ptr<QMenu> trayIconMenu;
QMenu* dockIconMenu = nullptr;
Notificator* notificator = nullptr;
RPCConsole* rpcConsole = nullptr;
Expand Down

0 comments on commit 9749fb9

Please sign in to comment.