[metacity] compositor: add ready_to_redraw vfunc
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: add ready_to_redraw vfunc
- Date: Sat, 12 Sep 2020 17:06:15 +0000 (UTC)
commit 3a787346ffae95a3cf26aa847fa3937349c29e30
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Sep 12 19:26:40 2020 +0300
compositor: add ready_to_redraw vfunc
src/compositor/meta-compositor-private.h | 2 ++
src/compositor/meta-compositor.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index baa60554..93400b6b 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -44,6 +44,8 @@ struct _MetaCompositorClass
void (* sync_window_geometry) (MetaCompositor *compositor,
MetaSurface *surface);
+ gboolean (* ready_to_redraw) (MetaCompositor *compositor);
+
void (* pre_paint) (MetaCompositor *compositor);
void (* redraw) (MetaCompositor *compositor,
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 25fad9e5..f5ad2bc0 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -173,6 +173,13 @@ redraw_idle_cb (gpointer user_data)
compositor = META_COMPOSITOR (user_data);
priv = meta_compositor_get_instance_private (compositor);
+ if (!META_COMPOSITOR_GET_CLASS (compositor)->ready_to_redraw (compositor))
+ {
+ priv->redraw_id = 0;
+
+ return G_SOURCE_REMOVE;
+ }
+
META_COMPOSITOR_GET_CLASS (compositor)->pre_paint (compositor);
if (priv->all_damage != None)
@@ -337,6 +344,12 @@ meta_compositor_set_property (GObject *object,
}
}
+static gboolean
+meta_compositor_ready_to_redraw (MetaCompositor *compositor)
+{
+ return TRUE;
+}
+
static void
meta_compositor_pre_paint (MetaCompositor *compositor)
{
@@ -379,6 +392,7 @@ meta_compositor_class_init (MetaCompositorClass *compositor_class)
object_class->get_property = meta_compositor_get_property;
object_class->set_property = meta_compositor_set_property;
+ compositor_class->ready_to_redraw = meta_compositor_ready_to_redraw;
compositor_class->pre_paint = meta_compositor_pre_paint;
install_properties (object_class);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]