启动时扫描已有窗口并管理

This commit is contained in:
2025-08-24 10:01:46 +08:00
parent 7eea0ee2d3
commit bac73368e3
5 changed files with 87 additions and 25 deletions

View File

@@ -218,11 +218,14 @@ bool get_window_visible(xcb_window_t window) {
}
xcb_window_t get_transient_window_for(xcb_window_t window) {
xcb_window_t transient_for = XCB_NONE;
xcb_window_t transient_for = WINDOW_NONE;
xcb_get_property_cookie_t cookie =
xcb_icccm_get_wm_transient_for(conn, window);
xcb_icccm_get_wm_transient_for_reply(conn, cookie, &transient_for, NULL);
return transient_for;
if (xcb_icccm_get_wm_transient_for_reply(conn, cookie, &transient_for,
NULL)) {
return transient_for;
}
return WINDOW_NONE;
}
window_geometry_t *get_window_geometry(xcb_window_t window) {