Merge pull request #2345 from psychon/fix_transient_for_unsetting
Handle unsetting of .transient_for
This commit is contained in:
commit
e9d95fba1e
|
@ -983,7 +983,9 @@ client_find_transient_for(client_t *c)
|
|||
{
|
||||
int counter;
|
||||
client_t *tc, *tmp;
|
||||
lua_State *L = globalconf_get_lua_State();
|
||||
|
||||
/* This might return NULL, in which case we unset transient_for */
|
||||
tmp = tc = client_getbywin(c->transient_for_window);
|
||||
|
||||
/* Verify that there are no loops in the transient_for relation after we are done */
|
||||
|
@ -994,14 +996,16 @@ client_find_transient_for(client_t *c)
|
|||
counter = globalconf.stack.len+1;
|
||||
tmp = tmp->transient_for;
|
||||
}
|
||||
if (counter <= globalconf.stack.len)
|
||||
{
|
||||
lua_State *L = globalconf_get_lua_State();
|
||||
|
||||
luaA_object_push(L, c);
|
||||
client_set_transient_for(L, -1, tc);
|
||||
lua_pop(L, 1);
|
||||
if (counter > globalconf.stack.len)
|
||||
{
|
||||
/* There was a loop, so unset .transient_for */
|
||||
tc = NULL;
|
||||
}
|
||||
|
||||
luaA_object_push(L, c);
|
||||
client_set_transient_for(L, -1, tc);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
10
property.c
10
property.c
|
@ -107,9 +107,13 @@ property_update_wm_transient_for(client_t *c, xcb_get_property_cookie_t cookie)
|
|||
xcb_window_t trans;
|
||||
|
||||
if(!xcb_icccm_get_wm_transient_for_reply(globalconf.connection,
|
||||
cookie,
|
||||
&trans, NULL))
|
||||
return;
|
||||
cookie,
|
||||
&trans, NULL))
|
||||
{
|
||||
c->transient_for_window = XCB_NONE;
|
||||
client_find_transient_for(c);
|
||||
return;
|
||||
}
|
||||
|
||||
c->transient_for_window = trans;
|
||||
|
||||
|
|
Loading…
Reference in New Issue