diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2018-11-02 10:58:14 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2018-11-04 02:42:18 +0200 |
commit | 6b1d2972bf9a40f97ba3a5c95831fd179b1054cf (patch) | |
tree | 45cb7b3258ab4b28685fd9b50f29234a4b749359 /src/qt/macdockiconhandler.mm | |
parent | 2464925e7be832d4926b6204169bbbc1646c6368 (diff) |
Remove obj_c for macOS Dock icon menu
Qt `setAsDockMenu()` does this work.
Diffstat (limited to 'src/qt/macdockiconhandler.mm')
-rw-r--r-- | src/qt/macdockiconhandler.mm | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index a356617697..102adce6c5 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -4,17 +4,13 @@ #include "macdockiconhandler.h" -#include <QMenu> -#include <QWidget> - #undef slots -#include <Cocoa/Cocoa.h> #include <objc/objc.h> #include <objc/message.h> static MacDockIconHandler *s_instance = nullptr; -bool dockClickHandler(id self,SEL _cmd,...) { +bool dockClickHandler(id self, SEL _cmd, ...) { Q_UNUSED(self) Q_UNUSED(_cmd) @@ -32,28 +28,9 @@ void setupDockClickHandler() { class_replaceMethod(delClass, shouldHandle, (IMP)dockClickHandler, "B@:"); } - MacDockIconHandler::MacDockIconHandler() : QObject() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - setupDockClickHandler(); - this->m_dummyWidget = new QWidget(); - this->m_dockMenu = new QMenu(this->m_dummyWidget); -#if QT_VERSION >= 0x050200 - this->m_dockMenu->setAsDockMenu(); -#endif - [pool release]; -} - -MacDockIconHandler::~MacDockIconHandler() -{ - delete this->m_dummyWidget; -} - -QMenu *MacDockIconHandler::dockMenu() -{ - return this->m_dockMenu; } MacDockIconHandler *MacDockIconHandler::instance() |