view: respect client size resize of floating views
mpv for example has key bindings to set the window size to a multiple of the video resolution. This is a valid use case for client-size resizing of the view and river should respect this if the view is floating.
This commit is contained in:
parent
e447e1b41f
commit
b986196118
1 changed files with 8 additions and 3 deletions
|
@ -307,10 +307,15 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) voi
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
view.output.damage.addWhole();
|
view.output.damage.addWhole();
|
||||||
// TODO: handle unexpected change in dimensions
|
const size_changed = !std.meta.eql(view.surface_box, new_box);
|
||||||
if (!std.meta.eql(view.surface_box, new_box))
|
|
||||||
log.err("view changed size unexpectedly", .{});
|
|
||||||
view.surface_box = new_box;
|
view.surface_box = new_box;
|
||||||
|
// If the client has decided to resize itself and the view is floating,
|
||||||
|
// then respect that resize.
|
||||||
|
if (view.pending.float and size_changed) {
|
||||||
|
view.pending.box.width = new_box.width;
|
||||||
|
view.pending.box.height = new_box.height;
|
||||||
|
view.applyPending();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue