Skip to content

MacOS捕获所有窗口只捕获到了MenuBar #202

@yIllusionSky

Description

@yIllusionSky

系统:Darwin
代码(参考示例):

use std::time::Instant;
use xcap::Window;

fn normalized(filename: &str) -> String {
    filename.replace(['|', '\\', ':', '/'], "")
}
#[test]
fn main() {
    let start = Instant::now();
    let windows = Window::all().unwrap();
    for window in windows {
        
        println!(
            "Window: {:?} {:?} {:?}",
            window.title().unwrap(),
            (
                window.x().unwrap(),
                window.y().unwrap(),
                window.width().unwrap(),
                window.height().unwrap()
            ),
            (
                window.is_minimized().unwrap(),
                window.is_maximized().unwrap()
            )
        );
        
    }

    println!("运行耗时: {:?}", start.elapsed());
}

输出:

Window: "Menubar" (0, 0, 1728, 37) (false, false)
运行耗时: 69.463125ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions