Codebase list i3-gaps / b247896
Move parent nodes in scratchpad correctly (#3793) * Move parent nodes in scratchpad across workspaces Co-Authored-By: Orestis <[email protected]> Heman Gandhi authored 4 years ago GitHub committed 4 years ago
2 changed file(s) with 27 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
137137 floating->scratchpad_state != SCRATCHPAD_NONE) {
138138 DLOG("Found a visible scratchpad window on another workspace,\n");
139139 DLOG("moving it to this workspace: con = %p\n", walk_con);
140 con_move_to_workspace(walk_con, focused_ws, true, false, false);
140 con_move_to_workspace(floating, focused_ws, true, false, false);
141141 con_activate(con_descend_focused(walk_con));
142142 return true;
143143 }
547547 cmd '[id=' . $first->id . '] move position center';
548548 is ($x->input_focus, $second->id, 'centering scratchpad window does not show it');
549549
550 ###################################################################################
551 # Verify that a scratchpad container with child containers that was open in
552 # another workspace is moved to the current workspace (with all its children)
553 # after a scratchpad show.
554 ################################################################################
555
556 kill_all_windows;
557 open_window;
558 open_window;
559 # This is to dodge the edge case were the whole workspace is moved
560 # window-by-window into the scratchpad.
561 cmd 'layout tabbed';
562 cmd 'focus parent';
563 cmd 'move to scratchpad';
564 $ws = fresh_workspace;
565 cmd 'scratchpad show';
566 # Case 1: a parent node in the scratchpad does not lose children
567 # Note on the layout: there should be a floating tabbed container, which is
568 # represented as follows:
569 # [workspace object] -> [floating_nodes] -> [tabbed node container] -> [the 2 children we expect]
570 is(scalar @{get_ws($ws)->{floating_nodes}->[0]->{nodes}->[0]->{nodes}}, 2, 'both windows moved from scratchpad to this workspace');
571
572 # Case 2: a parent node in the scratchpad from another workspace does not lose children
573 $ws = fresh_workspace;
574 cmd 'scratchpad show';
575 is(scalar @{get_ws($ws)->{floating_nodes}->[0]->{nodes}->[0]->{nodes}}, 2, 'both windows moved from scratchpad focused on other workspace to this workspace');
550576
551577 done_testing;