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

UI: Fix source name edit textbox not accepting input on enter #7373

Merged
merged 1 commit into from Sep 17, 2022

Conversation

PatTheMav
Copy link
Member

Description

The Enter key is connected to the Edit function and is handled by Qt with the highest priority in its key event handler. Alas the boolean return value is not propagated to the shortcut handling system, so the key event will always be consumed and as such the user will be stuck in editing state.

To fix this, Edit needs to behave like a toggle, saving the current state of the input at a repeat press of Enter while in editing state.

Motivation and Context

Fixes #7240

How Has This Been Tested?

Tested on macOS, also tested that functionality is not impacted on Windows 11 and Ubuntu 22.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

The Enter key is connected to the `Edit` function and is handled by
Qt with the highest priority in its key event handler. Alas the boolean
return value is not propagated to the shortcut handling system, so
the key event will always be consumed and as such the user will be stuck
in editing state.

To fix this, `Edit` needs to behave like a toggle, saving the current
state of the input at a repeat press of Enter while in editing state.
@PatTheMav PatTheMav added Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI macOS Affects macOS labels Sep 13, 2022
@cg2121
Copy link
Contributor

cg2121 commented Sep 15, 2022

Should do this for other list widgets such as scenes and filters, so everything is consistent.

@PatTheMav
Copy link
Member Author

Should do this for other list widgets such as scenes and filters, so everything is consistent.

Are other rename-able list fields affected by this as well? The root cause of this issue is setting the ‘Enter’ key as the hotkey triggering the edit (as is common on macOS) and not removing that action binding when in the signal handler.

@jp9000 jp9000 merged commit 43dc65b into obsproject:master Sep 17, 2022
@PatTheMav PatTheMav deleted the source-rename-fix branch September 18, 2022 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue macOS Affects macOS Seeking Testers Build artifacts on CI
Projects
No open projects
Status: Fixed & Released
Development

Successfully merging this pull request may close these issues.

Pressing enter when renaming a source does not save the name.
3 participants