diff options
-rw-r--r-- | gadgets/gdbar.c | 4 | ||||
-rw-r--r-- | main.c | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gadgets/gdbar.c b/gadgets/gdbar.c index c5364f1..f905542 100644 --- a/gadgets/gdbar.c +++ b/gadgets/gdbar.c @@ -44,7 +44,7 @@ pbar(const char* label, double perc, int maxc, int height, int pnl, int mode) { l = perc * ((mode ? (double)(maxc-2) : (double) maxc) / 100); if((int)(l + 0.5) >= (int)l) - l = l + 0.5; + l += 0.5; if((int)(perc + 0.5) >= (int)perc) rp = (int)(perc + 0.5); @@ -67,7 +67,7 @@ pbar(const char* label, double perc, int maxc, int height, int pnl, int mode) { fflush(stdout); } - int +int main(int argc, char *argv[]) { int i, nv; @@ -284,6 +284,7 @@ queryscreeninfo(Display *dpy, XRectangle *rect, int screen) { static void set_net_wm_strut_partial_for(Display *dpy, Window w) { unsigned long strut[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + unsigned long strut_s[4] = { 0, 0, 0, 0 }; XWindowAttributes wa; XGetWindowAttributes(dpy, w, &wa); @@ -292,11 +293,15 @@ set_net_wm_strut_partial_for(Display *dpy, Window w) { strut[2] = wa.height; strut[8] = wa.x; strut[9] = wa.x + wa.width - 1; + + strut_s[2] = wa.height; } else if((wa.y + wa.height) == DisplayHeight(dpy, DefaultScreen(dpy))) { strut[3] = wa.height; strut[10] = wa.x; strut[11] = wa.x + wa.width - 1; + + strut_s[3] = wa.height; } if(strut[2] != 0 || strut[3] != 0) { @@ -310,6 +315,16 @@ set_net_wm_strut_partial_for(Display *dpy, Window w) { (unsigned char *)&strut, 12 ); + XChangeProperty( + dpy, + w, + XInternAtom(dpy, "_NET_WM_STRUT", False), + XInternAtom(dpy, "CARDINAL", False), + 32, + PropModeReplace, + (unsigned char *)&strut, + 4 + ); } } |