From 5a798989c4ca6e2595fcd111072f18a5236a316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 21 Dec 2022 18:53:17 +0100 Subject: [PATCH] seat/native: Add run impl task helper Part-of: --- src/backends/native/meta-seat-native.c | 14 ++++++++++++++ src/backends/native/meta-seat-native.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c index 0265a01bc..f6c28fd67 100644 --- a/src/backends/native/meta-seat-native.c +++ b/src/backends/native/meta-seat-native.c @@ -659,3 +659,17 @@ meta_seat_native_set_viewports (MetaSeatNative *seat, { meta_seat_impl_set_viewports (seat->impl, viewports); } + +void +meta_seat_native_run_impl_task (MetaSeatNative *seat, + GSourceFunc dispatch_func, + gpointer user_data, + GDestroyNotify destroy_notify) +{ + g_autoptr (GTask) task = NULL; + + task = g_task_new (seat->impl, NULL, NULL, NULL); + g_task_set_task_data (task, user_data, destroy_notify); + meta_seat_impl_run_input_task (seat->impl, task, + (GSourceFunc) dispatch_func); +} diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h index 75a44269f..d16a3c4f3 100644 --- a/src/backends/native/meta-seat-native.h +++ b/src/backends/native/meta-seat-native.h @@ -133,4 +133,9 @@ MetaCursorRenderer * meta_seat_native_maybe_ensure_cursor_renderer (MetaSeatNati void meta_seat_native_set_viewports (MetaSeatNative *seat, MetaViewportInfo *viewports); +void meta_seat_native_run_impl_task (MetaSeatNative *seat, + GSourceFunc dispatch_func, + gpointer user_data, + GDestroyNotify destroy_notify); + #endif /* META_SEAT_NATIVE_H */