----------------------- Input event processing --------------------------- */
| 208 | |
| 209 | /* ----------------------- Input event processing --------------------------- */ |
| 210 | void wf::pointer_t::handle_pointer_button(wlr_pointer_button_event *ev, |
| 211 | input_event_processing_mode_t mode) |
| 212 | { |
| 213 | seat->priv->break_mod_bindings(); |
| 214 | bool handled_in_binding = (mode != input_event_processing_mode_t::FULL); |
| 215 | |
| 216 | if (ev->state == WL_POINTER_BUTTON_STATE_PRESSED) |
| 217 | { |
| 218 | count_pressed_buttons++; |
| 219 | if (count_pressed_buttons == 1) |
| 220 | { |
| 221 | /* Focus only the first click, since then we also start an implicit |
| 222 | * grab, and we don't want to suddenly change the output */ |
| 223 | auto gc = seat->priv->cursor->get_cursor_position(); |
| 224 | auto output = wf::get_core().output_layout->get_output_at(gc.x, gc.y); |
| 225 | seat->focus_output(output); |
| 226 | } |
| 227 | |
| 228 | handled_in_binding |= wf::get_core().bindings->handle_button( |
| 229 | wf::buttonbinding_t{seat->priv->get_modifiers(), ev->button}); |
| 230 | } else |
| 231 | { |
| 232 | count_pressed_buttons--; |
| 233 | } |
| 234 | |
| 235 | send_button(ev, handled_in_binding); |
| 236 | if (!handled_in_binding) |
| 237 | { |
| 238 | check_implicit_grab(); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | void wf::pointer_t::check_implicit_grab() |
| 243 | { |
no test coverage detected