xbattmon

simple battery monitor for X
git clone git://git.2f30.org/xbattmon
Log | Files | Refs | README | LICENSE

commit 37a230997161b33f7fdd583b9b8c28afa539802c
parent 585c1172c74af18bd5ecf9f160a697d0bb20995b
Author: Quentin Rameau <quinq@fifth.space>
Date:   Wed, 12 Sep 2018 23:20:03 +0200

Register X visibility events only with raise configured

Diffstat:
Mxbattmon.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xbattmon.c b/xbattmon.c @@ -150,12 +150,13 @@ setup(void) XChangeProperty(dpy, winbar, wintype, XA_ATOM, 32, PropModeReplace, (unsigned char *)&wintype_dock, 1); - XSelectInput(dpy, winbar, ExposureMask | VisibilityChangeMask); XSelectInput(dpy, RootWindow(dpy, screen), StructureNotifyMask); - if (raise == 1) + if (raise == 1) { + XSelectInput(dpy, winbar, ExposureMask | VisibilityChangeMask); XMapRaised(dpy, winbar); - else + } else { XMapWindow(dpy, winbar); + } gcbar = XCreateGC(dpy, winbar, 0, 0); @@ -387,8 +388,7 @@ loop(void) break; case VisibilityNotify: if (ev.xvisibility.state != VisibilityUnobscured) - if (raise == 1) - XRaiseWindow(dpy, winbar); + XRaiseWindow(dpy, winbar); break; case ConfigureNotify: if (ev.xconfigure.window == DefaultRootWindow(dpy)) {