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

InputCommon: Use the Window handle when initializing DirectInput. #8795

Merged
merged 2 commits into from
May 10, 2020

Conversation

WamWooWam
Copy link
Contributor

Previously, when initializing the Win32 input layer (and as a result DirectInput), Dolphin would use the handle of the render widget, which isn't updated when ControllerInterface::ChangeWindow is called. This had the annoying side effect of making all mouse input to Dolphin on Windows relative to the main Dolphin window, not the actual render target or render window.

This PR makes sure the Win32 controller interface is initialized using the actual window handle, which in turn makes mouse input relative to the render target itself, not the main window.

@JMC47
Copy link
Contributor

JMC47 commented May 6, 2020

@dolphin-emu-bot rebuild
@jordan-woyak please review.

@BhaaLseN
Copy link
Member

BhaaLseN commented May 7, 2020

Maybe @stenzek could also take a look, since #8666 changed this.

Copy link
Contributor

@stenzek stenzek left a comment

Choose a reason for hiding this comment

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

Thanks for bisecting/debugging! This should apply to the other platforms too, the only place the surface is different to the window is macos, and the surface points to the layer there (so the window should be used, not the surface/layer). So lines 113, 118, 119 (all platforms) should also be m_wsi.render_window. Not sure how I missed this...

@WamWooWam
Copy link
Contributor Author

Should be all done 👍

Copy link
Contributor

@stenzek stenzek left a comment

Choose a reason for hiding this comment

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

Thanks! :)

@stenzek stenzek merged commit 2488e4a into dolphin-emu:master May 10, 2020
@Filoppi
Copy link
Contributor

Filoppi commented May 16, 2020

This seems to have fixed a bug where about 1 times out of 4 the game windows would not receive any input (mouse/keyboard).

@pizuz
Copy link

pizuz commented May 19, 2020

Guess what? This broke MoltenVK on macOS... again...

https://bugs.dolphin-emu.org/issues/12107

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