~charlesk/gnome-control-center/make-new-panel

« back to all changes in this revision

Viewing changes to libwindow-settings/metacity-window-manager.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mfrom: (0.1.11 experimental) (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517104727-lqel6m8vhfw5jby1
Tags: 1:3.0.1.1-1ubuntu1
* Rebase on Debian, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on hardening-wrapper, dpkg-dev and dh-autoreconf
  - Add dependency on ubuntu-system-service
  - Remove dependency on gnome-icon-theme-symbolic
  - Move dependency on apg, gnome-icon-theme-symbolic and accountsservice to
    be a Recommends: until we get them in main
* debian/rules:
  - Use autoreconf
  - Add binary-post-install rule for gnome-control-center-data
  - Run dh-autoreconf
* debian/gnome-control-center.dirs:
* debian/gnome-control-center.links:
  - Add a link to the control center shell for indicators
* debian/patches/00_disable-nm.patch:
  - Temporary patch to disable building with NetworkManager until we get
    the new one in the archive
* debian/patches/01_git_remove_gettext_calls.patch:
  - Remove calls to AM_GNU_GETTEXT, IT_PROG_INTLTOOL should be enough
* debian/patches/01_git_kill_warning.patch:
  - Kill warning
* debian/patches/50_ubuntu_systemwide_prefs.patch:
  - Ubuntu specific proxy preferences
* debian/patches/51_ubuntu_system_keyboard.patch:
  - Implement the global keyboard spec at https://wiki.ubuntu.com/DefaultKeyboardSettings

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2
 
 
3
 
/* metacity-window-manager.c
4
 
 * Copyright (C) 2002 Seth Nickell
5
 
 * Copyright (C) 2002 Red Hat, Inc.
6
 
 *
7
 
 * Written by: Seth Nickell <snickell@stanford.edu>,
8
 
 *             Havoc Pennington <hp@redhat.com>
9
 
 *
10
 
 * This program is free software; you can redistribute it and/or modify
11
 
 * it under the terms of the GNU General Public License as published by
12
 
 * the Free Software Foundation; either version 2, or (at your option)
13
 
 * any later version.
14
 
 *
15
 
 * This program is distributed in the hope that it will be useful,
16
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 * GNU General Public License for more details.
19
 
 *
20
 
 * You should have received a copy of the GNU General Public License
21
 
 * along with this program; if not, write to the Free Software
22
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23
 
 * 02111-1307, USA.
24
 
 */
25
 
 
26
 
#include <config.h>
27
 
#include <sys/types.h>
28
 
#include <dirent.h>
29
 
#include <string.h>
30
 
#include <glib/gi18n.h>
31
 
#include <gconf/gconf-client.h>
32
 
 
33
 
#include "metacity-window-manager.h"
34
 
 
35
 
#define METACITY_THEME_KEY "/apps/metacity/general/theme"
36
 
#define METACITY_FONT_KEY  "/apps/metacity/general/titlebar_font"
37
 
#define METACITY_FOCUS_KEY "/apps/metacity/general/focus_mode"
38
 
#define METACITY_USE_SYSTEM_FONT_KEY "/apps/metacity/general/titlebar_uses_system_font"
39
 
#define METACITY_AUTORAISE_KEY "/apps/metacity/general/auto_raise"
40
 
#define METACITY_AUTORAISE_DELAY_KEY "/apps/metacity/general/auto_raise_delay"
41
 
#define METACITY_MOUSE_MODIFIER_KEY "/apps/metacity/general/mouse_button_modifier"
42
 
#define METACITY_DOUBLE_CLICK_TITLEBAR_KEY "/apps/metacity/general/action_double_click_titlebar"
43
 
 
44
 
enum
45
 
{
46
 
        DOUBLE_CLICK_MAXIMIZE,
47
 
        DOUBLE_CLICK_MAXIMIZE_VERTICALLY,
48
 
        DOUBLE_CLICK_MAXIMIZE_HORIZONTALLY,
49
 
        DOUBLE_CLICK_MINIMIZE,
50
 
        DOUBLE_CLICK_SHADE,
51
 
        DOUBLE_CLICK_NONE
52
 
};
53
 
 
54
 
static GnomeWindowManagerClass *parent_class;
55
 
 
56
 
struct _MetacityWindowManagerPrivate {
57
 
        GConfClient *gconf;
58
 
        char *font;
59
 
        char *theme;
60
 
        char *mouse_modifier;
61
 
};
62
 
 
63
 
static void
64
 
value_changed (GConfClient *client,
65
 
               const gchar *key,
66
 
               GConfValue  *value,
67
 
               void        *data)
68
 
{
69
 
        MetacityWindowManager *meta_wm;
70
 
 
71
 
        meta_wm = METACITY_WINDOW_MANAGER (data);
72
 
 
73
 
        gnome_window_manager_settings_changed (GNOME_WINDOW_MANAGER (meta_wm));
74
 
}
75
 
 
76
 
/* this function is called when the shared lib is loaded */
77
 
GObject *
78
 
window_manager_new (int expected_interface_version)
79
 
{
80
 
        GObject *wm;
81
 
 
82
 
        if (expected_interface_version != GNOME_WINDOW_MANAGER_INTERFACE_VERSION) {
83
 
                g_warning ("Metacity window manager module wasn't compiled with the current version of gnome-control-center");
84
 
                return NULL;
85
 
        }
86
 
  
87
 
        wm = g_object_new (metacity_window_manager_get_type (), NULL);
88
 
 
89
 
        return wm;
90
 
}
91
 
 
92
 
static GList *
93
 
add_themes_from_dir (GList *current_list, const char *path)
94
 
{
95
 
        DIR *theme_dir;
96
 
        struct dirent *entry;
97
 
        char *theme_file_path;
98
 
        GList *node;
99
 
        gboolean found = FALSE;
100
 
 
101
 
        if (!(g_file_test (path, G_FILE_TEST_EXISTS) && g_file_test (path, G_FILE_TEST_IS_DIR))) {
102
 
                return current_list;
103
 
        }
104
 
 
105
 
        theme_dir = opendir (path);
106
 
        /* If this is NULL, then we couldn't open ~/.themes.  The test above
107
 
         * only checks existence, not wether we can really read it.*/
108
 
        if (theme_dir == NULL)
109
 
                return current_list;
110
 
        
111
 
        for (entry = readdir (theme_dir); entry != NULL; entry = readdir (theme_dir)) {
112
 
                theme_file_path = g_build_filename (path, entry->d_name, "metacity-1/metacity-theme-1.xml", NULL);
113
 
 
114
 
                if (g_file_test (theme_file_path, G_FILE_TEST_EXISTS)) {
115
 
 
116
 
                        for (node = current_list; (node != NULL) && (!found); node = node->next) {
117
 
                                found = (strcmp (node->data, entry->d_name) == 0);
118
 
                        }
119
 
      
120
 
                        if (!found) {
121
 
                                current_list = g_list_prepend (current_list, g_strdup (entry->d_name));
122
 
                        }
123
 
                }
124
 
 
125
 
                found = FALSE;
126
 
                /*g_free (entry);*/
127
 
                g_free (theme_file_path);
128
 
        }
129
 
   
130
 
        closedir (theme_dir);
131
 
 
132
 
        return current_list;
133
 
}
134
 
 
135
 
static GList *  
136
 
metacity_get_theme_list (GnomeWindowManager *wm)
137
 
{
138
 
        GList *themes = NULL;
139
 
        char *home_dir_themes;
140
 
 
141
 
        home_dir_themes = g_build_filename (g_get_home_dir (), ".themes", NULL);
142
 
 
143
 
        themes = add_themes_from_dir (themes, METACITY_THEME_DIR);
144
 
        themes = add_themes_from_dir (themes, "/usr/share/themes");
145
 
        themes = add_themes_from_dir (themes, home_dir_themes);
146
 
 
147
 
        g_free (home_dir_themes);
148
 
 
149
 
        return themes;
150
 
}
151
 
 
152
 
static char *
153
 
metacity_get_user_theme_folder (GnomeWindowManager *wm)
154
 
{
155
 
        return g_build_filename (g_get_home_dir (), ".themes", NULL);
156
 
}
157
 
 
158
 
static void
159
 
metacity_change_settings (GnomeWindowManager    *wm,
160
 
                          const GnomeWMSettings *settings)
161
 
{
162
 
        MetacityWindowManager *meta_wm;
163
 
 
164
 
        meta_wm = METACITY_WINDOW_MANAGER (wm);
165
 
        
166
 
        if (settings->flags & GNOME_WM_SETTING_MOUSE_FOCUS)
167
 
                gconf_client_set_string (meta_wm->p->gconf,
168
 
                                         METACITY_FOCUS_KEY,
169
 
                                         settings->focus_follows_mouse ?
170
 
                                         "sloppy" : "click", NULL);
171
 
 
172
 
        if (settings->flags & GNOME_WM_SETTING_AUTORAISE)
173
 
                gconf_client_set_bool (meta_wm->p->gconf,
174
 
                                       METACITY_AUTORAISE_KEY,
175
 
                                       settings->autoraise, NULL);
176
 
        
177
 
        if (settings->flags & GNOME_WM_SETTING_AUTORAISE_DELAY)
178
 
                gconf_client_set_int (meta_wm->p->gconf,
179
 
                                      METACITY_AUTORAISE_DELAY_KEY,
180
 
                                      settings->autoraise_delay, NULL);
181
 
 
182
 
        if (settings->flags & GNOME_WM_SETTING_FONT) {
183
 
                gconf_client_set_string (meta_wm->p->gconf,
184
 
                                         METACITY_FONT_KEY,
185
 
                                         settings->font, NULL);
186
 
        }
187
 
        
188
 
        if (settings->flags & GNOME_WM_SETTING_MOUSE_MOVE_MODIFIER) {
189
 
                char *value;
190
 
 
191
 
                value = g_strdup_printf ("<%s>", settings->mouse_move_modifier);
192
 
                gconf_client_set_string (meta_wm->p->gconf,
193
 
                                         METACITY_MOUSE_MODIFIER_KEY,
194
 
                                         value, NULL);
195
 
                g_free (value);
196
 
        }
197
 
 
198
 
        if (settings->flags & GNOME_WM_SETTING_THEME) {
199
 
                gconf_client_set_string (meta_wm->p->gconf,
200
 
                                         METACITY_THEME_KEY,
201
 
                                         settings->theme, NULL);
202
 
        }
203
 
 
204
 
        if (settings->flags & GNOME_WM_SETTING_DOUBLE_CLICK_ACTION) {
205
 
                const char *action;
206
 
 
207
 
                action = NULL;
208
 
                
209
 
                switch (settings->double_click_action) {
210
 
                case DOUBLE_CLICK_SHADE:
211
 
                        action = "toggle_shade";
212
 
                        break;
213
 
                case DOUBLE_CLICK_MAXIMIZE:
214
 
                        action = "toggle_maximize";
215
 
                        break;
216
 
                case DOUBLE_CLICK_MAXIMIZE_VERTICALLY:
217
 
                        action = "toggle_maximize_vertically";
218
 
                        break;
219
 
                case DOUBLE_CLICK_MAXIMIZE_HORIZONTALLY:
220
 
                        action = "toggle_maximize_horizontally";
221
 
                        break;
222
 
                case DOUBLE_CLICK_MINIMIZE:
223
 
                        action = "minimize";
224
 
                        break;
225
 
                case DOUBLE_CLICK_NONE:
226
 
                        action = "none";
227
 
                        break;
228
 
                }
229
 
 
230
 
                if (action != NULL) {
231
 
                        gconf_client_set_string (meta_wm->p->gconf,
232
 
                                                 METACITY_DOUBLE_CLICK_TITLEBAR_KEY,
233
 
                                                 action, NULL);
234
 
                }
235
 
        }
236
 
}
237
 
 
238
 
static void
239
 
metacity_get_settings (GnomeWindowManager *wm,
240
 
                       GnomeWMSettings    *settings)
241
 
{
242
 
        int to_get;
243
 
        MetacityWindowManager *meta_wm;
244
 
 
245
 
        meta_wm = METACITY_WINDOW_MANAGER (wm);
246
 
        
247
 
        to_get = settings->flags;
248
 
        settings->flags = 0;
249
 
        
250
 
        if (to_get & GNOME_WM_SETTING_MOUSE_FOCUS) {
251
 
                char *str;
252
 
 
253
 
                str = gconf_client_get_string (meta_wm->p->gconf,
254
 
                                               METACITY_FOCUS_KEY, NULL);
255
 
                settings->focus_follows_mouse = FALSE;
256
 
                if (str && (strcmp (str, "sloppy") == 0 ||
257
 
                            strcmp (str, "mouse") == 0))
258
 
                        settings->focus_follows_mouse = TRUE;
259
 
 
260
 
                g_free (str);
261
 
                
262
 
                settings->flags |= GNOME_WM_SETTING_MOUSE_FOCUS;
263
 
        }
264
 
        
265
 
        if (to_get & GNOME_WM_SETTING_AUTORAISE) {
266
 
                settings->autoraise = gconf_client_get_bool (meta_wm->p->gconf,
267
 
                                                             METACITY_AUTORAISE_KEY,
268
 
                                                             NULL);
269
 
                settings->flags |= GNOME_WM_SETTING_AUTORAISE;
270
 
        }
271
 
        
272
 
        if (to_get & GNOME_WM_SETTING_AUTORAISE_DELAY) {
273
 
                settings->autoraise_delay =
274
 
                        gconf_client_get_int (meta_wm->p->gconf,
275
 
                                              METACITY_AUTORAISE_DELAY_KEY,
276
 
                                              NULL);
277
 
                settings->flags |= GNOME_WM_SETTING_AUTORAISE_DELAY;
278
 
        }
279
 
 
280
 
        if (to_get & GNOME_WM_SETTING_FONT) {
281
 
                char *str;
282
 
 
283
 
                str = gconf_client_get_string (meta_wm->p->gconf,
284
 
                                               METACITY_FONT_KEY,
285
 
                                               NULL);
286
 
 
287
 
                if (str == NULL)
288
 
                        str = g_strdup ("Sans Bold 12");
289
 
 
290
 
                if (meta_wm->p->font &&
291
 
                    strcmp (meta_wm->p->font, str) == 0) {
292
 
                        g_free (str);
293
 
                } else {
294
 
                        g_free (meta_wm->p->font);
295
 
                        meta_wm->p->font = str;
296
 
                }
297
 
                
298
 
                settings->font = meta_wm->p->font;
299
 
 
300
 
                settings->flags |= GNOME_WM_SETTING_FONT;
301
 
        }
302
 
        
303
 
        if (to_get & GNOME_WM_SETTING_MOUSE_MOVE_MODIFIER) {
304
 
                char *str;
305
 
                const char *new;
306
 
 
307
 
                str = gconf_client_get_string (meta_wm->p->gconf,
308
 
                                               METACITY_MOUSE_MODIFIER_KEY,
309
 
                                               NULL);
310
 
 
311
 
                if (str == NULL)
312
 
                        str = g_strdup ("<Super>");
313
 
 
314
 
                if (strcmp (str, "<Super>") == 0)
315
 
                        new = "Super";
316
 
                else if (strcmp (str, "<Alt>") == 0)
317
 
                        new = "Alt";
318
 
                else if (strcmp (str, "<Meta>") == 0)
319
 
                        new = "Meta";
320
 
                else if (strcmp (str, "<Hyper>") == 0)
321
 
                        new = "Hyper";
322
 
                else if (strcmp (str, "<Control>") == 0)
323
 
                        new = "Control";
324
 
                else
325
 
                        new = NULL;
326
 
 
327
 
                if (new && meta_wm->p->mouse_modifier &&
328
 
                    strcmp (new, meta_wm->p->mouse_modifier) == 0) {
329
 
                        /* unchanged */;
330
 
                } else {
331
 
                        g_free (meta_wm->p->mouse_modifier);
332
 
                        meta_wm->p->mouse_modifier = g_strdup (new);
333
 
                }
334
 
 
335
 
                g_free (str);
336
 
 
337
 
                settings->mouse_move_modifier = meta_wm->p->mouse_modifier;
338
 
                
339
 
                settings->flags |= GNOME_WM_SETTING_MOUSE_MOVE_MODIFIER;
340
 
        }
341
 
 
342
 
        if (to_get & GNOME_WM_SETTING_THEME) {
343
 
                char *str;
344
 
 
345
 
                str = gconf_client_get_string (meta_wm->p->gconf,
346
 
                                               METACITY_THEME_KEY,
347
 
                                               NULL);
348
 
 
349
 
                if (str == NULL)
350
 
                        str = g_strdup ("Atlanta");
351
 
 
352
 
                g_free (meta_wm->p->theme);
353
 
                meta_wm->p->theme = str;
354
 
                settings->theme = meta_wm->p->theme;
355
 
 
356
 
                settings->flags |= GNOME_WM_SETTING_THEME;
357
 
        }
358
 
 
359
 
        if (to_get & GNOME_WM_SETTING_DOUBLE_CLICK_ACTION) {
360
 
                char *str;
361
 
 
362
 
                str = gconf_client_get_string (meta_wm->p->gconf,
363
 
                                               METACITY_DOUBLE_CLICK_TITLEBAR_KEY,
364
 
                                               NULL);
365
 
                
366
 
                if (str == NULL)
367
 
                        str = g_strdup ("toggle_shade");
368
 
                
369
 
                if (strcmp (str, "toggle_shade") == 0)
370
 
                        settings->double_click_action = DOUBLE_CLICK_SHADE;
371
 
                else if (strcmp (str, "toggle_maximize") == 0)
372
 
                        settings->double_click_action = DOUBLE_CLICK_MAXIMIZE;
373
 
                else if (strcmp (str, "toggle_maximize_horizontally") == 0 ||
374
 
                         strcmp (str, "toggle_maximize_horiz") == 0)
375
 
                        settings->double_click_action = DOUBLE_CLICK_MAXIMIZE_HORIZONTALLY;
376
 
                else if (strcmp (str, "toggle_maximize_vertically") == 0 ||
377
 
                         strcmp (str, "toggle_maximize_vert") == 0)
378
 
                        settings->double_click_action = DOUBLE_CLICK_MAXIMIZE_VERTICALLY;
379
 
                else if (strcmp (str, "minimize") == 0)
380
 
                        settings->double_click_action = DOUBLE_CLICK_MINIMIZE;
381
 
                else if (strcmp (str, "none") == 0)
382
 
                        settings->double_click_action = DOUBLE_CLICK_NONE;
383
 
                else
384
 
                        settings->double_click_action = DOUBLE_CLICK_SHADE;
385
 
                
386
 
                g_free (str);
387
 
                
388
 
                settings->flags |= GNOME_WM_SETTING_DOUBLE_CLICK_ACTION;             
389
 
        }
390
 
}
391
 
 
392
 
static int
393
 
metacity_get_settings_mask (GnomeWindowManager *wm)
394
 
{
395
 
        return GNOME_WM_SETTING_MASK;
396
 
}
397
 
 
398
 
static void
399
 
metacity_get_double_click_actions (GnomeWindowManager              *wm,
400
 
                                   const GnomeWMDoubleClickAction **actions_p,
401
 
                                   int                             *n_actions_p)
402
 
{
403
 
        static GnomeWMDoubleClickAction actions[] = {
404
 
                { DOUBLE_CLICK_MAXIMIZE, N_("Maximize") },
405
 
                { DOUBLE_CLICK_MAXIMIZE_VERTICALLY, N_("Maximize Vertically") },
406
 
                { DOUBLE_CLICK_MAXIMIZE_HORIZONTALLY, N_("Maximize Horizontally") },
407
 
                { DOUBLE_CLICK_MINIMIZE, N_("Minimize") },
408
 
                { DOUBLE_CLICK_SHADE, N_("Roll up") },
409
 
                { DOUBLE_CLICK_NONE, N_("None") }
410
 
        };
411
 
        static gboolean initialized = FALSE;        
412
 
 
413
 
        if (!initialized) {
414
 
                int i;
415
 
                
416
 
                initialized = TRUE;
417
 
                i = 0;
418
 
                while (i < (int) G_N_ELEMENTS (actions)) {
419
 
                        g_assert (actions[i].number == i);
420
 
                        actions[i].human_readable_name = _(actions[i].human_readable_name);
421
 
                        
422
 
                        ++i;
423
 
                }
424
 
        }
425
 
 
426
 
        *actions_p = actions;
427
 
        *n_actions_p = (int) G_N_ELEMENTS (actions);        
428
 
}
429
 
 
430
 
static void
431
 
metacity_window_manager_init (MetacityWindowManager *metacity_window_manager,
432
 
                              MetacityWindowManagerClass *class)
433
 
{
434
 
        metacity_window_manager->p = g_new0 (MetacityWindowManagerPrivate, 1);
435
 
        metacity_window_manager->p->gconf = gconf_client_get_default ();
436
 
        metacity_window_manager->p->font = NULL;
437
 
        metacity_window_manager->p->theme = NULL;
438
 
        metacity_window_manager->p->mouse_modifier = NULL;
439
 
        
440
 
        gconf_client_add_dir (metacity_window_manager->p->gconf,
441
 
                              "/apps/metacity/general",
442
 
                              GCONF_CLIENT_PRELOAD_ONELEVEL,
443
 
                              NULL);
444
 
 
445
 
        g_signal_connect (G_OBJECT (metacity_window_manager->p->gconf),
446
 
                          "value_changed",
447
 
                          G_CALLBACK (value_changed), metacity_window_manager);
448
 
}
449
 
 
450
 
static void
451
 
metacity_window_manager_finalize (GObject *object) 
452
 
{
453
 
        MetacityWindowManager *metacity_window_manager;
454
 
 
455
 
        g_return_if_fail (object != NULL);
456
 
        g_return_if_fail (IS_METACITY_WINDOW_MANAGER (object));
457
 
 
458
 
        metacity_window_manager = METACITY_WINDOW_MANAGER (object);
459
 
        
460
 
        g_signal_handlers_disconnect_by_func (G_OBJECT (metacity_window_manager->p->gconf),
461
 
                                              G_CALLBACK (value_changed),
462
 
                                              metacity_window_manager);
463
 
        
464
 
        g_object_unref (G_OBJECT (metacity_window_manager->p->gconf));
465
 
        g_free (metacity_window_manager->p);
466
 
 
467
 
        G_OBJECT_CLASS (parent_class)->finalize (object);
468
 
}
469
 
 
470
 
 
471
 
static void
472
 
metacity_window_manager_class_init (MetacityWindowManagerClass *class) 
473
 
{
474
 
        GObjectClass *object_class;
475
 
        GnomeWindowManagerClass *wm_class;
476
 
 
477
 
        object_class = G_OBJECT_CLASS (class);
478
 
        wm_class = GNOME_WINDOW_MANAGER_CLASS (class);
479
 
 
480
 
        object_class->finalize = metacity_window_manager_finalize;
481
 
 
482
 
        wm_class->change_settings          = metacity_change_settings;
483
 
        wm_class->get_settings             = metacity_get_settings;
484
 
        wm_class->get_settings_mask        = metacity_get_settings_mask;
485
 
        wm_class->get_user_theme_folder    = metacity_get_user_theme_folder;
486
 
        wm_class->get_theme_list           = metacity_get_theme_list;
487
 
        wm_class->get_double_click_actions = metacity_get_double_click_actions;
488
 
        
489
 
        parent_class = g_type_class_peek_parent (class);
490
 
}
491
 
 
492
 
GType
493
 
metacity_window_manager_get_type (void)
494
 
{
495
 
        static GType metacity_window_manager_type = 0;
496
 
 
497
 
        if (!metacity_window_manager_type) {
498
 
                static GTypeInfo metacity_window_manager_info = {
499
 
                        sizeof (MetacityWindowManagerClass),
500
 
                        NULL, /* GBaseInitFunc */
501
 
                        NULL, /* GBaseFinalizeFunc */
502
 
                        (GClassInitFunc) metacity_window_manager_class_init,
503
 
                        NULL, /* GClassFinalizeFunc */
504
 
                        NULL, /* user-supplied data */
505
 
                        sizeof (MetacityWindowManager),
506
 
                        0, /* n_preallocs */
507
 
                        (GInstanceInitFunc) metacity_window_manager_init,
508
 
                        NULL
509
 
                };
510
 
 
511
 
                metacity_window_manager_type = 
512
 
                        g_type_register_static (gnome_window_manager_get_type (), 
513
 
                                                "MetacityWindowManager",
514
 
                                                &metacity_window_manager_info, 0);
515
 
        }
516
 
 
517
 
        return metacity_window_manager_type;
518
 
}
519
 
 
520