diff options
author | Danny Baumann <dannybaumann@web.de> | 2009-02-06 09:17:38 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2009-02-06 09:17:38 +0100 |
commit | 2b5c90e4bb40b7572ce6890a0e70f756f580f3fe (patch) | |
tree | 865cd42ebc26ba74452b0b2ef92cdaf6e671a217 | |
parent | a67a481ee1f581875157a82b84b992ff139c901e (diff) |
Also set foreground color for switcher.
-rw-r--r-- | gtk/window-decorator/gtk-window-decorator.c | 76 |
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 765a431a..5b14eb6a 100644 --- a/gtk/window-decorator/gtk-window-decorator.c +++ b/gtk/window-decorator/gtk-window-decorator.c @@ -310,6 +310,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_window_menu_atom; @@ -621,36 +622,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) @@ -2197,6 +2168,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 ()); @@ -2394,6 +2406,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 (); @@ -7041,6 +7054,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); |