diff options
author | Federico Mena Quintero <federico@gnome.org> | 2022-12-01 19:25:36 -0600 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2022-12-01 19:25:36 -0600 |
commit | dc626c9e8966f235e2e0bd6e7c61b31cea6d8f81 (patch) | |
tree | 51047d9f340e5eec87252af67a30f0d7fba8359c /registryd | |
parent | 130d98b0e3a8d0fd8b51260f51f796ca5084a0ea (diff) | |
download | at-spi2-core-dc626c9e8966f235e2e0bd6e7c61b31cea6d8f81.tar.gz |
spi_dec_poll_mouse_*(): immediately cast the user data to the SpiDEController
This makes it clear what the data is, and we'll use it in the next commit.
Diffstat (limited to 'registryd')
-rw-r--r-- | registryd/deviceeventcontroller.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index cb299fc0..9d05981b 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -396,14 +396,16 @@ spi_dec_poll_mouse_moved (gpointer data) static gboolean spi_dec_poll_mouse_idle (gpointer data) { + SpiDEController *controller = SPI_DEVICE_EVENT_CONTROLLER(data); + if (!have_mouse_event_listener && !have_mouse_listener) return FALSE; - else if (!spi_dec_poll_mouse_moved (data)) + else if (!spi_dec_poll_mouse_moved (controller)) return TRUE; else { guint id; - id = g_timeout_add (20, spi_dec_poll_mouse_moving, data); + id = g_timeout_add (20, spi_dec_poll_mouse_moving, controller); g_source_set_name_by_id (id, "[at-spi2-core] spi_dec_poll_mouse_moving"); return FALSE; } @@ -412,14 +414,16 @@ spi_dec_poll_mouse_idle (gpointer data) static gboolean spi_dec_poll_mouse_moving (gpointer data) { + SpiDEController *controller = SPI_DEVICE_EVENT_CONTROLLER(data); + if (!have_mouse_event_listener && !have_mouse_listener) return FALSE; - else if (spi_dec_poll_mouse_moved (data)) + else if (spi_dec_poll_mouse_moved (controller)) return TRUE; else { guint id; - id = g_timeout_add (100, spi_dec_poll_mouse_idle, data); + id = g_timeout_add (100, spi_dec_poll_mouse_idle, controller); g_source_set_name_by_id (id, "[at-spi2-core] check_release"); return FALSE; } |