Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad mouse pointer position (Ogre 1.12) after setting a resolution in fullscreen #30

Open
AsciiWolf opened this issue Mar 15, 2021 · 11 comments
Labels

Comments

@AsciiWolf
Copy link
Contributor

When using latest Stunt Rally from Git with OGRE 1.12.10, setting a different screen resolution ingame and switching to fullscreen, the actual mouse position is shifted and does not correspond with the mouse pointer position on screen. It gets fixed after restarting the game.

@cryham
Copy link
Member

cryham commented Mar 15, 2021

IDK if I can do anything about it. I wonder if this is something wrong in our code. Probably SDL window and Ogre/MyGui mouse cursor thing.
Is this a big difference, does it depend on resolution change, or is it just constant offset like cursor size or something?

@AsciiWolf
Copy link
Contributor Author

Hmm, on my laptop, the issue seems to happen only with 1920x1080 which is my native screen resolution.

@AsciiWolf
Copy link
Contributor Author

AsciiWolf commented Mar 16, 2021

Sometimes, this happens instead:
screenshot
(It seems that the new resolution is actually not applied, the old one is still used instead and game window is truncated. It corrects after game is restarted.)

@AsciiWolf
Copy link
Contributor Author

Anyway, it seems that the issue with new resolution not being correctly applied until restart also happens with older Stunt Rally 2.6.1 with old OGRE. But the cursor issue happens only on newer build that is using recent OGRE and much newer SDL. So yeah, it is probably a OGRE or SDL thing.

@cryham
Copy link
Member

cryham commented Mar 18, 2021

Hmm I just tested and in SR 2.6.1 with Ogre 1.9 on Debian 10:

  • I don't have any issues changing resolution on fullscreen
  • I saw this issue even after I changed to windowed from fullscreen, whole screen was drawn but main smaller resolution was shifted and drawn below while cursor was in fact above.
  • After I restarted, now in windowed mode I don't have any issues changing resolution.
  • I changed to fullscreen and saw this issue, well just wrong position of Quit button and GUI window size. After I changed resolution, it fixed itself.

Actually my both issues are fixed just by pressing resolution Change button.
Weird, yeah I'd also assume SDL-OGRE issues, but perhaps something wrong in our logic.

@cryham cryham changed the title Bad mouse pointer position after setting a resolution in fullscreen Bad mouse pointer position (Ogre 1.12) after setting a resolution in fullscreen Jan 29, 2022
@cryham cryham added the Bug label Jun 3, 2022
@AsciiWolf
Copy link
Contributor Author

AsciiWolf commented Sep 13, 2022

Sadly still the same issue with latest Stunt Rally from Git (5ce6dde + stuntrally/tracks@bef80ff) + latest OGRE (13.4.4).

@cryham
Copy link
Member

cryham commented Sep 14, 2022

Thanks for testing. Please don't just bump topics. I guess nobody tried fixing it so it's still there. Not a critical issue for me, but yeah there are now many related to resolution change etc.

@AsciiWolf
Copy link
Contributor Author

AsciiWolf commented Sep 14, 2022

Sorry. I just retested it and wanted to update this ticket with actual information. Next time, I will edit the original comment instead. The issue is actually quite annoying and harder to overcome if fullscreen is on as user has to close the game with Alt + F4 because it is not possible to click anything including the "Quit" button.

@cryham
Copy link
Member

cryham commented Sep 14, 2022

Strange, I don't have this on Debian with KDE.
Does it happen with mouse_capture = on and off too (in game.cfg)?
I guess it's probably some new bug in sdl4ogre/. Maybe you could use LogO(toStr(..) .. etc); in void SDLCursorManager::receiveCursorInfo( or in void BaseApp::onCursorChange(const string &name) to log all those values there get some more info on what could be wrong. Just an idea, not sure if this is even it.
Honestly I'd rather throw out sdl4ogre and copy and use the code Ogre's sample browser has, also good for changing window and resolution.

@AsciiWolf
Copy link
Contributor Author

Ugh, I just noticed that the resolution changing is quite glitchy. When fullscreen is already enabled, changing the resolution does not change it to a correct one. I first have to disable fullscreen, set the resolution, then restart the game and re-enable fullscreen. Weird.

@AsciiWolf
Copy link
Contributor Author

Setting mouse_capture to off seems to have no effect.

Anyway, I have at least found a way to workaround this issue: When changing the resolution first, then enabling fullscreen (instead of first enabling fullscreen and changing the resolution afterwards), the issue does not happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants