<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dolphin/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp, branch master</title>
<subtitle>GameCube and Wii emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/'/>
<entry>
<title>mingw: lower case windows includes</title>
<updated>2026-07-08T08:18:29+00:00</updated>
<author>
<name>Craig Carnell</name>
<email>1188869+cscd98@users.noreply.github.com</email>
</author>
<published>2025-09-28T17:34:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=e222665eb0a67b8d66b3e0f48476a8e62987fed3'/>
<id>e222665eb0a67b8d66b3e0f48476a8e62987fed3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ControllerInterface: Fix Windows deadlock</title>
<updated>2025-06-28T21:00:27+00:00</updated>
<author>
<name>Dentomologist</name>
<email>dentomologist@gmail.com</email>
</author>
<published>2025-06-28T19:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=c613d3ca109a437e5001aa86c7839f494345818f'/>
<id>c613d3ca109a437e5001aa86c7839f494345818f</id>
<content type='text'>
Remove the redundant s_populate_mutex and only use
ControllerInterface::m_devices_population_mutex instead to prevent a
deadlock caused by locking them in opposite orders.

The device population functions in the win32 InputBackend previously
locked s_populate_mutex first before calling various functions that
locked m_devices_population_mutex. This normally worked but
ControllerInterface::RefreshDevices locks m_devices_population_mutex
first and then calls HandleWindowChange which then locked
s_populate_mutex, potentially causing the deadlock.

Fix this by using PlatformPopulateDevices to lock
m_devices_population_mutex before running the code that was previously
protected by s_populate_mutex. The functions in question lock
m_devices_population_mutex anyway, so this shouldn't meaningfully
increase contention on the lock.

Reproduction steps:

* Let Dolphin finish startup.
* In Win32.cpp::OnDevicesChanged set a breakpoint on the call to
  PlatformPopulateDevices. When the breakpoint is triggered the function
  will have locked s_populate_mutex, but since PlatformPopulateDevices
  won't have run yet m_devices_population_mutex will still be unlocked.
* Unplug a device from your computer.
* Wait for the breakpoint to trigger. (At this point you can plug the
  device back in).
* Freeze the ntdll.dll!TppWorkerThread() that triggered the breakpoint.
* Resume Dolphin and start a game.
* Core::EmuThread will call ControllerInterface::ChangeWindow which
  calls RefreshDevices. It locks m_devices_population_mutex, then calls
  InputBackend::HandleWindowChange, which tries to lock
  s_populate_mutex.
* Unfreeze ntdll.dll!TppWorkerThread().

At this point EmuThread and TppWorkerThread are deadlocked. The UI is
still responsive since the Host thread is unaffected, but trying to stop
the game or close Dolphin normally will fail since EmuThread is unable
to stop.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the redundant s_populate_mutex and only use
ControllerInterface::m_devices_population_mutex instead to prevent a
deadlock caused by locking them in opposite orders.

The device population functions in the win32 InputBackend previously
locked s_populate_mutex first before calling various functions that
locked m_devices_population_mutex. This normally worked but
ControllerInterface::RefreshDevices locks m_devices_population_mutex
first and then calls HandleWindowChange which then locked
s_populate_mutex, potentially causing the deadlock.

Fix this by using PlatformPopulateDevices to lock
m_devices_population_mutex before running the code that was previously
protected by s_populate_mutex. The functions in question lock
m_devices_population_mutex anyway, so this shouldn't meaningfully
increase contention on the lock.

Reproduction steps:

* Let Dolphin finish startup.
* In Win32.cpp::OnDevicesChanged set a breakpoint on the call to
  PlatformPopulateDevices. When the breakpoint is triggered the function
  will have locked s_populate_mutex, but since PlatformPopulateDevices
  won't have run yet m_devices_population_mutex will still be unlocked.
* Unplug a device from your computer.
* Wait for the breakpoint to trigger. (At this point you can plug the
  device back in).
* Freeze the ntdll.dll!TppWorkerThread() that triggered the breakpoint.
* Resume Dolphin and start a game.
* Core::EmuThread will call ControllerInterface::ChangeWindow which
  calls RefreshDevices. It locks m_devices_population_mutex, then calls
  InputBackend::HandleWindowChange, which tries to lock
  s_populate_mutex.
* Unfreeze ntdll.dll!TppWorkerThread().

At this point EmuThread and TppWorkerThread are deadlocked. The UI is
still responsive since the Host thread is unaffected, but trying to stop
the game or close Dolphin normally will fail since EmuThread is unable
to stop.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make overriding explicit and remove redundant virtual specifiers on overriding destructors - Core &amp; UnitTests</title>
<updated>2025-05-01T13:00:37+00:00</updated>
<author>
<name>Dr. Dystopia</name>
<email>jonis9898@hotmail.com</email>
</author>
<published>2025-04-16T07:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=f240e20e3f8250d279255fe48ba6ab351b581679'/>
<id>f240e20e3f8250d279255fe48ba6ab351b581679</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>InputCommon: Add Win32 InputBackend class.</title>
<updated>2024-03-11T08:25:31+00:00</updated>
<author>
<name>Jordan Woyak</name>
<email>jordan.woyak@gmail.com</email>
</author>
<published>2024-03-11T07:09:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=341f99a3f1feaf981bb704909b2dc3b3a0b70245'/>
<id>341f99a3f1feaf981bb704909b2dc3b3a0b70245</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>WGInput: use c++/winrt</title>
<updated>2022-08-27T06:20:34+00:00</updated>
<author>
<name>Shawn Hoffman</name>
<email>godisgovernment@gmail.com</email>
</author>
<published>2022-08-08T09:17:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=6bc8ab700195e65f9ac77761c502fb42f0c6881a'/>
<id>6bc8ab700195e65f9ac77761c502fb42f0c6881a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ciface/win32: use CM_Register_Notification instead of wnd msgs</title>
<updated>2022-08-27T04:59:56+00:00</updated>
<author>
<name>Shawn Hoffman</name>
<email>godisgovernment@gmail.com</email>
</author>
<published>2022-08-08T00:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=76d2e47444636210a188ac57d2c962049947ec20'/>
<id>76d2e47444636210a188ac57d2c962049947ec20</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ci/win32: give the wndclass a unique name</title>
<updated>2022-07-10T22:39:06+00:00</updated>
<author>
<name>Shawn Hoffman</name>
<email>godisgovernment@gmail.com</email>
</author>
<published>2022-04-18T10:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=655fb94e61f9edcb30d0370c801f7aee79a8811e'/>
<id>655fb94e61f9edcb30d0370c801f7aee79a8811e</id>
<content type='text'>
other things (like SDL) may try to use "Message"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
other things (like SDL) may try to use "Message"
</pre>
</div>
</content>
</entry>
<entry>
<title>InputCommon: Add Windows.Gaming.Input to ControllerInterface.</title>
<updated>2022-04-04T00:03:35+00:00</updated>
<author>
<name>Jordan Woyak</name>
<email>jordan.woyak@gmail.com</email>
</author>
<published>2020-10-20T16:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=076a262b9e936860411213f3d2e2d2de97664c88'/>
<id>076a262b9e936860411213f3d2e2d2de97664c88</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use HRWrap in remaining locations</title>
<updated>2022-01-09T20:44:55+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2021-12-12T21:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=ca9bf3174f4acd4c9d78ac7c21b6aeaa1430b7ef'/>
<id>ca9bf3174f4acd4c9d78ac7c21b6aeaa1430b7ef</id>
<content type='text'>
Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
</pre>
</div>
</content>
</entry>
<entry>
<title>InputCommon: fix default input config default device not being loaded/found</title>
<updated>2021-12-05T21:35:47+00:00</updated>
<author>
<name>Filoppi</name>
<email>filippotarpini@hotmail.it</email>
</author>
<published>2021-11-27T12:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=125971d9f2cbfff81985610a750364a54c3d452d'/>
<id>125971d9f2cbfff81985610a750364a54c3d452d</id>
<content type='text'>
Fixes bug: https://bugs.dolphin-emu.org/issues/12744

Before https://github.com/dolphin-emu/dolphin/commit/e1e3db13baabefa89991388d37db0bb260c4f535
the ControllerInterface m_devices_mutex was "wrongfully" locked for the whole Initialize() call, which included the first device population refresh,
this has the unwanted (accidental) consequence of often preventing the different pads (GC Pad, Wii Contollers, ...) input configs from loading
until that mutex was released (the input config defaults loading was blocked in EmulatedController::LoadDefaults()), which meant that the devices
population would often have the time to finish adding its first device, which would then be selected as default device (by design, the first device
added to the CI is the default default device, usually the "Keyboard and Mouse" device).

After the commit mentioned above removed the unnecessary m_devices_mutex calls, the default default device would fail to load (be found)
causing the default input mappings, which are specifically written for the default default device on every platform, to not be bound to any
physical device input, breaking input on new dolphin installations (until a user tried to customize the default device manually).

Default devices are now always added synchronously to avoid the problem, and so they should in the future (I added comments and warnings to help with that)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes bug: https://bugs.dolphin-emu.org/issues/12744

Before https://github.com/dolphin-emu/dolphin/commit/e1e3db13baabefa89991388d37db0bb260c4f535
the ControllerInterface m_devices_mutex was "wrongfully" locked for the whole Initialize() call, which included the first device population refresh,
this has the unwanted (accidental) consequence of often preventing the different pads (GC Pad, Wii Contollers, ...) input configs from loading
until that mutex was released (the input config defaults loading was blocked in EmulatedController::LoadDefaults()), which meant that the devices
population would often have the time to finish adding its first device, which would then be selected as default device (by design, the first device
added to the CI is the default default device, usually the "Keyboard and Mouse" device).

After the commit mentioned above removed the unnecessary m_devices_mutex calls, the default default device would fail to load (be found)
causing the default input mappings, which are specifically written for the default default device on every platform, to not be bound to any
physical device input, breaking input on new dolphin installations (until a user tried to customize the default device manually).

Default devices are now always added synchronously to avoid the problem, and so they should in the future (I added comments and warnings to help with that)
</pre>
</div>
</content>
</entry>
</feed>
