diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2024-08-13 12:41:22 -0400 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2024-08-13 12:41:22 -0400 |
| commit | af92ca67d761b9b8d15b3920351f648822a74c23 (patch) | |
| tree | b58769948b525e24e1696094e6605c27d0fe1f4b /src/qt | |
| parent | 6889ab5ac178a3bcec6638106e60c413e9d3b071 (diff) | |
| parent | 8118355f39b114e309faad4574abf71c40bfe534 (diff) | |
| download | monzero-gui-af92ca67d761b9b8d15b3920351f648822a74c23.tar.gz monzero-gui-af92ca67d761b9b8d15b3920351f648822a74c23.tar.xz monzero-gui-af92ca67d761b9b8d15b3920351f648822a74c23.zip | |
Merge pull request #4333
8118355 macOS: remove deprecated screenshot function (tobtoht)
Diffstat (limited to 'src/qt')
| -rw-r--r-- | src/qt/macoshelper.h | 1 | ||||
| -rw-r--r-- | src/qt/macoshelper.mm | 35 |
2 files changed, 0 insertions, 36 deletions
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]; |
