mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
Use nanosleep() instead of the deprecated usleep().
This commit is contained in:
parent
4549c97e51
commit
cdcea91b50
@ -19,6 +19,8 @@
|
|||||||
#include "AutoTypeX11.h"
|
#include "AutoTypeX11.h"
|
||||||
#include "KeySymMap.h"
|
#include "KeySymMap.h"
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
bool AutoTypePlatformX11::m_catchXErrors = false;
|
bool AutoTypePlatformX11::m_catchXErrors = false;
|
||||||
bool AutoTypePlatformX11::m_xErrorOccured = false;
|
bool AutoTypePlatformX11::m_xErrorOccured = false;
|
||||||
int (*AutoTypePlatformX11::m_oldXErrorHandler)(Display*, XErrorEvent*) = Q_NULLPTR;
|
int (*AutoTypePlatformX11::m_oldXErrorHandler)(Display*, XErrorEvent*) = Q_NULLPTR;
|
||||||
@ -496,9 +498,14 @@ int AutoTypePlatformX11::AddKeysym(KeySym keysym)
|
|||||||
m_keysymTable[inx] = keysym;
|
m_keysymTable[inx] = keysym;
|
||||||
XChangeKeyboardMapping(m_dpy, m_specialCharacterKeycode, m_keysymPerKeycode, &m_keysymTable[inx], 1);
|
XChangeKeyboardMapping(m_dpy, m_specialCharacterKeycode, m_keysymPerKeycode, &m_keysymTable[inx], 1);
|
||||||
XFlush(m_dpy);
|
XFlush(m_dpy);
|
||||||
|
|
||||||
/* Xlib needs some time until the mapping is distributed to
|
/* Xlib needs some time until the mapping is distributed to
|
||||||
all clients */
|
all clients */
|
||||||
usleep(10000);
|
timespec ts;
|
||||||
|
ts.tv_sec = 0;
|
||||||
|
ts.tv_nsec = 10 * 1000 * 1000;
|
||||||
|
nanosleep(&ts, Q_NULLPTR);
|
||||||
|
|
||||||
return m_specialCharacterKeycode;
|
return m_specialCharacterKeycode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/extensions/XTest.h>
|
#include <X11/extensions/XTest.h>
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "autotype/AutoTypePlatformPlugin.h"
|
#include "autotype/AutoTypePlatformPlugin.h"
|
||||||
#include "autotype/AutoTypeAction.h"
|
#include "autotype/AutoTypeAction.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user