Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/joystick/windows/SDL_dinputjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,13 @@ bool SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joysti
}

/* Acquire shared access. Exclusive access is required for forces,
* though. */
* though. But if there's no window handle (b/c the video driver
* is disabled) use non-exclusive and give up forces rather than
* fail to open.
*/
result =
IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata->InputDevice, SDL_HelperWindow,
DISCL_EXCLUSIVE |
(SDL_HelperWindow ? DISCL_EXCLUSIVE : DISCL_NONEXCLUSIVE) |
DISCL_BACKGROUND);
if (FAILED(result)) {
return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
Expand Down