[metacity] compositor: add meta_compositor_is_our_xwindow
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: add meta_compositor_is_our_xwindow
- Date: Tue, 28 Feb 2017 01:55:24 +0000 (UTC)
commit f509916ccc5aeca1f7b6c43485e4e0aed4c56ca1
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Feb 27 23:56:50 2017 +0200
compositor: add meta_compositor_is_our_xwindow
src/compositor/meta-compositor-none.c | 8 ++++++++
src/compositor/meta-compositor-private.h | 3 +++
src/compositor/meta-compositor-xrender.c | 22 ++++++++++++++++++++++
src/compositor/meta-compositor.c | 11 +++++++++++
src/include/meta-compositor.h | 3 +++
5 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index c76814d..f63e236 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -128,6 +128,13 @@ meta_compositor_none_unmaximize_window (MetaCompositor *compositor,
{
}
+static gboolean
+meta_compositor_none_is_our_xwindow (MetaCompositor *compositor,
+ Window xwindow)
+{
+ return FALSE;
+}
+
static void
meta_compositor_none_class_init (MetaCompositorNoneClass *none_class)
{
@@ -150,6 +157,7 @@ meta_compositor_none_class_init (MetaCompositorNoneClass *none_class)
compositor_class->free_window = meta_compositor_none_free_window;
compositor_class->maximize_window = meta_compositor_none_maximize_window;
compositor_class->unmaximize_window = meta_compositor_none_unmaximize_window;
+ compositor_class->is_our_xwindow = meta_compositor_none_is_our_xwindow;
}
static void
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index a0a4a0d..17a3fc4 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -81,6 +81,9 @@ struct _MetaCompositorClass
void (* unmaximize_window) (MetaCompositor *compositor,
MetaWindow *window);
+
+ gboolean (* is_our_xwindow) (MetaCompositor *compositor,
+ Window xwindow);
};
G_END_DECLS
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 3f314c8..28cb75a 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -3694,6 +3694,27 @@ meta_compositor_xrender_unmaximize_window (MetaCompositor *compositor,
cw->needs_shadow = window_has_shadow (cw);
}
+static gboolean
+meta_compositor_xrender_is_our_xwindow (MetaCompositor *compositor,
+ Window xwindow)
+{
+ MetaDisplay *display;
+ MetaScreen *screen;
+ MetaCompScreen *info;
+
+ display = meta_compositor_get_display (compositor);
+ screen = meta_display_get_screen (display);
+ info = meta_screen_get_compositor_data (screen);
+
+ if (info == NULL)
+ return FALSE;
+
+ if (info->output == xwindow)
+ return TRUE;
+
+ return FALSE;
+}
+
static void
meta_compositor_xrender_class_init (MetaCompositorXRenderClass *xrender_class)
{
@@ -3716,6 +3737,7 @@ meta_compositor_xrender_class_init (MetaCompositorXRenderClass *xrender_class)
compositor_class->free_window = meta_compositor_xrender_free_window;
compositor_class->maximize_window = meta_compositor_xrender_maximize_window;
compositor_class->unmaximize_window = meta_compositor_xrender_unmaximize_window;
+ compositor_class->is_our_xwindow = meta_compositor_xrender_is_our_xwindow;
}
static void
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 86d4125..c1fd6fe 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -353,6 +353,17 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
{
}
+gboolean
+meta_compositor_is_our_xwindow (MetaCompositor *compositor,
+ Window xwindow)
+{
+ MetaCompositorClass *compositor_class;
+
+ compositor_class = META_COMPOSITOR_GET_CLASS (compositor);
+
+ return compositor_class->is_our_xwindow (compositor, xwindow);
+}
+
MetaDisplay *
meta_compositor_get_display (MetaCompositor *compositor)
{
diff --git a/src/include/meta-compositor.h b/src/include/meta-compositor.h
index 7555d11..8c1d19a 100644
--- a/src/include/meta-compositor.h
+++ b/src/include/meta-compositor.h
@@ -95,6 +95,9 @@ void meta_compositor_unmaximize_window (MetaCompositor *composi
void meta_compositor_sync_stack (MetaCompositor *compositor,
GList *stack);
+gboolean meta_compositor_is_our_xwindow (MetaCompositor *compositor,
+ Window xwindow);
+
MetaDisplay *meta_compositor_get_display (MetaCompositor *compositor);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]