Skip to content

Commit

Permalink
sctk: Fix handling of layer surface pointer_interactivity
Browse files Browse the repository at this point in the history
A null `region` represents an infinite region (the default). To set an
empty region, we need to create a `wl_region`.
  • Loading branch information
ids1024 committed Mar 13, 2024
1 parent 39426ea commit 80be052
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sctk/src/event_loop/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ use sctk::{
protocol::{
wl_keyboard::WlKeyboard,
wl_output::WlOutput,
wl_region::WlRegion,
wl_seat::WlSeat,
wl_subsurface::WlSubsurface,
wl_surface::{self, WlSurface},
Expand Down Expand Up @@ -786,7 +787,12 @@ where
.set_size(size.0.unwrap_or_default(), size.1.unwrap_or_default());
layer_surface.set_exclusive_zone(exclusive_zone);
if !pointer_interactivity {
layer_surface.set_input_region(None);
let region = self
.compositor_state
.wl_compositor()
.create_region(&self.queue_handle, ());
layer_surface.set_input_region(Some(&region));
region.destroy();
}
layer_surface.commit();

Expand Down Expand Up @@ -846,3 +852,4 @@ where
}

delegate_noop!(@<T: 'static + Debug> SctkState<T>: ignore WlSubsurface);
delegate_noop!(@<T: 'static + Debug> SctkState<T>: ignore WlRegion);

0 comments on commit 80be052

Please sign in to comment.