-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depends on Smithay/smithay#872. For some reason, pointer confinment isn't working correctly here at the moment, even though the code matches Anvil... May need solution to Smithay/smithay#1126 for behavior to be correct.
- Loading branch information
Showing
6 changed files
with
132 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
use crate::state::State; | ||
use smithay::{ | ||
delegate_pointer_constraints, | ||
input::pointer::PointerHandle, | ||
reexports::wayland_server::protocol::wl_surface::WlSurface, | ||
wayland::{ | ||
pointer_constraints::{with_pointer_constraint, PointerConstraintsHandler}, | ||
seat::WaylandFocus, | ||
}, | ||
}; | ||
|
||
impl PointerConstraintsHandler for State { | ||
fn new_constraint(&mut self, surface: &WlSurface, pointer: &PointerHandle<Self>) { | ||
// XXX region | ||
if pointer | ||
.current_focus() | ||
.and_then(|x| x.wl_surface()) | ||
.as_ref() | ||
== Some(surface) | ||
{ | ||
with_pointer_constraint(surface, pointer, |constraint| { | ||
constraint.unwrap().activate(); | ||
}); | ||
} | ||
} | ||
} | ||
delegate_pointer_constraints!(State); |