1
0
xorg-x11-server/U_kdrive-evdev-update-keyboard-LEDs-22302.patch
Egbert Eich 7aff496244 Accepting request 367497 from home:lbssousa:branches:X11:XOrg
- Backport upstream patches for Xephyr input hot-plugging /
  single-GPU multi-seat support:
    * U_kdrive-fix-up-NewInputDeviceRequest-implementation.patch
    * U_kdrive-set-evdev-driver-for-input-devices-automatica.patch
    * U_ephyr-don-t-load-ephyr-input-driver-if-seat-option-i.patch
    * U_kdrive-don-t-let-evdev-driver-overwrite-existing-dev.patch
    * U_ephyr-ignore-Xorg-multiseat-command-line-options.patch
    * U_ephyr-enable-option-sw-cursor-by-default-in-multi-se.patch
    * U_kdrive-introduce-input-hot-plugging-support-for-udev.patch
    * U_kdrive-add-options-to-set-default-XKB-properties.patch
    * U_kdrive-evdev-update-keyboard-LEDs-22302.patch
    * U_config-udev-distinguish-between-real-keyboards-and-o.patch

OBS-URL: https://build.opensuse.org/request/show/367497
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=616
2016-03-07 11:29:08 +00:00

57 lines
1.5 KiB
Diff

From 0461bca0cb2f7918c77ed45d2cbc756cf65021be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Mon, 22 Feb 2016 16:04:12 -0300
Subject: [PATCH 17/56] kdrive/evdev: update keyboard LEDs (#22302)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Implement missing parts in kdrive evdev driver for
correct update of evdev keyboard LEDs.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22302
[ajax: Fixed deref-before-null-check bug]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/linux/evdev.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index cdd45e7..8415772 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -442,10 +442,16 @@ EvdevKbdEnable(KdKeyboardInfo * ki)
static void
EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
{
-/* struct input_event event;
+ struct input_event event;
Kevdev *ke;
- ki->driverPrivate = ke;
+ if (!ki)
+ return;
+
+ ke = ki->driverPrivate;
+
+ if (!ke)
+ return;
memset(&event, 0, sizeof(event));
@@ -468,7 +474,6 @@ EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
event.code = LED_COMPOSE;
event.value = leds & (1 << 3) ? 1 : 0;
write(ke->fd, (char *) &event, sizeof(event));
-*/
}
static void
--
2.6.2