mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
Don't update the report mode until the related hint is set
Fixes https://github.com/libsdl-org/SDL/issues/12404
This commit is contained in:
@@ -869,33 +869,22 @@ static void SetEnhancedModeAvailable(SDL_DriverSwitch_Context *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetEnhancedMode(SDL_DriverSwitch_Context *ctx, bool bEnabled)
|
|
||||||
{
|
|
||||||
if (bEnabled) {
|
|
||||||
SetEnhancedModeAvailable(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bEnabled != ctx->m_bEnhancedMode) {
|
|
||||||
ctx->m_bEnhancedMode = bEnabled;
|
|
||||||
|
|
||||||
UpdateInputMode(ctx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void SetEnhancedReportHint(SDL_DriverSwitch_Context *ctx, HIDAPI_Switch_EnhancedReportHint eEnhancedReportHint)
|
static void SetEnhancedReportHint(SDL_DriverSwitch_Context *ctx, HIDAPI_Switch_EnhancedReportHint eEnhancedReportHint)
|
||||||
{
|
{
|
||||||
|
ctx->m_eEnhancedReportHint = eEnhancedReportHint;
|
||||||
|
|
||||||
switch (eEnhancedReportHint) {
|
switch (eEnhancedReportHint) {
|
||||||
case SWITCH_ENHANCED_REPORT_HINT_OFF:
|
case SWITCH_ENHANCED_REPORT_HINT_OFF:
|
||||||
SetEnhancedMode(ctx, false);
|
ctx->m_bEnhancedMode = false;
|
||||||
break;
|
break;
|
||||||
case SWITCH_ENHANCED_REPORT_HINT_ON:
|
case SWITCH_ENHANCED_REPORT_HINT_ON:
|
||||||
SetEnhancedMode(ctx, true);
|
SetEnhancedModeAvailable(ctx);
|
||||||
|
ctx->m_bEnhancedMode = true;
|
||||||
break;
|
break;
|
||||||
case SWITCH_ENHANCED_REPORT_HINT_AUTO:
|
case SWITCH_ENHANCED_REPORT_HINT_AUTO:
|
||||||
SetEnhancedModeAvailable(ctx);
|
SetEnhancedModeAvailable(ctx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ctx->m_eEnhancedReportHint = eEnhancedReportHint;
|
|
||||||
|
|
||||||
UpdateInputMode(ctx);
|
UpdateInputMode(ctx);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user