input: Prevent scrolling the overview in screenshot UI or lock
Browse files at this commitf8b7b7fcae6b1548ce799f8968210d045b50500bParent: 9d2841b1 changed file +9 -21
- src/input/mod.rs +9 -21
src/input/mod.rsmodified+9 -21
| @@ -3138,27 +3138,15 @@ impl State { | |||
| 3138 | vertical_amount_v120.unwrap_or(0.0) / 120. * 15. | 3138 | vertical_amount_v120.unwrap_or(0.0) / 120. * 15. |
| 3139 | }); | 3139 | }); |
| 3140 | 3140 | ||
| 3141 | - let is_overview_open = self.niri.layout.is_overview_open(); | 3141 | + // Check the contents before updating them as pointer binds are supposed to act on the |
| 3142 | - | 3142 | + // previous focus. |
| 3143 | - // We should only handle scrolling in the overview if the pointer is not over a (top or | 3143 | + // |
| 3144 | - // overlay) layer surface. | 3144 | + // Recompute rather than using self.niri.pointer_contents in order to take into account |
| 3145 | - let should_handle_in_overview = if is_overview_open { | 3145 | + // making the pointer visible and unsetting the tablet cursor location. |
| 3146 | - // FIXME: ideally this should happen after updating the pointer contents, which happens | 3146 | + let should_handle_in_overview = self |
| 3147 | - // below. However, our pointer actions are supposed to act on the old surface, before | 3147 | + .niri |
| 3148 | - // updating the pointer contents. | 3148 | + .contents_under(pointer.current_location()) |
| 3149 | - pointer | 3149 | + .overview; |
| 3150 | - .current_focus() | ||
| 3151 | - .map(|surface| self.niri.find_root_shell_surface(&surface)) | ||
| 3152 | - .is_none_or(|root| { | ||
| 3153 | - !self | ||
| 3154 | - .niri | ||
| 3155 | - .mapped_layer_surfaces | ||
| 3156 | - .keys() | ||
| 3157 | - .any(|layer| *layer.wl_surface() == root) | ||
| 3158 | - }) | ||
| 3159 | - } else { | ||
| 3160 | - false | ||
| 3161 | - }; | ||
| 3162 | 3150 | ||
| 3163 | let is_mru_open = self.niri.window_mru_ui.is_open(); | 3151 | let is_mru_open = self.niri.window_mru_ui.is_open(); |
| 3164 | 3152 | ||