summaryrefslogtreecommitdiff
path: root/app/cwm/xutil.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2016-09-16 14:32:03 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2016-09-16 14:32:03 +0000
commitab9a91599ced007e4aebd94a8eeb120a641453c2 (patch)
treeafff2902f770104a1195b8375fb7c51268566862 /app/cwm/xutil.c
parent030169216e9b075261283ee3ba07182f30dbe8ca (diff)
During init, query screen for _NET_ACTIVE_WINDOW and set that client as
active; while we already look at what's under the pointer, use this information first, then look under the pointer (saving that round-trip). This restores the active state to a client after restart even if the pointer is not above it (and of course the pointer is not above another client).
Diffstat (limited to 'app/cwm/xutil.c')
-rw-r--r--app/cwm/xutil.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index c8c74da7b..1a0c5d588 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.103 2015/08/27 18:53:15 okan Exp $
+ * $OpenBSD: xutil.c,v 1.104 2016/09/16 14:32:02 okan Exp $
*/
#include <sys/types.h>
@@ -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)
{