Skip to content

Fix window event pumping, mouse cursor sync and window sizing - #17

Merged
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/window-input-fixes
Aug 5, 2026
Merged

Fix window event pumping, mouse cursor sync and window sizing#17
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/window-input-fixes

Conversation

@Upabjojr

@Upabjojr Upabjojr commented Aug 1, 2026

Copy link
Copy Markdown

Five related defects that surfaced while getting the game running against OGRE 13.6.5 on X11: Ogre::Root::startRendering() no longer pumps window events for applications not built on Ogre::Bites, so resize events never arrived and CEGUI's display size and OIS' clipping rectangle went stale. The render loop is now driven directly with messagePump() every frame, and the mouse cursor, window sizing and related event handling are fixed along the way.

One commit: Fix window event pumping, mouse cursor sync and window sizing.


Split out of #16 so each topic can be reviewed on its own. Merging all of the split PRs reproduces the tree of #16 exactly.

🤖 Generated with Claude Code

Five related defects surfaced while getting the game running against
OGRE 13.6.5 on X11.

Pump window events. Ogre::Root::startRendering() no longer pumps them
(Ogre::Bites does that for applications built on its context, which we
are not), so ConfigureNotify never arrived: windowResized() ran only
once at startup and CEGUI's display size and OIS' clipping rectangle
went stale as soon as the window was resized. Drive the render loop
directly and call messagePump() every frame.

Exit cleanly when the window is closed. windowClosed() destroys the
mode manager, but frameStarted() dereferences it before testing the
exit flag, so the next frame segfaulted in _fireFrameStarted(). This
was unreachable before, as close events were never delivered. Request
exit from windowClosed() and check it before rendering.

Hide the system cursor while grabbing. When grabbing, OIS tracks the
pointer by accumulating relative motion and warps the real pointer back
to the window centre near the edges; leaving that cursor visible showed
it drifting away from the one CEGUI draws.

Keep the configured video mode. initVideoConfig() dropped any video
option whose value was not among the render system's possible values,
but the video mode also sizes the window when running windowed, where
it need not be one of the fullscreen modes. It was silently falling
back to the minimum size.

Raise the minimum window height to 660. MenuMain.layout stacks its
seven buttons around the vertical centre with fixed offsets and needs
660px; below that the game clipped the "Quit" button off its own menu.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit eac4b7d)
paramList.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false")));
// When grabbing, OIS tracks the pointer by accumulating relative motion and warps
// the real pointer back to the window centre near the edges. Leaving the system
// cursor visible then shows it drifting away from the one CEGUI draws, so hide it.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a while to understand what it is trying to say.
Anyway shoudn't the system cursor be always hidden ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Ubuntu 24.04 there was a serious mouse sync issue.

@tomluchowski
tomluchowski merged commit efebb27 into tomluchowski:shaders-improvement Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants