svkbd

Simple X11 onscreen keyboard.
git clone git://r-36.net/svkbd
Log | Files | Refs | LICENSE

commit 6f0e75ccc00c28ea26b4657b845ceb31e7f04bbe
parent 7223d564281e401478a591c217b22a6accf84125
Author: Enno Boland (Gottox) <tox@s01.de>
Date:   Sun, 10 Apr 2011 13:36:41 +0200

merging christophs "Fixing border and sizes now for real."-patch
Diffstat:
svkbd.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/svkbd.c b/svkbd.c @@ -340,8 +340,8 @@ setup(void) { /* init screen */ screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); - sw = DisplayWidth(dpy, screen) - 1; - sh = DisplayHeight(dpy, screen) - 1; + sw = DisplayWidth(dpy, screen); + sh = DisplayHeight(dpy, screen); initfont(font); /* init atoms */ @@ -356,7 +356,7 @@ setup(void) { if(!ww) ww = sw - wx; if(ww < 0) - ww = sw + ww; + ww = sw + ww + 1; if(!wx) wx = 0; if(wx < 0) @@ -364,7 +364,7 @@ setup(void) { if(!wh) wh = sh * rows / 32; if(wh < 0) - wh = sh + wh; + wh = sh + wh + 1; if(!wy) wy = sh - wh; if(wy < 0) @@ -454,22 +454,22 @@ updatekeys() { int i, j; int x = 0, y = 0, h, base, r = 0; - h = wh / rows; + h = (wh - 1) / rows; for(i = 0; i < LENGTH(keys); i++) { for(j = i, base = 0; j < LENGTH(keys) && keys[j].keysym != 0; j++) base += keys[j].width; for(x = 0; i < LENGTH(keys) && keys[i].keysym != 0; i++, r++) { keys[i].x = x; keys[i].y = y; - keys[i].w = keys[i].width * ww / base; + keys[i].w = keys[i].width * (ww - 1) / base; if(rows == r - 1) - keys[i].h = wh - y; + keys[i].h = wh - 1 - y; else keys[i].h = h; x += keys[i].w; } if(base != 0) - keys[i - 1].w = ww - keys[i - 1].x; + keys[i - 1].w = ww - 1 - keys[i - 1].x; y += h; } }