MantisBT - VCMI
View Issue Details
0002580VCMIGUI - Otherpublic2016-10-23 13:492023-05-17 18:23
Microsoft WindowsWindows 7Home Premium x64
0002580: Fullscreen game window width is bigger than it should be
When running game in fullscreen mode, mouse cursor can go far beyond right edge of the screen. When playing on 800x600 resolution, the effective resolution is 1067x600. When playing on 1024x768, resolution is around 1300x768.
Run game in fullscreen move and move mouse as far as possible to the right side. When moving mouse back to the left side, cursor will go back after moving mouse far left, instead of immediately.
I added "logGlobal->warn(std::to_string(x) + " " + std::to_string(y));" at the end of CCursorHandler::cursorMove and confirmed that resolution is bigger than desired.
No tags attached.
related to 0002476resolved Dydzio Adventure map scrolling doesn't work when moving mouse too fast to screen border 
related to 0003056closed  On Android the left and right bars which should be black are rendered with artifacts 
Issue History
2016-10-23 13:49DydzioNew Issue
2016-10-23 13:52DydzioSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=3286#r3286
2016-10-23 16:22vmarkovtsevNote Added: 0006859
2016-10-23 21:34SXXRelationship addedrelated to 0002476
2016-10-23 21:37SXXNote Added: 0006864
2017-02-10 15:32DydzioNote Added: 0006977
2017-07-22 14:20SXXNote Added: 0007164
2017-07-22 14:20SXXAssigned To => SXX
2017-07-22 14:20SXXStatusnew => feedback
2017-07-22 14:40DydzioNote Added: 0007165
2017-07-22 14:40DydzioStatusfeedback => assigned
2017-07-22 15:04SXXNote Added: 0007166
2017-07-22 15:04SXXAssigned ToSXX =>
2017-07-22 15:04SXXStatusassigned => acknowledged
2019-05-19 18:20DydzioRelationship addedrelated to 0003056
2019-05-21 15:45DydzioNote Added: 0007800
2023-05-17 18:23IvanNote Added: 0008628
2023-05-17 18:23IvanStatusacknowledged => resolved
2023-05-17 18:23IvanResolutionopen => fixed
2023-05-17 18:23IvanAssigned To => Ivan

2016-10-23 16:22   
This is Windows specific, no such problem on Linux and macOS.
2016-10-23 21:37   
I think problem is really related to fact that we don't have actual modal fullscreen mode. All we have is windowed fullscreen and this means that cursor might go outside of window borders into "invisible area".

At least for me on Kubuntu 16.04 there actually extra free space in right and bottom part of screen so cursor can always be outside of visible area a bit.

There absolutely no reason to have modal fullscreen really, but then we need mouse lock so you wouldn't be able to get cursor outside. This should also fix game behaviour on Windows.
2017-02-10 15:32   
I think we should allow modal fullscreen as option to choose for player. It fixes the problem completely. Opposite to SXX, I think there is no reason NOT to have modal fullscreen, while many modern games offer it.

Tested implementation: [^]
2017-07-22 14:20   
Please let us know if this fixed yet with your recent PRs.
2017-07-22 14:40   
Modal fullscreen workarounds the issue and makes game behave as intended. Without it the issue persists.
2017-07-22 15:04   
2019-05-21 15:45   
As far as I managed to learn, SDL_WINDOW_FULLSCREEN_DESKTOP is not meant to be used together with resizing (SDL_RenderSetLogicalSize etc.) The only workaround I found for this would be changing how mouse events are handled in resized "windowed fullscreen" by calculating mouse position - I find this unacceptable. To keep windowed fullscreen working properly we should start by trying other way around - render fullscreen resolution and use graphics upscaling for that or something...
2023-05-17 18:23   
Fixed in 1.3