From ff96ce1e91e5a8de451541cc7584fb6f64a6564b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 12 Dec 2020 19:05:24 +0100 Subject: input: rework mouse button/motion handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Store a list of currently pressed buttons, and which surface they belong to (i.e. which surface that received the press). Then, in motion events (with a button pressed, aka drag operations), send the event to the “original” surface (that received the press). Also send release events to the originating surface. This means a surface receiving a press will always receive a corresponding release. And no one will receive a release event without a corresponding press event. Motion events with a button pressed will *always* use the *first* button that was pressed. I.e. if you press a button, start dragging, and then press another button, we keep generating motion events for the *first* button. --- selection.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'selection.c') diff --git a/selection.c b/selection.c index cb57fd92..db5a0b9f 100644 --- a/selection.c +++ b/selection.c @@ -634,6 +634,8 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial) if (!term->selection.ongoing) return; + LOG_DBG("selection finalize"); + selection_stop_scroll_timer(term); term->selection.ongoing = false; -- cgit v1.3