added remanage swallow check

This commit is contained in:
izzel 2019-12-31 19:03:21 +00:00 committed by Wilhelm Schuster
parent 1d9160f2d2
commit 377f7d7ab2
2 changed files with 12 additions and 0 deletions

View File

@ -476,6 +476,9 @@ struct Window {
/* Time when the window became managed. Used to determine whether a window
* should be swallowed after initial management. */
time_t managed_since;
/* The window has been swallowed. */
bool swallowed;
};
/**

View File

@ -270,6 +270,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
DLOG("Initial geometry: (%d, %d, %d, %d)\n", geom->x, geom->y, geom->width, geom->height);
/* See if any container swallows this new window */
cwindow->swallowed = false;
Match *match = NULL;
Con *nc = con_for_window(search_at, cwindow, &match);
const bool match_from_restart_mode = (match && match->restart_mode);
@ -358,6 +359,8 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
match_free(match);
FREE(match);
}
cwindow->swallowed = true;
}
DLOG("new container = %p\n", nc);
@ -695,6 +698,11 @@ out:
*
*/
Con *remanage_window(Con *con) {
/* Make sure this windows hasn't already been swallowed. */
if (con->window->swallowed) {
run_assignments(con->window);
return con;
}
Match *match;
Con *nc = con_for_window(croot, con->window, &match);
if (nc == NULL || nc->window == NULL || nc->window == con->window) {
@ -740,5 +748,6 @@ Con *remanage_window(Con *con) {
ewmh_update_wm_desktop();
}
nc->window->swallowed = true;
return nc;
}