diff options
author | sabetts <sabetts> | 2001-05-18 21:28:57 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-05-18 21:28:57 +0000 |
commit | dc8862437485021dc0892ae4fc935f1b2a4b68cd (patch) | |
tree | da8f8274e65e6975f6da8c91a389bcabd9d0fede /src/events.c | |
parent | 8570b3d36d3566a602947ce60fc87940f5ce8b5f (diff) | |
download | ratpoison-dc8862437485021dc0892ae4fc935f1b2a4b68cd.zip |
* src/input.c (update_modifier_map): rename from
init_modifier_map. all callers updated. prototype updated.
* src/events.c (mapping_notify): new function
(delegate_event): handle MappingNotify events.
Diffstat (limited to 'src/events.c')
-rw-r--r-- | src/events.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/events.c b/src/events.c index f2dc76d..b75f055 100644 --- a/src/events.c +++ b/src/events.c @@ -584,6 +584,38 @@ focus_change (XFocusChangeEvent *ev) } } +static void +mapping_notify (XMappingEvent *ev) +{ + rp_window *cur; + + /* Remove the grab on the current prefix key */ + for (cur = rp_mapped_window_sentinel->next; + cur != rp_mapped_window_sentinel; + cur = cur->next) + { + ungrab_prefix_key (cur->w); + } + + switch (ev->request) + { + case MappingModifier: + update_modifier_map(); + /* This is meant to fall through. */ + case MappingKeyboard: + XRefreshKeyboardMapping (ev); + break; + } + + /* Add the grab on the current prefix key */ + for (cur = rp_mapped_window_sentinel->next; + cur != rp_mapped_window_sentinel; + cur = cur->next) + { + grab_prefix_key (cur->w); + } +} + /* Given an event, call the correct function to handle it. */ void delegate_event (XEvent *ev) @@ -676,6 +708,7 @@ delegate_event (XEvent *ev) break; case MappingNotify: PRINT_DEBUG ("MappingNotify\n"); + mapping_notify( &ev->xmapping ); break; default: PRINT_DEBUG ("Unhandled event %d\n", ev->type); |