Repository navigation
feat(window,screen-capture): add WindowLevel, instant macOS visibility, square frameless, and exclude_own_windows - #115
Merged
Conversation
…y, square frameless, and exclude_own_windows - Add WindowLevel (Normal, Floating, Status, ScreenSaver) with Window::SetLevel/GetLevel across all platforms and unconstrained macOS bounds at Status/ScreenSaver levels (#81) - Disable AppKit hide/show fade-and-shrink animation in macOS Window::Hide/Show/ShowInactive (#82) - Strip NSWindowStyleMaskTitled in macOS Window::SetFrameless(true) for true square corners while preserving key/main focusability (#83) - Add ScreenCaptureOptions::exclude_own_windows on macOS (SCContentFilter excluding own PID) and Windows (WDA_EXCLUDEFROMCAPTURE) (#84)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the four core API gaps tracked in libnativeapi/nativeapi#85 so overlay tools (such as region screenshots) can be built purely through
nativeapiwithout custom platform runner code:WindowLevel+ unconstrained macOS bounds (Window: set a window level above the menu bar / Dock / taskbar nativeapi#81):WindowLevel::{Normal, Floating, Status, ScreenSaver}andWindow::SetLevel(WindowLevel)/Window::GetLevel()across all 7 platforms (macOS, Windows, Linux GTK3/GTK4, Android, iOS, OHOS, WASM).SetBoundsbypasses AppKit's menu-bar/Dock frame clamping whenlevel >= NSStatusWindowLevelviaconstrainFrameRect:toScreen:swizzling and flushes subview layout.Hide/Show/ShowInactive(macOS: Window::Hide()/Show() play AppKit's fade-and-shrink animation nativeapi#82):NSWindowAnimationBehaviorNone(withCATransactiondisabled forHide) so programmatic show/hide does not play AppKit's fade-and-shrink animation.SetFrameless(true)on macOS (macOS: square-cornered borderless windows (SetCornerPreference unsupported, frameless keeps rounded corners) nativeapi#83):NSWindowStyleMaskTitled | Closable | Miniaturizable | FullSizeContentView(restored onSetFrameless(false)) while overridingcanBecomeKeyWindow/canBecomeMainWindowto preserve focusability.ScreenCaptureOptions::exclude_own_windows(ScreenCapturer: option to exclude the app's own windows from a capture nativeapi#84):exclude_own_windows(defaultfalse) toScreenCaptureOptions.SCContentFilter(display:excludingApplications:exceptingWindows:).WDA_EXCLUDEFROMCAPTUREto own windows during capture and restores previous display affinities via RAII.Verification
cmake --build build && ctest --test-dir build --output-on-failure -R "screen_capture_test|window_corner_preference_unsupported_test"— 2/2 passed on macOS../codegen check(87 files up to date).