Skip to content

Commit a0f3669

Browse files
committed
fix: accounting for border resizing when setting fullscreen
1 parent 74962e5 commit a0f3669

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/x/mod.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub trait XConnExt: XConn + Sized {
228228
notify_killed(self, state)?;
229229
set_window_props(self, state)?;
230230
notify_hidden_workspaces(state);
231-
self.position_clients(state.config.border_width, &state.diff.after.positions)?;
231+
self.position_clients(state)?;
232232
set_window_visibility(self, state)?;
233233
set_focus(self, state)?;
234234
handle_pointer_change(self, state)?;
@@ -323,11 +323,17 @@ pub trait XConnExt: XConn + Sized {
323323
/// border.
324324
///
325325
/// 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+
327331
self.restack(positions.iter().map(|(id, _)| id))?;
328332

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+
}
331337
self.position_client(c, r)?;
332338
}
333339

0 commit comments

Comments
 (0)