summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/widget_conf.h1
-rw-r--r--src/widget_conf.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/include/widget_conf.h b/include/widget_conf.h
index 7b5f1d8..474fde5 100644
--- a/include/widget_conf.h
+++ b/include/widget_conf.h
@@ -465,6 +465,7 @@ extern int widget_conf_reactivate_on_pause(void);
extern const char * const widget_conf_app_abi(void);
extern double widget_conf_visibility_change_delay(void);
extern int widget_conf_click_region(void);
+extern void widget_conf_set_search_input_node(int flag);
#define WIDGET_CONF_BASE_W widget_conf_base_width()
#define WIDGET_CONF_BASE_H widget_conf_base_height()
diff --git a/src/widget_conf.c b/src/widget_conf.c
index 809123c..2dc06ea 100644
--- a/src/widget_conf.c
+++ b/src/widget_conf.c
@@ -236,8 +236,10 @@ static struct widget_conf s_conf;
static struct info {
int conf_loaded;
+ int search_input_node;
} s_info = {
.conf_loaded = 0,
+ .search_input_node = 0,
};
static void visibility_change_delay_handler(char *buffer)
@@ -716,7 +718,7 @@ static char *find_input_device_by_path(const char *name)
ErrPrint("close: %d\n", errno);
}
- if (ret == 0 && !strcasecmp(name, dev_name)) {
+ if (ret == strlen(name) + 1 && !strcasecmp(name, dev_name)) {
return_path = strdup(path);
if (!return_path) {
ErrPrint("strdup: %d\n", errno);
@@ -883,8 +885,8 @@ static char *find_input_device(const char *name)
static void input_path_handler(char *buffer)
{
- if (buffer[0] == '/') {
- DbgPrint("Specifying the input device\n");
+ if (buffer[0] == '/' || !s_info.search_input_node) {
+ DbgPrint("Specifying the input device [%d]\n", s_info.search_input_node);
s_conf.path.input = strdup(buffer);
if (!s_conf.path.input) {
ErrPrint("Heap: %d\n", errno);
@@ -1047,6 +1049,11 @@ static char *conf_path(void)
return path;
}
+EAPI void widget_conf_set_search_input_node(int flag)
+{
+ s_info.search_input_node = !!flag;
+}
+
EAPI int widget_conf_load(void)
{
char *conf_file;