summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-15 15:22:12 +0100
committerGitHub <noreply@github.com>2018-12-15 15:22:12 +0100
commit814d6cad13270158215d3b5cbe20e96e43b44683 (patch)
tree7350a760154ce4f09a0f04091048b108b5b3daf9
parent4629152d68f715514be38921db192251a6de6715 (diff)
parent9974f6c56f379d3115f35326e60c0c854dac7c40 (diff)
Merge pull request #24371 from moiman100/fix-linux-mouse-buttons
Fix middle and secondary mouse buttons order
-rw-r--r--platform/x11/os_x11.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 7b30e7a064..34ec8709c4 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -2080,14 +2080,14 @@ void OS_X11::process_xevents() {
mb.instance();
get_key_modifier_state(event.xbutton.state, mb);
+ mb->set_button_index(event.xbutton.button);
if (mb->get_button_index() == 2)
mb->set_button_index(3);
else if (mb->get_button_index() == 3)
mb->set_button_index(2);
- mb->set_button_mask(get_mouse_button_state(event.xbutton.button, event.xbutton.type));
+ mb->set_button_mask(get_mouse_button_state(mb->get_button_index(), event.xbutton.type));
mb->set_position(Vector2(event.xbutton.x, event.xbutton.y));
mb->set_global_position(mb->get_position());
- mb->set_button_index(event.xbutton.button);
mb->set_pressed((event.type == ButtonPress));