raster pushed a commit to branch v-0.25.0.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5c7bd88632421f2f55a282322000cb34fa59aaeb

commit 5c7bd88632421f2f55a282322000cb34fa59aaeb
Author: Carsten Haitzler <[email protected]>
Date:   Tue Jan 18 21:17:54 2022 +0000

    gesture - add an option to turn it all on or off
    
    so - some people have issues if we open devices. why... i don't know,
    but add an option to toggle this and be conservative and have it off
    by default
    
    @fix
---
 data/config/default/e.src                          |  1 +
 data/config/standard/e.src                         |  1 +
 data/config/tiling/e.src                           |  1 +
 src/bin/e_config.c                                 |  4 ++++
 src/bin/e_config.h                                 |  2 ++
 src/bin/e_gesture.c                                | 24 +++++++++++++++++-----
 src/bin/e_main.c                                   | 11 ++++++----
 .../conf_bindings/e_int_config_swipebindings.c     | 16 ++++++++++++++-
 8 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/data/config/default/e.src b/data/config/default/e.src
index 73a362c77..5f91c8a35 100644
--- a/data/config/default/e.src
+++ b/data/config/default/e.src
@@ -164,6 +164,7 @@ group "E_Config" struct {
   value "theme_default_border_style" string: "default";
   value "desk_auto_switch" int: 0;
   value "thumb_nice" int: 0;
+  value "gesture_open_input_devices" int: 0;
   value "screen_limits" int: 0;
   value "menu_favorites_show" int: 1;
   value "menu_apps_show" int: 1;
diff --git a/data/config/standard/e.src b/data/config/standard/e.src
index ec8e7865e..d83c804d6 100644
--- a/data/config/standard/e.src
+++ b/data/config/standard/e.src
@@ -164,6 +164,7 @@ group "E_Config" struct {
     value "theme_default_border_style" string: "default";
     value "desk_auto_switch" int: 0;
     value "thumb_nice" int: 0;
+    value "gesture_open_input_devices" int: 0;
     value "screen_limits" int: 0;
     value "menu_favorites_show" int: 1;
     value "menu_apps_show" int: 1;
diff --git a/data/config/tiling/e.src b/data/config/tiling/e.src
index 87bf6c347..75f59a81d 100644
--- a/data/config/tiling/e.src
+++ b/data/config/tiling/e.src
@@ -164,6 +164,7 @@ group "E_Config" struct {
     value "theme_default_border_style" string: "default";
     value "desk_auto_switch" int: 0;
     value "thumb_nice" int: 0;
+    value "gesture_open_input_devices" int: 0;
     value "screen_limits" int: 0;
     value "menu_favorites_show" int: 1;
     value "menu_apps_show" int: 1;
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 8c15101f3..e7f091453 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -879,6 +879,8 @@ _e_config_edd_init(Eina_Bool old)
 
    E_CONFIG_VAL(D, T, thumb_nice, INT);
 
+   E_CONFIG_VAL(D, T, gesture_open_input_devices, UCHAR);
+
    E_CONFIG_VAL(D, T, menu_icons_hide, UCHAR);
    E_CONFIG_VAL(D, T, menu_favorites_show, INT);
    E_CONFIG_VAL(D, T, menu_apps_show, INT);
@@ -1919,6 +1921,8 @@ e_config_load(void)
    E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
 
    E_CONFIG_LIMIT(e_config->screen_limits, 0, 2);
+   E_CONFIG_LIMIT(e_config->thumb_nice, -20, 20);
+   E_CONFIG_LIMIT(e_config->gesture_open_input_devices, 0, 1);
 
    E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1);
    E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1);
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 1d287de1a..bfef8486a 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -291,6 +291,8 @@ struct _E_Config
 
    int                       thumb_nice;
 
+   unsigned char             gesture_open_input_devices; // GUI
+
    int                       ping_clients_interval; // GUI
 
    int                       thumbscroll_enable; // GUI
diff --git a/src/bin/e_gesture.c b/src/bin/e_gesture.c
index 9d2d48e24..07dbe11e3 100644
--- a/src/bin/e_gesture.c
+++ b/src/bin/e_gesture.c
@@ -22,6 +22,7 @@ typedef struct {
 static int gesture_capable_devices = 0;
 static E_Bindings_Swipe_Live_Update live_update;
 static void* live_update_data;
+static Eina_List *handlers = NULL;
 
 static Swipe_Stats*
 _find_swipe_gesture_recognizition(Elput_Device *dev)
@@ -250,10 +251,10 @@ e_gesture_init(void)
 
    active_gestures = eina_hash_pointer_new(_stats_free);
 
-   ecore_event_handler_add(ELPUT_EVENT_SWIPE_BEGIN, _swipe_cb, NULL);
-   ecore_event_handler_add(ELPUT_EVENT_SWIPE_UPDATE, _swipe_cb, NULL);
-   ecore_event_handler_add(ELPUT_EVENT_SWIPE_END, _swipe_cb, NULL);
-   ecore_event_handler_add(ELPUT_EVENT_SEAT_CAPS, _debug, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ELPUT_EVENT_SWIPE_BEGIN, _swipe_cb, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ELPUT_EVENT_SWIPE_UPDATE, _swipe_cb, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ELPUT_EVENT_SWIPE_END, _swipe_cb, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ELPUT_EVENT_SEAT_CAPS, _debug, NULL);
 
    return 1;
 }
@@ -261,7 +262,20 @@ e_gesture_init(void)
 E_API int
 e_gesture_shutdown(void)
 {
-//   if (_detect_vm()) return 1;
+   Ecore_Event_Handler *hand;
+
+   if (_detect_vm()) return 1;
+
+   if (active_gestures)
+     {
+        eina_hash_free(active_gestures);
+        active_gestures = NULL;
+     }
+
+   EINA_LIST_FREE(handlers, hand)
+     {
+        ecore_event_handler_del(hand);
+     }
 
    if (e_comp->comp_type == E_PIXMAP_TYPE_X)
      {
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index 926c68a83..8ffe39c95 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -1059,10 +1059,13 @@ main(int argc, char **argv)
    e_comp_canvas_keys_grab();
    TS("E_Comp_Canvas Keys Grab Done");
 #ifdef HAVE_ELPUT
-   TS("E_Gesture Init");
-   e_gesture_init();
-   TS("E_Gesture Init Done");
-   _e_main_shutdown_push(e_gesture_shutdown);
+   if (e_config->gesture_open_input_devices)
+     {
+        TS("E_Gesture Init");
+        e_gesture_init();
+        TS("E_Gesture Init Done");
+        _e_main_shutdown_push(e_gesture_shutdown);
+     }
 #endif
 
    TS("Run Startup Apps");
diff --git a/src/modules/conf_bindings/e_int_config_swipebindings.c 
b/src/modules/conf_bindings/e_int_config_swipebindings.c
index 085d5dec9..b5de2b79b 100644
--- a/src/modules/conf_bindings/e_int_config_swipebindings.c
+++ b/src/modules/conf_bindings/e_int_config_swipebindings.c
@@ -24,6 +24,7 @@ struct _E_Config_Dialog_Data
       double error;
       double length;
       unsigned int fingers;
+      int gesture_open_input_devices;
    } locals;
    struct
    {
@@ -75,6 +76,15 @@ _auto_apply_changes(E_Config_Dialog_Data *cfdata)
    E_Action_Group *actg;
    E_Action_Description *actd;
 
+   if (cfdata->locals.gesture_open_input_devices != 
e_config->gesture_open_input_devices)
+     {
+        E_Action *act;
+
+        e_config->gesture_open_input_devices = 
cfdata->locals.gesture_open_input_devices;
+        act = e_action_find("restart");
+        if ((act) && (act->func.go)) act->func.go(NULL, NULL);
+     }
+
    if ((!cfdata->locals.cur) || (!cfdata->locals.cur[0]) ||
        (!cfdata->locals.action) || (!cfdata->locals.action[0])) return;
 
@@ -133,6 +143,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
    cfdata->locals.source = eina_stringshare_add("");
    cfdata->locals.cur = NULL;
    cfdata->locals.dia = NULL;
+   cfdata->locals.gesture_open_input_devices = 
e_config->gesture_open_input_devices;
    cfdata->binding.swipe = NULL;
 
    EINA_LIST_FOREACH(e_bindings->swipe_bindings, l, bi)
@@ -912,7 +923,7 @@ _help_swipe_bindings_cb(void *data EINA_UNUSED, void *data2 
EINA_UNUSED)
 static Evas_Object *
 _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data 
*cfdata)
 {
-   Evas_Object *o, *ol, *ot, *of, *ob;
+   Evas_Object *o, *ol, *ot, *of, *ob, *oc;
 
    cfdata->evas = evas;
    o = e_widget_list_add(evas, 0, 0);
@@ -963,6 +974,9 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, 
E_Config_Dialog_Data *cf
 
    e_widget_list_object_append(o, ol, 1, 1, 0.5);
 
+   oc = e_widget_check_add(evas, _("Open input devices"), 
&(cfdata->locals.gesture_open_input_devices));
+   e_widget_list_object_append(o, oc, 1, 1, 0.5);
+
    _update_swipe_binding_list(cfdata);
    _fill_actions_list(cfdata);
 

-- 


Reply via email to