T46: Ely peeks over the main window's top edge from behind it, as the owner asked after the 0.1.3 film: her head and fingers from the icon's paths in a transparent window of her own, kept on the edge as each platform allows, macOS's child window, Windows' owned popup, X11's popup moved and stacked above the frame, Wayland's anchored popup; ten faces follow the most pressing of the sessions' marks, with hops, a shake and a rise; a press winks; Settings, Terminal, Ely turns her off
CI / platforms (windows-latest) (push) Failing after 10s
CI / platforms (ubuntu-24.04) (push) Successful in 1m52s
CI / macos (push) Successful in 12m52s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-18 05:06:59 -04:00
1 parent b35eb52d9a
commit 9aeb3f3552
22 files changed
+1090 -45

No files matched your search

+34
View File
@@ -21,6 +21,40 @@ pub fn number(window: &gpui::Window) -> anyhow::Result<u32> {
u32::try_from(number).context("window number out of range")
}
/// The window and each of its child windows: number and frame, in AppKit's screen points.
pub fn frames(number: u32) -> anyhow::Result<Vec<(u32, [f64; 4])>> {
use core_graphics::geometry::CGRect;
unsafe {
let app: *mut Object = msg_send![class!(NSApplication), sharedApplication];
let window: *mut Object = msg_send![app, windowWithWindowNumber: i64::from(number)];
anyhow::ensure!(!window.is_null(), "no window {number}");
let children: *mut Object = msg_send![window, childWindows];
let count: u64 = if children.is_null() {
0
} else {
msg_send![children, count]
};
let children = (0..count).map(|ix| msg_send![children, objectAtIndex: ix]);
std::iter::once(window)
.chain(children)
.map(|window: *mut Object| {
let number: i64 = msg_send![window, windowNumber];
let frame: CGRect = msg_send![window, frame];
let corners = [
frame.origin.x,
frame.origin.y,
frame.size.width,
frame.size.height,
];
Ok((
u32::try_from(number).context("window number out of range")?,
corners,
))
})
.collect()
}
}
/// Shows the window as key, the app left inactive.
pub fn front(number: u32) -> anyhow::Result<()> {
unsafe {