OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

Ignore mouse-click when bringing window back into focus

Open LordKobra opened this issue 8 months ago • 1 comments

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.

LordKobra avatar Apr 25 '25 17:04 LordKobra

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()).

Try avatar Apr 26 '25 17:04 Try