summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-12-09 22:43:16 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-12-09 22:43:16 +0800
commit843a4b2be86ccc8aa5f0d71c4cc3a8d9ae81bbfd (patch)
tree478d556e63a681e95e83ab071ff72e5cda1b980c /src
parent436013c17fefb1555585337098ac1618da5e212d (diff)
downloadunity-window-decorator-843a4b2be86ccc8aa5f0d71c4cc3a8d9ae81bbfd.tar.gz
unity-window-decorator-843a4b2be86ccc8aa5f0d71c4cc3a8d9ae81bbfd.tar.bz2
Fix not reading gconf properties and generate inactive shadows
Diffstat (limited to 'src')
-rw-r--r--src/config.h.gtk.in2
-rw-r--r--src/decorator.c50
-rw-r--r--src/gtk-window-decorator.h4
-rw-r--r--src/settings.c20
4 files changed, 63 insertions, 13 deletions
diff --git a/src/config.h.gtk.in b/src/config.h.gtk.in
index a9f34aa..24eed74 100644
--- a/src/config.h.gtk.in
+++ b/src/config.h.gtk.in
@@ -2,7 +2,7 @@
#cmakedefine USE_METACITY 1
/* Define to 1 if Gconf support is enabled */
-#cmakedefine USE_GCONF_GTK_WINDOW_DECORATOR 1
+#cmakedefine USE_GCONF_UNITY_WINDOW_DECORATOR 1
/* Define to 1 if you have the `wnck_window_has_name' function. */
#cmakedefine HAVE_WNCK_WINDOW_HAS_NAME 1
diff --git a/src/decorator.c b/src/decorator.c
index 9c08472..79dbee3 100644
--- a/src/decorator.c
+++ b/src/decorator.c
@@ -533,6 +533,32 @@ update_shadow (void)
draw_border_shape,
0);
+ if (border_inactive_shadow)
+ {
+ decor_shadow_destroy (xdisplay, border_inactive_shadow);
+ border_inactive_shadow = NULL;
+ }
+
+ border_inactive_shadow = decor_shadow_create (xdisplay,
+ gdk_x11_screen_get_xscreen (screen),
+ 1, 1,
+ _win_extents.left,
+ _win_extents.right,
+ _win_extents.top + titlebar_height,
+ _win_extents.bottom,
+ _win_extents.left -
+ TRANSLUCENT_CORNER_SIZE,
+ _win_extents.right -
+ TRANSLUCENT_CORNER_SIZE,
+ _win_extents.top + titlebar_height -
+ TRANSLUCENT_CORNER_SIZE,
+ _win_extents.bottom -
+ TRANSLUCENT_CORNER_SIZE,
+ &opt_shadow,
+ &window_context,
+ draw_border_shape,
+ 0);
+
if (border_no_shadow)
{
decor_shadow_destroy (xdisplay, border_no_shadow);
@@ -586,6 +612,30 @@ update_shadow (void)
draw_border_shape,
(void *) 1);
+ if (max_border_inactive_shadow)
+ {
+ decor_shadow_destroy (xdisplay, max_border_inactive_shadow);
+ max_border_inactive_shadow = NULL;
+ }
+
+ max_border_inactive_shadow =
+ decor_shadow_create (xdisplay,
+ gdk_x11_screen_get_xscreen (screen),
+ 1, 1,
+ _max_win_extents.left,
+ _max_win_extents.right,
+ _max_win_extents.top + max_titlebar_height,
+ _max_win_extents.bottom,
+ _max_win_extents.left - TRANSLUCENT_CORNER_SIZE,
+ _max_win_extents.right - TRANSLUCENT_CORNER_SIZE,
+ _max_win_extents.top + max_titlebar_height -
+ TRANSLUCENT_CORNER_SIZE,
+ _max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE,
+ &opt_shadow,
+ &max_window_context,
+ draw_border_shape,
+ (void *) 1);
+
if (max_border_no_shadow)
{
decor_shadow_destroy (xdisplay, max_border_active_shadow);
diff --git a/src/gtk-window-decorator.h b/src/gtk-window-decorator.h
index 7945e7a..da5ef5d 100644
--- a/src/gtk-window-decorator.h
+++ b/src/gtk-window-decorator.h
@@ -4,7 +4,7 @@
#include <config.h>
#endif
-#include "decoration.h"
+#include <decoration.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -23,7 +23,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#ifdef USE_GCONF
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
#include <gconf/gconf-client.h>
#endif
diff --git a/src/settings.c b/src/settings.c
index f158636..039905f 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -54,14 +54,14 @@ shadow_property_changed (WnckScreen *s)
result = XGetTextProperty (xdisplay, root, &shadow_color_xtp,
compiz_shadow_color_atom);
-
+
if (shadow_color_xtp.value)
{
int ret_count = 0;
char **t_data = NULL;
-
+
XTextPropertyToStringList (&shadow_color_xtp, &t_data, &ret_count);
-
+
if (ret_count == 1)
{
int c[4];
@@ -84,8 +84,8 @@ shadow_property_changed (WnckScreen *s)
if (changed)
decorations_changed (s);
}
-
-#ifdef USE_GCONF
+
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
static gboolean
blur_settings_changed (GConfClient *client)
{
@@ -437,7 +437,7 @@ init_settings (WnckScreen *screen)
GdkColormap *colormap;
AtkObject *switcher_label_obj;
-#ifdef USE_GCONF
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
GConfClient *gconf;
gconf = gconf_client_get_default ();
@@ -516,7 +516,7 @@ init_settings (WnckScreen *screen)
pango_context = gtk_widget_create_pango_context (style_window_rgb);
-#ifdef USE_GCONF
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
use_system_font = gconf_client_get_bool (gconf,
COMPIZ_USE_SYSTEM_FONT_KEY,
NULL);
@@ -527,13 +527,13 @@ init_settings (WnckScreen *screen)
update_style (style_window_rgba);
update_style (style_window_rgb);
-#ifdef USE_GCONF
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
titlebar_font_changed (gconf);
#endif
update_titlebar_font ();
-#ifdef USE_GCONF
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
titlebar_click_action_changed (gconf,
COMPIZ_DOUBLE_CLICK_TITLEBAR_KEY,
&double_click_action,
@@ -551,7 +551,7 @@ init_settings (WnckScreen *screen)
#endif
(*theme_update_border_extents) (text_height);
-
+
shadow_property_changed (screen);
update_shadow ();