diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/oshelper.cpp | 4 | ||||
| -rw-r--r-- | src/qt/macoshelper.h | 1 | ||||
| -rw-r--r-- | src/qt/macoshelper.mm | 35 | ||||
| -rw-r--r-- | src/qt/utils.cpp | 2 |
4 files changed, 1 insertions, 41 deletions
diff --git a/src/main/oshelper.cpp b/src/main/oshelper.cpp index 766aac5d..f9e33d13 100644 --- a/src/main/oshelper.cpp +++ b/src/main/oshelper.cpp @@ -70,9 +70,6 @@ namespace QPixmap screenshot() { -#ifdef Q_OS_MAC - return MacOSHelper::screenshot(); -#else std::unordered_set<QWindow *> hidden; const QWindowList windows = QGuiApplication::allWindows(); for (QWindow *window : windows) @@ -91,7 +88,6 @@ QPixmap screenshot() }); return QGuiApplication::primaryScreen()->grabWindow(0); -#endif } } // namespace diff --git a/src/qt/macoshelper.h b/src/qt/macoshelper.h index 7a7f2486..6bb7748d 100644 --- a/src/qt/macoshelper.h +++ b/src/qt/macoshelper.h @@ -38,7 +38,6 @@ class MacOSHelper public: static bool isCapsLock(); static bool openFolderAndSelectItem(const QUrl &path); - static QPixmap screenshot(); static QString bundlePath(); static void disableWindowTabbing(); }; diff --git a/src/qt/macoshelper.mm b/src/qt/macoshelper.mm index 47d22c44..eb96ef84 100644 --- a/src/qt/macoshelper.mm +++ b/src/qt/macoshelper.mm @@ -68,41 +68,6 @@ bool MacOSHelper::openFolderAndSelectItem(const QUrl &path) return true; } -QPixmap MacOSHelper::screenshot() -{ - std::unordered_set<uintptr_t> appWindowIds; - for (NSWindow *window in [NSApp windows]) - { - appWindowIds.insert((uintptr_t)[window windowNumber]); - } - - CFArrayRef onScreenWindows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); - const auto onScreenWindowsClenaup = sg::make_scope_guard([&onScreenWindows]() { - CFRelease(onScreenWindows); - }); - - CFMutableArrayRef foreignWindows = CFArrayCreateMutable(NULL, CFArrayGetCount(onScreenWindows), NULL); - const auto foreignWindowsClenaup = sg::make_scope_guard([&foreignWindows]() { - CFRelease(foreignWindows); - }); - - for (CFIndex index = 0, count = CFArrayGetCount(onScreenWindows); index < count; ++index) - { - const uintptr_t windowId = reinterpret_cast<const uintptr_t>(CFArrayGetValueAtIndex(onScreenWindows, index)); - if (appWindowIds.find(windowId) == appWindowIds.end()) - { - CFArrayAppendValue(foreignWindows, reinterpret_cast<const void *>(windowId)); - } - } - - CGImageRef image = CGWindowListCreateImageFromArray(CGRectInfinite, foreignWindows, kCGWindowListOptionAll); - const auto imageClenaup = sg::make_scope_guard([&image]() { - CFRelease(image); - }); - - return QtMac::fromCGImageRef(image); -} - QString MacOSHelper::bundlePath() { NSBundle *main = [NSBundle mainBundle]; diff --git a/src/qt/utils.cpp b/src/qt/utils.cpp index f4eafab2..a2f0962c 100644 --- a/src/qt/utils.cpp +++ b/src/qt/utils.cpp @@ -96,7 +96,7 @@ QString xdgMime(){ "X-GNOME-FullName=Monero-GUI\n" "Comment=Monero GUI\n" "Keywords=Monero;\n" - "Exec=%1 %u\n" + "Exec=\"%1\" %u\n" "Terminal=false\n" "Type=Application\n" "Icon=monero\n" |
