Commit 7cff339
committed
SDL2: warn at init when winraw input driver is selected
The Windows winraw input driver does not work alongside the SDL2
video driver because SDL2 internally registers for raw input and
drains the WM_INPUT stream via GetRawInputBuffer() to feed its own
keyboard / mouse APIs. winraw's hidden HWND_MESSAGE window then
never sees any input events, so keyboard / mouse polling silently
stops working.
This is a fundamental architectural mismatch and not something the
SDL2 video driver can fix from RA's side - SDL owns its window's
WndProc. Unlike the d3d8 / d3d9 / d3d11 / d3d12 drivers, which
create their main window themselves with a winraw-aware WndProc
(wnd_proc_d3d_winraw, gfx/common/win32_common.c) that forwards the
relevant focus / input messages, SDL_CreateWindow installs SDL's
own WndProc and we have no clean way to subclass or replace it.
The bug has existed since both drivers existed, but went largely
unnoticed before the recent SDL2 backend work because the SDL2
driver was missing menu rendering and rarely used as a primary
choice. Now that it is feature-complete, more users will hit the
combination.
Detect the broken combo at sdl2_gfx_init time and emit two
RARCH_WARN lines with concrete actionable guidance ("switch to
dinput in Settings -> Drivers -> Input") so the user has a clear
explanation instead of a black-hole input experience. Does not
refuse to init - gamepad-only users still get a working setup.
Gated on _WIN32 (and not _XBOX / __WINRT__) since winraw is
Windows-only. See input/drivers/winraw_input.c for the input side.1 parent f2bb729 commit 7cff339
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
345 | 371 | | |
346 | 372 | | |
347 | 373 | | |
| |||
0 commit comments