Run XFlush instead of XSync before starting main loop; fixes bug where rending of keys fails when used in conjunction w/ dwm dock patch
This commit is contained in:
parent
819f92950e
commit
edfd50cdcb
25
svkbd.c
25
svkbd.c
@ -258,7 +258,6 @@ drawkeyboard(void) {
|
|||||||
if(keys[i].keysym != 0)
|
if(keys[i].keysym != 0)
|
||||||
drawkey(&keys[i]);
|
drawkey(&keys[i]);
|
||||||
}
|
}
|
||||||
XSync(dpy, False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -459,16 +458,24 @@ run(void) {
|
|||||||
fd_set fds;
|
fd_set fds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
|
|
||||||
xfd = ConnectionNumber(dpy);
|
xfd = ConnectionNumber(dpy);
|
||||||
FD_ZERO(&fds);
|
|
||||||
FD_SET(xfd, &fds);
|
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
tv.tv_sec = 1;
|
tv.tv_sec = 2;
|
||||||
|
|
||||||
|
//XSync(dpy, False);
|
||||||
|
XFlush(dpy);
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
select(xfd + 1, &fds, NULL, NULL, &tv);
|
FD_ZERO(&fds);
|
||||||
XNextEvent(dpy, &ev);
|
FD_SET(xfd, &fds);
|
||||||
if(handler[ev.type]) {
|
if (select(xfd + 1, &fds, NULL, NULL, &tv)) {
|
||||||
(handler[ev.type])(&ev); /* call handler */
|
while (XPending(dpy)) {
|
||||||
|
XNextEvent(dpy, &ev);
|
||||||
|
if(handler[ev.type]) {
|
||||||
|
(handler[ev.type])(&ev); /* call handler */
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,8 +638,8 @@ main(int argc, char *argv[]) {
|
|||||||
int i, xr, yr, bitm;
|
int i, xr, yr, bitm;
|
||||||
unsigned int wr, hr;
|
unsigned int wr, hr;
|
||||||
|
|
||||||
signal(SIGTERM, sigterm);
|
|
||||||
memcpy(&keys, &keys_en, sizeof(keys_en));
|
memcpy(&keys, &keys_en, sizeof(keys_en));
|
||||||
|
signal(SIGTERM, sigterm);
|
||||||
for (i = 1; argv[i]; i++) {
|
for (i = 1; argv[i]; i++) {
|
||||||
if(!strcmp(argv[i], "-v")) {
|
if(!strcmp(argv[i], "-v")) {
|
||||||
die("svkbd-"VERSION", © 2006-2016 svkbd engineers,"
|
die("svkbd-"VERSION", © 2006-2016 svkbd engineers,"
|
||||||
|
Loading…
Reference in New Issue
Block a user