aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2013-12-13 14:40:52 +0000
committerokan2013-12-13 14:40:52 +0000
commit8bf0caccf5ae3af242795fe54cb48ec4b847d0e3 (patch)
tree2f1b843524267a87193b4f21e9b478e5646cbf96 /client.c
parent754e61eb263aa34c713a1854a432f4fc979453d7 (diff)
downloadcwm-8bf0caccf5ae3af242795fe54cb48ec4b847d0e3.tar.gz
Add support for XUrgency and matching _NET_WM_STATE_DEMANDS_ATTENTION
ewmh hint; urgencyborder is configurable. The urgency flag will stick, even while on a client in a non-viewable group, until the client receives focus (where the border is reset). Initial diff from Thomas Adam with some changes/enhancements from me.
Diffstat (limited to '')
-rw-r--r--client.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/client.c b/client.c
index 5a0005f..92c52f1 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.160 2013/12/12 20:15:07 okan Exp $
+ * $OpenBSD: client.c,v 1.161 2013/12/13 14:40:52 okan Exp $
*/
#include <sys/param.h>
@@ -192,6 +192,7 @@ client_setactive(struct client_ctx *cc)
_curcc = cc;
cc->active = 1;
+ cc->flags &= ~CLIENT_URGENCY;
client_draw_border(cc);
conf_grab_mouse(cc->win);
xu_ewmh_net_active_window(sc, cc->win);
@@ -462,6 +463,12 @@ client_unhide(struct client_ctx *cc)
}
void
+client_urgency(struct client_ctx *cc)
+{
+ cc->flags |= CLIENT_URGENCY;
+}
+
+void
client_draw_border(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
@@ -482,6 +489,9 @@ client_draw_border(struct client_ctx *cc)
else
pixel = sc->xftcolor[CWM_COLOR_BORDER_INACTIVE].pixel;
+ if (cc->flags & CLIENT_URGENCY)
+ pixel = sc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel;
+
XSetWindowBorderWidth(X_Dpy, cc->win, cc->bwidth);
XSetWindowBorder(X_Dpy, cc->win, pixel);
}
@@ -511,6 +521,9 @@ client_wm_hints(struct client_ctx *cc)
if ((cc->wmh->flags & InputHint) && (cc->wmh->input))
cc->flags |= CLIENT_INPUT;
+
+ if ((cc->wmh->flags & XUrgencyHint))
+ client_urgency(cc);
}
void