changeset:   1795:c291e2f478c5
tag:         tip
user:        Kris Maglione <jg_AT_suckless.org>
date:        Thu Feb 08 21:50:49 2007 -0500
summary:     Added Urgent and NotUrgent events for the urgency hint
diff -r 3b15b370853b -r c291e2f478c5 client.c
--- a/client.c	Thu Feb 08 21:32:47 2007 -0500
+++ b/client.c	Thu Feb 08 21:50:49 2007 -0500
@@ -244,6 +244,7 @@ kill_client(Client * c) {
 
 void
 prop_client(Client *c, XPropertyEvent *e) {
+	XWMHints *wmh;
         long msize;
 
         if(e->atom == wm_atom[WMProtocols]) {
@@ -264,6 +265,17 @@ prop_client(Client *c, XPropertyEvent *e
                                 c->fixedsize = True;
                 else
                         c->fixedsize = False;
+		break;
+	case XA_WM_HINTS:
+		wmh = XGetWMHints(blz.dpy, c->win);
+		if(wmh->flags&XUrgencyHint && !client->urgent) {
+			write_event("Urgent 0x%x\n", client->win);;
+			client->urgent = True;
+		}
+		else if(!(wmh->flags&XUrgencyHint) && client->urgent) {
+			write_event("NotUrgent 0x%x\n", client->win);;
+			client->urgent = False;
+		}
                 break;
         }
         if(e->atom == XA_WM_NAME || e->atom == net_atom[NetWMName]) {
diff -r 3b15b370853b -r c291e2f478c5 wmii.h
--- a/wmii.h	Thu Feb 08 21:32:47 2007 -0500
+++ b/wmii.h	Thu Feb 08 21:50:49 2007 -0500
@@ -143,6 +143,7 @@ struct Client {
         int proto;
         Bool floating;
         Bool fixedsize;
+	Bool urgent;
         Window win;
         Window trans;
         Window framewin;
Received on Fri Feb 09 2007 - 03:55:32 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:02 UTC