summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-03-03 19:52:18 -0300
committerJuan Linietsky <juan@godotengine.org>2019-03-03 19:53:13 -0300
commita1e73dcc944627ab7185aec7cd4141fe4ebb97d7 (patch)
tree917b9912d48607e19d214a0e3931dd325f75d1e6 /platform/x11
parenta9fe834a8e962a7b9e15e5dc218af4b857b47da4 (diff)
Add support for event accumlation (off by default, on for editor), fixes #26536
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/os_x11.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index b7fbb89edf..cc4d57ea99 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1660,7 +1660,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
k->set_shift(true);
}
- input->parse_input_event(k);
+ input->accumulate_input_event(k);
}
return;
}
@@ -1804,7 +1804,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
}
//printf("key: %x\n",k->get_scancode());
- input->parse_input_event(k);
+ input->accumulate_input_event(k);
}
struct Property {
@@ -1991,12 +1991,12 @@ void OS_X11::process_xevents() {
// in a spurious mouse motion event being sent to Godot; remember it to be able to filter it out
xi.mouse_pos_to_filter = pos;
}
- input->parse_input_event(st);
+ input->accumulate_input_event(st);
} else {
if (!xi.state.has(index)) // Defensive
break;
xi.state.erase(index);
- input->parse_input_event(st);
+ input->accumulate_input_event(st);
}
} break;
@@ -2014,7 +2014,7 @@ void OS_X11::process_xevents() {
sd->set_index(index);
sd->set_position(pos);
sd->set_relative(pos - curr_pos_elem->value());
- input->parse_input_event(sd);
+ input->accumulate_input_event(sd);
curr_pos_elem->value() = pos;
}
@@ -2102,7 +2102,7 @@ void OS_X11::process_xevents() {
st.instance();
st->set_index(E->key());
st->set_position(E->get());
- input->parse_input_event(st);
+ input->accumulate_input_event(st);
}
xi.state.clear();
#endif
@@ -2163,7 +2163,7 @@ void OS_X11::process_xevents() {
}
}
- input->parse_input_event(mb);
+ input->accumulate_input_event(mb);
} break;
case MotionNotify: {
@@ -2273,7 +2273,7 @@ void OS_X11::process_xevents() {
// this is so that the relative motion doesn't get messed up
// after we regain focus.
if (window_has_focus || !mouse_mode_grab)
- input->parse_input_event(mm);
+ input->accumulate_input_event(mm);
} break;
case KeyPress:
@@ -2457,6 +2457,8 @@ void OS_X11::process_xevents() {
printf("Win: %d,%d\n", win_x, win_y);
*/
}
+
+ input->flush_accumulated_events();
}
MainLoop *OS_X11::get_main_loop() const {