File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -986,6 +986,10 @@ impl<W: LayoutElement> ScrollingSpace<W> {
986986 self . data . insert ( idx, ColumnData :: new ( & column) ) ;
987987 self . columns . insert ( idx, column) ;
988988
989+ if !was_empty && idx <= self . active_column_idx {
990+ self . active_column_idx += 1 ;
991+ }
992+
989993 if activate {
990994 // If this is the first window on an empty workspace, remove the effect of whatever
991995 // view_offset was left over and skip the animation.
@@ -1002,8 +1006,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
10021006 anim_config. unwrap_or ( self . options . animations . horizontal_view_movement . 0 ) ;
10031007 self . activate_column_with_anim_config ( idx, anim_config) ;
10041008 self . activate_prev_column_on_removal = prev_offset;
1005- } else if !was_empty && idx <= self . active_column_idx {
1006- self . active_column_idx += 1 ;
10071009 }
10081010
10091011 // Animate movement of other columns.
Original file line number Diff line number Diff line change @@ -3674,6 +3674,34 @@ fn tabs_with_different_border() {
36743674 check_ops_with_options ( options, ops) ;
36753675}
36763676
3677+ #[ test]
3678+ fn expel_pending_left_from_fullscreen_tabbed_column ( ) {
3679+ let ops = [
3680+ Op :: AddOutput ( 1 ) ,
3681+ Op :: AddWindow {
3682+ params : TestWindowParams :: new ( 1 ) ,
3683+ } ,
3684+ Op :: FullscreenWindow ( 1 ) ,
3685+ Op :: Communicate ( 1 ) ,
3686+ // 1 is now fullscreen, view_offset_to_restore is set.
3687+ Op :: ToggleColumnTabbedDisplay ,
3688+ Op :: AddWindow {
3689+ params : TestWindowParams :: new ( 2 ) ,
3690+ } ,
3691+ Op :: ConsumeOrExpelWindowLeft { id : Some ( 2 ) } ,
3692+ // 2 is consumed into a fullscreen column, fullscreen is requested but not applied.
3693+ //
3694+ // Now, get it back out while keeping it focused.
3695+ //
3696+ // Importantly, we expel it *left*, which results in adding a new column with the exact
3697+ // same active_column_idx.
3698+ Op :: FocusWindow ( 2 ) ,
3699+ Op :: ConsumeOrExpelWindowLeft { id : None } ,
3700+ ] ;
3701+
3702+ check_ops ( ops) ;
3703+ }
3704+
36773705fn parent_id_causes_loop ( layout : & Layout < TestWindow > , id : usize , mut parent_id : usize ) -> bool {
36783706 if parent_id == id {
36793707 return true ;
You can’t perform that action at this time.
0 commit comments