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:
parent
d276317e3a
commit
ab960ea12d
@ -70,6 +70,11 @@ Changelog
|
|||||||
|
|
||||||
- macOS: Fix control+tab key combination not working (:iss:`801`)
|
- macOS: Fix control+tab key combination not working (:iss:`801`)
|
||||||
|
|
||||||
|
- Linux: Fix slow startup on some systems caused by GLFW searching for
|
||||||
|
joysticks. Since kitty does not use joysticks, disable joystick support.
|
||||||
|
(:iss:`830`)
|
||||||
|
|
||||||
|
|
||||||
0.11.3 [2018-07-10]
|
0.11.3 [2018-07-10]
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
|||||||
1
glfw/glfw3.h
vendored
1
glfw/glfw3.h
vendored
@ -1058,6 +1058,7 @@ extern "C" {
|
|||||||
* @{ */
|
* @{ */
|
||||||
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
|
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
|
||||||
#define GLFW_DEBUG_KEYBOARD 0x00050002
|
#define GLFW_DEBUG_KEYBOARD 0x00050002
|
||||||
|
#define GLFW_ENABLE_JOYSTICKS 0x00050003
|
||||||
|
|
||||||
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
|
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
|
||||||
#define GLFW_COCOA_MENUBAR 0x00051002
|
#define GLFW_COCOA_MENUBAR 0x00051002
|
||||||
|
|||||||
4
glfw/init.c
vendored
4
glfw/init.c
vendored
@ -52,6 +52,7 @@ static _GLFWinitconfig _glfwInitHints =
|
|||||||
{
|
{
|
||||||
GLFW_TRUE, // hat buttons
|
GLFW_TRUE, // hat buttons
|
||||||
GLFW_FALSE, // debug keyboard
|
GLFW_FALSE, // debug keyboard
|
||||||
|
GLFW_TRUE, // enable joystick
|
||||||
{
|
{
|
||||||
GLFW_TRUE, // macOS menu bar
|
GLFW_TRUE, // macOS menu bar
|
||||||
GLFW_TRUE // macOS bundle chdir
|
GLFW_TRUE // macOS bundle chdir
|
||||||
@ -254,6 +255,9 @@ GLFWAPI void glfwInitHint(int hint, int value)
|
|||||||
{
|
{
|
||||||
switch (hint)
|
switch (hint)
|
||||||
{
|
{
|
||||||
|
case GLFW_ENABLE_JOYSTICKS:
|
||||||
|
_glfwInitHints.enableJoysticks = value;
|
||||||
|
return;
|
||||||
case GLFW_JOYSTICK_HAT_BUTTONS:
|
case GLFW_JOYSTICK_HAT_BUTTONS:
|
||||||
_glfwInitHints.hatButtons = value;
|
_glfwInitHints.hatButtons = value;
|
||||||
return;
|
return;
|
||||||
|
|||||||
1
glfw/internal.h
vendored
1
glfw/internal.h
vendored
@ -244,6 +244,7 @@ struct _GLFWinitconfig
|
|||||||
{
|
{
|
||||||
GLFWbool hatButtons;
|
GLFWbool hatButtons;
|
||||||
GLFWbool debugKeyboard;
|
GLFWbool debugKeyboard;
|
||||||
|
GLFWbool enableJoysticks;
|
||||||
struct {
|
struct {
|
||||||
GLFWbool menubar;
|
GLFWbool menubar;
|
||||||
GLFWbool chdir;
|
GLFWbool chdir;
|
||||||
|
|||||||
6
glfw/wl_init.c
vendored
6
glfw/wl_init.c
vendored
@ -688,8 +688,10 @@ int _glfwPlatformInit(void)
|
|||||||
wl_display_roundtrip(_glfw.wl.display);
|
wl_display_roundtrip(_glfw.wl.display);
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
if (!_glfwInitJoysticksLinux())
|
if (_glfw.hints.init.enableJoysticks) {
|
||||||
return GLFW_FALSE;
|
if (!_glfwInitJoysticksLinux())
|
||||||
|
return GLFW_FALSE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_glfwInitTimerPOSIX();
|
_glfwInitTimerPOSIX();
|
||||||
|
|||||||
11
glfw/x11_init.c
vendored
11
glfw/x11_init.c
vendored
@ -659,10 +659,13 @@ int _glfwPlatformInit(void)
|
|||||||
_glfw.x11.hiddenCursorHandle = createHiddenCursor();
|
_glfw.x11.hiddenCursorHandle = createHiddenCursor();
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
if (!_glfwInitJoysticksLinux())
|
if (_glfw.hints.init.enableJoysticks) {
|
||||||
return GLFW_FALSE;
|
printf("1111111111\n");
|
||||||
if (_glfw.linjs.inotify > 0)
|
if (!_glfwInitJoysticksLinux())
|
||||||
addWatch(&_glfw.x11.eventLoopData, "joystick", _glfw.linjs.inotify, POLLIN, 1, NULL, NULL);
|
return GLFW_FALSE;
|
||||||
|
if (_glfw.linjs.inotify > 0)
|
||||||
|
addWatch(&_glfw.x11.eventLoopData, "joystick", _glfw.linjs.inotify, POLLIN, 1, NULL, NULL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_glfwInitTimerPOSIX();
|
_glfwInitTimerPOSIX();
|
||||||
|
|||||||
1
kitty/glfw-wrapper.h
generated
1
kitty/glfw-wrapper.h
generated
@ -819,6 +819,7 @@ typedef int (* GLFWapplicationshouldhandlereopenfun)(int);
|
|||||||
* @{ */
|
* @{ */
|
||||||
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
|
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
|
||||||
#define GLFW_DEBUG_KEYBOARD 0x00050002
|
#define GLFW_DEBUG_KEYBOARD 0x00050002
|
||||||
|
#define GLFW_ENABLE_JOYSTICKS 0x00050003
|
||||||
|
|
||||||
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
|
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
|
||||||
#define GLFW_COCOA_MENUBAR 0x00051002
|
#define GLFW_COCOA_MENUBAR 0x00051002
|
||||||
|
|||||||
@ -593,6 +593,9 @@ glfw_init(PyObject UNUSED *self, PyObject *args) {
|
|||||||
if (err) { PyErr_SetString(PyExc_RuntimeError, err); return NULL; }
|
if (err) { PyErr_SetString(PyExc_RuntimeError, err); return NULL; }
|
||||||
glfwSetErrorCallback(error_callback);
|
glfwSetErrorCallback(error_callback);
|
||||||
glfwInitHint(GLFW_DEBUG_KEYBOARD, debug_keyboard);
|
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;
|
global_state.opts.debug_keyboard = debug_keyboard != 0;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, 0);
|
glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user