Ensure key name is null terminated
This commit is contained in:
parent
286f3630d7
commit
c8f20d0edf
@ -2181,6 +2181,7 @@ GLFWAPI void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun
|
|||||||
|
|
||||||
GLFWAPI void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char cocoa_key[32], int *cocoa_mods) {
|
GLFWAPI void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char cocoa_key[32], int *cocoa_mods) {
|
||||||
*cocoa_mods = 0;
|
*cocoa_mods = 0;
|
||||||
|
memset(cocoa_key, 0, sizeof(cocoa_key));
|
||||||
|
|
||||||
if (glfw_mods & GLFW_MOD_SHIFT)
|
if (glfw_mods & GLFW_MOD_SHIFT)
|
||||||
*cocoa_mods |= NSEventModifierFlagShift;
|
*cocoa_mods |= NSEventModifierFlagShift;
|
||||||
|
|||||||
@ -166,7 +166,7 @@ def generate_wrappers(glfw_header):
|
|||||||
GLFWcocoatogglefullscreenfun glfwSetCocoaToggleFullscreenIntercept(GLFWwindow *window, GLFWcocoatogglefullscreenfun callback)
|
GLFWcocoatogglefullscreenfun glfwSetCocoaToggleFullscreenIntercept(GLFWwindow *window, GLFWcocoatogglefullscreenfun callback)
|
||||||
GLFWapplicationshouldhandlereopenfun glfwSetApplicationShouldHandleReopen(GLFWapplicationshouldhandlereopenfun callback)
|
GLFWapplicationshouldhandlereopenfun glfwSetApplicationShouldHandleReopen(GLFWapplicationshouldhandlereopenfun callback)
|
||||||
GLFWapplicationwillfinishlaunchingfun glfwSetApplicationWillFinishLaunching(GLFWapplicationwillfinishlaunchingfun callback)
|
GLFWapplicationwillfinishlaunchingfun glfwSetApplicationWillFinishLaunching(GLFWapplicationwillfinishlaunchingfun callback)
|
||||||
void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char cocoa_key[32], int* cocoa_mods)
|
void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char[32] cocoa_key, int* cocoa_mods)
|
||||||
void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun callback)
|
void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun callback)
|
||||||
void* glfwGetX11Display(void)
|
void* glfwGetX11Display(void)
|
||||||
int32_t glfwGetX11Window(GLFWwindow* window)
|
int32_t glfwGetX11Window(GLFWwindow* window)
|
||||||
|
|||||||
@ -105,7 +105,6 @@ cocoa_set_new_window_trigger(PyObject *self UNUSED, PyObject *args) {
|
|||||||
int mods, key;
|
int mods, key;
|
||||||
if (!PyArg_ParseTuple(args, "ii", &mods, &key)) return NULL;
|
if (!PyArg_ParseTuple(args, "ii", &mods, &key)) return NULL;
|
||||||
int nwm;
|
int nwm;
|
||||||
memset(new_window_key, 0, sizeof(new_window_key));
|
|
||||||
get_cocoa_key_equivalent(key, mods, new_window_key, &nwm);
|
get_cocoa_key_equivalent(key, mods, new_window_key, &nwm);
|
||||||
new_window_mods = nwm;
|
new_window_mods = nwm;
|
||||||
if (new_window_key[0]) Py_RETURN_TRUE;
|
if (new_window_key[0]) Py_RETURN_TRUE;
|
||||||
|
|||||||
2
kitty/glfw-wrapper.h
generated
2
kitty/glfw-wrapper.h
generated
@ -2083,7 +2083,7 @@ typedef GLFWapplicationwillfinishlaunchingfun (*glfwSetApplicationWillFinishLaun
|
|||||||
glfwSetApplicationWillFinishLaunching_func glfwSetApplicationWillFinishLaunching_impl;
|
glfwSetApplicationWillFinishLaunching_func glfwSetApplicationWillFinishLaunching_impl;
|
||||||
#define glfwSetApplicationWillFinishLaunching glfwSetApplicationWillFinishLaunching_impl
|
#define glfwSetApplicationWillFinishLaunching glfwSetApplicationWillFinishLaunching_impl
|
||||||
|
|
||||||
typedef void (*glfwGetCocoaKeyEquivalent_func)(int, int, char, int*);
|
typedef void (*glfwGetCocoaKeyEquivalent_func)(int, int, char[32], int*);
|
||||||
glfwGetCocoaKeyEquivalent_func glfwGetCocoaKeyEquivalent_impl;
|
glfwGetCocoaKeyEquivalent_func glfwGetCocoaKeyEquivalent_impl;
|
||||||
#define glfwGetCocoaKeyEquivalent glfwGetCocoaKeyEquivalent_impl
|
#define glfwGetCocoaKeyEquivalent glfwGetCocoaKeyEquivalent_impl
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user