mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 02:28:05 +02:00
compositor-drm, evdev: don't crash on missing keyboard
Weston's notify_keyboard_focus_*() assume that a keyboard is present, if they are called. With evdev, there might not always be a keyboard. Also clean up the variable definition in evdev_notify_keyborad_focus(). I read that function through many times and finally had to grep where does 'all_keys' come from. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
b2d021b95e
commit
e427ef8cb7
1 changed files with 5 additions and 1 deletions
|
|
@ -561,10 +561,14 @@ evdev_notify_keyboard_focus(struct weston_seat *seat,
|
||||||
struct evdev_input_device *device;
|
struct evdev_input_device *device;
|
||||||
struct wl_array keys;
|
struct wl_array keys;
|
||||||
unsigned int i, set;
|
unsigned int i, set;
|
||||||
char evdev_keys[(KEY_CNT + 7) / 8], all_keys[(KEY_CNT + 7) / 8];
|
char evdev_keys[(KEY_CNT + 7) / 8];
|
||||||
|
char all_keys[(KEY_CNT + 7) / 8];
|
||||||
uint32_t *k;
|
uint32_t *k;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!seat->seat.keyboard)
|
||||||
|
return;
|
||||||
|
|
||||||
memset(all_keys, 0, sizeof all_keys);
|
memset(all_keys, 0, sizeof all_keys);
|
||||||
wl_list_for_each(device, evdev_devices, link) {
|
wl_list_for_each(device, evdev_devices, link) {
|
||||||
memset(evdev_keys, 0, sizeof evdev_keys);
|
memset(evdev_keys, 0, sizeof evdev_keys);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue