summaryrefslogtreecommitdiff
path: root/app/cwm/xutil.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-12-13 14:40:53 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-12-13 14:40:53 +0000
commitb864308ec6d48f74393b05c05f6a6936b4864b41 (patch)
treea80bac6e86157fe240f66a3d816e719cfd35a997 /app/cwm/xutil.c
parentb93885b5e8bd6e1a0f7e0c82aeaacc12634e43e2 (diff)
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 'app/cwm/xutil.c')
-rw-r--r--app/cwm/xutil.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index 439d7aec0..303346349 100644
--- a/app/cwm/xutil.c
+++ b/app/cwm/xutil.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: xutil.c,v 1.79 2013/12/11 14:16:10 okan Exp $
+ * $OpenBSD: xutil.c,v 1.80 2013/12/13 14:40:52 okan Exp $
*/
#include <sys/param.h>
@@ -333,6 +333,9 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
{ _NET_WM_STATE_MAXIMIZED_HORZ,
CLIENT_HMAXIMIZED,
client_hmaximize },
+ { _NET_WM_STATE_DEMANDS_ATTENTION,
+ CLIENT_URGENCY,
+ client_urgency },
};
for (i = 0; i < nitems(handlers); i++) {
@@ -366,6 +369,8 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
client_hmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
client_vmaximize(cc);
+ if (atoms[i] == ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
+ client_urgency(cc);
}
free(atoms);
}
@@ -380,7 +385,8 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
atoms = xcalloc((n + _NET_WM_STATES_NITEMS), sizeof(Atom));
for (i = j = 0; i < n; i++) {
if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] &&
- oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
+ oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT] &&
+ oatoms[i] != ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
atoms[j++] = oatoms[i];
}
free(oatoms);
@@ -388,6 +394,8 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_HORZ];
if (cc->flags & CLIENT_VMAXIMIZED)
atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_VERT];
+ if (cc->flags & CLIENT_URGENCY)
+ atoms[j++] = ewmh[_NET_WM_STATE_DEMANDS_ATTENTION];
if (j > 0)
XChangeProperty(X_Dpy, cc->win, ewmh[_NET_WM_STATE],
XA_ATOM, 32, PropModeReplace, (unsigned char *)atoms, j);