[metacity] surface: add sync_geometry vfunc
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] surface: add sync_geometry vfunc
- Date: Tue, 22 Oct 2019 23:47:50 +0000 (UTC)
commit 4977d10134e66e5d72689c89ad970f9d578d22ce
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Oct 22 22:56:21 2019 +0300
surface: add sync_geometry vfunc
src/compositor/meta-surface-private.h | 5 +++++
src/compositor/meta-surface-vulkan.c | 9 +++++++++
src/compositor/meta-surface-xrender.c | 9 +++++++++
src/compositor/meta-surface.c | 19 +++++++++++++++++++
4 files changed, 42 insertions(+)
---
diff --git a/src/compositor/meta-surface-private.h b/src/compositor/meta-surface-private.h
index c285fe1e..f3cb23a1 100644
--- a/src/compositor/meta-surface-private.h
+++ b/src/compositor/meta-surface-private.h
@@ -36,6 +36,11 @@ struct _MetaSurfaceClass
void (* opacity_changed) (MetaSurface *self);
+ void (* sync_geometry) (MetaSurface *self,
+ MetaRectangle old_geometry,
+ gboolean position_changed,
+ gboolean size_changed);
+
void (* free_pixmap) (MetaSurface *self);
void (* pre_paint) (MetaSurface *self,
diff --git a/src/compositor/meta-surface-vulkan.c b/src/compositor/meta-surface-vulkan.c
index 49e1a0ce..729fa047 100644
--- a/src/compositor/meta-surface-vulkan.c
+++ b/src/compositor/meta-surface-vulkan.c
@@ -52,6 +52,14 @@ meta_surface_vulkan_opacity_changed (MetaSurface *surface)
{
}
+static void
+meta_surface_vulkan_sync_geometry (MetaSurface *surface,
+ MetaRectangle old_geometry,
+ gboolean position_changed,
+ gboolean size_changed)
+{
+}
+
static void
meta_surface_vulkan_free_pixmap (MetaSurface *surface)
{
@@ -75,6 +83,7 @@ meta_surface_vulkan_class_init (MetaSurfaceVulkanClass *self_class)
surface_class->show = meta_surface_vulkan_show;
surface_class->hide = meta_surface_vulkan_hide;
surface_class->opacity_changed = meta_surface_vulkan_opacity_changed;
+ surface_class->sync_geometry = meta_surface_vulkan_sync_geometry;
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 73ed1b48..827649f2 100644
--- a/src/compositor/meta-surface-xrender.c
+++ b/src/compositor/meta-surface-xrender.c
@@ -633,6 +633,14 @@ meta_surface_xrender_opacity_changed (MetaSurface *surface)
free_mask_picture (self);
}
+static void
+meta_surface_xrender_sync_geometry (MetaSurface *surface,
+ MetaRectangle old_geometry,
+ gboolean position_changed,
+ gboolean size_changed)
+{
+}
+
static void
meta_surface_xrender_free_pixmap (MetaSurface *surface)
{
@@ -687,6 +695,7 @@ meta_surface_xrender_class_init (MetaSurfaceXRenderClass *self_class)
surface_class->show = meta_surface_xrender_show;
surface_class->hide = meta_surface_xrender_hide;
surface_class->opacity_changed = meta_surface_xrender_opacity_changed;
+ surface_class->sync_geometry = meta_surface_xrender_sync_geometry;
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 40f9b5c3..7235596b 100644
--- a/src/compositor/meta-surface.c
+++ b/src/compositor/meta-surface.c
@@ -845,11 +845,22 @@ meta_surface_sync_geometry (MetaSurface *self)
{
MetaSurfacePrivate *priv;
MetaRectangle rect;
+ MetaRectangle old_geometry;
+ gboolean position_changed;
+ gboolean size_changed;
priv = meta_surface_get_instance_private (self);
meta_window_get_input_rect (priv->window, &rect);
+ old_geometry.x = priv->x;
+ old_geometry.y = priv->y;
+ old_geometry.width = priv->width;
+ old_geometry.height = priv->height;
+
+ position_changed = FALSE;
+ size_changed = FALSE;
+
if (priv->x != rect.x ||
priv->y != rect.y)
{
@@ -859,6 +870,7 @@ meta_surface_sync_geometry (MetaSurface *self)
priv->y = rect.y;
priv->position_changed = TRUE;
+ position_changed = TRUE;
}
if (priv->width != rect.width ||
@@ -871,7 +883,14 @@ meta_surface_sync_geometry (MetaSurface *self)
priv->width = rect.width;
priv->height = rect.height;
+
+ size_changed = TRUE;
}
+
+ META_SURFACE_GET_CLASS (self)->sync_geometry (self,
+ old_geometry,
+ position_changed,
+ size_changed);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]