Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:qzhao:branches:openSUSE:Factory
plymouth
plymouth-renderers-Do-not-assume-all-keyboards-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File plymouth-renderers-Do-not-assume-all-keyboards-have-LEDs.patch of Package plymouth
From 709f21e80199ee51badff2d9b5dc6bae8af2a1a1 Mon Sep 17 00:00:00 2001 From: n3rdopolis <bluescreen_avenger@verizon.net> Date: Wed, 31 Jan 2024 08:38:38 -0500 Subject: [PATCH] renderers: Do not assume all keyboards have LEDs This is an attempt to fix #245 --- src/plugins/renderers/drm/plugin.c | 22 +++++++++++++++++++-- src/plugins/renderers/frame-buffer/plugin.c | 22 +++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) Index: plymouth-22.02.122+180.b1d5aa9/src/plugins/renderers/drm/plugin.c =================================================================== --- plymouth-22.02.122+180.b1d5aa9.orig/src/plugins/renderers/drm/plugin.c +++ plymouth-22.02.122+180.b1d5aa9/src/plugins/renderers/drm/plugin.c @@ -1926,6 +1926,17 @@ get_panel_properties (ply_renderer_backe } static ply_input_device_t * +get_any_input_device (ply_renderer_backend_t *backend) +{ + ply_list_node_t *node = ply_list_get_first_node (backend->input_source.input_devices); + + if (node != NULL) + return ply_list_node_get_data (node); + + return NULL; +} + +static ply_input_device_t * get_any_input_device_with_leds (ply_renderer_backend_t *backend) { ply_list_node_t *node; @@ -1947,6 +1958,9 @@ get_capslock_state (ply_renderer_backend { if (using_input_device (&backend->input_source)) { ply_input_device_t *dev = get_any_input_device_with_leds (backend); + if (!dev) + return false; + return ply_input_device_get_capslock_state (dev); } if (!backend->terminal) @@ -1959,8 +1973,12 @@ static const char * get_keymap (ply_renderer_backend_t *backend) { if (using_input_device (&backend->input_source)) { - ply_input_device_t *dev = get_any_input_device_with_leds (backend); - const char *keymap = ply_input_device_get_keymap (dev); + const char *keymap; + ply_input_device_t *dev = get_any_input_device (backend); + if (!dev) + return NULL; + + keymap = ply_input_device_get_keymap (dev); if (keymap != NULL) { return keymap; } Index: plymouth-22.02.122+180.b1d5aa9/src/plugins/renderers/frame-buffer/plugin.c =================================================================== --- plymouth-22.02.122+180.b1d5aa9.orig/src/plugins/renderers/frame-buffer/plugin.c +++ plymouth-22.02.122+180.b1d5aa9/src/plugins/renderers/frame-buffer/plugin.c @@ -816,6 +816,17 @@ close_input_source (ply_renderer_backend } static ply_input_device_t * +get_any_input_device (ply_renderer_backend_t *backend) +{ + ply_list_node_t *node = ply_list_get_first_node (backend->input_source.input_devices); + + if (node != NULL) + return ply_list_node_get_data (node); + + return NULL; +} + +static ply_input_device_t * get_any_input_device_with_leds (ply_renderer_backend_t *backend) { ply_list_node_t *node; @@ -837,6 +848,9 @@ get_capslock_state (ply_renderer_backend { if (using_input_device (&backend->input_source)) { ply_input_device_t *dev = get_any_input_device_with_leds (backend); + if (!dev) + return false; + return ply_input_device_get_capslock_state (dev); } if (!backend->terminal) @@ -849,8 +863,12 @@ static const char * get_keymap (ply_renderer_backend_t *backend) { if (using_input_device (&backend->input_source)) { - ply_input_device_t *dev = get_any_input_device_with_leds (backend); - const char *keymap = ply_input_device_get_keymap (dev); + const char *keymap; + ply_input_device_t *dev = get_any_input_device (backend); + if (!dev) + return NULL; + + keymap = ply_input_device_get_keymap (dev); if (keymap != NULL) { return keymap; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor