From 1cd6cb03f8a874f5956b442295544914a49ab100 Mon Sep 17 00:00:00 2001 From: MC Date: Thu, 1 Jul 2010 11:15:55 +0200 Subject: Only set border colour on fixed windows when the user specifically set them fixed, not when starting. --- mcwm.c | 30 ++++++++++++++++++------------ 1 file 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 */ -- cgit v1.2.3