mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 12:42:25 +00:00
Allow using None for wait_events to mean no timeout
This commit is contained in:
parent
ec53436565
commit
3604b8c3e5
1 changed files with 4 additions and 1 deletions
|
|
@ -157,7 +157,10 @@ glfw_swap_interval(PyObject UNUSED *self, PyObject *args) {
|
|||
PyObject*
|
||||
glfw_wait_events(PyObject UNUSED *self, PyObject *args) {
|
||||
double time = -1;
|
||||
if(!PyArg_ParseTuple(args, "|d", &time)) return NULL;
|
||||
if (PyTuple_GET_SIZE(args) > 0) {
|
||||
time = PyFloat_AsDouble(PyTuple_GET_ITEM(args, 0));
|
||||
if (PyErr_Occurred()) PyErr_Clear();
|
||||
}
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
if (time < 0) glfwWaitEvents();
|
||||
else glfwWaitEventsTimeout(time);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue