diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-07-25 16:35:28 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-07-25 16:35:28 -0400 |
commit | 4fc1535c0aa250ea4d610921f58da00f7256f7c2 (patch) | |
tree | 400566fb47324e8e9a0fa6961f592715b8a4c351 | |
parent | 82b4c1bc6b4aa02472c0bfa9517b931ce6f56e8b (diff) |
window: Handle Alt-F4 to close windows
-rw-r--r-- | clients/window.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c index c55ec77a..a2f339fa 100644 --- a/clients/window.c +++ b/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); |