Skip to content

Ignore mouse-click when bringing window back into focus #772

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

Open
LordKobra opened this issue Apr 25, 2025 · 1 comment
Open

Ignore mouse-click when bringing window back into focus #772

LordKobra opened this issue Apr 25, 2025 · 1 comment

Comments

@LordKobra
Copy link
Contributor

It's a minor inconvenience, but when i tab out of Gothic and then select the window by clicking the mouse into the window, it registers the mouse-click. And the way how the menu is made, it will select some button currently close in the menu. In the worst case starting a new adventure or overwriting a save. Would be cool if we could ignore this first signal when bringing the window back into focus.

@Try
Copy link
Owner

Try commented Apr 26, 2025

Hi,

In engine there is a void focusEvent(Tempest::FocusEvent& event). However at lest on windows, OS reports focus event first and only then mouseClick.
In widget system (non-native UI controls controlled by the engine) it's other way around: mouseDown first, then if accepted, focusEvent.

I think it would be nice to ensure consistency between OS and internal UI, by forcing mouseDown to be processed first, then you can early-out from mouseDown even ala if(!hasFocus()).

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

No branches or pull requests

2 participants