give DF a small breathing room for processing X events

develop
Petr Mrázek 2009-12-13 01:39:58 +00:00
parent bb2a455dbb
commit 2adfe39f9f
1 changed files with 4 additions and 2 deletions

@ -150,6 +150,8 @@ bool getDFWindow (Display *dpy, Window& dfWindow, Window & rootWindow)
} }
return false; return false;
} }
// FIXME: Too much black magic.
bool setWMClientLeaderProperty (Display *dpy, Window &dfWin, Window &currentFocus) bool setWMClientLeaderProperty (Display *dpy, Window &dfWin, Window &currentFocus)
{ {
static bool propertySet; static bool propertySet;
@ -243,7 +245,7 @@ void API::TypeStr (const char *lpszString, int delay, bool useShift)
XTestFakeKeyEvent (dpy, XKeysymToKeycode (dpy, XStringToKeysym ("Shift_L")), false, CurrentTime); XTestFakeKeyEvent (dpy, XKeysymToKeycode (dpy, XStringToKeysym ("Shift_L")), false, CurrentTime);
XSync (dpy, false); XSync (dpy, false);
} }
usleep(10000);
} }
if (currAttr.map_state == IsUnmapped) if (currAttr.map_state == IsUnmapped)
{ {
@ -295,7 +297,7 @@ void API::TypeSpecial (t_special command, int count, int delay)
XSync (dpy, true); XSync (dpy, true);
XTestFakeKeyEvent (dpy, xkeycode, false, CurrentTime); XTestFakeKeyEvent (dpy, xkeycode, false, CurrentTime);
XSync (dpy, true); XSync (dpy, true);
usleep(20000); usleep(10000);
} }
if (currAttr.map_state == IsUnmapped) if (currAttr.map_state == IsUnmapped)
{ {