Implement pointer constraints; update to send frame manually
This commit is contained in:
parent
0b057f153e
commit
373af07319
16 changed files with 272 additions and 49 deletions
|
|
@ -10,6 +10,7 @@ pub mod keyboard_shortcuts_inhibit;
|
|||
pub mod layer_shell;
|
||||
pub mod output;
|
||||
pub mod output_configuration;
|
||||
pub mod pointer_constraints;
|
||||
pub mod pointer_gestures;
|
||||
pub mod presentation;
|
||||
pub mod primary_selection;
|
||||
|
|
|
|||
29
src/wayland/handlers/pointer_constraints.rs
Normal file
29
src/wayland/handlers/pointer_constraints.rs
Normal file
|
|
@ -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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue