Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from main Branch #6

Merged
merged 25 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
95bae83
Add SECURITY.md to guide security vulnerability reporting (#11360)
Ahlam-Banu Oct 19, 2024
6e0baf9
Support passkeys with Bitwarden import (#11401)
varjolintu Oct 25, 2024
8acc542
Reset splitter sizes on database unlock
droidmonkey Jul 1, 2024
feafcec
Improve related splitter UX
droidmonkey Sep 23, 2024
34fe413
Fix resolving advanced values in entry preview
droidmonkey Sep 23, 2024
5d24495
Hide the menubar when menus lose focus (if toggled off)
droidmonkey Oct 12, 2024
2738a72
Fix assert hit when viewing entry history
droidmonkey Oct 19, 2024
181f480
Build for MacOS too
blessio Oct 17, 2024
b734037
Removed apt upgrade and corrected winget install
blessio Nov 2, 2024
d03ffc2
Fixed background color when window is out of focus
xboxones1 Nov 2, 2024
1e7175d
Merger manually a wait logic from air-hand
blessio Nov 2, 2024
3fd8286
pinned winget version to a newer but still working version
blessio Nov 3, 2024
d4e0fd3
Merge branch 'keepassxreboot:develop' into devbleo3
blessio Nov 3, 2024
63eab48
Set the devbleo3 scheduled overy friday 3:07 AM
blessio Nov 4, 2024
9e3763c
Merge branch 'devbleo3' of github.com:blessio/keepassxc-B into devbleo3
blessio Nov 4, 2024
970e5ee
move from macos-12 to macos-13
blessio Nov 4, 2024
6e81451
Add timeout to SSH Agent streams
droidmonkey Sep 23, 2024
ca9b88f
Replace legacy code on macOS builds (#11428)
FischLu Nov 10, 2024
bff0b93
Device Password fallback when Touch-ID devices are unavailable (#11410)
findus Nov 10, 2024
2fc24be
Browser: Fix cancel with database unlock dialog (#11435)
varjolintu Nov 10, 2024
4acb377
Hide status bar on WelcomeScreen
xboxones1 Nov 10, 2024
b9c5869
Implement T-CONV and T-REPLACE-RX entry placeholders
droidmonkey Nov 9, 2024
9b8163c
Use better xref syntax for documentation
droidmonkey Nov 10, 2024
bf856d2
Detect outdated VC Redist with MSI Installer
droidmonkey Nov 8, 2024
b97969e
Merge branch 'keepassxreboot:develop' into devbleo3
blessio Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace legacy code on macOS builds (keepassxreboot#11428)
* Fix macOS build error due to CGDisplayStreamCreate being deprecated.

---------

Co-authored-by: FischLu <randomDe@proton.me>
  • Loading branch information
FischLu and FischLu authored Nov 10, 2024
commit ca9b88fae80c6827cd252a94e5a802dc22d8b084
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ target_link_libraries(keepassxc_gui
${sshagent_LIB})

if(APPLE)
target_link_libraries(keepassxc_gui "-framework Foundation -framework AppKit -framework Carbon -framework Security -framework LocalAuthentication")
target_link_libraries(keepassxc_gui "-framework Foundation -framework AppKit -framework Carbon -framework Security -framework LocalAuthentication -framework ScreenCaptureKit")
if(Qt5MacExtras_FOUND)
target_link_libraries(keepassxc_gui Qt5::MacExtras)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/mac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(autotype_mac_SOURCES AutoTypeMac.cpp)

add_library(keepassxc-autotype-cocoa MODULE ${autotype_mac_SOURCES})
set_target_properties(keepassxc-autotype-cocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit -framework Carbon")
set_target_properties(keepassxc-autotype-cocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit -framework Carbon -framework ScreenCaptureKit")
target_link_libraries(keepassxc-autotype-cocoa ${PROGNAME} Qt5::Core Qt5::Widgets)

install(TARGETS keepassxc-autotype-cocoa
Expand Down
50 changes: 31 additions & 19 deletions src/gui/osutils/macutils/AppKitImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#import "AppKitImpl.h"
#import <QWindow>
#import <Cocoa/Cocoa.h>
#if __clang_major__ >= 13 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_3
#import <ScreenCaptureKit/ScreenCaptureKit.h>
#endif

@implementation AppKitImpl

Expand Down Expand Up @@ -181,28 +184,37 @@ - (bool) enableAccessibility
//
// Check if screen recording is enabled, may show an popup asking for permissions
//
- (bool) enableScreenRecording
- (bool) enableScreenRecording
{
#if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
if (@available(macOS 10.15, *)) {
// Request screen recording permission on macOS 10.15+
// This is necessary to get the current window title
CGDisplayStreamRef stream = CGDisplayStreamCreate(CGMainDisplayID(), 1, 1, kCVPixelFormatType_32BGRA, nil,
^(CGDisplayStreamFrameStatus status, uint64_t displayTime,
IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) {
Q_UNUSED(status);
Q_UNUSED(displayTime);
Q_UNUSED(frameSurface);
Q_UNUSED(updateRef);
});
if (stream) {
CFRelease(stream);
} else {
return NO;
}
#if __clang_major__ >= 13 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_3
if (@available(macOS 12.3, *)) {
__block BOOL hasPermission = NO;
dispatch_semaphore_t sema = dispatch_semaphore_create(0);

// Attempt to use SCShareableContent to check for screen recording permission
[SCShareableContent getShareableContentWithCompletionHandler:^(SCShareableContent * _Nullable content,
NSError * _Nullable error) {
Q_UNUSED(error);
if (content) {
// Successfully obtained content, indicating permission is granted
hasPermission = YES;
} else {
// No permission or other error occurred
hasPermission = NO;
}
// Notify the semaphore that the asynchronous task is complete
dispatch_semaphore_signal(sema);
}];

// Wait for the asynchronous callback to complete
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
dispatch_semaphore_wait(sema, timeout);

// Return the final result
return hasPermission;
}
#endif
return YES;
return YES; // Return YES for macOS versions that do not support ScreenCaptureKit
}

- (void) toggleForegroundApp:(bool) foreground
Expand Down