Open Selenium39 opened 1 year ago
明白了,原来是org_gnome_shell_screenshot
执行失败后执行org_freedesktop_portal_screenshot
请求截图时,会有一个系统的交互框。
org_gnome_shell_screenshot
执行失败抛的异常为ScreenshotArea is not allowed
不过我还是不想要系统的这个交互框...
应该是wayland 的问题,这个目前没有啥好的办法避免,我也在寻找解决方案
One solution I can think of to fix this issue is to prioritize wlr instead of gnome, it sounds silly, but it could be useful
wlr_screenshot(x, y, width, height)
.or_else(|_| org_freedesktop_portal_screenshot(&conn, x, y, width, height))
.or_else(|_| org_gnome_shell_screenshot(&conn, x, y, width, height))
在执行
let image_result = screen.capture_area(top_left_x as i32, top_left_y as i32, rect_width, rect_height);
这行代码时,弹出了系统自带的截图弹框,相同的代码在MacOS上无此问题,有什么解决办法吗?