[metacity] surface: add meta_surface_opacity_changed



commit 6282f7f39d99ff281e68171753f80fe1e74ed634
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Oct 11 22:45:39 2019 +0300

    surface: add meta_surface_opacity_changed

 src/compositor/meta-compositor.c      |  1 +
 src/compositor/meta-surface-private.h |  8 +++++---
 src/compositor/meta-surface-vulkan.c  |  6 ++++++
 src/compositor/meta-surface-xrender.c |  6 ++++++
 src/compositor/meta-surface.c         |  6 ++++++
 src/compositor/meta-surface.h         | 24 +++++++++++++-----------
 6 files changed, 37 insertions(+), 14 deletions(-)
---
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 4328ffb8..1c41eced 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -485,6 +485,7 @@ meta_compositor_window_opacity_changed (MetaCompositor *compositor,
     return;
 
   compositor_class->window_opacity_changed (compositor, surface);
+  meta_surface_opacity_changed (surface);
 }
 
 void
diff --git a/src/compositor/meta-surface-private.h b/src/compositor/meta-surface-private.h
index 29f67545..d1ae613d 100644
--- a/src/compositor/meta-surface-private.h
+++ b/src/compositor/meta-surface-private.h
@@ -26,11 +26,13 @@ struct _MetaSurfaceClass
 {
   GObjectClass parent_class;
 
-  void (* hide)        (MetaSurface *self);
+  void (* hide)            (MetaSurface *self);
 
-  void (* free_pixmap) (MetaSurface *self);
+  void (* opacity_changed) (MetaSurface *self);
 
-  void (* pre_paint)   (MetaSurface *self);
+  void (* free_pixmap)     (MetaSurface *self);
+
+  void (* pre_paint)       (MetaSurface *self);
 };
 
 G_END_DECLS
diff --git a/src/compositor/meta-surface-vulkan.c b/src/compositor/meta-surface-vulkan.c
index 2a04776b..a17271fe 100644
--- a/src/compositor/meta-surface-vulkan.c
+++ b/src/compositor/meta-surface-vulkan.c
@@ -30,6 +30,11 @@ meta_surface_vulkan_hide (MetaSurface *surface)
 {
 }
 
+static void
+meta_surface_vulkan_opacity_changed (MetaSurface *surface)
+{
+}
+
 static void
 meta_surface_vulkan_free_pixmap (MetaSurface *surface)
 {
@@ -48,6 +53,7 @@ meta_surface_vulkan_class_init (MetaSurfaceVulkanClass *self_class)
   surface_class = META_SURFACE_CLASS (self_class);
 
   surface_class->hide = meta_surface_vulkan_hide;
+  surface_class->opacity_changed = meta_surface_vulkan_opacity_changed;
   surface_class->free_pixmap = meta_surface_vulkan_free_pixmap;
   surface_class->pre_paint = meta_surface_vulkan_pre_paint;
 }
diff --git a/src/compositor/meta-surface-xrender.c b/src/compositor/meta-surface-xrender.c
index eadcff15..14819829 100644
--- a/src/compositor/meta-surface-xrender.c
+++ b/src/compositor/meta-surface-xrender.c
@@ -125,6 +125,11 @@ meta_surface_xrender_hide (MetaSurface *surface)
   free_picture (self);
 }
 
+static void
+meta_surface_xrender_opacity_changed (MetaSurface *surface)
+{
+}
+
 static void
 meta_surface_xrender_free_pixmap (MetaSurface *surface)
 {
@@ -164,6 +169,7 @@ meta_surface_xrender_class_init (MetaSurfaceXRenderClass *self_class)
   object_class->finalize = meta_surface_xrender_finalize;
 
   surface_class->hide = meta_surface_xrender_hide;
+  surface_class->opacity_changed = meta_surface_xrender_opacity_changed;
   surface_class->free_pixmap = meta_surface_xrender_free_pixmap;
   surface_class->pre_paint = meta_surface_xrender_pre_paint;
 }
diff --git a/src/compositor/meta-surface.c b/src/compositor/meta-surface.c
index e3c7f2ca..096ee12f 100644
--- a/src/compositor/meta-surface.c
+++ b/src/compositor/meta-surface.c
@@ -360,6 +360,12 @@ meta_surface_process_damage (MetaSurface        *self,
   meta_compositor_queue_redraw (priv->compositor);
 }
 
+void
+meta_surface_opacity_changed (MetaSurface *self)
+{
+  META_SURFACE_GET_CLASS (self)->opacity_changed (self);
+}
+
 void
 meta_surface_sync_geometry (MetaSurface *self)
 {
diff --git a/src/compositor/meta-surface.h b/src/compositor/meta-surface.h
index 5d299dcd..f05404af 100644
--- a/src/compositor/meta-surface.h
+++ b/src/compositor/meta-surface.h
@@ -27,26 +27,28 @@ G_BEGIN_DECLS
 #define META_TYPE_SURFACE (meta_surface_get_type ())
 G_DECLARE_DERIVABLE_TYPE (MetaSurface, meta_surface, META, SURFACE, GObject)
 
-MetaCompositor *meta_surface_get_compositor (MetaSurface        *self);
+MetaCompositor *meta_surface_get_compositor  (MetaSurface        *self);
 
-MetaWindow     *meta_surface_get_window     (MetaSurface        *self);
+MetaWindow     *meta_surface_get_window      (MetaSurface        *self);
 
-Pixmap          meta_surface_get_pixmap     (MetaSurface        *self);
+Pixmap          meta_surface_get_pixmap      (MetaSurface        *self);
 
-int             meta_surface_get_width      (MetaSurface        *self);
+int             meta_surface_get_width       (MetaSurface        *self);
 
-int             meta_surface_get_height     (MetaSurface        *self);
+int             meta_surface_get_height      (MetaSurface        *self);
 
-void            meta_surface_show           (MetaSurface        *self);
+void            meta_surface_show            (MetaSurface        *self);
 
-void            meta_surface_hide           (MetaSurface        *self);
+void            meta_surface_hide            (MetaSurface        *self);
 
-void            meta_surface_process_damage (MetaSurface        *self,
-                                             XDamageNotifyEvent *event);
+void            meta_surface_process_damage  (MetaSurface        *self,
+                                              XDamageNotifyEvent *event);
 
-void            meta_surface_sync_geometry  (MetaSurface        *self);
+void            meta_surface_opacity_changed (MetaSurface        *self);
 
-void            meta_surface_pre_paint      (MetaSurface        *self);
+void            meta_surface_sync_geometry   (MetaSurface        *self);
+
+void            meta_surface_pre_paint       (MetaSurface        *self);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]