]> git.pld-linux.org Git - packages/clutter.git/blob - clutter-bug692706.patch
Backport upstream patch to fix gnome-shell crashes. Release 2
[packages/clutter.git] / clutter-bug692706.patch
1 From a586c23ddcef9a11f6e343b4b6848cde2df54927 Mon Sep 17 00:00:00 2001
2 From: Emmanuele Bassi <ebassi@gnome.org>
3 Date: Mon, 06 May 2013 22:46:25 +0000
4 Subject: cally: Use a weak pointer to hold the key focus in CallyStage
5
6 We want to avoid the pointer getting stale, and causing crashes.
7
8 https://bugzilla.gnome.org/show_bug.cgi?id=692706
9 (cherry picked from commit 19391a9626b087bd4df452e8699d53caa54c350f)
10
11 Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
12 ---
13 diff --git a/clutter/cally/cally-stage.c b/clutter/cally/cally-stage.c
14 index 2b1cfd1..c95ccb0 100644
15 --- a/clutter/cally/cally-stage.c
16 +++ b/clutter/cally/cally-stage.c
17 @@ -139,7 +139,11 @@ cally_stage_notify_key_focus_cb (ClutterStage *stage,
18        AtkObject *old = NULL;
19  
20        if (self->priv->key_focus != NULL)
21 -        old = clutter_actor_get_accessible (self->priv->key_focus);
22 +        {
23 +          g_object_remove_weak_pointer (G_OBJECT (self->priv->key_focus),
24 +                                        (gpointer *) &self->priv->key_focus);
25 +          old = clutter_actor_get_accessible (self->priv->key_focus);
26 +        }
27        else
28          old = clutter_actor_get_accessible (CLUTTER_ACTOR (stage));
29  
30 @@ -154,7 +158,19 @@ cally_stage_notify_key_focus_cb (ClutterStage *stage,
31    self->priv->key_focus = key_focus;
32  
33    if (key_focus != NULL)
34 -    new = clutter_actor_get_accessible (key_focus);
35 +    {
36 +      /* ensure that if the key focus goes away, the field inside
37 +       * CallyStage is reset. see bug:
38 +       *
39 +       * https://bugzilla.gnome.org/show_bug.cgi?id=692706
40 +       *
41 +       * we remove the weak pointer above.
42 +       */
43 +      g_object_add_weak_pointer (G_OBJECT (self->priv->key_focus),
44 +                                 (gpointer *) &self->priv->key_focus);
45 +
46 +      new = clutter_actor_get_accessible (key_focus);
47 +    }
48    else
49      new = clutter_actor_get_accessible (CLUTTER_ACTOR (stage));
50  
51 --
52 cgit v0.9.1
This page took 0.062102 seconds and 3 git commands to generate.