瀏覽代碼

InputComponent: add a setting to disable SDL

In some situations it appears that the SDL code causes issues (such as
crashes), even if the user isn't using SDL. This new setting is supposed
to help debugging this. A user can set main.sdlEnabled to "false", and
we won't initialize and use SDL.
Vincent Lang 7 年之前
父節點
當前提交
fc3094567f
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 4 0
      resources/settings/settings_description.json
  2. 2 1
      src/input/InputComponent.cpp

+ 4 - 0
resources/settings/settings_description.json

@@ -151,6 +151,10 @@
         "value": "forceAlwaysFS",
         "default": false,
         "hidden": true
+      },
+      {
+        "value": "sdlEnabled",
+        "default": true
       }
     ]
   },

+ 2 - 1
src/input/InputComponent.cpp

@@ -91,7 +91,8 @@ bool InputComponent::componentInitialize()
   addInput(new InputAppleMediaKeys(this));
 #endif
 #ifdef HAVE_SDL
-  addInput(new InputSDL(this));
+  if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "sdlEnabled").toBool())
+    addInput(new InputSDL(this));
 #endif
 #ifdef HAVE_LIRC
   addInput(new InputLIRC(this));