Revert "Linux: Fix slow startup on some systems caused by GLFW searching for joysticks. Since kitty does not use joysticks, disable joystick support."
This reverts commit ab960ea12d3e1e3489898b663f8d678ece8b2409.
This commit is contained in:
parent
1bb6242020
commit
78efefcea1
1
glfw/glfw3.h
vendored
1
glfw/glfw3.h
vendored
@ -1202,7 +1202,6 @@ typedef enum {
|
||||
*/
|
||||
#define GLFW_ANGLE_PLATFORM_TYPE 0x00050002
|
||||
#define GLFW_DEBUG_KEYBOARD 0x00050003
|
||||
#define GLFW_ENABLE_JOYSTICKS 0x00050004
|
||||
/*! @brief macOS specific init hint.
|
||||
*
|
||||
* macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint).
|
||||
|
||||
4
glfw/init.c
vendored
4
glfw/init.c
vendored
@ -55,7 +55,6 @@ static _GLFWinitconfig _glfwInitHints =
|
||||
true, // hat buttons
|
||||
GLFW_ANGLE_PLATFORM_TYPE_NONE, // ANGLE backend
|
||||
false, // debug keyboard
|
||||
true, // enable joystick
|
||||
{
|
||||
true, // macOS menu bar
|
||||
true // macOS bundle chdir
|
||||
@ -276,9 +275,6 @@ GLFWAPI void glfwInitHint(int hint, int value)
|
||||
{
|
||||
switch (hint)
|
||||
{
|
||||
case GLFW_ENABLE_JOYSTICKS:
|
||||
_glfwInitHints.enableJoysticks = value;
|
||||
return;
|
||||
case GLFW_JOYSTICK_HAT_BUTTONS:
|
||||
_glfwInitHints.hatButtons = value;
|
||||
return;
|
||||
|
||||
1
glfw/internal.h
vendored
1
glfw/internal.h
vendored
@ -276,7 +276,6 @@ struct _GLFWinitconfig
|
||||
bool hatButtons;
|
||||
int angleType;
|
||||
bool debugKeyboard;
|
||||
bool enableJoysticks;
|
||||
struct {
|
||||
bool menubar;
|
||||
bool chdir;
|
||||
|
||||
2
glfw/wl_init.c
vendored
2
glfw/wl_init.c
vendored
@ -772,10 +772,8 @@ int _glfwPlatformInit(void)
|
||||
wl_display_roundtrip(_glfw.wl.display);
|
||||
|
||||
#ifdef __linux__
|
||||
if (_glfw.hints.init.enableJoysticks) {
|
||||
if (!_glfwInitJoysticksLinux())
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_glfw.wl.wmBase)
|
||||
|
||||
2
glfw/x11_init.c
vendored
2
glfw/x11_init.c
vendored
@ -654,12 +654,10 @@ int _glfwPlatformInit(void)
|
||||
_glfw.x11.hiddenCursorHandle = createHiddenCursor();
|
||||
|
||||
#if defined(__linux__)
|
||||
if (_glfw.hints.init.enableJoysticks) {
|
||||
if (!_glfwInitJoysticksLinux())
|
||||
return false;
|
||||
if (_glfw.linjs.inotify > 0)
|
||||
addWatch(&_glfw.x11.eventLoopData, "joystick", _glfw.linjs.inotify, POLLIN, 1, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
_glfwPollMonitorsX11();
|
||||
|
||||
2
glfw/x11_window.c
vendored
2
glfw/x11_window.c
vendored
@ -2653,7 +2653,7 @@ _glfwDispatchX11Events(void) {
|
||||
unsigned dispatched = 0;
|
||||
|
||||
#if defined(__linux__)
|
||||
if (_glfw.hints.init.enableJoysticks) _glfwDetectJoystickConnectionLinux();
|
||||
_glfwDetectJoystickConnectionLinux();
|
||||
#endif
|
||||
dispatched += dispatch_x11_queued_events(XEventsQueued(_glfw.x11.display, QueuedAfterFlush));
|
||||
|
||||
|
||||
1
kitty/glfw-wrapper.h
generated
1
kitty/glfw-wrapper.h
generated
@ -940,7 +940,6 @@ typedef enum {
|
||||
*/
|
||||
#define GLFW_ANGLE_PLATFORM_TYPE 0x00050002
|
||||
#define GLFW_DEBUG_KEYBOARD 0x00050003
|
||||
#define GLFW_ENABLE_JOYSTICKS 0x00050004
|
||||
/*! @brief macOS specific init hint.
|
||||
*
|
||||
* macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint).
|
||||
|
||||
@ -814,9 +814,6 @@ 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);
|
||||
OPT(debug_keyboard) = debug_keyboard != 0;
|
||||
#ifdef __APPLE__
|
||||
glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user