parent
90722ecbe7
commit
37e3e29c8c
@ -97,6 +97,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
|
|
||||||
- Fix inactive tab closing causing active tab to change (:iss:`3398`)
|
- Fix inactive tab closing causing active tab to change (:iss:`3398`)
|
||||||
|
|
||||||
|
- Fix a crash on systems using musl as libc (:iss:`3395`)
|
||||||
|
|
||||||
|
|
||||||
0.19.3 [2020-12-19]
|
0.19.3 [2020-12-19]
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
11
glfw/glfw.py
11
glfw/glfw.py
@ -179,13 +179,12 @@ class Function:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def load(self) -> str:
|
def load(self) -> str:
|
||||||
ans = '*(void **) (&{name}_impl) = dlsym(handle, "{name}");'.format(
|
ans = f'*(void **) (&{self.name}_impl) = dlsym(handle, "{self.name}");'
|
||||||
name=self.name
|
ans += f'\n if ({self.name}_impl == NULL) '
|
||||||
)
|
|
||||||
if self.check_fail:
|
if self.check_fail:
|
||||||
ans += '\n if ({name}_impl == NULL) fail("Failed to load glfw function {name} with error: %s", dlerror());'.format(
|
ans += f'fail("Failed to load glfw function {self.name} with error: %s", dlerror());'
|
||||||
name=self.name
|
else:
|
||||||
)
|
ans += 'dlerror(); // clear error indicator'
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,9 +11,11 @@
|
|||||||
#define FUNC(name, restype, ...) typedef restype (*name##_func)(__VA_ARGS__); static name##_func name = NULL
|
#define FUNC(name, restype, ...) typedef restype (*name##_func)(__VA_ARGS__); static name##_func name = NULL
|
||||||
#define LOAD_FUNC(handle, name) {\
|
#define LOAD_FUNC(handle, name) {\
|
||||||
*(void **) (&name) = dlsym(handle, #name); \
|
*(void **) (&name) = dlsym(handle, #name); \
|
||||||
const char* error = dlerror(); \
|
if (!name) { \
|
||||||
if (error != NULL) { \
|
const char* error = dlerror(); \
|
||||||
PyErr_Format(PyExc_OSError, "Failed to load the function %s with error: %s", #name, error); dlclose(handle); handle = NULL; return NULL; \
|
if (error != NULL) { \
|
||||||
|
PyErr_Format(PyExc_OSError, "Failed to load the function %s with error: %s", #name, error); dlclose(handle); handle = NULL; return NULL; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +141,7 @@ load_libcanberra(void) {
|
|||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
dlclose(libcanberra_handle); libcanberra_handle = NULL;
|
dlclose(libcanberra_handle); libcanberra_handle = NULL;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (ca_context_create(&canberra_ctx) != 0) {
|
if (ca_context_create(&canberra_ctx) != 0) {
|
||||||
fprintf(stderr, "Failed to create libcanberra context, cannot play beep sound\n");
|
fprintf(stderr, "Failed to create libcanberra context, cannot play beep sound\n");
|
||||||
|
|||||||
19
kitty/glfw-wrapper.c
generated
19
kitty/glfw-wrapper.c
generated
@ -379,42 +379,61 @@ load_glfw(const char* path) {
|
|||||||
if (glfwGetRequiredInstanceExtensions_impl == NULL) fail("Failed to load glfw function glfwGetRequiredInstanceExtensions with error: %s", dlerror());
|
if (glfwGetRequiredInstanceExtensions_impl == NULL) fail("Failed to load glfw function glfwGetRequiredInstanceExtensions with error: %s", dlerror());
|
||||||
|
|
||||||
*(void **) (&glfwGetCocoaWindow_impl) = dlsym(handle, "glfwGetCocoaWindow");
|
*(void **) (&glfwGetCocoaWindow_impl) = dlsym(handle, "glfwGetCocoaWindow");
|
||||||
|
if (glfwGetCocoaWindow_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwHideCocoaTitlebar_impl) = dlsym(handle, "glfwHideCocoaTitlebar");
|
*(void **) (&glfwHideCocoaTitlebar_impl) = dlsym(handle, "glfwHideCocoaTitlebar");
|
||||||
|
if (glfwHideCocoaTitlebar_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetNSGLContext_impl) = dlsym(handle, "glfwGetNSGLContext");
|
*(void **) (&glfwGetNSGLContext_impl) = dlsym(handle, "glfwGetNSGLContext");
|
||||||
|
if (glfwGetNSGLContext_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetCocoaMonitor_impl) = dlsym(handle, "glfwGetCocoaMonitor");
|
*(void **) (&glfwGetCocoaMonitor_impl) = dlsym(handle, "glfwGetCocoaMonitor");
|
||||||
|
if (glfwGetCocoaMonitor_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetCocoaTextInputFilter_impl) = dlsym(handle, "glfwSetCocoaTextInputFilter");
|
*(void **) (&glfwSetCocoaTextInputFilter_impl) = dlsym(handle, "glfwSetCocoaTextInputFilter");
|
||||||
|
if (glfwSetCocoaTextInputFilter_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetCocoaFileOpenCallback_impl) = dlsym(handle, "glfwSetCocoaFileOpenCallback");
|
*(void **) (&glfwSetCocoaFileOpenCallback_impl) = dlsym(handle, "glfwSetCocoaFileOpenCallback");
|
||||||
|
if (glfwSetCocoaFileOpenCallback_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetCocoaToggleFullscreenIntercept_impl) = dlsym(handle, "glfwSetCocoaToggleFullscreenIntercept");
|
*(void **) (&glfwSetCocoaToggleFullscreenIntercept_impl) = dlsym(handle, "glfwSetCocoaToggleFullscreenIntercept");
|
||||||
|
if (glfwSetCocoaToggleFullscreenIntercept_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetApplicationShouldHandleReopen_impl) = dlsym(handle, "glfwSetApplicationShouldHandleReopen");
|
*(void **) (&glfwSetApplicationShouldHandleReopen_impl) = dlsym(handle, "glfwSetApplicationShouldHandleReopen");
|
||||||
|
if (glfwSetApplicationShouldHandleReopen_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetApplicationWillFinishLaunching_impl) = dlsym(handle, "glfwSetApplicationWillFinishLaunching");
|
*(void **) (&glfwSetApplicationWillFinishLaunching_impl) = dlsym(handle, "glfwSetApplicationWillFinishLaunching");
|
||||||
|
if (glfwSetApplicationWillFinishLaunching_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetCocoaKeyEquivalent_impl) = dlsym(handle, "glfwGetCocoaKeyEquivalent");
|
*(void **) (&glfwGetCocoaKeyEquivalent_impl) = dlsym(handle, "glfwGetCocoaKeyEquivalent");
|
||||||
|
if (glfwGetCocoaKeyEquivalent_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwCocoaRequestRenderFrame_impl) = dlsym(handle, "glfwCocoaRequestRenderFrame");
|
*(void **) (&glfwCocoaRequestRenderFrame_impl) = dlsym(handle, "glfwCocoaRequestRenderFrame");
|
||||||
|
if (glfwCocoaRequestRenderFrame_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetX11Display_impl) = dlsym(handle, "glfwGetX11Display");
|
*(void **) (&glfwGetX11Display_impl) = dlsym(handle, "glfwGetX11Display");
|
||||||
|
if (glfwGetX11Display_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetX11Window_impl) = dlsym(handle, "glfwGetX11Window");
|
*(void **) (&glfwGetX11Window_impl) = dlsym(handle, "glfwGetX11Window");
|
||||||
|
if (glfwGetX11Window_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwSetPrimarySelectionString_impl) = dlsym(handle, "glfwSetPrimarySelectionString");
|
*(void **) (&glfwSetPrimarySelectionString_impl) = dlsym(handle, "glfwSetPrimarySelectionString");
|
||||||
|
if (glfwSetPrimarySelectionString_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetPrimarySelectionString_impl) = dlsym(handle, "glfwGetPrimarySelectionString");
|
*(void **) (&glfwGetPrimarySelectionString_impl) = dlsym(handle, "glfwGetPrimarySelectionString");
|
||||||
|
if (glfwGetPrimarySelectionString_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwGetNativeKeyForName_impl) = dlsym(handle, "glfwGetNativeKeyForName");
|
*(void **) (&glfwGetNativeKeyForName_impl) = dlsym(handle, "glfwGetNativeKeyForName");
|
||||||
|
if (glfwGetNativeKeyForName_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwRequestWaylandFrameEvent_impl) = dlsym(handle, "glfwRequestWaylandFrameEvent");
|
*(void **) (&glfwRequestWaylandFrameEvent_impl) = dlsym(handle, "glfwRequestWaylandFrameEvent");
|
||||||
|
if (glfwRequestWaylandFrameEvent_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwDBusUserNotify_impl) = dlsym(handle, "glfwDBusUserNotify");
|
*(void **) (&glfwDBusUserNotify_impl) = dlsym(handle, "glfwDBusUserNotify");
|
||||||
|
if (glfwDBusUserNotify_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
*(void **) (&glfwDBusSetUserNotificationHandler_impl) = dlsym(handle, "glfwDBusSetUserNotificationHandler");
|
*(void **) (&glfwDBusSetUserNotificationHandler_impl) = dlsym(handle, "glfwDBusSetUserNotificationHandler");
|
||||||
|
if (glfwDBusSetUserNotificationHandler_impl == NULL) dlerror(); // clear error indicator
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user