From 50071303afd47cbb67e6738fc8c0acb767368c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 21 Dec 2018 17:28:33 +0100 Subject: [PATCH] clutter/stage: Add clutter_stage_is_redraw_queued() API This will be used by the screen casting code to check whether it should wait for a frame before reading cursor state, or send only the cursor update, if no redraw is queued. https://gitlab.gnome.org/GNOME/mutter/merge_requests/357 --- clutter/clutter/clutter-stage.c | 11 +++++++++++ clutter/clutter/clutter-stage.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index d1107149e..8dc7ebc4e 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -3731,6 +3731,17 @@ clutter_stage_ensure_redraw (ClutterStage *stage) _clutter_master_clock_start_running (master_clock); } +/** + * clutter_stage_is_redraw_queued: (skip) + */ +gboolean +clutter_stage_is_redraw_queued (ClutterStage *stage) +{ + ClutterStagePrivate *priv = stage->priv; + + return priv->redraw_pending; +} + /** * clutter_stage_queue_redraw: * @stage: the #ClutterStage diff --git a/clutter/clutter/clutter-stage.h b/clutter/clutter/clutter-stage.h index 643f8d7b3..ab1ab92fa 100644 --- a/clutter/clutter/clutter-stage.h +++ b/clutter/clutter/clutter-stage.h @@ -250,6 +250,9 @@ void clutter_stage_ensure_viewport (ClutterStage CLUTTER_EXPORT void clutter_stage_ensure_redraw (ClutterStage *stage); +CLUTTER_EXPORT +gboolean clutter_stage_is_redraw_queued (ClutterStage *stage); + #ifdef CLUTTER_ENABLE_EXPERIMENTAL_API CLUTTER_EXPORT void clutter_stage_set_sync_delay (ClutterStage *stage,