summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMC <mc@hack.org>2010-07-01 11:15:55 +0200
committerMC <mc@brain.hack.org>2010-07-01 11:15:55 +0200
commit1cd6cb03f8a874f5956b442295544914a49ab100 (patch)
tree22800a89f1e0891903bea604bc0e1465fa59b92a
parent409eb3a123101714ea2b55b42fdd5ab1d45c5e78 (diff)
downloadmcwm-1cd6cb03f8a874f5956b442295544914a49ab100.zip
Only set border colour on fixed windows when the user specifically set
them fixed, not when starting.
-rw-r--r--mcwm.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/mcwm.c b/mcwm.c
index a691668..6ada1c8 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -176,7 +176,7 @@ int32_t getwmdesktop(xcb_drawable_t win);
void addtoworkspace(struct client *client, uint32_t ws);
void delfromworkspace(struct client *client, uint32_t ws);
void changeworkspace(uint32_t ws);
-void fixwindow(struct client *client);
+void fixwindow(struct client *client, bool setcolour);
uint32_t getcolor(const char *colstr);
void forgetwin(xcb_window_t win);
void newwin(xcb_window_t win);
@@ -368,7 +368,7 @@ void changeworkspace(uint32_t ws)
curws = ws;
}
-void fixwindow(struct client *client)
+void fixwindow(struct client *client, bool setcolour)
{
uint32_t values[1];
@@ -382,10 +382,13 @@ void fixwindow(struct client *client)
client->fixed = false;
setwmdesktop(client->id, curws);
- /* Set border color to ordinary focus colour. */
- values[0] = conf.focuscol;
- xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
- values);
+ if (setcolour)
+ {
+ /* Set border color to ordinary focus colour. */
+ values[0] = conf.focuscol;
+ xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
+ values);
+ }
}
else
@@ -393,10 +396,13 @@ void fixwindow(struct client *client)
client->fixed = true;
setwmdesktop(client->id, NET_WM_FIXED);
- /* Set border color to fixed colour. */
- values[0] = conf.fixedcol;
- xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
- values);
+ if (setcolour)
+ {
+ /* Set border color to fixed colour. */
+ values[0] = conf.fixedcol;
+ xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
+ values);
+ }
}
xcb_flush(conn);
@@ -736,7 +742,7 @@ int setupscreen(void)
if (ws == NET_WM_FIXED)
{
- fixwindow(client);
+ fixwindow(client, false);
addtoworkspace(client, curws);
}
else if (MCWM_NOWS != ws && ws < WORKSPACE_MAX)
@@ -1556,7 +1562,7 @@ void handle_keypress(xcb_key_press_event_t *ev)
break;
case KEY_F: /* f */
- fixwindow(focuswin);
+ fixwindow(focuswin, true);
break;
case KEY_H: /* h */