-
Notifications
You must be signed in to change notification settings - Fork 2.9k
DolphinQt: Add Dolphin focus for inputs #13993
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
Dentomologist
wants to merge
16
commits into
dolphin-emu:master
Choose a base branch
from
Dentomologist:dolphinqt_add_dolphin_focus_for_inputs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DolphinQt: Add Dolphin focus for inputs #13993
Dentomologist
wants to merge
16
commits into
dolphin-emu:master
from
Dentomologist:dolphinqt_add_dolphin_focus_for_inputs
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove input suppression from the Settings and Free Look Settings windows. In an upcoming commit input suppression will be added to individual text fields, so there won't be a need to suppress inputs for the whole time those windows are open. Removing the suppression from these windows now reduces commit noise as various refactorings happen. Keep input suppression for the mapping windows, since users should be able to check their mappings via the indicator lights without causing other inputs. The removed call to install a WindowActivationEventFilter on MainWindow::m_hotkey_window was redundant with the filter installed in MappingWindow's constructor.
Use an atomic integer to track the hotkey suppression count instead of a boolean. This allows for nested suppressions without having to worry about the order of window activations and deactivations, and making it atomic fixes a potential data race between the Host and Hotkey Scheduler threads. Previously if you had a window that disabled hotkeys focused (such as the Controllers pane in the Settings window) then opened another such window (such as a controller mapping window), the focus-in event for the new window would disable hotkeys again, followed by the focus-out event for the first window enabling them.
Include InputCommon/InputConfig.h directly in MainWindow.cpp instead of indirectly via Core/HotkeyManager.h.
In an upcoming commit input suppression will be added for Free Look and controller inputs. Use an independent class instead of having those input channels call HotkeyManagerEmu::IsSuppressed.
Adjust #includes and forward declarations and use the DolphinFileDialog namespace in the .cpp file instead of prefixing each function.
Add filters to automatically add a suppression on hotkey, Free Look, and controller inputs when a widget with meaningful text input gains focus, then remove the suppression when that widget loses focus. Specifically this applies to QLineEdits, QTextEdits, QAbstractSpinBoxes, and QComboBoxes, as well as any class deriving from one of those.
Accept "True" and "False" in INI files as their corresponding values for other types. The purpose of this is to enable backward compatibility when adding a new value to a formerly boolean type.
Add functions to let DolphinQt notify Core when Dolphin becomes or stops being the active application.
This will be used by controller/hotkey/Free Look inputs in future commits.
Replace "Hotkeys Require Window Focus" checkbox with "Accept Hotkeys From" combobox. The "Any Application" option has the same behavior as "Hotkeys Require Window Focus" = False, and will be used by configs with that value. The "Render Window or TAS Input" option has the same behavior as "Hotkeys Require Window Focus" = True. The default "Dolphin" option behaves similarly to the "Any Application" option, but limited to (most) Dolphin windows. It will be used by configs with "Hotkeys Require Window Focus" = True, under the theory that a majority of users would prefer hotkeys to have always behaved that way.
Replace "Background Input" checkbox with "Accept Input From" combobox. The default "Render Window or TAS Input" option has the same behavior as "Background Input" = False, and will be used by configs with that value set. The "Any Application" option has the same behavior as "Background Input" = True, and will be used by configs with that value set. The "Dolphin" option behaves similarly to the "Any Application" option, but limited to (most) Dolphin windows.
Replace "Background Input" checkbox with "Accept Input From" combobox. The default "Render Window or TAS Input" option has the same behavior as "Background Input" = False, and will be used by configs with that value set. The "Any Application" option has the same behavior as "Background Input" = True, and will be used by configs with that value set. The "Dolphin" option behaves similarly to the "Any Application" option, but limited to (most) Dolphin windows.
All of the callers of UpdateInputGate now use the InputFocusPolicy version so we can get rid of the bool version.
Fix a bug where changing the cursor's focus policy wouldn't update RenderWidget's cursor icon until either RenderWidget gained/lost focus, or the cursor visibility setting changed. This would cause the cursor to be shown or hidden using the wrong focus policy.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new
Dolphin
input focus option for each of hotkeys, controller input, and Free Look. This option behaves like background input, but only accepts input from most Dolphin windows. This PR is built on top of #13990 to better reflect the intended user experience, so the input suppression when text fields are focused applies here too (and the first actual commit of this PR is 002544c).The
Hotkeys Require Window Focus:
andBackground Input:
checkboxes have been replaced withAccept [Input/Hotkeys] From:
comboboxes with the optionsRender Window or TAS Input
,Any Application
, andDolphin
.For controller input and Free Look the default value is
Render Window or TAS Input
and the current config value will seamlessly be applied.For hotkeys I've opted to make the default value
Dolphin
, because it seems to me like a number of hotkeys are more useful if you can use them from places other than the render/TAS windows and I suspect most users would prefer to have the new behavior. For the same reason I've made the config value forHotkeys Require Window Focus = True
correspond to the config value forDolphin
, so configs with that value set will automatically be converted to the new behavior.Some questions for discussion:
Render Window or TAS Input
instead?Dolphin
instead?Background Input
/Hotkeys Require Window Focus
would mostly prefer to haveDolphin
instead ofAny Application
?