Fix sometimes disappearing mouse cursor above wallpapers
Disable receiving pointer, touch, and tablet events by setting an empty input region for our surfaces. This prevents a sometimes disappearing or hidden cursor when a normal window closes below the pointer leaving it above our surface.
This commit is contained in:
parent
1ff294e14d
commit
5c4fdf7735
1 changed files with 13 additions and 1 deletions
|
@ -4,7 +4,7 @@ use log::{debug, error, warn};
|
|||
use smithay_client_toolkit::{
|
||||
delegate_compositor, delegate_layer, delegate_output, delegate_registry,
|
||||
delegate_shm,
|
||||
compositor::{CompositorHandler, CompositorState},
|
||||
compositor::{CompositorHandler, CompositorState, Region},
|
||||
output::{OutputHandler, OutputState},
|
||||
registry::{ProvidesRegistryState, RegistryState},
|
||||
registry_handlers,
|
||||
|
@ -274,6 +274,18 @@ logical size: {}x{}, transform: {:?}",
|
|||
|
||||
let surface = layer.wl_surface();
|
||||
|
||||
// Disable receiving pointer, touch, and tablet events
|
||||
// by setting an empty input region.
|
||||
// This prevents disappearing or hidden cursor when a normal window
|
||||
// closes below the pointer leaving it above our surface
|
||||
match Region::new(&self.compositor_state) {
|
||||
Ok(region) => surface.set_input_region(Some(region.wl_region())),
|
||||
Err(error) => error!(
|
||||
"Failed to create empty input region, on new output '{}': {}",
|
||||
output_name, error
|
||||
)
|
||||
};
|
||||
|
||||
let mut viewport = None;
|
||||
|
||||
if width == logical_width || height == logical_height {
|
||||
|
|
Loading…
Add table
Reference in a new issue