summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorizzel <34325651+izzel@users.noreply.github.com>2019-12-31 19:03:21 +0000
committerWilhelm Schuster <ws@rot13.io>2020-11-10 16:58:43 +0100
commit377f7d7ab2789400b39a717785d3e7d4f2ff8596 (patch)
tree334c96b651469968a7921a93a0e3e317c460e9fa
parent1d9160f2d247dbaa83fb62f02fd7041dec767fc2 (diff)
downloadi3-377f7d7ab2789400b39a717785d3e7d4f2ff8596.tar.gz
i3-377f7d7ab2789400b39a717785d3e7d4f2ff8596.zip
added remanage swallow check
-rw-r--r--include/data.h3
-rw-r--r--src/manage.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/include/data.h b/include/data.h
index d794909f..e411129f 100644
--- a/include/data.h
+++ b/include/data.h
@@ -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;
};
/**
diff --git a/src/manage.c b/src/manage.c
index 13e67d94..da23ab3e 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -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;
}