summary refs log tree commit diff
path: root/xutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xutil.c b/xutil.c
index a831794..eaaa0a4 100644
--- a/xutil.c
+++ b/xutil.c
@@ -256,6 +256,22 @@ xu_ewmh_net_active_window(struct screen_ctx *sc, Window w)
 	    XA_WINDOW, 32, PropModeReplace, (unsigned char *)&w, 1);
 }
 
+Window
+xu_ewmh_get_net_active_window(struct screen_ctx *sc)
+{
+	long		*p;
+	Window		 win;
+
+	if ((xu_getprop(sc->rootwin, ewmh[_NET_ACTIVE_WINDOW],
+	    XA_WINDOW, 32, (unsigned char **)&p)) <= 0)
+		return(None);
+
+	win = (Window)*p;
+	XFree(p);
+
+	return(win);
+}
+
 void
 xu_ewmh_net_wm_desktop_viewport(struct screen_ctx *sc)
 {