libweston: Rename LED_* to WESTON_LED*

This is required to avoid a namespace collision for LED_COMPOSE key
code and was introduced with c112760368, "input: Add support for
LED_COMPOSE and LED_KANA".

If not already done this requires a libweston major version bump.

Fixes: #997
Fixes: c112760368, "input: Add support for LED_COMPOSE and LED_KANA
USB HID LEDs"

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-02-28 18:09:08 +02:00 committed by Marius Vlad
parent 82c5b386d8
commit 1a2c25116b
3 changed files with 15 additions and 15 deletions

View file

@ -107,12 +107,12 @@ enum weston_keyboard_locks {
}; };
enum weston_led { enum weston_led {
LED_NUM_LOCK = (1 << 0), WESTON_LED_NUM_LOCK = (1 << 0),
LED_CAPS_LOCK = (1 << 1), WESTON_LED_CAPS_LOCK = (1 << 1),
LED_SCROLL_LOCK = (1 << 2), WESTON_LED_SCROLL_LOCK = (1 << 2),
#ifdef HAVE_COMPOSE_AND_KANA #ifdef HAVE_COMPOSE_AND_KANA
LED_COMPOSE = (1 << 3), WESTON_LED_COMPOSE = (1 << 3),
LED_KANA = (1 << 4), WESTON_LED_KANA = (1 << 4),
#endif #endif
}; };

View file

@ -2518,20 +2518,20 @@ notify_modifiers(struct weston_seat *seat, uint32_t serial)
/* Finally, notify the compositor that LEDs have changed. */ /* Finally, notify the compositor that LEDs have changed. */
if (xkb_state_led_index_is_active(keyboard->xkb_state.state, if (xkb_state_led_index_is_active(keyboard->xkb_state.state,
keyboard->xkb_info->num_led)) keyboard->xkb_info->num_led))
leds |= LED_NUM_LOCK; leds |= WESTON_LED_NUM_LOCK;
if (xkb_state_led_index_is_active(keyboard->xkb_state.state, if (xkb_state_led_index_is_active(keyboard->xkb_state.state,
keyboard->xkb_info->caps_led)) keyboard->xkb_info->caps_led))
leds |= LED_CAPS_LOCK; leds |= WESTON_LED_CAPS_LOCK;
if (xkb_state_led_index_is_active(keyboard->xkb_state.state, if (xkb_state_led_index_is_active(keyboard->xkb_state.state,
keyboard->xkb_info->scroll_led)) keyboard->xkb_info->scroll_led))
leds |= LED_SCROLL_LOCK; leds |= WESTON_LED_SCROLL_LOCK;
#ifdef HAVE_COMPOSE_AND_KANA #ifdef HAVE_COMPOSE_AND_KANA
if (xkb_state_led_index_is_active(keyboard->xkb_state.state, if (xkb_state_led_index_is_active(keyboard->xkb_state.state,
keyboard->xkb_info->compose_led)) keyboard->xkb_info->compose_led))
leds |= LED_COMPOSE; leds |= WESTON_LED_COMPOSE;
if (xkb_state_led_index_is_active(keyboard->xkb_state.state, if (xkb_state_led_index_is_active(keyboard->xkb_state.state,
keyboard->xkb_info->kana_led)) keyboard->xkb_info->kana_led))
leds |= LED_KANA; leds |= WESTON_LED_KANA;
#endif #endif
if (leds != keyboard->xkb_state.leds && seat->led_update) if (leds != keyboard->xkb_state.leds && seat->led_update)
seat->led_update(seat, leds); seat->led_update(seat, leds);

View file

@ -57,16 +57,16 @@ evdev_led_update(struct evdev_device *device, enum weston_led weston_leds)
{ {
enum libinput_led leds = 0; enum libinput_led leds = 0;
if (weston_leds & LED_NUM_LOCK) if (weston_leds & WESTON_LED_NUM_LOCK)
leds |= LIBINPUT_LED_NUM_LOCK; leds |= LIBINPUT_LED_NUM_LOCK;
if (weston_leds & LED_CAPS_LOCK) if (weston_leds & WESTON_LED_CAPS_LOCK)
leds |= LIBINPUT_LED_CAPS_LOCK; leds |= LIBINPUT_LED_CAPS_LOCK;
if (weston_leds & LED_SCROLL_LOCK) if (weston_leds & WESTON_LED_SCROLL_LOCK)
leds |= LIBINPUT_LED_SCROLL_LOCK; leds |= LIBINPUT_LED_SCROLL_LOCK;
#ifdef HAVE_COMPOSE_AND_KANA #ifdef HAVE_COMPOSE_AND_KANA
if (weston_leds & LED_COMPOSE) if (weston_leds & WESTON_LED_COMPOSE)
leds |= LIBINPUT_LED_COMPOSE; leds |= LIBINPUT_LED_COMPOSE;
if (weston_leds & LED_KANA) if (weston_leds & WESTON_LED_KANA)
leds |= LIBINPUT_LED_KANA; leds |= LIBINPUT_LED_KANA;
#endif #endif
libinput_device_led_update(device->device, leds); libinput_device_led_update(device->device, leds);