@@ -228,7 +228,7 @@ pub trait XConnExt: XConn + Sized {
228
228
notify_killed ( self , state) ?;
229
229
set_window_props ( self , state) ?;
230
230
notify_hidden_workspaces ( state) ;
231
- self . position_clients ( state. config . border_width , & state . diff . after . positions ) ?;
231
+ self . position_clients ( state) ?;
232
232
set_window_visibility ( self , state) ?;
233
233
set_focus ( self , state) ?;
234
234
handle_pointer_change ( self , state) ?;
@@ -323,11 +323,17 @@ pub trait XConnExt: XConn + Sized {
323
323
/// border.
324
324
///
325
325
/// See `restack` for details of stacking order is determined.
326
- fn position_clients ( & self , border : u32 , positions : & [ ( Xid , Rect ) ] ) -> Result < ( ) > {
326
+ fn position_clients ( & self , state : & State < Self > ) -> Result < ( ) > {
327
+ let border = state. config . border_width ;
328
+ let positions = & state. diff . after . positions ;
329
+ let screen_positions: Vec < _ > = state. client_set . screens ( ) . map ( |s| s. r ) . collect ( ) ;
330
+
327
331
self . restack ( positions. iter ( ) . map ( |( id, _) | id) ) ?;
328
332
329
- for & ( c, r) in positions. iter ( ) {
330
- let r = r. shrink_in ( border) ;
333
+ for & ( c, mut r) in positions. iter ( ) {
334
+ if !screen_positions. contains ( & r) {
335
+ r = r. shrink_in ( border) ;
336
+ }
331
337
self . position_client ( c, r) ?;
332
338
}
333
339
0 commit comments