1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-11 13:15:38 +02:00
JakubK a8d5081895 More mouse scrolling fixes
Defect:
After my previous change that enabled map layer (`CAdvMapInt`) to listen to all mouse move events via `strongInterest` bool, I noticed that there are a few scenario that start scrolling the map unexpectedly. The two that were the easiest to reproduce were using keyboard arrows to move the hero or dimissing a popup dialog.

I traced this down to unexpected mouse move event (`SDL_MouseMotionEvent`) that SDL seems to dispatch in this situation. The windowID that comes with the event in this scenario is 0 (so no window with mouse focus). I don't know why SDL dispatches this mysterious (to me) mouse move event in that case (note that there is no actual mouse movement in either repro case).

Fix:
Don't handle the mouse move event if the windowID of the mouse motion event is 0.

Notes:
Impacts scrolling of the game map. Did some play testing and didn't notice the scrolling not working when expected. The two specific cases where the map would scroll unexpectedly (move a hero with keyboard arrows or dismiss a popup dialog) no longer move the map.
2020-01-04 22:45:33 -08:00
..
2018-08-26 19:09:56 +03:00
2018-11-14 20:58:37 +03:00
2019-01-19 13:52:02 +03:00
2018-08-26 19:09:56 +03:00
2018-07-25 01:36:48 +03:00
2018-08-26 19:09:56 +03:00
2018-08-26 19:09:56 +03:00
2018-10-29 14:12:07 +01:00
2018-10-29 14:12:07 +01:00
2018-10-29 14:12:07 +01:00
2018-07-25 01:36:48 +03:00
2018-07-25 01:36:48 +03:00