Skip to content

Window occlusion checks on MacOS#6135

Merged
fetchfern merged 9 commits into
mainfrom
boris/window-occlusion-macos
May 20, 2026
Merged

Window occlusion checks on MacOS#6135
fetchfern merged 9 commits into
mainfrom
boris/window-occlusion-macos

Conversation

@aecsocket
Copy link
Copy Markdown
Contributor

No description provided.

@modrinth-bot
Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@aecsocket aecsocket force-pushed the boris/window-occlusion-macos branch from 0512e64 to 1f39334 Compare May 19, 2026 14:33
@aecsocket aecsocket marked this pull request as ready for review May 20, 2026 12:31
Comment thread apps/app/src/api/ads_occlusion_macos.rs Outdated
Comment on lines +16 to +25
pub fn main_window_id(ns_window: *mut std::ffi::c_void) -> Option<CGWindowID> {
if ns_window.is_null() {
return None;
}

let window_number =
unsafe { (ns_window as *mut NSWindow).as_ref()?.windowNumber() };

(window_number > 0).then_some(window_number as CGWindowID)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be marked unsafe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrote to inline this function, since a func taking a ns_window: c_void and blind casting is stupid - just do this in the flow which gets the window.

@fetchfern fetchfern self-requested a review May 20, 2026 19:31
@fetchfern fetchfern added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 451b2d0 May 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants