diff --git a/doc.md b/doc.md index 59815ac..f7be2b6 100644 --- a/doc.md +++ b/doc.md @@ -56,7 +56,7 @@ ##[Window](#Window) This is a work in progress. -#####[ShowAlert(support linux as soon as possible)](#ShowAlert) +#####[ShowAlert](#ShowAlert) #####[CloseWindow](#CloseWindow) #####[IsValid](#IsValid) #####[SetActive](#SetActive) diff --git a/doc_zh.md b/doc_zh.md index a23b796..9e39ef5 100644 --- a/doc_zh.md +++ b/doc_zh.md @@ -59,7 +59,7 @@ ##[窗口](#Window) This is a work in progress. -#####[ShowAlert(support linux as soon as possible)](#ShowAlert) +#####[ShowAlert](#ShowAlert) #####[CloseWindow](#CloseWindow) #####[IsValid](#IsValid) #####[SetActive](#SetActive) diff --git a/robotgo.go b/robotgo.go index 52f0f9e..d3eafb0 100644 --- a/robotgo.go +++ b/robotgo.go @@ -39,7 +39,7 @@ import ( ) const ( - version string = "v0.41.1.202,fate!" + version string = "v0.41.1.204,fate!" ) //GetVersion get version diff --git a/window/alert_c.h b/window/alert_c.h index 19cdef6..5a61033 100644 --- a/window/alert_c.h +++ b/window/alert_c.h @@ -123,8 +123,9 @@ static int runTask(const char *taskname, char * const argv[], int *exit_status); static int xmessage(char *argv[], int *exit_status) { - static const char * const MSG_PROGS[] = {"gmessage", "gxmessage", - "kmessage", "xmessage"}; + // static const char * const MSG_PROGS[] = {"gmessage", "gxmessage", + // "kmessage", "xmessage"}; + static const char * const MSG_PROGS[] = {"xmessage"}; static int PREV_MSG_INDEX = -1; #define MSG_PROGS_LEN (sizeof(MSG_PROGS) / sizeof(MSG_PROGS[0])) @@ -155,15 +156,18 @@ static int xmessage(char *argv[], int *exit_status) static int runTask(const char *taskname, char * const argv[], int *exit_status) { - pid_t pid; + pid_t pid = fork(); int status; - switch (pid = fork()) { + switch (pid) { case -1: /* Failed to fork */ perror("fork"); return FORK_FAILED; /* Failed to fork. */ case 0: /* Child process */ - execvp(taskname, argv); + if (strcmp(argv[0],"xmessage") == 0){ + execvp(taskname, argv); + perror("execvp failed"); + } exit(42); /* Failed to run task. */ default: /* Parent process */ wait(&status); /* Block execution until finished. */