mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 16:35:47 +08:00
209 lines
6.1 KiB
Diff
209 lines
6.1 KiB
Diff
diff --git a/Xext/shm.c b/Xext/shm.c
|
|
index 071bd1a41..011969283 100644
|
|
--- a/Xext/shm.c
|
|
+++ b/Xext/shm.c
|
|
@@ -193,6 +193,10 @@ CheckForShmSyscall(void)
|
|
|
|
#endif
|
|
|
|
+const DevPrivateKey ShmGetDevPrivateKeyRec(void) {
|
|
+ return shmPixmapPrivateKey;
|
|
+}
|
|
+
|
|
static Bool
|
|
ShmCloseScreen(ScreenPtr pScreen)
|
|
{
|
|
diff --git a/Xext/shmint.h b/Xext/shmint.h
|
|
index 9dadea756..e4e6f4db6 100644
|
|
--- a/Xext/shmint.h
|
|
+++ b/Xext/shmint.h
|
|
@@ -80,6 +80,8 @@ typedef struct _ShmDesc {
|
|
#define SHMDESC_IS_FD(shmdesc) (0)
|
|
#endif
|
|
|
|
+extern const DevPrivateKey ShmGetDevPrivateKeyRec(void);
|
|
+
|
|
extern _X_EXPORT void
|
|
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
|
|
|
|
diff --git a/dix/main.c b/dix/main.c
|
|
index bfc8addbe..56fb30b63 100644
|
|
--- a/dix/main.c
|
|
+++ b/dix/main.c
|
|
@@ -266,6 +266,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
|
}
|
|
|
|
NotifyParentProcess();
|
|
+ ddxReady();
|
|
|
|
InputThreadInit();
|
|
|
|
diff --git a/include/os.h b/include/os.h
|
|
index bb3348b18..1a5400717 100644
|
|
--- a/include/os.h
|
|
+++ b/include/os.h
|
|
@@ -560,6 +560,8 @@ enum ExitCode {
|
|
extern _X_EXPORT void
|
|
ddxGiveUp(enum ExitCode error);
|
|
extern _X_EXPORT void
|
|
+ddxReady(void);
|
|
+extern _X_EXPORT void
|
|
ddxInputThreadInit(void);
|
|
extern _X_EXPORT int
|
|
TimeSinceLastInputEvent(void);
|
|
diff --git a/include/xkbfile.h b/include/xkbfile.h
|
|
index f93d31ab0..f65338ac4 100644
|
|
--- a/include/xkbfile.h
|
|
+++ b/include/xkbfile.h
|
|
@@ -79,6 +79,36 @@ typedef void (*XkbFileAddOnFunc) (FILE * /* file */ ,
|
|
|
|
/***====================================================================***/
|
|
|
|
+#define XkbInternAtom XXkbInternAtom
|
|
+#define XkbAtomText XXkbAtomText
|
|
+#define XkbStringText XXkbStringText
|
|
+#define XkbVModIndexText XXkbVModIndexText
|
|
+#define XkbVModMaskText XXkbVModMaskText
|
|
+#define XkbModMaskText XXkbModMaskText
|
|
+#define XkbModIndexText XXkbModIndexText
|
|
+#define XkbConfigText XXkbConfigText
|
|
+#define XkbKeysymText XXkbKeysymText
|
|
+#define XkbKeyNameText XXkbKeyNameText
|
|
+#define XkbSIMatchText XXkbSIMatchText
|
|
+#define XkbIMWhichStateMaskText XXkbIMWhichStateMaskText
|
|
+#define XkbControlsMaskText XXkbControlsMaskText
|
|
+#define XkbGeomFPText XXkbGeomFPText
|
|
+#define XkbDoodadTypeText XXkbDoodadTypeText
|
|
+#define XkbActionTypeText XXkbActionTypeText
|
|
+#define XkbActionText XXkbActionText
|
|
+#define XkbBehaviorText XXkbBehaviorText
|
|
+#define XkbIndentText XXkbIndentText
|
|
+#define XkbWriteXKBKeycodes XXkbWriteXKBKeycodes
|
|
+#define XkbWriteXKBKeyTypes XXkbWriteXKBKeyTypes
|
|
+#define XkbWriteXKBCompatMap XXkbWriteXKBCompatMap
|
|
+#define XkbWriteXKBSymbols XXkbWriteXKBSymbols
|
|
+#define XkbWriteXKBGeometry XXkbWriteXKBGeometry
|
|
+#define XkbWriteXKBKeymapForNames XXkbWriteXKBKeymapForNames
|
|
+#define XkbFindKeycodeByName XXkbFindKeycodeByName
|
|
+#define XkbConvertGetByNameComponents XXkbConvertGetByNameComponents
|
|
+#define XkbNameMatchesPattern XXkbNameMatchesPattern
|
|
+#define _XkbKSCheckCase _XXkbKSCheckCase
|
|
+
|
|
_XFUNCPROTOBEGIN
|
|
|
|
extern _X_EXPORT char *XkbIndentText(unsigned /* size */
|
|
diff --git a/os/osinit.c b/os/osinit.c
|
|
index 8575319ff..06c44a416 100644
|
|
--- a/os/osinit.c
|
|
+++ b/os/osinit.c
|
|
@@ -170,11 +170,11 @@ OsInit(void)
|
|
#endif
|
|
|
|
if (!been_here) {
|
|
-#if !defined(WIN32) || defined(__CYGWIN__)
|
|
+#if !defined(WIN32) || defined(__CYGWIN__) || !defined(__ANDROID__)
|
|
struct sigaction act, oact;
|
|
int i;
|
|
|
|
- int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
|
|
+ int siglist[] = { SIGQUIT, SIGILL, SIGFPE, SIGBUS,
|
|
SIGABRT,
|
|
SIGSYS,
|
|
SIGXCPU,
|
|
diff --git a/os/utils.c b/os/utils.c
|
|
index 92a66e81a..d2ca69684 100644
|
|
--- a/os/utils.c
|
|
+++ b/os/utils.c
|
|
@@ -212,6 +212,8 @@ OsSignal(int sig, OsSigHandlerPtr handler)
|
|
{
|
|
#if defined(WIN32) && !defined(__CYGWIN__)
|
|
return signal(sig, handler);
|
|
+#elif defined(__ANDROID__)
|
|
+ return SIG_DFL;
|
|
#else
|
|
struct sigaction act, oact;
|
|
|
|
@@ -232,7 +234,7 @@ OsSignal(int sig, OsSigHandlerPtr handler)
|
|
* server at a time. This keeps the servers from stomping on each other
|
|
* if the user forgets to give them different display numbers.
|
|
*/
|
|
-#define LOCK_DIR "/tmp"
|
|
+#define LOCK_DIR (getenv("TMPDIR") ?: "/tmp")
|
|
#define LOCK_TMP_PREFIX "/.tX"
|
|
#define LOCK_PREFIX "/.X"
|
|
#define LOCK_SUFFIX "-lock"
|
|
@@ -324,7 +326,7 @@ LockServer(void)
|
|
i = 0;
|
|
haslock = 0;
|
|
while ((!haslock) && (i++ < 3)) {
|
|
- haslock = (link(tmp, LockFile) == 0);
|
|
+ haslock = (rename(tmp, LockFile) == 0);
|
|
if (haslock) {
|
|
/*
|
|
* We're done.
|
|
@@ -1412,6 +1414,10 @@ static struct pid {
|
|
int pid;
|
|
} *pidlist;
|
|
|
|
+extern char* xkbcomp_argv[];
|
|
+extern int xkbcomp_argc;
|
|
+int xkbcomp_main(int argc, char *argv[]);
|
|
+
|
|
void *
|
|
Popen(const char *command, const char *type)
|
|
{
|
|
@@ -1475,8 +1481,11 @@ Popen(const char *command, const char *type)
|
|
}
|
|
close(pdes[1]);
|
|
}
|
|
- execl("/bin/sh", "sh", "-c", command, (char *) NULL);
|
|
- _exit(127);
|
|
+
|
|
+ for(int j=1; j<= SIGUNUSED; j++)
|
|
+ signal(j, SIG_DFL);
|
|
+
|
|
+ _exit(xkbcomp_main(xkbcomp_argc, xkbcomp_argv));
|
|
}
|
|
|
|
/* Avoid EINTR during stdio calls */
|
|
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
|
|
index f9b7b06d9..f4b2aeddc 100644
|
|
--- a/xkb/ddxLoad.c
|
|
+++ b/xkb/ddxLoad.c
|
|
@@ -56,6 +56,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
#define PATHSEPARATOR "/"
|
|
#endif
|
|
|
|
+char* xkbcomp_argv[16] = {0};
|
|
+int xkbcomp_argc = 0;
|
|
+
|
|
static unsigned
|
|
LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn);
|
|
|
|
@@ -152,6 +155,25 @@ RunXkbComp(xkbcomp_buffer_callback callback, void *userdata)
|
|
xkm_output_dir, keymap) == -1)
|
|
buf = NULL;
|
|
|
|
+ char buf2[256];
|
|
+ char buf3[256];
|
|
+ sprintf(buf2, "-R%s", XkbBaseDirectory);
|
|
+ sprintf(buf3, "%s%s.xkm", xkm_output_dir, keymap);
|
|
+ xkbcomp_argv[0] = "xkbcomp";
|
|
+ xkbcomp_argv[1] = "-w";
|
|
+ xkbcomp_argv[2] = "1";
|
|
+ xkbcomp_argv[3] = buf2;
|
|
+ xkbcomp_argv[4] = "-xkm";
|
|
+ xkbcomp_argv[5] = (char*) xkmfile;
|
|
+ xkbcomp_argv[6] = "-em1";
|
|
+ xkbcomp_argv[7] = PRE_ERROR_MSG;
|
|
+ xkbcomp_argv[8] = "-emp";
|
|
+ xkbcomp_argv[9] = ERROR_PREFIX;
|
|
+ xkbcomp_argv[10] = "-eml";
|
|
+ xkbcomp_argv[11] = POST_ERROR_MSG1;
|
|
+ xkbcomp_argv[12] = buf3;
|
|
+ xkbcomp_argc = 13;
|
|
+
|
|
free(xkbbasedirflag);
|
|
|
|
if (!buf) {
|