summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-02-06 09:17:38 +0100
committerDanny Baumann <dannybaumann@web.de>2009-02-25 23:34:32 +0100
commit9cccdb0b2e1904bfe6da030788ea7617e681df44 (patch)
treece75251b942e4178c715f40e5ea78dcf05f3ef71 /gtk
parent75e195679bea1910d7aeaa094c2d878896bfe545 (diff)
downloadzcomp-9cccdb0b2e1904bfe6da030788ea7617e681df44.tar.gz
zcomp-9cccdb0b2e1904bfe6da030788ea7617e681df44.tar.bz2
Also set foreground color for switcher.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/window-decorator/gtk-window-decorator.c76
1 files changed, 46 insertions, 30 deletions
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 0e0bfb2..cdcc4d6 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -311,6 +311,7 @@ static Atom wm_move_resize_atom;
static Atom restack_window_atom;
static Atom select_window_atom;
static Atom mwm_hints_atom;
+static Atom switcher_fg_atom;
static Atom toolkit_action_atom;
static Atom toolkit_action_main_menu_atom;
@@ -628,36 +629,6 @@ decor_update_window_property (decor_t *d)
}
static void
-decor_update_switcher_property (decor_t *d)
-{
- long data[256];
- Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- gint nQuad;
- decor_quad_t quads[N_QUADS_MAX];
-
- nQuad = decor_set_lSrStSbX_window_quads (quads, &switcher_context,
- &d->border_layout,
- d->border_layout.top.x2 -
- d->border_layout.top.x1 -
- switcher_context.extents.left -
- switcher_context.extents.right -
- 32);
-
- decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
- &_switcher_extents, &_switcher_extents,
- 0, 0, quads, nQuad);
-
- gdk_error_trap_push ();
- XChangeProperty (xdisplay, d->prop_xid,
- win_decor_atom,
- XA_INTEGER,
- 32, PropModeReplace, (guchar *) data,
- BASE_PROP_SIZE + QUAD_PROP_SIZE * nQuad);
- gdk_display_sync (gdk_display_get_default ());
- gdk_error_trap_pop ();
-}
-
-static void
gdk_cairo_set_source_color_alpha (cairo_t *cr,
GdkColor *color,
double alpha)
@@ -2182,6 +2153,47 @@ meta_draw_window_decoration (decor_t *d)
#define SWITCHER_ALPHA 0xa0a0
static void
+decor_update_switcher_property (decor_t *d)
+{
+ long data[256];
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+ gint nQuad;
+ decor_quad_t quads[N_QUADS_MAX];
+ GtkStyle *style;
+ long fgColor[4];
+
+ nQuad = decor_set_lSrStSbX_window_quads (quads, &switcher_context,
+ &d->border_layout,
+ d->border_layout.top.x2 -
+ d->border_layout.top.x1 -
+ switcher_context.extents.left -
+ switcher_context.extents.right -
+ 32);
+
+ decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
+ &_switcher_extents, &_switcher_extents,
+ 0, 0, quads, nQuad);
+
+ style = gtk_widget_get_style (style_window);
+
+ fgColor[0] = style->fg[GTK_STATE_NORMAL].red;
+ fgColor[1] = style->fg[GTK_STATE_NORMAL].green;
+ fgColor[2] = style->fg[GTK_STATE_NORMAL].blue;
+ fgColor[3] = SWITCHER_ALPHA;
+
+ gdk_error_trap_push ();
+ XChangeProperty (xdisplay, d->prop_xid,
+ win_decor_atom,
+ XA_INTEGER,
+ 32, PropModeReplace, (guchar *) data,
+ BASE_PROP_SIZE + QUAD_PROP_SIZE * nQuad);
+ XChangeProperty (xdisplay, d->prop_xid, switcher_fg_atom,
+ XA_INTEGER, 32, PropModeReplace, (guchar *) fgColor, 4);
+ gdk_display_sync (gdk_display_get_default ());
+ gdk_error_trap_pop ();
+}
+
+static void
draw_switcher_background (decor_t *d)
{
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
@@ -2379,6 +2391,7 @@ draw_switcher_background (decor_t *d)
gdk_error_trap_push ();
XSetWindowBackground (xdisplay, d->prop_xid, pixel);
XClearWindow (xdisplay, d->prop_xid);
+
gdk_display_sync (gdk_display_get_default ());
gdk_error_trap_pop ();
@@ -6985,6 +6998,9 @@ main (int argc, char *argv[])
select_window_atom = XInternAtom (xdisplay, DECOR_SWITCH_WINDOW_ATOM_NAME,
FALSE);
mwm_hints_atom = XInternAtom (xdisplay, "_MOTIF_WM_HINTS", FALSE);
+ switcher_fg_atom = XInternAtom (xdisplay,
+ DECOR_SWITCH_FOREGROUND_COLOR_ATOM_NAME,
+ FALSE);
toolkit_action_atom =
XInternAtom (xdisplay, "_COMPIZ_TOOLKIT_ACTION", FALSE);