7474 VrrMode as ConfigVrrMode ,
7575 } ,
7676 window:: { TileState as ConfigTileState , Window , WindowMatcher } ,
77- workspace:: WorkspaceDisplayOrder ,
77+ workspace:: { WorkspaceDisplayOrder , WorkspaceEmptyBehavior } ,
7878 xwayland:: XScalingMode ,
7979 } ,
8080 kbvm:: Keycode ,
@@ -585,6 +585,9 @@ impl ConfigProxyHandler {
585585 fn handle_get_workspaces ( & self ) {
586586 let mut workspaces = vec ! [ ] ;
587587 for ws in self . state . workspaces . lock ( ) . values ( ) {
588+ if ws. hidden . get ( ) {
589+ continue ;
590+ }
588591 workspaces. push ( self . get_workspace_by_name ( & ws. name , ws. ty ) ) ;
589592 }
590593 self . respond ( Response :: GetWorkspaces { workspaces } ) ;
@@ -1159,7 +1162,11 @@ impl ConfigProxyHandler {
11591162 seat,
11601163 }
11611164 } ;
1162- if move_ {
1165+ let hidden = ws. hidden . get ( ) ;
1166+ if move_ && hidden {
1167+ self . state . show_workspace2 ( seat. as_ref ( ) , & output, & ws) ;
1168+ }
1169+ if move_ && !hidden {
11631170 move_ws_to_output (
11641171 & ws,
11651172 & output,
@@ -1173,7 +1180,8 @@ impl ConfigProxyHandler {
11731180 if let Some ( seat) = & seat {
11741181 ws. do_focus ( seat, crate :: tree:: Direction :: Unspecified ) ;
11751182 }
1176- } else {
1183+ }
1184+ if !move_ {
11771185 self . state . show_workspace2 ( seat. as_ref ( ) , & output, & ws) ;
11781186 }
11791187 if let Some ( seat) = & seat {
@@ -1193,6 +1201,14 @@ impl ConfigProxyHandler {
11931201 }
11941202 } ,
11951203 } ;
1204+ if workspace. hidden . get ( )
1205+ && self
1206+ . state
1207+ . restore_hidden_workspace ( & workspace, Some ( seat. get_fallback_output ( ) ) , Some ( & seat) )
1208+ . is_none ( )
1209+ {
1210+ return Ok ( ( ) ) ;
1211+ }
11961212 seat. set_workspace ( & workspace) ;
11971213 Ok ( ( ) )
11981214 }
@@ -1209,6 +1225,14 @@ impl ConfigProxyHandler {
12091225 } ,
12101226 } ,
12111227 } ;
1228+ if workspace. hidden . get ( )
1229+ && self
1230+ . state
1231+ . restore_hidden_workspace ( & workspace, window. node_output ( ) , None )
1232+ . is_none ( )
1233+ {
1234+ return Ok ( ( ) ) ;
1235+ }
12121236 toplevel_set_workspace ( & self . state , window, & workspace) ;
12131237 Ok ( ( ) )
12141238 }
@@ -1581,6 +1605,10 @@ impl ConfigProxyHandler {
15811605 self . state . set_workspace_display_order ( order. into ( ) ) ;
15821606 }
15831607
1608+ fn handle_set_workspace_empty_behavior ( & self , behavior : WorkspaceEmptyBehavior ) {
1609+ self . state . set_workspace_empty_behavior ( behavior. into ( ) ) ;
1610+ }
1611+
15841612 fn handle_get_seat_float_pinned ( & self , seat : Seat ) -> Result < ( ) , CphError > {
15851613 let seat = self . get_seat ( seat) ?;
15861614 self . respond ( Response :: GetFloatPinned {
@@ -1773,6 +1801,7 @@ impl ConfigProxyHandler {
17731801 fn handle_get_workspace_connector ( & self , workspace : Workspace ) -> Result < ( ) , CphError > {
17741802 let connector = self
17751803 . get_existing_workspace ( workspace) ?
1804+ . filter ( |ws| !ws. hidden . get ( ) )
17761805 . map ( |ws| ws. output . get ( ) )
17771806 . filter ( |o| !o. is_dummy )
17781807 . map ( |o| Connector ( o. global . connector . id . raw ( ) as _ ) )
@@ -3597,6 +3626,9 @@ impl ConfigProxyHandler {
35973626 ClientMessage :: ShowWorkspace3 { v1 } => {
35983627 self . handle_show_workspace_3 ( v1) . wrn ( "show_workspace_3" ) ?
35993628 }
3629+ ClientMessage :: SetWorkspaceEmptyBehavior { behavior } => {
3630+ self . handle_set_workspace_empty_behavior ( behavior)
3631+ }
36003632 }
36013633 Ok ( ( ) )
36023634 }
0 commit comments