Linux: Fix slow startup on some systems caused by GLFW searching for joysticks. Since kitty does not use joysticks, disable joystick support.

Fixes #830
This commit is contained in:
Kovid Goyal
2018-08-31 07:50:51 +05:30
parent d276317e3a
commit ab960ea12d
8 changed files with 26 additions and 6 deletions

1
kitty/glfw-wrapper.h generated
View File

@@ -819,6 +819,7 @@ typedef int (* GLFWapplicationshouldhandlereopenfun)(int);
* @{ */
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
#define GLFW_DEBUG_KEYBOARD 0x00050002
#define GLFW_ENABLE_JOYSTICKS 0x00050003
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
#define GLFW_COCOA_MENUBAR 0x00051002

View File

@@ -593,6 +593,9 @@ glfw_init(PyObject UNUSED *self, PyObject *args) {
if (err) { PyErr_SetString(PyExc_RuntimeError, err); return NULL; }
glfwSetErrorCallback(error_callback);
glfwInitHint(GLFW_DEBUG_KEYBOARD, debug_keyboard);
// Joysticks cause slow startup on some linux systems, see
// https://github.com/kovidgoyal/kitty/issues/830
glfwInitHint(GLFW_ENABLE_JOYSTICKS, 0);
global_state.opts.debug_keyboard = debug_keyboard != 0;
#ifdef __APPLE__
glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, 0);