From 0f01abd69eb241af59cc7bfb5ec9f6d4b3b61c12 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 11 Jun 2018 20:03:07 +0200 Subject: [PATCH] fixed order of handling mouse clicks on gadgets and on global animations Before, gadgets were checked for clicks before global animations, which caused clickable global animations to not be clicked if a gadget at the same position was successfully clicked (because mouse events are forced to be off-screen afterwards). Now, clickable global animations are checked for mouse clicks before gadgets, and they either consume the mouse click (so a gadget at the same position will not receive the mouse click anymore), or they are set to "passthrough_clicks" style (so a gadget at the same position will still receive the mouse click). --- src/events.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events.c b/src/events.c index b21f3706..146689f6 100644 --- a/src/events.c +++ b/src/events.c @@ -1554,16 +1554,16 @@ void HandleButton(int mx, int my, int button, int button_nr) strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER)); #endif - if (handle_gadgets && HandleGadgets(mx, my, button)) + if (HandleGlobalAnimClicks(mx, my, button)) { /* do not handle this button event anymore */ - mx = my = -32; /* force mouse event to be outside screen tiles */ + return; /* force mouse event not to be handled at all */ } - if (HandleGlobalAnimClicks(mx, my, button)) + if (handle_gadgets && HandleGadgets(mx, my, button)) { /* do not handle this button event anymore */ - return; /* force mouse event not to be handled at all */ + mx = my = -32; /* force mouse event to be outside screen tiles */ } if (button_hold && game_status == GAME_MODE_PLAYING && tape.pausing) -- 2.34.1