From 7be0a97998aab831a9e4c85b029c4008000f1341 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 18 Oct 2002 04:04:41 +0000 Subject: [PATCH] - More cleanups for obsoleted xxx_gc's and xxx_pixel's in WScreen --- src/defaults.c | 7 ++----- src/dock.c | 2 +- src/screen.c | 12 ++---------- src/screen.h | 6 +++--- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index f75e8f08..df5f351f 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -2999,8 +2999,6 @@ setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index) scr->clip_title_color[index] = WMCreateRGBColor(scr->wmscreen, color->red, color->green, color->blue, True); - wFreeColor(scr, color->pixel); - #ifdef GRADIENT_CLIP_ARROW if (index == CLIP_NORMAL) { RImage *image; @@ -3024,6 +3022,8 @@ setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index) } #endif /* GRADIENT_CLIP_ARROW */ + wFreeColor(scr, color->pixel); + return REFRESH_ICON_TITLE_COLOR; } @@ -3038,9 +3038,6 @@ setWTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index) WMCreateRGBColor(scr->wmscreen, color->red, color->green, color->blue, True); - if (index == WS_UNFOCUSED) - XSetForeground(dpy, scr->info_text_gc, color->pixel); - wFreeColor(scr, color->pixel); return REFRESH_WINDOW_TITLE_COLOR; diff --git a/src/dock.c b/src/dock.c index 67e5fffd..127b13f2 100644 --- a/src/dock.c +++ b/src/dock.c @@ -352,7 +352,7 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed) int pt = CLIP_BUTTON_SIZE*ICON_SIZE/64; int tp = ICON_SIZE - pt; int as = pt - 15; /* 15 = 5+5+5 */ - GC gc = scr->clip_title_gc; + GC gc = scr->draw_gc; /* maybe use WMColorGC() instead here? */ WMColor *color; #ifdef GRADIENT_CLIP_ARROW Bool collapsed = clipIcon->dock->collapsed; diff --git a/src/screen.c b/src/screen.c index 6886bb38..96a849e2 100644 --- a/src/screen.c +++ b/src/screen.c @@ -351,22 +351,14 @@ allocGCs(WScreen *scr) scr->copy_gc = XCreateGC(dpy, scr->w_win, GCForeground|GCBackground |GCGraphicsExposures, &gcv); - /* clip title GC */ - scr->clip_title_gc = XCreateGC(dpy, scr->w_win, GCGraphicsExposures, &gcv); - - /* move/size display GC */ - gcv.graphics_exposures = False; - gcm = GCGraphicsExposures; - scr->info_text_gc = XCreateGC(dpy, scr->w_win, gcm, &gcv); - /* misc drawing GC */ gcv.graphics_exposures = False; gcm = GCGraphicsExposures; scr->draw_gc = XCreateGC(dpy, scr->w_win, gcm, &gcv); assert (scr->stipple_bitmap!=None); - - + + /* mono GC */ scr->mono_gc = XCreateGC(dpy, scr->stipple_bitmap, gcm, &gcv); } diff --git a/src/screen.h b/src/screen.h index dfd01c07..83486307 100644 --- a/src/screen.h +++ b/src/screen.h @@ -145,9 +145,9 @@ typedef struct _WScreen { WMColor *gray; WMColor *darkGray; + /* shortcuts for the pixels of the above colors. just for convenience */ WMPixel black_pixel; WMPixel white_pixel; - WMPixel light_pixel; WMPixel dark_pixel; @@ -171,6 +171,7 @@ typedef struct _WScreen { WMColor *clip_title_color[2]; /* clip title text */ WMColor *mtext_color; /* menu item text */ WMColor *dtext_color; /* disabled menu item text */ + WMPixel line_pixel; WMPixel frame_border_pixel; /* frame border */ @@ -191,8 +192,7 @@ typedef struct _WScreen { WMColor *icon_title_color; /* icon title color */ - GC clip_title_gc; /* clip title */ - GC info_text_gc; /* for size/position display */ + GC icon_select_gc; GC frame_gc; /* gc for resize/move frame (root) */