[mutter] MetaWaylandSurface: Add 'unmapped' signal
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaWaylandSurface: Add 'unmapped' signal
- Date: Mon, 22 Aug 2016 13:04:35 +0000 (UTC)
commit aea706230d19d61e40e4481a1a1f1b09c426dd70
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Aug 18 12:57:17 2016 +0800
MetaWaylandSurface: Add 'unmapped' signal
Meant to be used by users of MetaWaylandSurface's that need to know
when the surface was unmapped. So far only emitted by shell surfaces
(surfaces with MetaWindow's).
https://bugzilla.gnome.org/show_bug.cgi?id=769786
src/wayland/meta-wayland-surface.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 210f771..765f06e 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -120,6 +120,7 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND,
enum {
SURFACE_DESTROY,
+ SURFACE_UNMAPPED,
N_SURFACE_SIGNALS
};
@@ -1100,9 +1101,14 @@ void
meta_wayland_surface_set_window (MetaWaylandSurface *surface,
MetaWindow *window)
{
+ gboolean was_unmapped = surface->window && !window;
+
surface->window = window;
sync_reactive (surface);
sync_drag_dest_funcs (surface);
+
+ if (was_unmapped)
+ g_signal_emit (surface, surface_signals[SURFACE_UNMAPPED], 0);
}
static void
@@ -1855,6 +1861,14 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass)
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ surface_signals[SURFACE_UNMAPPED] =
+ g_signal_new ("unmapped",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]