Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-23 14:19:22 +0300
committerCampbell Barton <campbell@blender.org>2022-06-23 15:25:13 +0300
commitb8403b065e222faff3dfb3e2e9aa1b3d3f56c555 (patch)
treee7eebb34c96b27f9abe29a660de2c6b846982796 /source/blender/windowmanager/intern/wm_event_system.cc
parente63799e791109bc4357995566e421648bf9c5c4c (diff)
Fix T99027: Touch typing in text fields results in dropped key presses
Fix by always testing unhandled double-click events as press events, irrespective of the previous event type. **Details** Handling double-click events only ran when the previously pressed-key matched the current pressed-key. Originally when double-click support was added the previous type was compared (ignoring it's press/release value) and while not necessary it was harmless as it matched the check for double-click events being generated. As of [0] the logic for click/drag detection changed to ignore release events as release this could interrupt dragging. This made it possible to generate double-click events that failed the `event->prev_press_type == event->type` comparison. In these cases it was possible to generate double-click events that would not fall-back to a 'press' value when unhandled. [0]: 102644cb8cbb8b21e55643cebe2ed364885023a6
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.cc')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc
index d3ae4177e4d..51486f664c7 100644
--- a/source/blender/windowmanager/intern/wm_event_system.cc
+++ b/source/blender/windowmanager/intern/wm_event_system.cc
@@ -3376,9 +3376,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
}
}
- if (event->prev_press_type == event->type) {
-
- if (event->val == KM_RELEASE) {
+ if (event->val == KM_RELEASE) {
+ if (event->prev_press_type == event->type) {
if (event->prev_val == KM_PRESS) {
if (win->event_queue_check_click) {
if (WM_event_drag_test(event, event->prev_press_xy)) {
@@ -3408,15 +3407,15 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
}
}
}
- else if (event->val == KM_DBL_CLICK) {
- /* The underlying event is a press, so try and handle this. */
- event->val = KM_PRESS;
- action |= wm_handlers_do_intern(C, win, event, handlers);
+ }
+ else if (event->val == KM_DBL_CLICK) {
+ /* The underlying event is a press, so try and handle this. */
+ event->val = KM_PRESS;
+ action |= wm_handlers_do_intern(C, win, event, handlers);
- /* Revert value if not handled. */
- if (wm_action_not_handled(action)) {
- event->val = KM_DBL_CLICK;
- }
+ /* Revert value if not handled. */
+ if (wm_action_not_handled(action)) {
+ event->val = KM_DBL_CLICK;
}
}
}