summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-08-31 17:55:14 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-08-31 17:55:14 +0300
commitd7f2445ec7e70274c7501586a537c699f6628335 (patch)
tree52fb51ec06ff1bfcb81630bb233a23a83503c0d2
parent86cf1dfd319d1cde39ece975719fdc7396204f90 (diff)
downloadmetacity-d7f2445ec7e70274c7501586a537c699f6628335.tar.gz
libmetacity: switch from .ssd to .csd
-rw-r--r--libmetacity/meta-style-info.c2
-rw-r--r--src/compositor/compositor-xrender.c69
-rw-r--r--src/core/window.c6
-rw-r--r--src/include/window.h1
4 files changed, 69 insertions, 9 deletions
diff --git a/libmetacity/meta-style-info.c b/libmetacity/meta-style-info.c
index 30ab6871..f1558907 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 11a1ca99..963aa1f7 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 */
@@ -2996,6 +3013,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 d6d3d416..499e3623 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8668,6 +8668,12 @@ meta_window_get_transient_for (MetaWindow *window)
}
gboolean
+meta_window_is_fullscreen (MetaWindow *window)
+{
+ return window->fullscreen;
+}
+
+gboolean
meta_window_is_maximized (MetaWindow *window)
{
return META_WINDOW_MAXIMIZED (window);
diff --git a/src/include/window.h b/src/include/window.h
index 6e81829d..f82c444a 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);