mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
os: change Input::Touch_id from int to unsigned
There no sensible meaning for negative touch IDs. Issue #3669
This commit is contained in:
parent
8e9cabf819
commit
024b987e4c
@ -281,7 +281,7 @@ void Driver::input_callback(Input_event type, unsigned code,
|
||||
case EVENT_TYPE_WHEEL: submit(Wheel{rx, ry}); break;
|
||||
case EVENT_TYPE_TOUCH:
|
||||
{
|
||||
Touch_id const id { (int)code };
|
||||
Touch_id const id { code };
|
||||
|
||||
if (rx == -1 && ry == -1)
|
||||
submit(Touch_release{id});
|
||||
|
@ -23,7 +23,7 @@ namespace Input {
|
||||
|
||||
typedef Genode::Codepoint Codepoint;
|
||||
|
||||
struct Touch_id { int value; };
|
||||
struct Touch_id { unsigned value; };
|
||||
|
||||
/*
|
||||
* Event attributes
|
||||
|
@ -77,7 +77,7 @@ struct Synaptics
|
||||
_i2c.send(I2C_ADDR, _buf, 1);
|
||||
_i2c.recv(I2C_ADDR, (uint8_t *)fingers, sizeof(fingers));
|
||||
|
||||
for (int i = 0; i < FINGERS; i++) {
|
||||
for (unsigned i = 0; i < FINGERS; i++) {
|
||||
Finger_data ¤t = fingers[i];
|
||||
|
||||
Input::Touch_id id { i };
|
||||
|
@ -75,7 +75,7 @@ namespace {
|
||||
static void _touch(struct genode_event_submit *myself,
|
||||
struct genode_event_touch_args const *args)
|
||||
{
|
||||
Input::Touch_id id { (int)args->finger };
|
||||
Input::Touch_id id { args->finger };
|
||||
|
||||
_with_batch(myself, [&] (Event::Session_client::Batch &batch) {
|
||||
batch.submit(Input::Touch { id, (float)args->xpos, (float)args->ypos }); });
|
||||
@ -84,7 +84,7 @@ namespace {
|
||||
static void _touch_release(struct genode_event_submit *myself,
|
||||
unsigned finger)
|
||||
{
|
||||
Input::Touch_id id { (int)finger };
|
||||
Input::Touch_id id { finger };
|
||||
|
||||
_with_batch(myself, [&] (Event::Session_client::Batch &batch) {
|
||||
batch.submit(Input::Touch_release { id }); });
|
||||
|
Loading…
x
Reference in New Issue
Block a user