~darkxst/ubuntu/saucy/gnome-shell/upstart_log

« back to all changes in this revision

Viewing changes to src/st/st-theme-context.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-31 12:01:12 UTC
  • mfrom: (1.1.49) (19.1.36 experimental)
  • Revision ID: package-import@ubuntu.com-20130531120112-ew91khxf051x9i2r
Tags: 3.8.2-1ubuntu1
* Merge with Debian (LP: #1185869, #1185721). Remaining changes:
  - debian/control.in:
    + Build-depend on libsystemd-login-dev & libsystemd-daemon-dev
    + Depend on gdm instead of gdm3
    + Don't recommend gnome-session-fallback
  - debian/patches/40_change-pam-name-to-match-gdm.patch:
  - debian/patches/revert-suspend-break.patch:
    + Disabled, not needed on Ubuntu
  - debian/patches/ubuntu-lightdm-user-switching.patch:
    + Allow user switching when using LightDM. Thanks Gerhard Stein
      for rebasing against gnome-shell 3.8!
  - debian/patches/ubuntu_lock_on_suspend.patch
    + Respect Ubuntu's lock-on-suspend setting.
      Disabled until it can be rewritten.
  - debian/patches/git_relock_screen_after_crash.patch:
    + Add Upstream fix for unlocked session after crash (LP: #1064584)
* Note that the new GNOME Classic mode (which requires installing
  gnome-shell-extensions) won't work until gnome-session 3.8 is
  available in Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
  PangoFontDescription *font;
32
32
  StThemeNode *root_node;
33
33
  StTheme *theme;
 
34
 
 
35
  /* set of StThemeNode */
 
36
  GHashTable *nodes;
34
37
};
35
38
 
36
39
struct _StThemeContextClass {
66
69
                                        (gpointer) st_theme_context_changed,
67
70
                                        context);
68
71
 
 
72
  if (context->nodes)
 
73
    g_hash_table_unref (context->nodes);
69
74
  if (context->root_node)
70
75
    g_object_unref (context->root_node);
71
76
  if (context->theme)
105
110
                            "resolution-changed",
106
111
                            G_CALLBACK (st_theme_context_changed),
107
112
                            context);
 
113
 
 
114
  context->nodes = g_hash_table_new_full ((GHashFunc) st_theme_node_hash,
 
115
                                          (GEqualFunc) st_theme_node_equal,
 
116
                                          g_object_unref, NULL);
108
117
}
109
118
 
110
119
/**
134
143
  g_object_unref (context);
135
144
}
136
145
 
137
 
static gboolean
138
 
emit_changed (StThemeContext *context)
139
 
{
140
 
  g_signal_emit (context, signals[CHANGED], 0);
141
 
  return FALSE;
142
 
}
143
 
 
144
146
static void
145
147
st_theme_context_changed (StThemeContext *context)
146
148
{
147
149
  StThemeNode *old_root = context->root_node;
148
150
  context->root_node = NULL;
 
151
  g_hash_table_remove_all (context->nodes);
149
152
 
150
 
  emit_changed (context);
 
153
  g_signal_emit (context, signals[CHANGED], 0);
151
154
 
152
155
  if (old_root)
153
156
    g_object_unref (old_root);
154
157
}
155
158
 
 
159
static gboolean
 
160
changed_idle (gpointer userdata)
 
161
{
 
162
  st_theme_context_changed (userdata);
 
163
  return FALSE;
 
164
}
 
165
 
156
166
static void
157
167
on_icon_theme_changed (StTextureCache *cache,
158
168
                       StThemeContext *context)
160
170
  /* Note that an icon theme change isn't really a change of the StThemeContext;
161
171
   * the style information has changed. But since the style factors into the
162
172
   * icon_name => icon lookup, faking a theme context change is a good way
163
 
   * to force users such as StIcon to look up icons again. Don't bother recreating
164
 
   * the root node, though. */
165
 
  g_idle_add ((GSourceFunc) emit_changed, context);
 
173
   * to force users such as StIcon to look up icons again.
 
174
   */
 
175
  g_idle_add ((GSourceFunc) changed_idle, context);
166
176
}
167
177
 
168
178
/**
299
309
 
300
310
  return context->root_node;
301
311
}
 
312
 
 
313
/**
 
314
 * st_theme_context_intern_node:
 
315
 * @context: a #StThemeContext
 
316
 * @node: a #StThemeNode
 
317
 *
 
318
 * Return an existing node matching @node, or if that isn't possible,
 
319
 * @node itself.
 
320
 *
 
321
 * Return value: (transfer none): a node with the same properties as @node
 
322
 */
 
323
StThemeNode *
 
324
st_theme_context_intern_node (StThemeContext *context,
 
325
                              StThemeNode    *node)
 
326
{
 
327
  StThemeNode *mine = g_hash_table_lookup (context->nodes, node);
 
328
 
 
329
  /* this might be node or not - it doesn't actually matter */
 
330
  if (mine != NULL)
 
331
    return mine;
 
332
 
 
333
  g_hash_table_add (context->nodes, g_object_ref (node));
 
334
  return node;
 
335
}