[mutter/gnome-3-38] clutter/actor: Add private API to get whether we're painting unmapped
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-38] clutter/actor: Add private API to get whether we're painting unmapped
- Date: Tue, 20 Oct 2020 15:53:51 +0000 (UTC)
commit bfc617c255cbf7f7d591893f3f9d277a8947dede
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sat Jul 11 10:18:59 2020 +0000
clutter/actor: Add private API to get whether we're painting unmapped
Add new private API to ClutterActor, returning TRUE in case the actor is
being painted while unmapped. This is useful for implementations of the
paint() vfunc or for signal handlers of the "notify::mapped" signal.
Use this API in CallyActor to properly detect "notify::mapped" emissions
while painting unmapped, this fixes detecting the case where
painting-unmapped is used for screencasting.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1366
(cherry picked from commit cbf3001bc2c43b3d9c0becde6b43e0f6b5474fea)
clutter/clutter/cally/cally-actor.c | 4 +++-
clutter/clutter/clutter-actor-private.h | 2 ++
clutter/clutter/clutter-actor.c | 8 ++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c
index 44f4f64bb5..2c4c1f34da 100644
--- a/clutter/clutter/cally/cally-actor.c
+++ b/clutter/clutter/cally/cally-actor.c
@@ -72,6 +72,8 @@
#include <glib.h>
#include <clutter/clutter.h>
+#include "clutter/clutter-actor-private.h"
+
#ifdef CLUTTER_WINDOWING_X11
#include <clutter/x11/clutter-x11.h>
#endif
@@ -972,7 +974,7 @@ cally_actor_real_notify_clutter (GObject *obj,
* paint it; we don't want this to generate an ATK
* state change
*/
- if (clutter_actor_is_in_clone_paint (actor))
+ if (clutter_actor_is_painting_unmapped (actor))
return;
state = ATK_STATE_SHOWING;
diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h
index 16ab012b6f..197f27b5bf 100644
--- a/clutter/clutter/clutter-actor-private.h
+++ b/clutter/clutter/clutter-actor-private.h
@@ -293,6 +293,8 @@ void clutter_actor_update_stage_views (ClutterActor *self,
void clutter_actor_queue_immediate_relayout (ClutterActor *self);
+gboolean clutter_actor_is_painting_unmapped (ClutterActor *self);
+
G_END_DECLS
#endif /* __CLUTTER_ACTOR_PRIVATE_H__ */
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 47c9171849..d06138b576 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -14909,6 +14909,14 @@ clutter_actor_is_in_clone_paint (ClutterActor *self)
return FALSE;
}
+gboolean
+clutter_actor_is_painting_unmapped (ClutterActor *self)
+{
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
+
+ return self->priv->unmapped_paint_branch_counter > 0;
+}
+
gboolean
clutter_actor_has_damage (ClutterActor *actor)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]