~muktupavels/metacity/lp1403583

« back to all changes in this revision

Viewing changes to src/core/group.c

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2014-11-18 18:13:01 UTC
  • mfrom: (2.3.7 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118181301-omfi79vghwycfal2
Tags: 1:3.14.2-0ubuntu1
* Merge with Debian unstable, remaining changes:
  - 05_raise_on_click_for_click_mode.patch:
    Force raise on click option.
  - 22_fix_above_tab_switching.patch:
    For Above_Tab, don't compare keysym (fixes group switching).
  - debian/metacity-common.links:
    Show keybindings in Unity control center.
  - Use Ubuntu Desktop team Vcs fields.
* Drop all other patches, they were needed only for Unity 2D.
* New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
/* Metacity window groups */
4
4
 
5
 
/* 
 
5
/*
6
6
 * Copyright (C) 2002 Red Hat Inc.
7
7
 * Copyright (C) 2003 Rob Adams
8
 
 * 
 
8
 *
9
9
 * This program is free software; you can redistribute it and/or
10
10
 * modify it under the terms of the GNU General Public License as
11
11
 * published by the Free Software Foundation; either version 2 of the
15
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
16
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
17
 * General Public License for more details.
18
 
 * 
 
18
 *
19
19
 * You should have received a copy of the GNU General Public License
20
20
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21
21
 */
34
34
#define N_INITIAL_PROPS 3
35
35
  Atom initial_props[N_INITIAL_PROPS];
36
36
  int i;
37
 
  
 
37
 
38
38
  g_assert (N_INITIAL_PROPS == (int) G_N_ELEMENTS (initial_props));
39
 
  
 
39
 
40
40
  group = g_new0 (MetaGroup, 1);
41
41
 
42
42
  group->display = display;
43
43
  group->windows = NULL;
44
44
  group->group_leader = group_leader;
45
45
  group->refcount = 1; /* owned by caller, hash table has only weak ref */
46
 
  
 
46
 
47
47
  if (display->groups_by_leader == NULL)
48
48
    display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash,
49
49
                                                  meta_unsigned_long_equal);
60
60
  initial_props[i++] = display->atom__NET_WM_PID;
61
61
  initial_props[i++] = display->atom__NET_STARTUP_ID;
62
62
  g_assert (N_INITIAL_PROPS == i);
63
 
  
 
63
 
64
64
  meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS);
65
65
 
66
66
  meta_topic (META_DEBUG_GROUPS,
67
67
              "Created new group with leader 0x%lx\n",
68
68
              group->group_leader);
69
 
  
 
69
 
70
70
  return group;
71
71
}
72
72
 
80
80
    {
81
81
      meta_topic (META_DEBUG_GROUPS,
82
82
                  "Destroying group with leader 0x%lx\n",
83
 
                  group->group_leader);      
84
 
      
 
83
                  group->group_leader);
 
84
 
85
85
      g_assert (group->display->groups_by_leader != NULL);
86
 
      
 
86
 
87
87
      g_hash_table_remove (group->display->groups_by_leader,
88
88
                           &group->group_leader);
89
89
 
96
96
 
97
97
      g_free (group->wm_client_machine);
98
98
      g_free (group->startup_id);
99
 
      
 
99
 
100
100
      g_free (group);
101
101
    }
102
102
}
117
117
  MetaWindow *ancestor;
118
118
 
119
119
  /* use window->xwindow if no window->xgroup_leader */
120
 
      
 
120
 
121
121
  group = NULL;
122
 
      
 
122
 
123
123
  /* Determine the ancestor of the window; its group setting will override the
124
124
   * normal grouping rules; see bug 328211.
125
125
   */
136
136
        group = g_hash_table_lookup (window->display->groups_by_leader,
137
137
                                     &window->xwindow);
138
138
    }
139
 
      
 
139
 
140
140
  if (group != NULL)
141
141
    {
142
142
      window->group = group;
153
153
      else
154
154
        group = meta_group_new (window->display,
155
155
                                window->xwindow);
156
 
          
 
156
 
157
157
      window->group = group;
158
158
    }
159
159
 
173
173
      meta_topic (META_DEBUG_GROUPS,
174
174
                  "Removing %s from group with leader 0x%lx\n",
175
175
                  window->desc, window->group->group_leader);
176
 
      
 
176
 
177
177
      window->group->windows =
178
178
        g_slist_remove (window->group->windows,
179
179
                        window);
200
200
                           Window       group_leader)
201
201
{
202
202
  MetaGroup *group;
203
 
  
 
203
 
204
204
  group = NULL;
205
 
  
 
205
 
206
206
  if (display->groups_by_leader)
207
207
    group = g_hash_table_lookup (display->groups_by_leader,
208
208
                                 &group_leader);
221
221
{
222
222
  GSList *tmp;
223
223
  GSList *frozen_stacks;
224
 
  
 
224
 
225
225
  if (group->windows == NULL)
226
226
    return;
227
227
 
240
240
 
241
241
      meta_stack_update_layer (window->screen->stack,
242
242
                               window);
243
 
      
 
243
 
244
244
      tmp = tmp->next;
245
245
    }
246
246