diff --git a/libmetacity/meta-style-info.c b/libmetacity/meta-style-info.c index 30ab68715..f1558907d 100644 --- a/libmetacity/meta-style-info.c +++ b/libmetacity/meta-style-info.c @@ -164,7 +164,7 @@ meta_style_info_constructed (GObject *object) NULL, "window", GTK_STYLE_CLASS_BACKGROUND, - style_info->composited == TRUE ? "ssd" : "solid-csd", + style_info->composited == TRUE ? "csd" : "solid-csd", NULL); style_info->styles[META_STYLE_ELEMENT_DECORATION] = diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index 11a1ca995..963aa1f79 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -38,6 +38,7 @@ #include "screen.h" #include "frame.h" #include "errors.h" +#include "prefs.h" #include "window.h" #include "compositor-private.h" #include "compositor-xrender.h" @@ -1037,22 +1038,38 @@ window_has_shadow (MetaCompWindow *cw) if (info == NULL || info->have_shadows == FALSE) return FALSE; - /* Always put a shadow around windows with a frame - This should override - the restriction about not putting a shadow around shaped windows - as the frame might be the reason the window is shaped */ + /* Always put a shadow around windows with a frame. This should override + * the restriction about not putting a shadow around shaped windows as the + * frame might be the reason the window is shaped. + */ if (cw->window) { - /* Do not add shadows for maximized windows */ + /* Do not add shadows to fullscreen windows */ + if (meta_window_is_fullscreen (cw->window)) + { + meta_verbose ("Window has no shadow because it is fullscreen\n"); + return FALSE; + } + + /* Do not add shadows to maximized windows */ if (meta_window_is_maximized (cw->window)) { meta_verbose ("Window has no shadow because it is maximized\n"); return FALSE; } - if (meta_window_get_frame (cw->window)) { - meta_verbose ("Window has shadow because it has a frame\n"); - return TRUE; - } + /* Do not add shadows if GTK+ theme is used */ + if (meta_prefs_get_theme_type () == META_THEME_TYPE_GTK) + { + meta_verbose ("Window has shadow from GTK+ theme\n"); + return FALSE; + } + + if (meta_window_get_frame (cw->window)) + { + meta_verbose ("Window has shadow because it has a frame\n"); + return TRUE; + } } /* Do not add shadows to ARGB windows */ @@ -2995,6 +3012,38 @@ xrender_remove_window (MetaCompositor *compositor, { } +static void +update_shadows (MetaPreference pref, + gpointer data) +{ + MetaCompScreen *info; + MetaDisplay *display; + Display *xdisplay; + GList *index; + + if (pref != META_PREF_THEME_TYPE) + return; + + info = (MetaCompScreen *) data; + display = meta_screen_get_display (info->screen); + xdisplay = meta_display_get_xdisplay (display); + + for (index = info->windows; index; index = index->next) + { + MetaCompWindow *cw; + + cw = (MetaCompWindow *) index->data; + + if (cw->window && cw->shadow) + { + XRenderFreePicture (xdisplay, cw->shadow); + cw->shadow = None; + } + + cw->needs_shadow = window_has_shadow (cw); + } +} + static void show_overlay_window (MetaScreen *screen, Window cow) @@ -3123,6 +3172,8 @@ xrender_manage_screen (MetaCompositor *compositor, /* Now we're up and running we can show the output if needed */ show_overlay_window (screen, info->output); + + meta_prefs_add_listener (update_shadows, info); } static void @@ -3141,6 +3192,8 @@ xrender_unmanage_screen (MetaCompositor *compositor, if (info == NULL) return; + meta_prefs_remove_listener (update_shadows, info); + hide_overlay_window (screen, info->output); /* Destroy the windows */ diff --git a/src/core/window.c b/src/core/window.c index d6d3d416f..499e36238 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8667,6 +8667,12 @@ meta_window_get_transient_for (MetaWindow *window) return NULL; } +gboolean +meta_window_is_fullscreen (MetaWindow *window) +{ + return window->fullscreen; +} + gboolean meta_window_is_maximized (MetaWindow *window) { diff --git a/src/include/window.h b/src/include/window.h index 6e81829df..f82c444a6 100644 --- a/src/include/window.h +++ b/src/include/window.h @@ -34,6 +34,7 @@ MetaScreen *meta_window_get_screen (MetaWindow *window); MetaDisplay *meta_window_get_display (MetaWindow *window); Window meta_window_get_xwindow (MetaWindow *window); MetaWindow *meta_window_get_transient_for (MetaWindow *window); +gboolean meta_window_is_fullscreen (MetaWindow *window); gboolean meta_window_is_maximized (MetaWindow *window); cairo_region_t *meta_window_get_frame_bounds (MetaWindow *window);