ystr(i3string_as_utf8(con->window->name));
}
+ ystr("transient_for");
+ if (con->window->transient_for == XCB_NONE)
+ y(null);
+ else y(integer, con->window->transient_for);
+
y(map_close);
}
while (transient_con != NULL &&
transient_con->window != NULL &&
transient_con->window->transient_for != XCB_NONE) {
+ DLOG("transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
+ transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
if (transient_con->window->transient_for == fullscreen->window->id) {
is_transient_for = true;
break;
*/
void window_update_leader(i3Window *win, xcb_get_property_reply_t *prop) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("CLIENT_LEADER not set.\n");
+ DLOG("CLIENT_LEADER not set on window 0x%08x.\n", win->id);
+ win->leader = XCB_NONE;
FREE(prop);
return;
}
*/
void window_update_transient_for(i3Window *win, xcb_get_property_reply_t *prop) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("TRANSIENT_FOR not set.\n");
+ DLOG("TRANSIENT_FOR not set on window 0x%08x.\n", win->id);
+ win->transient_for = XCB_NONE;
FREE(prop);
return;
}
return;
}
- DLOG("Transient for changed to %08x\n", transient_for);
+ DLOG("Transient for changed to 0x%08x (window 0x%08x)\n", transient_for, win->id);
win->transient_for = transient_for;
}
+################################################################################
+# Verify that transient_for can be set and unset.
+################################################################################
+
+$tmp = fresh_workspace;
+
+$fwindow = open_window({ dont_map => 1 });
+$fwindow->transient_for($right);
+$fwindow->map;
+
+my $floating_con = get_ws($tmp)->{floating_nodes}[0]->{nodes}[0];
+is($floating_con->{window_properties}->{transient_for}, $right->id, 'WM_TRANSIENT_FOR properly parsed');
+
+$x->delete_property($fwindow->id, $x->atom(name => 'WM_TRANSIENT_FOR')->id);
+$x->flush;
+
+sync_with_i3;
+
+$floating_con = get_ws($tmp)->{floating_nodes}[0]->{nodes}[0];
+is($floating_con->{window_properties}->{transient_for}, undef, 'WM_TRANSIENT_FOR properly removed');
+
done_testing;