grabs: Snap Window Edges to Close Output Edges

This commit is contained in:
Daniel 2025-02-14 21:58:09 +11:00 committed by GitHub
parent 2678cf41b2
commit 2553810621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 148 additions and 13 deletions

View file

@ -197,9 +197,14 @@ impl XdgShellHandler for State {
) {
let seat = Seat::from_resource(&seat).unwrap();
let mut shell = self.common.shell.write().unwrap();
if let Some((grab, focus)) =
shell.resize_request(surface.wl_surface(), &seat, serial, edges.into(), true)
{
if let Some((grab, focus)) = shell.resize_request(
surface.wl_surface(),
&seat,
serial,
edges.into(),
self.common.config.cosmic_conf.edge_snap_threshold,
true,
) {
std::mem::drop(shell);
if grab.is_touch_grab() {
seat.get_touch().unwrap().set_grab(self, grab, serial)