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
This commit is contained in:
Carsten Haitzler 2022-01-18 21:17:54 +00:00
parent 29e1a12da3
commit 264b59c42f
8 changed files with 50 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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)
{

View File

@ -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");

View File

@ -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);