~ubuntu-branches/ubuntu/precise/compiz/precise

« back to all changes in this revision

Viewing changes to .pc/default_drag_key.patch/gtk/window-decorator/settings.c

  • Committer: Package Import Robot
  • Author(s): Didier Roche, Łukasz 'sil2100' Zemczak, Didier Roche
  • Date: 2012-03-12 10:22:10 UTC
  • mfrom: (0.168.15)
  • Revision ID: package-import@ubuntu.com-20120312102210-e248pzbccr7r2tdq
Tags: 1:0.9.7.0+bzr3035-0ubuntu1
[ Łukasz 'sil2100' Zemczak ]
* New upstream snapshot:
  - Fix gtk-window-decorator crash upon demaximizing a window (LP: #930071)
  - Fix core keybindings (LP: #930412)
  - Fixes compiz crash with SIGSEGV on shutdown (LP: #931283)
  - Plugins can't tell the difference between a key-tap and modifier
    key-release (LP: #925293)
  - compiz-core r3001 (and 3002) ftbfs (LP: #933226)
  - Semi-maximized windows have no shadow or frame (LP: #924736)
  - Untranslated strings in gtk-window-decorator (LP: #780505)
  - Initialize the _NET_WM_STATE_FOCUSED (LP: #932087)
  - [regression] Customized shortcuts don't work (LP: #931927)
  - Window stacking problem (LP: #936675)
  - Quickly demaximized windows can receive maximized window decorations if 
    they were initially maximized (LP: #936778)
  - Maximized windows do not get shadows at all (LP: #936774)
  - [regression] Launcher, top panel and keyboard un-responsive after using 
    any Super-x shortcut (LP: #934058)
  - No draggable border if mutter isn't installed (LP: #936781)
  - Fix compiz crash with SIGSEGV in XDefineCursor() (LP: #936487)
  - Fixes memory leak at DecorWindow::updateSwitcher() (LP: #940115)
  - Unresolved symbols in plugins cause compiz to exit (LP: #938478)
  - Fix compiz spending about 51% of its CPU time in CompRegion 
    construction/destruction (LP: #940139)
  - Fix Conditional jump or move depends on uninitialised value(s) in 
    decor_match_pixmap (LP: #940066)
  - Fix 'show desktop' behaviour (LP: #871801)
  - Tweak algorithm used to cast shadows on maximized windows (LP: #936784)
  - "Svg" and "Png" should be "SVG and "PNG" (LP: #942890)
  - Fix invalid memory usage after free() in DecorWindow (LP: #943116)
  - Fix alt + F10 (LP: #943223)
* Removed cherry-picked patches
* debian/patches/fix_944631.patch:
  - Always replay the keyboard if something was grabbed and didn't trigger 
    an action and don't trigger actions which aren't added accidentally 
    (LP: #943612) (LP: #944631)
* debian/patches/fix_923683.patch:
  - Backports a patch which prevents the shift race condition

[ Didier Roche ]
* debian/patches/fix_alt_pressing.patch:
  - Patch from ddv to fix all the regressions with the alt key fix and other
    (LP: #943851, #945373)
  - Fix Quicklist are not showing if right-clicking a launcher icon in Expo
    mode if triggered by Super + S (LP: #944979)
* debian/patches/fix_806255.patch:
  - Unity/compiz intercepts keystrokes from grabbed windows (LP: #806255)
* debian/patches/fix_943194.patch:
  - second part for the alt key fix (LP: #943194)
* debian/patches/additional_alt_tapping_fix.patch:
  - again another alt tapping related fix for some regressions from the
    previous branch. Taken from "tapping-panacea" upstream branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2006 Novell, Inc.
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Lesser General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 2 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Lesser General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Lesser General Public
15
 
 * License along with this library; if not, write to the
16
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
 
 * Boston, MA 02111-1307, USA.
18
 
 *
19
 
 * Author: David Reveman <davidr@novell.com>
20
 
 */
21
 
 
22
 
#include "gtk-window-decorator.h"
23
 
 
24
 
/* TODO: Trash all of this and use a window property
25
 
 * instead - much much cleaner!
26
 
 */
27
 
 
28
 
gboolean
29
 
shadow_property_changed (WnckScreen *s)
30
 
{
31
 
    GdkDisplay *display = gdk_display_get_default ();
32
 
    Display    *xdisplay = GDK_DISPLAY_XDISPLAY (display);
33
 
    GdkScreen  *screen = gdk_display_get_default_screen (display);
34
 
    Window     root = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
35
 
    Atom actual;
36
 
    int  result, format;
37
 
    unsigned long n, left;
38
 
    unsigned char *prop_data;
39
 
    gboolean      changed = FALSE;
40
 
    XTextProperty shadow_color_xtp;
41
 
 
42
 
    result = XGetWindowProperty (xdisplay, root, compiz_shadow_info_atom,
43
 
                                 0, 32768, 0, XA_INTEGER, &actual,
44
 
                                 &format, &n, &left, &prop_data);
45
 
 
46
 
    if (result != Success)
47
 
        return FALSE;
48
 
 
49
 
    if (n == 8)
50
 
    {
51
 
        long *data      = (long *) prop_data;
52
 
        gdouble aradius  = data[0];
53
 
        gdouble aopacity = data[1];
54
 
        gint ax_off      = data[2];
55
 
        gint ay_off      = data[3];
56
 
 
57
 
        gdouble iradius  = data[4];
58
 
        gdouble iopacity = data[5];
59
 
        gint ix_off      = data[6];
60
 
        gint iy_off      = data[7];
61
 
        /* Radius and Opacity are multiplied by 1000 to keep precision,
62
 
         * divide by that much to get our real radius and opacity
63
 
         */
64
 
        aradius /= 1000;
65
 
        aopacity /= 1000;
66
 
        iradius /= 1000;
67
 
        iopacity /= 1000;
68
 
 
69
 
        changed = aradius != settings->active_shadow_radius   ||
70
 
                  aopacity != settings->active_shadow_opacity ||
71
 
                  ax_off != settings->active_shadow_offset_x  ||
72
 
                  ay_off != settings->active_shadow_offset_y ||
73
 
                  iradius != settings->inactive_shadow_radius   ||
74
 
                  iopacity != settings->inactive_shadow_opacity ||
75
 
                  ix_off != settings->inactive_shadow_offset_x  ||
76
 
                  iy_off != settings->inactive_shadow_offset_y;
77
 
 
78
 
        settings->active_shadow_radius = (gdouble) MAX (0.0, MIN (aradius, 48.0));
79
 
        settings->active_shadow_opacity = (gdouble) MAX (0.0, MIN (aopacity, 6.0));
80
 
        settings->active_shadow_offset_x = (gint) MAX (-16, MIN (ax_off, 16));
81
 
        settings->active_shadow_offset_y = (gint) MAX (-16, MIN (ay_off, 16));
82
 
        settings->inactive_shadow_radius = (gdouble) MAX (0.0, MIN (iradius, 48.0));
83
 
        settings->inactive_shadow_opacity = (gdouble) MAX (0.0, MIN (iopacity, 6.0));
84
 
        settings->inactive_shadow_offset_x = (gint) MAX (-16, MIN (ix_off, 16));
85
 
        settings->inactive_shadow_offset_y = (gint) MAX (-16, MIN (iy_off, 16));
86
 
    }
87
 
 
88
 
    XFree (prop_data);
89
 
 
90
 
    result = XGetTextProperty (xdisplay, root, &shadow_color_xtp,
91
 
                               compiz_shadow_color_atom);
92
 
 
93
 
    if (shadow_color_xtp.value)
94
 
    {
95
 
        int  ret_count = 0;
96
 
        char **t_data = NULL;
97
 
        
98
 
        XTextPropertyToStringList (&shadow_color_xtp, &t_data, &ret_count);
99
 
        
100
 
        if (ret_count == 2)
101
 
        {
102
 
            int c[4];
103
 
 
104
 
            if (sscanf (t_data[0], "#%2x%2x%2x%2x",
105
 
                        &c[0], &c[1], &c[2], &c[3]) == 4)
106
 
            {
107
 
                settings->active_shadow_color[0] = c[0] << 8 | c[0];
108
 
                settings->active_shadow_color[1] = c[1] << 8 | c[1];
109
 
                settings->active_shadow_color[2] = c[2] << 8 | c[2];
110
 
                changed = TRUE;
111
 
            }
112
 
 
113
 
            if (sscanf (t_data[1], "#%2x%2x%2x%2x",
114
 
                        &c[0], &c[1], &c[2], &c[3]) == 4)
115
 
            {
116
 
                settings->inactive_shadow_color[0] = c[0] << 8 | c[0];
117
 
                settings->inactive_shadow_color[1] = c[1] << 8 | c[1];
118
 
                settings->inactive_shadow_color[2] = c[2] << 8 | c[2];
119
 
                changed = TRUE;
120
 
            }
121
 
        }
122
 
 
123
 
        XFree (shadow_color_xtp.value);
124
 
        if (t_data)
125
 
            XFreeStringList (t_data);
126
 
    }
127
 
 
128
 
    return changed;
129
 
}
130
 
 
131
 
#ifdef USE_GCONF
132
 
static gboolean
133
 
use_tooltips_changed (GConfClient *client)
134
 
{
135
 
    gboolean      new_use_tooltips;
136
 
    gboolean      use_tooltips = settings->use_tooltips;
137
 
 
138
 
    new_use_tooltips = gconf_client_get_bool (client,
139
 
                                              USE_TOOLTIPS_KEY,
140
 
                                              NULL);
141
 
 
142
 
    if (new_use_tooltips != use_tooltips)
143
 
    {
144
 
        settings->use_tooltips = new_use_tooltips;
145
 
        return TRUE;
146
 
    }
147
 
 
148
 
    return FALSE;
149
 
}
150
 
 
151
 
static gboolean
152
 
mutter_draggable_border_width_changed (GConfClient *client)
153
 
{
154
 
    int      new_width;
155
 
    int      width = settings->mutter_draggable_border_width;
156
 
 
157
 
    new_width = gconf_client_get_int (client,
158
 
                                      MUTTER_DRAGGABLE_BORDER_WIDTH_KEY,
159
 
                                      NULL);
160
 
 
161
 
    if (new_width != width)
162
 
    {
163
 
        settings->mutter_draggable_border_width = new_width;
164
 
        return TRUE;
165
 
    }
166
 
 
167
 
    return FALSE;
168
 
}
169
 
 
170
 
static gboolean
171
 
mutter_attach_modal_dialogs_changed (GConfClient *client)
172
 
{
173
 
    gboolean      new_attach;
174
 
    gboolean      attach = settings->mutter_attach_modal_dialogs;
175
 
 
176
 
    new_attach = gconf_client_get_bool (client,
177
 
                                            MUTTER_ATTACH_MODAL_DIALOGS_KEY,
178
 
                                                NULL);
179
 
 
180
 
    if (new_attach != attach)
181
 
    {
182
 
        settings->mutter_attach_modal_dialogs = new_attach;
183
 
        return TRUE;
184
 
    }
185
 
 
186
 
    return FALSE;
187
 
}
188
 
 
189
 
static gboolean
190
 
blur_settings_changed (GConfClient *client)
191
 
{
192
 
    gchar *type;
193
 
    int   new_type = settings->blur_type;
194
 
 
195
 
    if (cmdline_options & CMDLINE_BLUR)
196
 
        return FALSE;
197
 
 
198
 
    type = gconf_client_get_string (client,
199
 
                                    BLUR_TYPE_KEY,
200
 
                                    NULL);
201
 
 
202
 
    if (type)
203
 
    {
204
 
        if (strcmp (type, "titlebar") == 0)
205
 
            new_type = BLUR_TYPE_TITLEBAR;
206
 
        else if (strcmp (type, "all") == 0)
207
 
            new_type = BLUR_TYPE_ALL;
208
 
        else if (strcmp (type, "none") == 0)
209
 
            new_type = BLUR_TYPE_NONE;
210
 
 
211
 
        g_free (type);
212
 
    }
213
 
 
214
 
    if (new_type != settings->blur_type)
215
 
    {
216
 
        settings->blur_type = new_type;
217
 
        return TRUE;
218
 
    }
219
 
 
220
 
    return FALSE;
221
 
}
222
 
 
223
 
static gboolean
224
 
theme_changed (GConfClient *client)
225
 
{
226
 
 
227
 
#ifdef USE_METACITY
228
 
    gboolean use_meta_theme;
229
 
 
230
 
    if (cmdline_options & CMDLINE_THEME)
231
 
        return FALSE;
232
 
 
233
 
    use_meta_theme = gconf_client_get_bool (client,
234
 
                                            USE_META_THEME_KEY,
235
 
                                            NULL);
236
 
 
237
 
    if (use_meta_theme)
238
 
    {
239
 
        gchar *theme;
240
 
 
241
 
        theme = gconf_client_get_string (client,
242
 
                                         META_THEME_KEY,
243
 
                                         NULL);
244
 
 
245
 
        if (theme)
246
 
        {
247
 
            meta_theme_set_current (theme, TRUE);
248
 
            if (!meta_theme_get_current ())
249
 
                use_meta_theme = FALSE;
250
 
 
251
 
            g_free (theme);
252
 
        }
253
 
        else
254
 
        {
255
 
            use_meta_theme = FALSE;
256
 
        }
257
 
    }
258
 
 
259
 
    if (use_meta_theme)
260
 
    {
261
 
        theme_draw_window_decoration    = meta_draw_window_decoration;
262
 
        theme_calc_decoration_size      = meta_calc_decoration_size;
263
 
        theme_update_border_extents     = meta_update_border_extents;
264
 
        theme_get_event_window_position = meta_get_event_window_position;
265
 
        theme_get_button_position       = meta_get_button_position;
266
 
        theme_get_title_scale           = meta_get_title_scale;
267
 
        theme_get_shadow                = meta_get_shadow;
268
 
    }
269
 
    else
270
 
    {
271
 
        theme_draw_window_decoration    = draw_window_decoration;
272
 
        theme_calc_decoration_size      = calc_decoration_size;
273
 
        theme_update_border_extents     = update_border_extents;
274
 
        theme_get_event_window_position = get_event_window_position;
275
 
        theme_get_button_position       = get_button_position;
276
 
        theme_get_title_scale           = get_title_scale;
277
 
        theme_get_shadow                = cairo_get_shadow;
278
 
    }
279
 
 
280
 
    return TRUE;
281
 
#else
282
 
    theme_draw_window_decoration    = draw_window_decoration;
283
 
    theme_calc_decoration_size      = calc_decoration_size;
284
 
    theme_update_border_extents     = update_border_extents;
285
 
    theme_get_event_window_position = get_event_window_position;
286
 
    theme_get_button_position       = get_button_position;
287
 
    theme_get_title_scale           = get_title_scale;
288
 
    theme_get_shadow                = cairo_get_shadow;
289
 
 
290
 
    return FALSE;
291
 
#endif
292
 
 
293
 
}
294
 
 
295
 
static gboolean
296
 
theme_opacity_changed (GConfClient *client)
297
 
{
298
 
 
299
 
#ifdef USE_METACITY
300
 
    gboolean shade_opacity, changed = FALSE;
301
 
    gdouble  opacity;
302
 
 
303
 
    opacity = gconf_client_get_float (client,
304
 
                                      META_THEME_OPACITY_KEY,
305
 
                                      NULL);
306
 
 
307
 
    if (!(cmdline_options & CMDLINE_OPACITY) &&
308
 
        opacity != settings->meta_opacity)
309
 
    {
310
 
        settings->meta_opacity = opacity;
311
 
        changed = TRUE;
312
 
    }
313
 
 
314
 
    if (opacity < 1.0)
315
 
    {
316
 
        shade_opacity = gconf_client_get_bool (client,
317
 
                                               META_THEME_SHADE_OPACITY_KEY,
318
 
                                               NULL);
319
 
 
320
 
        if (!(cmdline_options & CMDLINE_OPACITY_SHADE) &&
321
 
            shade_opacity != settings->meta_shade_opacity)
322
 
        {
323
 
            settings->meta_shade_opacity = shade_opacity;
324
 
            changed = TRUE;
325
 
        }
326
 
    }
327
 
 
328
 
    opacity = gconf_client_get_float (client,
329
 
                                      META_THEME_ACTIVE_OPACITY_KEY,
330
 
                                      NULL);
331
 
 
332
 
    if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY) &&
333
 
        opacity != settings->meta_active_opacity)
334
 
    {
335
 
        settings->meta_active_opacity = opacity;
336
 
        changed = TRUE;
337
 
    }
338
 
 
339
 
    if (opacity < 1.0)
340
 
    {
341
 
        shade_opacity =
342
 
            gconf_client_get_bool (client,
343
 
                                   META_THEME_ACTIVE_SHADE_OPACITY_KEY,
344
 
                                   NULL);
345
 
 
346
 
        if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY_SHADE) &&
347
 
            shade_opacity != settings->meta_active_shade_opacity)
348
 
        {
349
 
            settings->meta_active_shade_opacity = shade_opacity;
350
 
            changed = TRUE;
351
 
        }
352
 
    }
353
 
 
354
 
    return changed;
355
 
#else
356
 
    return FALSE;
357
 
#endif
358
 
 
359
 
}
360
 
 
361
 
static gboolean
362
 
button_layout_changed (GConfClient *client)
363
 
{
364
 
 
365
 
#ifdef USE_METACITY
366
 
    gchar *button_layout;
367
 
 
368
 
    button_layout = gconf_client_get_string (client,
369
 
                                             META_BUTTON_LAYOUT_KEY,
370
 
                                             NULL);
371
 
 
372
 
    if (button_layout)
373
 
    {
374
 
        meta_update_button_layout (button_layout);
375
 
 
376
 
        settings->meta_button_layout_set = TRUE;
377
 
 
378
 
        g_free (button_layout);
379
 
 
380
 
        return TRUE;
381
 
    }
382
 
 
383
 
    if (settings->meta_button_layout_set)
384
 
    {
385
 
        settings->meta_button_layout_set = FALSE;
386
 
        return TRUE;
387
 
    }
388
 
#endif
389
 
 
390
 
    return FALSE;
391
 
}
392
 
 
393
 
void
394
 
set_frame_scale (decor_frame_t *frame,
395
 
                 gchar         *font_str)
396
 
{
397
 
    gfloat        scale = 1.0f;
398
 
 
399
 
    gwd_decor_frame_ref (frame);
400
 
 
401
 
    if (frame->titlebar_font)
402
 
        pango_font_description_free (frame->titlebar_font);
403
 
 
404
 
    frame->titlebar_font = pango_font_description_from_string (font_str);
405
 
 
406
 
    scale = (*theme_get_title_scale) (frame);
407
 
 
408
 
    pango_font_description_set_size (frame->titlebar_font,
409
 
                                     MAX (pango_font_description_get_size (frame->titlebar_font) * scale, 1));
410
 
 
411
 
    gwd_decor_frame_unref (frame);
412
 
}
413
 
 
414
 
void
415
 
set_frames_scales (gpointer key,
416
 
                   gpointer value,
417
 
                   gpointer user_data)
418
 
{
419
 
    decor_frame_t *frame = (decor_frame_t *) value;
420
 
    gchar         *font_str = (gchar *) user_data;
421
 
 
422
 
    gwd_decor_frame_ref (frame);
423
 
 
424
 
    set_frame_scale (frame, font_str);
425
 
 
426
 
    gwd_decor_frame_unref (frame);
427
 
}
428
 
 
429
 
static void
430
 
titlebar_font_changed (GConfClient *client)
431
 
{
432
 
    gchar *str;
433
 
 
434
 
    str = gconf_client_get_string (client,
435
 
                                   COMPIZ_TITLEBAR_FONT_KEY,
436
 
                                   NULL);
437
 
    if (!str)
438
 
        str = g_strdup ("Sans Bold 12");
439
 
 
440
 
    if (settings->font)
441
 
    {
442
 
        g_free (settings->font);
443
 
        settings->font = g_strdup (str);
444
 
    }
445
 
 
446
 
    gwd_frames_foreach (set_frames_scales, (gpointer) settings->font);
447
 
 
448
 
    if (str)
449
 
        g_free (str);
450
 
}
451
 
 
452
 
static void
453
 
titlebar_click_action_changed (GConfClient *client,
454
 
                               const gchar *key,
455
 
                               int         *action_value,
456
 
                               int          default_value)
457
 
{
458
 
    gchar *action;
459
 
 
460
 
    *action_value = default_value;
461
 
 
462
 
    action = gconf_client_get_string (client, key, NULL);
463
 
    if (action)
464
 
    {
465
 
        if (strcmp (action, "toggle_shade") == 0)
466
 
            *action_value = CLICK_ACTION_SHADE;
467
 
        else if (strcmp (action, "toggle_maximize") == 0)
468
 
            *action_value = CLICK_ACTION_MAXIMIZE;
469
 
        else if (strcmp (action, "minimize") == 0)
470
 
            *action_value = CLICK_ACTION_MINIMIZE;
471
 
        else if (strcmp (action, "raise") == 0)
472
 
            *action_value = CLICK_ACTION_RAISE;
473
 
        else if (strcmp (action, "lower") == 0)
474
 
            *action_value = CLICK_ACTION_LOWER;
475
 
        else if (strcmp (action, "menu") == 0)
476
 
            *action_value = CLICK_ACTION_MENU;
477
 
        else if (strcmp (action, "none") == 0)
478
 
            *action_value = CLICK_ACTION_NONE;
479
 
 
480
 
        g_free (action);
481
 
    }
482
 
}
483
 
 
484
 
static void
485
 
wheel_action_changed (GConfClient *client)
486
 
{
487
 
    gchar *action;
488
 
 
489
 
    settings->wheel_action = WHEEL_ACTION_DEFAULT;
490
 
 
491
 
    action = gconf_client_get_string (client, WHEEL_ACTION_KEY, NULL);
492
 
    if (action)
493
 
    {
494
 
        if (strcmp (action, "shade") == 0)
495
 
            settings->wheel_action = WHEEL_ACTION_SHADE;
496
 
        else if (strcmp (action, "none") == 0)
497
 
            settings->wheel_action = WHEEL_ACTION_NONE;
498
 
 
499
 
        g_free (action);
500
 
    }
501
 
}
502
 
 
503
 
static void
504
 
value_changed (GConfClient *client,
505
 
               const gchar *key,
506
 
               GConfValue  *value,
507
 
               void        *data)
508
 
{
509
 
    gboolean changed = FALSE;
510
 
 
511
 
    if (strcmp (key, COMPIZ_USE_SYSTEM_FONT_KEY) == 0)
512
 
    {
513
 
        if (gconf_client_get_bool (client,
514
 
                                   COMPIZ_USE_SYSTEM_FONT_KEY,
515
 
                                   NULL) != settings->use_system_font)
516
 
        {
517
 
            settings->use_system_font = !settings->use_system_font;
518
 
            changed = TRUE;
519
 
        }
520
 
    }
521
 
    else if (strcmp (key, COMPIZ_TITLEBAR_FONT_KEY) == 0)
522
 
    {
523
 
        titlebar_font_changed (client);
524
 
        changed = !settings->use_system_font;
525
 
    }
526
 
    else if (strcmp (key, COMPIZ_DOUBLE_CLICK_TITLEBAR_KEY) == 0)
527
 
    {
528
 
        titlebar_click_action_changed (client, key,
529
 
                                       &settings->double_click_action,
530
 
                                       DOUBLE_CLICK_ACTION_DEFAULT);
531
 
    }
532
 
    else if (strcmp (key, COMPIZ_MIDDLE_CLICK_TITLEBAR_KEY) == 0)
533
 
    {
534
 
        titlebar_click_action_changed (client, key,
535
 
                                       &settings->middle_click_action,
536
 
                                       MIDDLE_CLICK_ACTION_DEFAULT);
537
 
    }
538
 
    else if (strcmp (key, COMPIZ_RIGHT_CLICK_TITLEBAR_KEY) == 0)
539
 
    {
540
 
        titlebar_click_action_changed (client, key,
541
 
                                       &settings->right_click_action,
542
 
                                       RIGHT_CLICK_ACTION_DEFAULT);
543
 
    }
544
 
    else if (strcmp (key, WHEEL_ACTION_KEY) == 0)
545
 
    {
546
 
        wheel_action_changed (client);
547
 
    }
548
 
    else if (strcmp (key, BLUR_TYPE_KEY) == 0)
549
 
    {
550
 
        if (blur_settings_changed (client))
551
 
            changed = TRUE;
552
 
    }
553
 
    else if (strcmp (key, USE_META_THEME_KEY) == 0 ||
554
 
             strcmp (key, META_THEME_KEY) == 0)
555
 
    {
556
 
        if (theme_changed (client))
557
 
            changed = TRUE;
558
 
    }
559
 
    else if (strcmp (key, META_BUTTON_LAYOUT_KEY) == 0)
560
 
    {
561
 
        if (button_layout_changed (client))
562
 
            changed = TRUE;
563
 
    }
564
 
    else if (strcmp (key, META_THEME_OPACITY_KEY)              == 0 ||
565
 
             strcmp (key, META_THEME_SHADE_OPACITY_KEY)        == 0 ||
566
 
             strcmp (key, META_THEME_ACTIVE_OPACITY_KEY)       == 0 ||
567
 
             strcmp (key, META_THEME_ACTIVE_SHADE_OPACITY_KEY) == 0)
568
 
    {
569
 
        if (theme_opacity_changed (client))
570
 
            changed = TRUE;
571
 
    }
572
 
    else if (strcmp (key, MUTTER_DRAGGABLE_BORDER_WIDTH_KEY) == 0)
573
 
    {
574
 
        if (mutter_draggable_border_width_changed (client))
575
 
            changed = TRUE;
576
 
    }
577
 
    else if (strcmp (key, MUTTER_ATTACH_MODAL_DIALOGS_KEY) == 0)
578
 
    {
579
 
        if (mutter_attach_modal_dialogs_changed (client))
580
 
            changed = TRUE;
581
 
    }
582
 
    else if (strcmp (key, USE_TOOLTIPS_KEY) == 0)
583
 
    {
584
 
        if (use_tooltips_changed (client))
585
 
            changed = TRUE;
586
 
    }
587
 
 
588
 
    if (changed)
589
 
        decorations_changed (data);
590
 
}
591
 
#endif
592
 
 
593
 
gboolean
594
 
init_settings (WnckScreen *screen)
595
 
{
596
 
#ifdef USE_GCONF
597
 
    GConfClient    *gconf;
598
 
 
599
 
    gconf = gconf_client_get_default ();
600
 
 
601
 
    gconf_client_add_dir (gconf,
602
 
                          GCONF_DIR,
603
 
                          GCONF_CLIENT_PRELOAD_ONELEVEL,
604
 
                          NULL);
605
 
 
606
 
    gconf_client_add_dir (gconf,
607
 
                          METACITY_GCONF_DIR,
608
 
                          GCONF_CLIENT_PRELOAD_ONELEVEL,
609
 
                          NULL);
610
 
 
611
 
    gconf_client_add_dir (gconf,
612
 
                          MUTTER_GCONF_DIR,
613
 
                          GCONF_CLIENT_PRELOAD_ONELEVEL,
614
 
                          NULL);
615
 
 
616
 
    g_signal_connect (G_OBJECT (gconf),
617
 
                      "value_changed",
618
 
                      G_CALLBACK (value_changed),
619
 
                      screen);
620
 
    settings->use_system_font = gconf_client_get_bool (gconf,
621
 
                                                       COMPIZ_USE_SYSTEM_FONT_KEY,
622
 
                                                       NULL);
623
 
    theme_changed (gconf);
624
 
    theme_opacity_changed (gconf);
625
 
    button_layout_changed (gconf);
626
 
    titlebar_font_changed (gconf);
627
 
 
628
 
    titlebar_click_action_changed (gconf,
629
 
                                   COMPIZ_DOUBLE_CLICK_TITLEBAR_KEY,
630
 
                                   &settings->double_click_action,
631
 
                                   DOUBLE_CLICK_ACTION_DEFAULT);
632
 
    titlebar_click_action_changed (gconf,
633
 
                                   COMPIZ_MIDDLE_CLICK_TITLEBAR_KEY,
634
 
                                   &settings->middle_click_action,
635
 
                                   MIDDLE_CLICK_ACTION_DEFAULT);
636
 
    titlebar_click_action_changed (gconf,
637
 
                                   COMPIZ_RIGHT_CLICK_TITLEBAR_KEY,
638
 
                                   &settings->right_click_action,
639
 
                                   RIGHT_CLICK_ACTION_DEFAULT);
640
 
    wheel_action_changed (gconf);
641
 
    blur_settings_changed (gconf);
642
 
 
643
 
    mutter_draggable_border_width_changed (gconf);
644
 
    mutter_attach_modal_dialogs_changed (gconf);
645
 
    use_tooltips_changed (gconf);
646
 
 
647
 
    g_object_unref (gconf);
648
 
#endif
649
 
 
650
 
    shadow_property_changed (screen);
651
 
 
652
 
    return TRUE;
653
 
}