MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / handle_pointer_button

Method handle_pointer_button

src/core/seat/pointer.cpp:210–240  ·  view source on GitHub ↗

----------------------- Input event processing --------------------------- */

Source from the content-addressed store, hash-verified

208
209/* ----------------------- Input event processing --------------------------- */
210void 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
242void wf::pointer_t::check_implicit_grab()
243{

Callers 2

send_leave_to_focusMethod · 0.45
send_buttonMethod · 0.45

Calls 6

break_mod_bindingsMethod · 0.80
focus_outputMethod · 0.80
get_cursor_positionMethod · 0.45
get_output_atMethod · 0.45
handle_buttonMethod · 0.45
get_modifiersMethod · 0.45

Tested by

no test coverage detected