summaryrefslogtreecommitdiff
path: root/src/libply-splash-core
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2022-11-29 13:08:59 -0500
committerRay Strode <rstrode@redhat.com>2022-11-29 13:34:05 -0500
commitb6c8bf3be71e2770ae3ac885a134a050b8557487 (patch)
tree51370e90e663d750b7f177ac890647f3ba22a373 /src/libply-splash-core
parent5a9b24f18e551e1c058fac0557006b1cd5115a58 (diff)
input-device: Only allow one renderer to consume input at a time
Right now if there are two graphics cards, there ends up with two renderers active at the same time. Both process keyboard inputs and both end up sending those events to plymouthd, resulting in duplicate input. This commit changes the input handlers so the first one wins, and the rest don't get input. Closes https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/197
Diffstat (limited to 'src/libply-splash-core')
-rw-r--r--src/libply-splash-core/ply-input-device.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libply-splash-core/ply-input-device.h b/src/libply-splash-core/ply-input-device.h
index ecc88982..7101895d 100644
--- a/src/libply-splash-core/ply-input-device.h
+++ b/src/libply-splash-core/ply-input-device.h
@@ -38,10 +38,16 @@ typedef enum
PLY_KEY_HELD,
} ply_key_direction_t;
+typedef enum
+{
+ PLY_INPUT_RESULT_PROPAGATED = false,
+ PLY_INPUT_RESULT_CONSUMED = true,
+} ply_input_device_input_result_t;
+
typedef struct _ply_input_device ply_input_device_t;
-typedef void (*ply_input_device_input_handler_t) (void *user_data,
- ply_input_device_t *input_device,
- const char *buf);
+typedef ply_input_device_input_result_t (*ply_input_device_input_handler_t) (void *user_data,
+ ply_input_device_t *input_device,
+ const char *buf);
typedef void (*ply_input_device_leds_changed_handler_t) (void *user_data,
ply_input_device_t *input_device);
typedef void (*ply_input_device_disconnect_handler_t) (void *user_data,