~darkxst/ubuntu/quantal/gnome-shell/lp1128804

« back to all changes in this revision

Viewing changes to src/st/st-focus-manager.c

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2012-10-09 20:42:33 UTC
  • mfrom: (57.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121009204233-chcl8989muuzfpws
Tags: 3.6.0-0ubuntu3
* debian/patches/ubuntu-lightdm-user-switching.patch
  - Fix user switching when running lightdm.  LP: #1064269
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
st_focus_manager_add_group (StFocusManager *manager,
181
181
                            StWidget       *root)
182
182
{
 
183
  gpointer count_p = g_hash_table_lookup (manager->priv->groups, root);
 
184
  int count = count_p ? GPOINTER_TO_INT (count_p) : 0;
 
185
 
183
186
  g_signal_connect (root, "destroy",
184
187
                    G_CALLBACK (remove_destroyed_group),
185
188
                    manager);
186
 
  g_hash_table_insert (manager->priv->groups, root, GINT_TO_POINTER (1));
 
189
  g_hash_table_insert (manager->priv->groups, root, GINT_TO_POINTER (++count));
187
190
}
188
191
 
189
192
/**
197
200
st_focus_manager_remove_group (StFocusManager *manager,
198
201
                               StWidget       *root)
199
202
{
200
 
  g_hash_table_remove (manager->priv->groups, root);
 
203
  gpointer count_p = g_hash_table_lookup (manager->priv->groups, root);
 
204
  int count = count_p ? GPOINTER_TO_INT (count_p) : 0;
 
205
 
 
206
  if (count == 0)
 
207
    return;
 
208
  if (count == 1)
 
209
    g_hash_table_remove (manager->priv->groups, root);
 
210
  else
 
211
    g_hash_table_insert (manager->priv->groups, root, GINT_TO_POINTER(--count));
201
212
}
202
213
 
203
214
/**