put comp fixed keybinds back - why? it's an emergency "shit hit the

fan" key combo that u can always quote to anyone with problems and it
will never need configuring.



SVN revision: 76394
This commit is contained in:
Carsten Haitzler 2012-09-10 11:01:11 +00:00
parent 3243b919d4
commit 9de64890a0
4 changed files with 56 additions and 84 deletions

View File

@ -3169,6 +3169,59 @@ _e_mod_comp_bd_unfullscreen(void *data __UNUSED__,
}
//////////////////////////////////////////////////////////////////////////
static void
_e_mod_comp_fps_toggle(void)
{
if (_comp_mod)
{
Eina_List *l;
E_Comp *c;
if (_comp_mod->conf->fps_show)
{
_comp_mod->conf->fps_show = 0;
e_config_save_queue();
}
else
{
_comp_mod->conf->fps_show = 1;
e_config_save_queue();
}
EINA_LIST_FOREACH(compositors, l, c) _e_mod_comp_cb_update(c);
}
}
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);
}
}
else if ((!strcasecmp(ev->keyname, "f")) &&
(ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) &&
(ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(ev->modifiers & ECORE_EVENT_MODIFIER_ALT))
{
_e_mod_comp_fps_toggle();
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_mod_comp_signal_user(void *data __UNUSED__,
@ -3183,7 +3236,7 @@ _e_mod_comp_signal_user(void *data __UNUSED__,
}
else if (ev->number == 2)
{
e_mod_comp_fps_toggle();
_e_mod_comp_fps_toggle();
}
return ECORE_CALLBACK_PASS_ON;
}
@ -3750,6 +3803,7 @@ e_mod_comp_init(void)
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_SCREENSAVER_NOTIFY, _e_mod_comp_screensaver, 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(E_EVENT_CONTAINER_RESIZE, _e_mod_comp_randr, NULL));
@ -3836,29 +3890,6 @@ e_mod_comp_shutdown(void)
e_sys_handlers_set(NULL, NULL, NULL, NULL, NULL, NULL);
}
void
e_mod_comp_fps_toggle(void)
{
if (_comp_mod)
{
Eina_List *l;
E_Comp *c;
if (_comp_mod->conf->fps_show)
{
_comp_mod->conf->fps_show = 0;
e_config_save_queue();
}
else
{
_comp_mod->conf->fps_show = 1;
e_config_save_queue();
}
EINA_LIST_FOREACH(compositors, l, c)
_e_mod_comp_cb_update(c);
}
}
void
e_mod_comp_shadow_set(void)
{

View File

@ -9,7 +9,7 @@ typedef struct _E_Comp_Zone E_Comp_Zone;
Eina_Bool e_mod_comp_init(void);
void e_mod_comp_shutdown(void);
void e_mod_comp_fps_toggle(void);
void e_mod_comp_shadow_set(void);
#endif

View File

@ -19,7 +19,6 @@
/* module private routines */
Mod *_comp_mod = NULL;
static E_Action *act = NULL;
/* public module routines. all modules must have these */
EAPI E_Module_Api e_modapi =
@ -28,38 +27,6 @@ EAPI E_Module_Api e_modapi =
"Composite"
};
static void
_comp_disable(void)
{
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
_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();
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 *
e_modapi_init(E_Module *m)
{
@ -80,17 +47,6 @@ e_modapi_init(E_Module *m)
&(mod->conf_match_edd));
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
/* add module supplied action */
act = e_action_add("composite");
if (act)
{
act->func.go = _e_mod_action_cb;
act->func.go_key = _e_mod_action_key_cb;
e_action_predef_name_set(_("Composite"), _("Toggle FPS Display"),
"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 (!e_config->use_composite)
@ -166,15 +122,6 @@ e_modapi_shutdown(E_Module *m)
}
_e_mod_config_free(m);
if (act)
{
e_action_predef_name_del(_("Composite"),
_("Toggle FPS Display"));
e_action_predef_name_del(_("Composite"),
_("Disable Composite Module"));
e_action_del("composite");
}
E_CONFIG_DD_FREE(mod->conf_match_edd);
E_CONFIG_DD_FREE(mod->conf_edd);
free(mod);

View File

@ -615,12 +615,6 @@ _restore_key_binding_defaults_cb(void *data,
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Escape",
E_BINDING_MODIFIER_ALT, 0,
"everything", NULL);
CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "f",
E_BINDING_MODIFIER_ALT | E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_CTRL, 0,
"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",
E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
"desk_lock", NULL);