# X11: Fix handling of key remapping \(\#32780\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/6150c26bd2dddcd59e667c062eb2111037d32b80)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 6150c26bd2dddcd59e667c062eb2111037d32b80

Requested commit: 6150c26bd2dddcd59e667c062eb2111037d32b80

Commit: 6150c26bd2dddcd59e667c062eb2111037d32b80

Tree: daf14e55f2e415a291958655ac0a4ea88aa18d7d

Author: Michael Sloan

Committer: GitHub

## Message

```
X11: Fix handling of key remapping (#32780)

Closes #27384

I wrote #32771 before seeing #27384, and hoped that change would fix it.
It didn't because `XkbSelectNotify` wants a mask of which types of
`XkbMapNotify` to deliver, and otherwise won't send them.

I noticed quite a few events are sent just for remapping a single
keycode, so I updated the event loop to deduplicate these events (since
the handler does not attempt to apply them and instead just re-queries
keyboard info).

Also adds a missing call of `keyboard_layout_change` on `XkbMapNotify`
and `XkbNewKeyboardNotify`.

Release Notes:

- x11: Fixed handling of key remapping occurring while Zed is running
(e.g. xmodmap)
```

## Parents

- [3bed5b767f32028dc0beb5cc8dc4983e1398f2ed](https://git.cafe/gitcafe/zed/commit/3bed5b767f32028dc0beb5cc8dc4983e1398f2ed?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/6150c26bd2dddcd59e667c062eb2111037d32b80?format=markdown)
