Skip to content

Fix controller detection on Windows 11 by disabling modern game controller API#471

Merged
RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:disable-win11-wgi
Feb 4, 2025
Merged

Fix controller detection on Windows 11 by disabling modern game controller API#471
RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:disable-win11-wgi

Conversation

@WizardCM

Copy link
Copy Markdown
Member

Description

Chromium 117 and above uses Windows.Gaming.Input, which states

Remarks

A Windows application must have focus to receive input from a controller.

This is not useful, as users will have the game focused, not OBS.

Issue raised with Chromium: https://issues.chromium.org/issues/392661398
Original commit that introduced the change:
https://chromiumdash.appspot.com/commit/aeb76145fe766a359f2e2b7432c207cc135113b6

The mentioned flag is set to never expire, so should be available indefinitely.

Ideally, Microsoft should update this API to match the previous (XInput) behaviour, or provide a flag to set the focus policy, which is provided by the IGameInput API. Until then, we will disable WGI.

Motivation and Context

Ultimately, this is a regression. Multiple users have reported being unable to use Gamepad Viewer when using Windows 11 and OBS 31. This is a very common use case of displaying controller inputs on stream.

How Has This Been Tested?

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.

Chromium 117 and above uses Windows.Gaming.Input, which states
> A Windows application must have focus to receive input from a controller.

This is not useful, as users will have the game focused, not OBS.

https://issues.chromium.org/issues/392661398
https://chromiumdash.appspot.com/commit/aeb76145fe766a359f2e2b7432c207cc135113b6
@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Jan 30, 2025

@RytoEX RytoEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine.

@RytoEX RytoEX merged commit 663dc38 into obsproject:master Feb 4, 2025
@WizardCM WizardCM deleted the disable-win11-wgi branch February 15, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants