|
|
@ -7,7 +7,6 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void handle_desktop(void* input_struct, struct tb_event* event)
|
|
|
|
void handle_desktop(void* input_struct, struct tb_event* event)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -77,7 +76,6 @@ void handle_text(void* input_struct, struct tb_event* event)
|
|
|
|
void input_desktop(struct desktop* target)
|
|
|
|
void input_desktop(struct desktop* target)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
target->list = NULL;
|
|
|
|
target->list = NULL;
|
|
|
|
target->list_simple = NULL;
|
|
|
|
|
|
|
|
target->cmd = NULL;
|
|
|
|
target->cmd = NULL;
|
|
|
|
target->display_server = NULL;
|
|
|
|
target->display_server = NULL;
|
|
|
|
target->cur = 0;
|
|
|
|
target->cur = 0;
|
|
|
@ -178,7 +176,6 @@ void input_desktop_add(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
++(target->len);
|
|
|
|
++(target->len);
|
|
|
|
target->list = realloc(target->list, target->len * (sizeof (char*)));
|
|
|
|
target->list = realloc(target->list, target->len * (sizeof (char*)));
|
|
|
|
target->list_simple = realloc(target->list_simple, target->len * (sizeof (char*)));
|
|
|
|
|
|
|
|
target->cmd = realloc(target->cmd, target->len * (sizeof (char*)));
|
|
|
|
target->cmd = realloc(target->cmd, target->len * (sizeof (char*)));
|
|
|
|
target->display_server = realloc(
|
|
|
|
target->display_server = realloc(
|
|
|
|
target->display_server,
|
|
|
|
target->display_server,
|
|
|
@ -193,22 +190,7 @@ void input_desktop_add(
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int name_len = strlen(name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target->list[target->cur] = name;
|
|
|
|
target->list[target->cur] = name;
|
|
|
|
|
|
|
|
|
|
|
|
char* name_simple = *name;
|
|
|
|
|
|
|
|
if (strstr(name_simple, " ") != NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name_simple = strtok(name_simple, " ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < name_len; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name_simple[i] = tolower(name_simple[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target->list_simple[target->cur] = name_simple;
|
|
|
|
|
|
|
|
target->cmd[target->cur] = cmd;
|
|
|
|
target->cmd[target->cur] = cmd;
|
|
|
|
target->display_server[target->cur] = display_server;
|
|
|
|
target->display_server[target->cur] = display_server;
|
|
|
|
}
|
|
|
|
}
|
|
|
|