summarylogtreecommitdiffstats
path: root/mr3729.patch
blob: 9b110267e0986c9cb063b3241eb195b4d4873199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index 819672c4a..d20ed5523 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -260,6 +260,18 @@ out:
   parent_class->apply_transform (actor, matrix);
 }
 
+static void
+on_surface_disposed (gpointer user_data,
+                     GObject *destroyed_object)
+{
+  MetaSurfaceActorWayland *self = user_data;
+
+  g_assert (destroyed_object == (GObject *) self->surface);
+
+  clutter_actor_set_reactive (CLUTTER_ACTOR (self), FALSE);
+  self->surface = NULL;
+}
+
 static void
 meta_surface_actor_wayland_dispose (GObject *object)
 {
@@ -272,8 +284,9 @@ meta_surface_actor_wayland_dispose (GObject *object)
 
   if (self->surface)
     {
-      g_object_remove_weak_pointer (G_OBJECT (self->surface),
-                                    (gpointer *) &self->surface);
+      g_object_weak_unref (G_OBJECT (self->surface),
+                           on_surface_disposed,
+                           self);
       self->surface = NULL;
     }
 
@@ -308,8 +321,9 @@ meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
   g_assert (meta_is_wayland_compositor ());
 
   self->surface = surface;
-  g_object_add_weak_pointer (G_OBJECT (self->surface),
-                             (gpointer *) &self->surface);
+  g_object_weak_ref (G_OBJECT (self->surface),
+                     on_surface_disposed,
+                     self);
 
   return META_SURFACE_ACTOR (self);
 }
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 88b27f84d..cf6008064 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -600,10 +600,13 @@ repick_for_event (MetaWaylandPointer *pointer,
     {
       MetaSurfaceActorWayland *actor_wayland =
         META_SURFACE_ACTOR_WAYLAND (actor);
+      MetaWindow *window = NULL;
 
       surface = meta_surface_actor_wayland_get_surface (actor_wayland);
+      if (surface)
+        window = meta_wayland_surface_get_window (surface);
 
-      if (surface && meta_window_has_modals (meta_wayland_surface_get_window (surface)))
+      if (window && meta_window_has_modals (window))
         surface = NULL;
     }
   else
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 8d40eb088..ba8946df7 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -412,6 +412,7 @@ permanently_unmap_subsurface (MetaWaylandSurface *surface)
 {
   MetaWaylandSubsurfacePlacementOp *op;
   MetaWaylandTransaction *transaction;
+  MetaSurfaceActor *surface_actor;
 
   op = get_subsurface_placement_op (surface, NULL,
                                     META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW);
@@ -422,6 +423,8 @@ permanently_unmap_subsurface (MetaWaylandSurface *surface)
   meta_wayland_transaction_add_subsurface_position (transaction, surface, 0, 0);
   meta_wayland_transaction_commit (transaction);
 
+  surface_actor = meta_wayland_surface_get_actor (surface);
+  clutter_actor_set_reactive (CLUTTER_ACTOR (surface_actor), FALSE);
   surface->committed_state.parent = NULL;
 }