diff options
author | Sam Spilsbury <sam.spilsbury@canonical.com> | 2011-02-19 00:31:55 +0800 |
---|---|---|
committer | Sam Spilsbury <sam.spilsbury@canonical.com> | 2011-02-19 00:31:55 +0800 |
commit | 14bd863ea1cefe28de156dcf15f71a2a93c42219 (patch) | |
tree | 0418e325191b9070eda87c979c9a6d6be782bac8 | |
parent | e0bf309cbb81e1797d26cc29246fdbd1d9713e78 (diff) | |
download | compiz-with-glib-mainloop-14bd863ea1cefe28de156dcf15f71a2a93c42219.tar.gz compiz-with-glib-mainloop-14bd863ea1cefe28de156dcf15f71a2a93c42219.tar.bz2 |
Store settings data in its own struct
Prevents namespace issues and makes it more clear where to access this
data.
-rw-r--r-- | gtk/window-decorator/blurprops.c | 6 | ||||
-rw-r--r-- | gtk/window-decorator/cairo.c | 4 | ||||
-rw-r--r-- | gtk/window-decorator/decorator.c | 22 | ||||
-rw-r--r-- | gtk/window-decorator/events.c | 12 | ||||
-rw-r--r-- | gtk/window-decorator/frames.c | 10 | ||||
-rw-r--r-- | gtk/window-decorator/gtk-window-decorator.c | 64 | ||||
-rw-r--r-- | gtk/window-decorator/gtk-window-decorator.h | 52 | ||||
-rw-r--r-- | gtk/window-decorator/metacity.c | 36 | ||||
-rw-r--r-- | gtk/window-decorator/settings.c | 82 |
9 files changed, 149 insertions, 139 deletions
diff --git a/gtk/window-decorator/blurprops.c b/gtk/window-decorator/blurprops.c index d30979b..6ca3b47 100644 --- a/gtk/window-decorator/blurprops.c +++ b/gtk/window-decorator/blurprops.c @@ -17,13 +17,13 @@ decor_update_blur_property (decor_t *d, long *data = NULL; int size = 0; - if (blur_type != BLUR_TYPE_ALL) + if (settings->blur_type != BLUR_TYPE_ALL) { bottom_region = NULL; left_region = NULL; right_region = NULL; - if (blur_type != BLUR_TYPE_TITLEBAR) + if (settings->blur_type != BLUR_TYPE_TITLEBAR) top_region = NULL; } @@ -65,4 +65,4 @@ decor_update_blur_property (decor_t *d, gdk_display_sync (gdk_display_get_default ()); gdk_error_trap_pop (); } -}
\ No newline at end of file +} diff --git a/gtk/window-decorator/cairo.c b/gtk/window-decorator/cairo.c index 27c2790..c267253 100644 --- a/gtk/window-decorator/cairo.c +++ b/gtk/window-decorator/cairo.c @@ -329,7 +329,7 @@ draw_window_decoration (decor_t *d) { decor_color_t *title_color = _title_color; - alpha = decoration_alpha + 0.3; + alpha = settings->decoration_alpha + 0.3; fill_rounded_rectangle (cr, x1 + 0.5, @@ -361,7 +361,7 @@ draw_window_decoration (decor_t *d) } else { - alpha = decoration_alpha; + alpha = settings->decoration_alpha; fill_rounded_rectangle (cr, x1 + 0.5, diff --git a/gtk/window-decorator/decorator.c b/gtk/window-decorator/decorator.c index a6db744..efb2e20 100644 --- a/gtk/window-decorator/decorator.c +++ b/gtk/window-decorator/decorator.c @@ -82,7 +82,7 @@ destroy_bare_frame (decor_frame_t *frame) static const PangoFontDescription * get_titlebar_font (decor_frame_t *frame) { - if (use_system_font) + if (settings->use_system_font) return NULL; else return frame->titlebar_font; @@ -549,13 +549,15 @@ draw_border_shape (Display *xdisplay, colormap = get_colormap_for_drawable (GDK_DRAWABLE (d.pixmap)); gdk_drawable_set_colormap (d.pixmap, colormap); - /* create shadow from opaque decoration */ - save_decoration_alpha = decoration_alpha; - decoration_alpha = 1.0; + /* create shadow from opaque decoration + * FIXME: Should not modify settings value + * like this */ + save_decoration_alpha = settings->decoration_alpha; + settings->decoration_alpha = 1.0; (*d.draw) (&d); - decoration_alpha = save_decoration_alpha; + settings->decoration_alpha = save_decoration_alpha; XRenderFillRectangle (xdisplay, PictOpSrc, picture, &white, c->left_space, @@ -803,13 +805,13 @@ update_shadow (void) if (!opts) return 0; - opt_shadow.shadow_radius = shadow_radius; - opt_shadow.shadow_opacity = shadow_opacity; + opt_shadow.shadow_radius = settings->shadow_radius; + opt_shadow.shadow_opacity = settings->shadow_opacity; - memcpy (opt_shadow.shadow_color, shadow_color, sizeof (shadow_color)); + memcpy (opt_shadow.shadow_color, settings->shadow_color, sizeof (settings->shadow_color)); - opt_shadow.shadow_offset_x = shadow_offset_x; - opt_shadow.shadow_offset_y = shadow_offset_y; + opt_shadow.shadow_offset_x = settings->shadow_offset_x; + opt_shadow.shadow_offset_y = settings->shadow_offset_y; opt_no_shadow.shadow_radius = 0; opt_no_shadow.shadow_opacity = 0; diff --git a/gtk/window-decorator/events.c b/gtk/window-decorator/events.c index 1faec8b..57f9a21 100644 --- a/gtk/window-decorator/events.c +++ b/gtk/window-decorator/events.c @@ -387,7 +387,7 @@ void handle_mouse_wheel_title_event (WnckWindow *win, unsigned int button) { - switch (wheel_action) { + switch (settings->wheel_action) { case WHEEL_ACTION_SHADE: if (button == 4) { @@ -436,7 +436,7 @@ title_event (WnckWindow *win, dist (gtkwd_event->x, gtkwd_event->y, last_button_x, last_button_y) < DOUBLE_CLICK_DISTANCE) { - handle_title_button_event (win, double_click_action, + handle_title_button_event (win, settings->double_click_action, gtkwd_event); last_button_num = 0; @@ -460,12 +460,12 @@ title_event (WnckWindow *win, } else if (gtkwd_event->button == 2) { - handle_title_button_event (win, middle_click_action, + handle_title_button_event (win, settings->middle_click_action, gtkwd_event); } else if (gtkwd_event->button == 3) { - handle_title_button_event (win, right_click_action, + handle_title_button_event (win, settings->right_click_action, gtkwd_event); } else if (gtkwd_event->button == 4 || @@ -534,11 +534,11 @@ frame_common_event (WnckWindow *win, restack_window (win, Above); break; case 2: - handle_title_button_event (win, middle_click_action, + handle_title_button_event (win, settings->middle_click_action, gtkwd_event); break; case 3: - handle_title_button_event (win, right_click_action, + handle_title_button_event (win, settings->right_click_action, gtkwd_event); break; } diff --git a/gtk/window-decorator/frames.c b/gtk/window-decorator/frames.c index dc93b8c..2c188f9 100644 --- a/gtk/window-decorator/frames.c +++ b/gtk/window-decorator/frames.c @@ -46,13 +46,13 @@ decor_frame_refresh (decor_frame_t *frame) strcmp (frame->type, "switcher")) (*theme_update_border_extents) (frame); - opt_shadow.shadow_radius = shadow_radius; - opt_shadow.shadow_opacity = shadow_opacity; + opt_shadow.shadow_radius = settings->shadow_radius; + opt_shadow.shadow_opacity = settings->shadow_opacity; - memcpy (opt_shadow.shadow_color, shadow_color, sizeof (shadow_color)); + memcpy (opt_shadow.shadow_color, settings->shadow_color, sizeof (settings->shadow_color)); - opt_shadow.shadow_offset_x = shadow_offset_x; - opt_shadow.shadow_offset_y = shadow_offset_y; + opt_shadow.shadow_offset_x = settings->shadow_offset_x; + opt_shadow.shadow_offset_y = settings->shadow_offset_y; opt_no_shadow.shadow_radius = 0; opt_no_shadow.shadow_opacity = 0; diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c index af69a74..a45487d 100644 --- a/gtk/window-decorator/gtk-window-decorator.c +++ b/gtk/window-decorator/gtk-window-decorator.c @@ -23,24 +23,10 @@ gboolean minimal = FALSE; -double decoration_alpha = 0.5; - #define SWITCHER_SPACE 40 decor_frame_t decor_frames[NUM_DECOR_FRAMES]; - - -gdouble shadow_radius = SHADOW_RADIUS; -gdouble shadow_opacity = SHADOW_OPACITY; -gushort shadow_color[3] = { - SHADOW_COLOR_RED, - SHADOW_COLOR_GREEN, - SHADOW_COLOR_BLUE -}; -gint shadow_offset_x = SHADOW_OFFSET_X; -gint shadow_offset_y = SHADOW_OFFSET_Y; - guint cmdline_options = 0; GdkPixmap *decor_normal_pixmap = NULL; @@ -112,16 +98,14 @@ gint tooltip_timer_tag = 0; GSList *draw_list = NULL; guint draw_idle_id = 0; -gboolean use_system_font = FALSE; - -gint blur_type = BLUR_TYPE_NONE; - Window switcher_selected_window = None; decor_t *switcher_window = NULL; XRenderPictFormat *xformat_rgba; XRenderPictFormat *xformat_rgb; +decor_settings_t *settings; + int main (int argc, char *argv[]) { @@ -141,12 +125,40 @@ main (int argc, char *argv[]) program_name = argv[0]; + settings = malloc (sizeof (decor_settings_t)); + + if (!settings) + return 1; + gtk_init (&argc, &argv); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); + settings->blur_type = BLUR_TYPE_NONE; + settings->use_system_font = FALSE; + + settings->shadow_radius = SHADOW_RADIUS; + settings->shadow_opacity = SHADOW_OPACITY; + settings->shadow_color[0] = SHADOW_COLOR_RED; + settings->shadow_color[1] = SHADOW_COLOR_GREEN; + settings->shadow_color[2] = SHADOW_COLOR_BLUE; + settings->shadow_offset_x = SHADOW_OFFSET_X; + settings->shadow_offset_y = SHADOW_OFFSET_Y; + settings->decoration_alpha = 0.5; + +#ifdef USE_METACITY + + settings->meta_opacity = META_OPACITY; + settings->meta_shade_opacity = META_SHADE_OPACITY; + settings->meta_active_opacity = META_ACTIVE_OPACITY; + settings->meta_active_shade_opacity = META_ACTIVE_SHADE_OPACITY; + + settings->meta_button_layout_set = FALSE; +#endif + + for (i = 0; i < argc; i++) { if (strcmp (argv[i], "--minimal") == 0) @@ -162,9 +174,9 @@ main (int argc, char *argv[]) if (argc > ++i) { if (strcmp (argv[i], "titlebar") == 0) - blur_type = BLUR_TYPE_TITLEBAR; + settings->blur_type = BLUR_TYPE_TITLEBAR; else if (strcmp (argv[i], "all") == 0) - blur_type = BLUR_TYPE_ALL; + settings->blur_type = BLUR_TYPE_ALL; } cmdline_options |= CMDLINE_BLUR; } @@ -173,23 +185,23 @@ main (int argc, char *argv[]) else if (strcmp (argv[i], "--opacity") == 0) { if (argc > ++i) - meta_opacity = atof (argv[i]); + settings->meta_opacity = atof (argv[i]); cmdline_options |= CMDLINE_OPACITY; } else if (strcmp (argv[i], "--no-opacity-shade") == 0) { - meta_shade_opacity = FALSE; + settings->meta_shade_opacity = FALSE; cmdline_options |= CMDLINE_OPACITY_SHADE; } else if (strcmp (argv[i], "--active-opacity") == 0) { if (argc > ++i) - meta_active_opacity = atof (argv[i]); + settings->meta_active_opacity = atof (argv[i]); cmdline_options |= CMDLINE_ACTIVE_OPACITY; } else if (strcmp (argv[i], "--no-active-opacity-shade") == 0) { - meta_active_shade_opacity = FALSE; + settings->meta_active_shade_opacity = FALSE; cmdline_options |= CMDLINE_ACTIVE_OPACITY_SHADE; } else if (strcmp (argv[i], "--metacity-theme") == 0) @@ -320,6 +332,7 @@ main (int argc, char *argv[]) if (!create_tooltip_window ()) { + free (settings); fprintf (stderr, "%s, Couldn't create tooltip window\n", argv[0]); return 1; } @@ -369,6 +382,7 @@ main (int argc, char *argv[]) if (!init_settings (screen)) { + free (settings); fprintf (stderr, "%s: Failed to get necessary gtk settings\n", argv[0]); return 1; } @@ -381,5 +395,7 @@ main (int argc, char *argv[]) gtk_main (); + free (settings); + return 0; } diff --git a/gtk/window-decorator/gtk-window-decorator.h b/gtk/window-decorator/gtk-window-decorator.h index 903052d..200ffbb 100644 --- a/gtk/window-decorator/gtk-window-decorator.h +++ b/gtk/window-decorator/gtk-window-decorator.h @@ -210,36 +210,40 @@ enum { WHEEL_ACTION_SHADE }; +typedef struct _decor_settings { + int double_click_action; + int middle_click_action; + int right_click_action; + int wheel_action; + gdouble shadow_radius; + gdouble shadow_opacity; + gushort shadow_color[3]; + gint shadow_offset_x; + gint shadow_offset_y; +#ifdef USE_METACITY + double meta_opacity; + gboolean meta_shade_opacity; + double meta_active_opacity; + gboolean meta_active_shade_opacity; + + gboolean meta_button_layout_set; + MetaButtonLayout meta_button_layout; +#endif + double decoration_alpha; + gboolean use_system_font; + gint blur_type; +} decor_settings_t; + #define DOUBLE_CLICK_ACTION_DEFAULT CLICK_ACTION_MAXIMIZE #define MIDDLE_CLICK_ACTION_DEFAULT CLICK_ACTION_LOWER #define RIGHT_CLICK_ACTION_DEFAULT CLICK_ACTION_MENU #define WHEEL_ACTION_DEFAULT WHEEL_ACTION_NONE -int double_click_action; -int middle_click_action; -int right_click_action; -int wheel_action; - extern gboolean minimal; -extern double decoration_alpha; - -#define SWITCHER_SPACE 40 +extern decor_settings_t *settings; -extern gdouble shadow_radius; -extern gdouble shadow_opacity; -extern gushort shadow_color[3]; -extern gint shadow_offset_x; -extern gint shadow_offset_y; -#ifdef USE_METACITY -extern double meta_opacity; -extern gboolean meta_shade_opacity; -extern double meta_active_opacity; -extern gboolean meta_active_shade_opacity; - -extern gboolean meta_button_layout_set; -extern MetaButtonLayout meta_button_layout; -#endif +#define SWITCHER_SPACE 40 extern guint cmdline_options; @@ -475,14 +479,10 @@ extern gint tooltip_timer_tag; extern GSList *draw_list; extern guint draw_idle_id; -extern gboolean use_system_font; - #define BLUR_TYPE_NONE 0 #define BLUR_TYPE_TITLEBAR 1 #define BLUR_TYPE_ALL 2 -extern gint blur_type; - /* switcher */ extern Window switcher_selected_window; extern GtkWidget *switcher_label; diff --git a/gtk/window-decorator/metacity.c b/gtk/window-decorator/metacity.c index 1e9e451..f9bc0f2 100644 --- a/gtk/window-decorator/metacity.c +++ b/gtk/window-decorator/metacity.c @@ -2,14 +2,6 @@ #ifdef USE_METACITY -double meta_opacity = META_OPACITY; -gboolean meta_shade_opacity = META_SHADE_OPACITY; -double meta_active_opacity = META_ACTIVE_OPACITY; -gboolean meta_active_shade_opacity = META_ACTIVE_SHADE_OPACITY; - -gboolean meta_button_layout_set = FALSE; -MetaButtonLayout meta_button_layout; - static void decor_update_meta_window_property (decor_t *d, MetaTheme *theme, @@ -347,22 +339,22 @@ meta_button_state_for_button_type (decor_t *d, { switch (type) { case META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND: - type = meta_function_to_type (meta_button_layout.left_buttons[0]); + type = meta_function_to_type (settings->meta_button_layout.left_buttons[0]); break; case META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND: - type = meta_function_to_type (meta_button_layout.left_buttons[1]); + type = meta_function_to_type (settings->meta_button_layout.left_buttons[1]); break; case META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND: - type = meta_function_to_type (meta_button_layout.left_buttons[2]); + type = meta_function_to_type (settings->meta_button_layout.left_buttons[2]); break; case META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND: - type = meta_function_to_type (meta_button_layout.right_buttons[0]); + type = meta_function_to_type (settings->meta_button_layout.right_buttons[0]); break; case META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND: - type = meta_function_to_type (meta_button_layout.right_buttons[1]); + type = meta_function_to_type (settings->meta_button_layout.right_buttons[1]); break; case META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND: - type = meta_function_to_type (meta_button_layout.right_buttons[2]); + type = meta_function_to_type (settings->meta_button_layout.right_buttons[2]); default: break; } @@ -413,9 +405,9 @@ meta_get_decoration_geometry (decor_t *d, if (!(frame_type < META_FRAME_TYPE_LAST)) frame_type = META_FRAME_TYPE_NORMAL; - if (meta_button_layout_set) + if (settings->meta_button_layout_set) { - *button_layout = meta_button_layout; + *button_layout = settings->meta_button_layout; } else { @@ -524,7 +516,7 @@ meta_draw_window_decoration (decor_t *d) GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); GdkPixmap *pixmap; Picture src; - MetaButtonState button_states[META_BUTTON_TYPE_LAST]; + MetaButtonState button_states [META_BUTTON_TYPE_LAST]; MetaButtonLayout button_layout; MetaFrameGeometry fgeom; MetaFrameFlags flags; @@ -539,9 +531,9 @@ meta_draw_window_decoration (decor_t *d) Region bottom_region = NULL; Region left_region = NULL; Region right_region = NULL; - double alpha = (d->active) ? meta_active_opacity : meta_opacity; - gboolean shade_alpha = (d->active) ? meta_active_shade_opacity : - meta_shade_opacity; + double alpha = (d->active) ? settings->meta_active_opacity : settings->meta_opacity; + gboolean shade_alpha = (d->active) ? settings->meta_active_shade_opacity : + settings->meta_shade_opacity; MetaFrameStyle *frame_style; GtkWidget *style_window; GdkColor bg_color; @@ -559,7 +551,7 @@ meta_draw_window_decoration (decor_t *d) gdk_drawable_set_colormap (GDK_DRAWABLE (d->buffer_pixmap), cmap); } - if (decoration_alpha == 1.0) + if (settings->decoration_alpha == 1.0) alpha = 1.0; if (gdk_drawable_get_depth (GDK_DRAWABLE (d->pixmap)) == 32) @@ -1562,7 +1554,7 @@ meta_update_button_layout (const char *value) new_layout = rtl_layout; } - meta_button_layout = new_layout; + settings->meta_button_layout = new_layout; } void diff --git a/gtk/window-decorator/settings.c b/gtk/window-decorator/settings.c index 617f30f..57ea766 100644 --- a/gtk/window-decorator/settings.c +++ b/gtk/window-decorator/settings.c @@ -39,15 +39,15 @@ shadow_property_changed (WnckScreen *s) radius /= 1000; opacity /= 1000; - changed = radius != shadow_radius || - opacity != shadow_opacity || - x_off != shadow_offset_x || - y_off != shadow_offset_y; - - shadow_radius = (gdouble) MAX (0.0, MIN (radius, 48.0)); - shadow_opacity = (gdouble) MAX (0.0, MIN (opacity, 6.0)); - shadow_offset_x = (gint) MAX (-16, MIN (x_off, 16)); - shadow_offset_y = (gint) MAX (-16, MIN (y_off, 16)); + changed = radius != settings->shadow_radius || + opacity != settings->shadow_opacity || + x_off != settings->shadow_offset_x || + y_off != settings->shadow_offset_y; + + settings->shadow_radius = (gdouble) MAX (0.0, MIN (radius, 48.0)); + settings->shadow_opacity = (gdouble) MAX (0.0, MIN (opacity, 6.0)); + settings->shadow_offset_x = (gint) MAX (-16, MIN (x_off, 16)); + settings->shadow_offset_y = (gint) MAX (-16, MIN (y_off, 16)); } XFree (prop_data); @@ -69,9 +69,9 @@ shadow_property_changed (WnckScreen *s) if (sscanf (t_data[0], "#%2x%2x%2x%2x", &c[0], &c[1], &c[2], &c[3]) == 4) { - shadow_color[0] = c[0] << 8 | c[0]; - shadow_color[1] = c[1] << 8 | c[1]; - shadow_color[2] = c[2] << 8 | c[2]; + settings->shadow_color[0] = c[0] << 8 | c[0]; + settings->shadow_color[1] = c[1] << 8 | c[1]; + settings->shadow_color[2] = c[2] << 8 | c[2]; changed = TRUE; } } @@ -90,7 +90,7 @@ static gboolean blur_settings_changed (GConfClient *client) { gchar *type; - int new_type = blur_type; + int new_type = settings->blur_type; if (cmdline_options & CMDLINE_BLUR) return FALSE; @@ -111,9 +111,9 @@ blur_settings_changed (GConfClient *client) g_free (type); } - if (new_type != blur_type) + if (new_type != settings->blur_type) { - blur_type = new_type; + settings->blur_type = new_type; return TRUE; } @@ -202,9 +202,9 @@ theme_opacity_changed (GConfClient *client) NULL); if (!(cmdline_options & CMDLINE_OPACITY) && - opacity != meta_opacity) + opacity != settings->meta_opacity) { - meta_opacity = opacity; + settings->meta_opacity = opacity; changed = TRUE; } @@ -215,9 +215,9 @@ theme_opacity_changed (GConfClient *client) NULL); if (!(cmdline_options & CMDLINE_OPACITY_SHADE) && - shade_opacity != meta_shade_opacity) + shade_opacity != settings->meta_shade_opacity) { - meta_shade_opacity = shade_opacity; + settings->meta_shade_opacity = shade_opacity; changed = TRUE; } } @@ -227,9 +227,9 @@ theme_opacity_changed (GConfClient *client) NULL); if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY) && - opacity != meta_active_opacity) + opacity != settings->meta_active_opacity) { - meta_active_opacity = opacity; + settings->meta_active_opacity = opacity; changed = TRUE; } @@ -241,9 +241,9 @@ theme_opacity_changed (GConfClient *client) NULL); if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY_SHADE) && - shade_opacity != meta_active_shade_opacity) + shade_opacity != settings->meta_active_shade_opacity) { - meta_active_shade_opacity = shade_opacity; + settings->meta_active_shade_opacity = shade_opacity; changed = TRUE; } } @@ -270,16 +270,16 @@ button_layout_changed (GConfClient *client) { meta_update_button_layout (button_layout); - meta_button_layout_set = TRUE; + settings->meta_button_layout_set = TRUE; g_free (button_layout); return TRUE; } - if (meta_button_layout_set) + if (settings->meta_button_layout_set) { - meta_button_layout_set = FALSE; + settings->meta_button_layout_set = FALSE; return TRUE; } #endif @@ -376,15 +376,15 @@ wheel_action_changed (GConfClient *client) { gchar *action; - wheel_action = WHEEL_ACTION_DEFAULT; + settings->wheel_action = WHEEL_ACTION_DEFAULT; action = gconf_client_get_string (client, WHEEL_ACTION_KEY, NULL); if (action) { if (strcmp (action, "shade") == 0) - wheel_action = WHEEL_ACTION_SHADE; + settings->wheel_action = WHEEL_ACTION_SHADE; else if (strcmp (action, "none") == 0) - wheel_action = WHEEL_ACTION_NONE; + settings->wheel_action = WHEEL_ACTION_NONE; g_free (action); } @@ -402,33 +402,33 @@ value_changed (GConfClient *client, { if (gconf_client_get_bool (client, COMPIZ_USE_SYSTEM_FONT_KEY, - NULL) != use_system_font) + NULL) != settings->use_system_font) { - use_system_font = !use_system_font; + settings->use_system_font = !settings->use_system_font; changed = TRUE; } } else if (strcmp (key, COMPIZ_TITLEBAR_FONT_KEY) == 0) { titlebar_font_changed (client); - changed = !use_system_font; + changed = !settings->use_system_font; } else if (strcmp (key, COMPIZ_DOUBLE_CLICK_TITLEBAR_KEY) == 0) { titlebar_click_action_changed (client, key, - &double_click_action, + &settings->double_click_action, DOUBLE_CLICK_ACTION_DEFAULT); } else if (strcmp (key, COMPIZ_MIDDLE_CLICK_TITLEBAR_KEY) == 0) { titlebar_click_action_changed (client, key, - &middle_click_action, + &settings->middle_click_action, MIDDLE_CLICK_ACTION_DEFAULT); } else if (strcmp (key, COMPIZ_RIGHT_CLICK_TITLEBAR_KEY) == 0) { titlebar_click_action_changed (client, key, - &right_click_action, + &settings->right_click_action, RIGHT_CLICK_ACTION_DEFAULT); } else if (strcmp (key, WHEEL_ACTION_KEY) == 0) @@ -498,9 +498,9 @@ init_settings (WnckScreen *screen) gtk_container_add (GTK_CONTAINER (switcher_frame->style_window_rgba), switcher_label); #ifdef USE_GCONF - use_system_font = gconf_client_get_bool (gconf, - COMPIZ_USE_SYSTEM_FONT_KEY, - NULL); + settings->use_system_font = gconf_client_get_bool (gconf, + COMPIZ_USE_SYSTEM_FONT_KEY, + NULL); theme_changed (gconf); theme_opacity_changed (gconf); button_layout_changed (gconf); @@ -516,15 +516,15 @@ init_settings (WnckScreen *screen) #ifdef USE_GCONF titlebar_click_action_changed (gconf, COMPIZ_DOUBLE_CLICK_TITLEBAR_KEY, - &double_click_action, + &settings->double_click_action, DOUBLE_CLICK_ACTION_DEFAULT); titlebar_click_action_changed (gconf, COMPIZ_MIDDLE_CLICK_TITLEBAR_KEY, - &middle_click_action, + &settings->middle_click_action, MIDDLE_CLICK_ACTION_DEFAULT); titlebar_click_action_changed (gconf, COMPIZ_RIGHT_CLICK_TITLEBAR_KEY, - &right_click_action, + &settings->right_click_action, RIGHT_CLICK_ACTION_DEFAULT); wheel_action_changed (gconf); blur_settings_changed (gconf); |