Skip to content

Commit 9e7031f

Browse files
committed
Dont call window_for_id() unnecessarily
1 parent cca590c commit 9e7031f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kitty/keys.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ on_key_input(GLFWkeyevent *ev) {
155155

156156
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
157157
create_key_event();
158+
w->last_special_key_pressed = 0;
158159
PyObject *ret = PyObject_CallMethod(global_state.boss, "dispatch_possible_special_key", "O", ke);
159160
Py_CLEAR(ke);
160161
bool consumed = false;
161-
// the shortcut could have created a new window or closed the window, rendering the pointer
162-
// no longer valid
162+
// the shortcut could have created a new window or closed the
163+
// window, rendering the pointer no longer valid
163164
w = window_for_id(active_window_id);
164-
if (w) w->last_special_key_pressed = 0;
165165
if (ret == NULL) { PyErr_Print(); }
166166
else {
167167
consumed = ret == Py_True;

0 commit comments

Comments
 (0)