forked from enlightenment/enlightenment
comp disable shortcut is also now configurable and set by default
SVN revision: 72977
This commit is contained in:
parent
e666e4f19e
commit
10a172162b
|
@ -2990,31 +2990,6 @@ _e_mod_comp_bd_property(void *data __UNUSED__,
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_e_mod_comp_key_down(void *data __UNUSED__,
|
|
||||||
int type __UNUSED__,
|
|
||||||
void *event)
|
|
||||||
{
|
|
||||||
Ecore_Event_Key *ev = event;
|
|
||||||
|
|
||||||
if ((!strcmp(ev->keyname, "Home")) &&
|
|
||||||
(ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) &&
|
|
||||||
(ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
|
|
||||||
(ev->modifiers & ECORE_EVENT_MODIFIER_ALT))
|
|
||||||
{
|
|
||||||
if (_comp_mod)
|
|
||||||
{
|
|
||||||
_e_mod_config_free(_comp_mod->module);
|
|
||||||
_e_mod_config_new(_comp_mod->module);
|
|
||||||
e_config_save();
|
|
||||||
e_module_disable(_comp_mod->module);
|
|
||||||
e_config_save();
|
|
||||||
e_sys_action_do(E_SYS_RESTART, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_mod_comp_signal_user(void *data __UNUSED__,
|
_e_mod_comp_signal_user(void *data __UNUSED__,
|
||||||
int type __UNUSED__,
|
int type __UNUSED__,
|
||||||
|
@ -3464,7 +3439,6 @@ e_mod_comp_init(void)
|
||||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, _e_mod_comp_damage, NULL));
|
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, _e_mod_comp_damage, NULL));
|
||||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, _e_mod_comp_damage_win, NULL));
|
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, _e_mod_comp_damage_win, NULL));
|
||||||
|
|
||||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_mod_comp_key_down, NULL));
|
|
||||||
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _e_mod_comp_signal_user, NULL));
|
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _e_mod_comp_signal_user, NULL));
|
||||||
|
|
||||||
handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE, _e_mod_comp_randr, NULL));
|
handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE, _e_mod_comp_randr, NULL));
|
||||||
|
|
|
@ -29,15 +29,35 @@ EAPI E_Module_Api e_modapi =
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_mod_action_key_cb(E_Object *obj __UNUSED__, const char *p __UNUSED__, Ecore_Event_Key *ev __UNUSED__)
|
_comp_disable(void)
|
||||||
{
|
{
|
||||||
e_mod_comp_fps_toggle();
|
if (!_comp_mod) return;
|
||||||
|
_e_mod_config_free(_comp_mod->module);
|
||||||
|
_e_mod_config_new(_comp_mod->module);
|
||||||
|
e_config_save();
|
||||||
|
e_module_disable(_comp_mod->module);
|
||||||
|
e_config_save();
|
||||||
|
e_sys_action_do(E_SYS_RESTART, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_mod_action_cb(E_Object *obj __UNUSED__, const char *p __UNUSED__)
|
_e_mod_action_key_cb(E_Object *obj __UNUSED__, const char *p, Ecore_Event_Key *ev __UNUSED__)
|
||||||
{
|
{
|
||||||
|
if (!p) return;
|
||||||
|
if (!strcmp(p, "toggle_fps"))
|
||||||
e_mod_comp_fps_toggle();
|
e_mod_comp_fps_toggle();
|
||||||
|
else
|
||||||
|
_comp_disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_mod_action_cb(E_Object *obj __UNUSED__, const char *p)
|
||||||
|
{
|
||||||
|
if (!p) return;
|
||||||
|
if (!strcmp(p, "toggle_fps"))
|
||||||
|
e_mod_comp_fps_toggle();
|
||||||
|
else
|
||||||
|
_comp_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
|
@ -67,7 +87,9 @@ e_modapi_init(E_Module *m)
|
||||||
act->func.go = _e_mod_action_cb;
|
act->func.go = _e_mod_action_cb;
|
||||||
act->func.go_key = _e_mod_action_key_cb;
|
act->func.go_key = _e_mod_action_key_cb;
|
||||||
e_action_predef_name_set(_("Composite"), _("Toggle FPS Display"),
|
e_action_predef_name_set(_("Composite"), _("Toggle FPS Display"),
|
||||||
"composite", "", NULL, 0);
|
"composite", "toggle_fps", NULL, 0);
|
||||||
|
e_action_predef_name_set(_("Composite"), _("Disable Composite Module"),
|
||||||
|
"composite", "disable", NULL, 0);
|
||||||
}
|
}
|
||||||
if (!mod->conf) _e_mod_config_new(m);
|
if (!mod->conf) _e_mod_config_new(m);
|
||||||
|
|
||||||
|
@ -142,6 +164,8 @@ e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
e_action_predef_name_del(_("Composite"),
|
e_action_predef_name_del(_("Composite"),
|
||||||
_("Toggle FPS Display"));
|
_("Toggle FPS Display"));
|
||||||
|
e_action_predef_name_del(_("Composite"),
|
||||||
|
_("Disable Composite Module"));
|
||||||
e_action_del("composite");
|
e_action_del("composite");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -618,7 +618,10 @@ _restore_key_binding_defaults_cb(void *data,
|
||||||
"everything", NULL);
|
"everything", NULL);
|
||||||
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "f",
|
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "f",
|
||||||
E_BINDING_MODIFIER_ALT | E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_CTRL, 0,
|
E_BINDING_MODIFIER_ALT | E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_CTRL, 0,
|
||||||
"composite", NULL);
|
"composite", "toggle_fps");
|
||||||
|
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Home",
|
||||||
|
E_BINDING_MODIFIER_ALT | E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_CTRL, 0,
|
||||||
|
"composite", "disable");
|
||||||
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "l",
|
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "l",
|
||||||
E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
|
E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
|
||||||
"desk_lock", NULL);
|
"desk_lock", NULL);
|
||||||
|
|
Loading…
Reference in New Issue