On Tue, 12 Mar 2013 at 12:40:43 -0300, Renato Botelho wrote:
> Hello guys,
> 
> After a long time, I'm back using windowmaker.
> 
> I didn't find a way to change the window border color even
> looking at source code.
> 
> Is it impossible to change it or am I missing something?

It is impossible nowadays.

A long time ago I received a patch from Michael Shigorin that
was trying to implement this. He said the patch was broken and
I never had the time to look at this (since I personally don't
care that much).

But I understand that some people have the need for changing
that color to create a better look, so if someone takes care
of improving the patch I'll accept it.

The patch is attached.
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index f266382..15b8fae 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -324,6 +324,7 @@ static char *textureOptions[] = {
 #define ICONB_COL	(1<<9)
 #define CLIP_COL	(1<<10)
 #define CCLIP_COL	(1<<11)
+#define BORDER_COL	(1<<12)
 
 static char *colorOptions[] = {
 	"FTitleColor", "white",
@@ -337,7 +338,8 @@ static char *colorOptions[] = {
 	"IconTitleColor", "white",
 	"IconTitleBack", "black",
 	"ClipTitleColor", "black",
-	"CClipTitleColor", "#454045"
+	"CClipTitleColor", "#454045",
+	"FrameBorderColor", "cyan"
 };
 
 static WMRect previewPositions[] = {
@@ -347,6 +349,11 @@ static WMRect previewPositions[] = {
 	{{30, 40}, {190, 20}},
 #define POWNER		2
 	{{30, 70}, {190, 20}},
+/*
+#define PBORDER		3
+	{{30, 100}, {190, 9}},
+(and shift the below items)
+*/
 #define PRESIZEBAR	3
 	{{30, 100}, {190, 9}},
 #define PMTITLE		4
@@ -371,7 +378,8 @@ static WMRect previewColorPositions[] = {
 	{{155, 130}, {64, 64}},
 	{{155, 130}, {64, 64}},
 	{{155, 130}, {64, 64}},
-	{{155, 130}, {64, 64}}
+	{{155, 130}, {64, 64}},
+	{{30, 90}, {190, 9}}
 };
 
 static void str2rcolor(RContext * rc, char *name, RColor * color)
@@ -801,6 +809,7 @@ static void updatePreviewBox(_Panel * panel, int elements)
 	}
 	if (elements & (1 << PRESIZEBAR)) {
 		renderPreview(panel, gc, PRESIZEBAR, RESIZEBAR_BEVEL);
+		colorUpdate |= BORDER_COL;
 	}
 	if (elements & (1 << PMTITLE)) {
 		renderPreview(panel, gc, PMTITLE, RBEV_RAISED2);
@@ -1343,7 +1352,8 @@ static void changeColorPage(WMWidget * w, void *data)
 		{130, 140},
 		{130, 140},
 		{130, 140},
-		{130, 140}
+		{130, 140},
+		{5, 95}
 	};
 
 	if (panel->preview) {
@@ -1439,6 +1449,10 @@ static void updateColorPreviewBox(_Panel * panel, int elements)
 		XCopyArea(dpy, pnot, d, gc, 30, 180, 90, 20, 30, 180);
 		paintText(scr, d, panel->colors[7], panel->normalFont, 30, 180, 90, 20, WALeft, _("Highlighted"));
 	}
+	if (elements & BORDER_COL ) {
+		/* FIXME: it's just to make it visible at all */
+		XFillRectangle(WMScreenDisplay(scr), d, WMColorGC(panel->colors[12]), 31, 95, 87, 9);
+	}
 	/*
 	   if (elements & ICONT_COL) {
 	   WRITE(_("Focused Window"), panel->colors[8], panel->boldFont,
@@ -1715,11 +1729,13 @@ static void createPanel(Panel * p)
 	WMAddPopUpButtonItem(panel->colP, _("Focused Window Title"));
 	WMAddPopUpButtonItem(panel->colP, _("Unfocused Window Title"));
 	WMAddPopUpButtonItem(panel->colP, _("Owner of Focused Window Title"));
+	/* WMAddPopUpButtonItem(panel->colP, _("Frame Border Color")); --> breaks menu order */
 	WMAddPopUpButtonItem(panel->colP, _("Menu Title"));
 	WMAddPopUpButtonItem(panel->colP, _("Menu Item Text"));
 	WMAddPopUpButtonItem(panel->colP, _("Disabled Menu Item Text"));
 	WMAddPopUpButtonItem(panel->colP, _("Menu Highlight Color"));
 	WMAddPopUpButtonItem(panel->colP, _("Highlighted Menu Text Color"));
+	WMAddPopUpButtonItem(panel->colP, _("Frame Border Color"));
 	/*
 	   WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title"));
 	   WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title Back"));
diff --git a/src/defaults.c b/src/defaults.c
index c1edf7b..e676942 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -127,6 +127,7 @@ static int setWTitleColor();
 static int setFTitleBack();
 static int setPTitleBack();
 static int setUTitleBack();
+static int setFrameBorder();
 static int setResizebarBack();
 static int setWorkspaceBack();
 static int setWorkspaceSpecificBack();
@@ -180,6 +181,7 @@ static int setCursor();
 
 #define REFRESH_ICON_TITLE_COLOR (1<<13)
 #define REFRESH_ICON_TITLE_BACK (1<<14)
+#define REFRESH_BORDER_COLOR (1<<15)
 
 static WOptionEnumeration seFocusModes[] = {
 	{"Manual", WKF_CLICK, 0}, {"ClickToFocus", WKF_CLICK, 1},
@@ -505,6 +507,8 @@ WDefaultEntry optionList[] = {
 	    NULL, getColor, setWTitleColor, NULL, NULL},
 	{"UTitleColor", "black", (void *)WS_UNFOCUSED,
 	    NULL, getColor, setWTitleColor, NULL, NULL},
+	{"FrameBorderColor", "cyan", NULL,
+	    NULL, getColor, setFrameBorder, NULL, NULL},
 	{"FTitleBack", "(solid, black)", NULL,
 	    NULL, getTexture, setFTitleBack, NULL, NULL},
 	{"PTitleBack", "(solid, \"#616161\")", NULL,
@@ -1126,6 +1130,12 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
 		if (foo)
 			WMPostNotificationName(WNWindowAppearanceSettingsChanged, NULL, (void *)(uintptr_t) foo);
 
+		foo = 0;
+		if (needs_refresh & REFRESH_BORDER_COLOR)
+			foo |= WColorSettings;
+		if (foo)
+			WMPostNotificationName(WNWindowAppearanceSettingsChanged, NULL, (void *)(uintptr_t) foo);
+
 		if (!(needs_refresh & REFRESH_ICON_TILE)) {
 			foo = 0;
 			if (needs_refresh & REFRESH_ICON_FONT) {
@@ -2554,6 +2564,18 @@ static int setClipTitleColor(WScreen * scr, WDefaultEntry * entry, XColor * colo
 	return REFRESH_ICON_TITLE_COLOR;
 }
 
+static int setFrameBorder(WScreen * scr, WDefaultEntry * entry, XColor * color, void *foo)
+{
+	if (scr->select_border_color)
+		WMReleaseColor(scr->select_border_color);
+
+	scr->select_border_color = WMCreateRGBColor(scr->wmscreen, color->red, color->green, color->blue, True);
+
+	wFreeColor(scr, color->pixel);
+
+	return REFRESH_BORDER_COLOR;
+}
+
 static int setWTitleColor(WScreen * scr, WDefaultEntry * entry, XColor * color, long widx)
 {
 	if (scr->window_title_color[widx])
diff --git a/src/screen.c b/src/screen.c
index e2cda33..04fcf76 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -723,10 +723,11 @@ WScreen *wScreenInit(int screen_number)
 	scr->dark_pixel = WMColorPixel(scr->darkGray);
 
 	{
-		XColor xcol;
+		/* XColor xcol; */
 		/* frame boder color */
-		wGetColor(scr, FRAME_BORDER_COLOR, &xcol);
-		scr->frame_border_pixel = xcol.pixel;
+		/* wGetColor(scr, FRAME_BORDER_COLOR, &xcol); */
+		/* scr->frame_border_pixel = xcol.pixel; */
+		scr->frame_border_pixel = WMColorPixel(scr->select_border_color);
 	}
 
 	/* create GCs with default values */
diff --git a/src/screen.h b/src/screen.h
index b95ba29..ad0b669 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -163,6 +163,8 @@ typedef struct _WScreen {
     WMColor *mtext_color;	       /* menu item text */
     WMColor *dtext_color;	       /* disabled menu item text */
 
+    WMColor *select_border_color;      /* window frame border */
+
     WMPixel line_pixel;
     WMPixel frame_border_pixel;	       /* frame border */
 
diff --git a/util/getstyle.c b/util/getstyle.c
index 1a9ac31..21805e3 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -74,6 +74,7 @@ static char *options[] = {
 	"FTitleColor",
 	"PTitleColor",
 	"UTitleColor",
+	"FrameBorderColor",
 	"FTitleBack",
 	"PTitleBack",
 	"UTitleBack",

Reply via email to