window: Handle Alt-F4 to close windows

Kristian Høgsberg 12 years ago
parent 82b4c1bc6b
commit 4fc1535c0a
  1. 8
      clients/window.c

@ -1882,6 +1882,14 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard,
window->fullscreen_handler &&
state == WL_KEYBOARD_KEY_STATE_PRESSED) {
window->fullscreen_handler(window, window->user_data);
} else if (sym == XKB_KEY_F4 &&
input->modifiers == MOD_ALT_MASK &&
state == WL_KEYBOARD_KEY_STATE_PRESSED) {
if (window->close_handler)
window->close_handler(window->parent,
window->user_data);
else
display_exit(window->display);
} else if (window->key_handler) {
(*window->key_handler)(window, input, time, key,
sym, state, window->user_data);

Loading…
Cancel
Save