Skip to content

Commit

Permalink
nitpicker: send pointer pos to global key handler
Browse files Browse the repository at this point in the history
To enable a global key handler to implement motion gestures while a
global key is held, it needs to know the current pointer position at the
time when the global key sequence starts. This is prerequisite for
the window layouter's ability to drag windows by clicking anywhere
within the window while holding a global key.

Issue genodelabs#5403
  • Loading branch information
nfeske committed Dec 11, 2024
1 parent 4ed739d commit c770865
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions repos/os/src/server/nitpicker/user_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,17 @@ void User_state::_handle_input_event(Input::Event ev)
global_receiver = _global_keys.global_receiver(keycode);

if (global_receiver) {
bool const orig_global_key_sequence = _global_key_sequence;
_global_key_sequence = true;
_input_receiver = global_receiver;

/* deliver current pointer position at start of key sequence */
if (orig_global_key_sequence != _global_key_sequence)
_pointer.with_result(
[&] (Point at) {
Absolute_motion motion { at.x, at.y };
_input_receiver->submit_input_event(motion); },
[&] (Nowhere) { });
}

/*
Expand Down

0 comments on commit c770865

Please sign in to comment.