freeciv21
freeciv21 copied to clipboard
Using the keyboard while holding down middle mouse causes sprite retention in map view
Describe the bug When you hold down the middle mouse button and repeatedly click any keys, new "this tile is selected" sprites appear on each tile you click a key. Additionally, if you hold down any modifier keys when releasing the middle mouse button, the currently selected tile stays selected.
To Reproduce Steps to reproduce the behavior:
- Reveal a little bit of the map (so it's easier to see)
- Middle click and hold on any tile
- While holding middle click, move the mouse to another tile
- Click any key
- Observe a new "this tile is selected" sprite appearing
- Hold down any modifier key (such as Shift)
- Release middle mouse button
- Release the modifier key pressed
- Observe tile info and "this tile is selected" sprites still on screen
Expected behavior Only the tile that was middle-clicked should have the "this tile is selected" sprite over it. It should disappear when the mouse is released, regardless of modifier keys pressed.
Screenshots Video, since it's easier that way. Currently pressed keys are in the top right corner
https://user-images.githubusercontent.com/7669061/178741617-bdde2d4d-9e0b-4b5b-98be-0bb9abb7c388.mp4
Platform and version (please complete the following information):
- OS: Windows 10
- Freeciv21 version: beta 2
- Ruleset/Longturn game (if applicable): not applicable
Additional context No additional context
Good catch. Maybe the shortcuts PR already fixed it, but I totally see how it can happen.
Can confirm the shortcuts PR fixes the "additional sprites appearing" part of this issue. It doesn't fix the "tile info stays up if you're holding Shift when releasing the middle mouse button" part. That's probably not related to shortcuts, since it also happens if you click on a unit stack while holding the middle mouse button. If you'd like me to record a video of that, I can do that as well.
Video of the issue when caused only with mouse:
https://user-images.githubusercontent.com/7669061/178751428-37654393-7959-476e-9ced-5b9b886358aa.mp4
This is the following steps repeatedly:
- Click and hold middle mouse on a tile
- While holding, move over to a unit stack
- While still holding, click on the unit stack with the left mouse button (requires some finger dexterity)
- Release middle mouse
- Click on any tile to close the unit stack window
Relevant code: https://github.com/longturn/freeciv21/blob/4fed71bea81cd527472ef64f4add0d120615ef3a/client/mapctrl.cpp#L427
Let's call this a feature and close it! xD Allows you to mark multiple tiles at once! 😄