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

Make SubViewportContainer event propagation aware of focused Control #79248

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

Sauermann
Copy link
Contributor

@Sauermann Sauermann commented Jul 9, 2023

resolve #79235
Regression from #58334

The fix for the linked issue consists of three changes:

  1. Propagate InputEvents without position either
    • during the Input-stage, when it has focus or
    • during the Unhandled-Input-stage otherwise
  • This makes sure that Gui-Input happens in the correct order, respecting the focused Control node.
  1. Move "Unhandled key Input" handling before "Unhandled Input" handling, so that Unicode input with Alt / Ctrl modifiers are sent to LineEdit-nodes in the correct order.

  2. Change the default focus mode of SubViewportContainer from FOCUS_NONE to FOCUS_CLICK, to automatically remove focus from other Control-nodes, when clicking inside a SubViewport.

Updated 2023-07-14: Change process groups only on focus change
Updated 2023-07-17: Fix Unicode input with Alt / Ctrl modifiers propagation order for nodes like LineEdit

Propagate `InputEvents` without position either
- during the Input-stage, when it has focus or
- during the Unhandled-Input-stage, otherwise

This makes sure that Gui-Input happens in the correct order.

Move "Unhandled key Input" handling before "Unhandled Input" handling,
so that Unicode input with Alt / Ctrl modifiers are sent to the nodes
in the correct order.

Change the default focus mode of `SubViewportContainer` from
`FOCUS_NONE` to `FOCUS_CLICK`, to automatically remove focus from
other `Control`-nodes, when clicking inside a `SubViewport`.
Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

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

With a big TIWAGOS, I can say changes look good and I also make the now classical disclaimer: the best option now is to put this in the wild, especially being early in the 4.2 cycle.

@YuriSizov YuriSizov merged commit 67873d0 into godotengine:master Jul 26, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

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

Successfully merging this pull request may close these issues.

InputEventKey not reaching focused Control when embedding Windows inside SubViewports
3 participants