Fix clicks activating windows through layer-shell surfaces
Browse files at this commite46b614c2bf08dd7b09ca8a84321f2c066855aaaParent: 78aa08b1 changed file +13 -0
- src/niri.rs +13 -0
src/niri.rsmodified+13 -0
| @@ -1055,6 +1055,19 @@ impl Niri { | |||
| 1055 | } | 1055 | } |
| 1056 | 1056 | ||
| 1057 | let (output, pos_within_output) = self.output_under(pos)?; | 1057 | let (output, pos_within_output) = self.output_under(pos)?; |
| 1058 | + | ||
| 1059 | + // Check if some layer-shell surface is on top. | ||
| 1060 | + let layers = layer_map_for_output(output); | ||
| 1061 | + let layer_under = |layer| layers.layer_under(layer, pos_within_output).is_some(); | ||
| 1062 | + if layer_under(Layer::Overlay) { | ||
| 1063 | + return None; | ||
| 1064 | + } | ||
| 1065 | + | ||
| 1066 | + let mon = self.layout.monitor_for_output(output).unwrap(); | ||
| 1067 | + if !mon.render_above_top_layer() && layer_under(Layer::Top) { | ||
| 1068 | + return None; | ||
| 1069 | + } | ||
| 1070 | + | ||
| 1058 | let (window, _loc) = self.layout.window_under(output, pos_within_output)?; | 1071 | let (window, _loc) = self.layout.window_under(output, pos_within_output)?; |
| 1059 | Some(window) | 1072 | Some(window) |
| 1060 | } | 1073 | } |