fix: check for layer surface under cursor when clicking

This commit is contained in:
Rémi Labeyrie
2024-12-21 15:34:14 +01:00
committed by Ivan Molodetskikh
parent b014c267ae
commit b1c40a9079
+13 -1
View File
@@ -2420,7 +2420,19 @@ impl Niri {
// Check if some layer-shell surface is on top.
let layers = layer_map_for_output(output);
let layer_under = |layer| layers.layer_under(layer, pos_within_output).is_some();
let layer_under = |layer| {
layers
.layer_under(layer, pos_within_output)
.and_then(|layer| {
let layer_pos_within_output =
layers.layer_geometry(layer).unwrap().loc.to_f64();
layer.surface_under(
pos_within_output - layer_pos_within_output,
WindowSurfaceType::ALL,
)
})
.is_some()
};
if layer_under(Layer::Overlay) {
return None;
}