mouse buttons on desktop are now configurable. you can configurew what

buttons do what - default is what it was. you will need to rm your config to
get this...


SVN revision: 14611
This commit is contained in:
Carsten Haitzler 2005-05-05 08:33:17 +00:00
parent 978bef16d6
commit 55da077571
4 changed files with 124 additions and 55 deletions

View File

@ -369,99 +369,100 @@ _e_actions_menu_find(char *name)
} }
ACT_FN_GO(menu_show) ACT_FN_GO(menu_show)
{ {
E_Zone *zone; E_Zone *zone = NULL;
/* menu is active - abort */ /* menu is active - abort */
if (e_menu_grab_window_get()) return; if (e_menu_grab_window_get()) return;
if (!obj) return; if (!obj) return;
if (obj->type == E_MANAGER_TYPE) if (obj->type == E_MANAGER_TYPE)
zone = e_util_zone_current_get((E_Manager *)obj);
else if (obj->type == E_ZONE_TYPE)
zone = (E_Zone *)obj;
if (zone)
{ {
zone = e_util_zone_current_get((E_Manager *)obj); if (params)
if (zone)
{ {
if (params) E_Menu *m = NULL;
m = _e_actions_menu_find(params);
if (m)
{ {
E_Menu *m = NULL; int x, y;
m = _e_actions_menu_find(params); /* FIXME: this is a bit of a hack... setting m->con - bad hack */
if (m) m->zone = zone;
{ ecore_x_pointer_xy_get(zone->container->win, &x, &y);
int x, y; e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
e_menu_activate_mouse(m, zone, x, y, 1, 1,
/* FIXME: this is a bit of a hack... setting m->con - bad hack */ E_MENU_POP_DIRECTION_DOWN);
m->zone = zone;
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
e_menu_activate_mouse(m, zone, x, y, 1, 1,
E_MENU_POP_DIRECTION_DOWN);
}
} }
} }
} }
} }
ACT_FN_GO_MOUSE(menu_show) ACT_FN_GO_MOUSE(menu_show)
{ {
E_Zone *zone; E_Zone *zone = NULL;
/* menu is active - abort */ /* menu is active - abort */
if (e_menu_grab_window_get()) return; if (e_menu_grab_window_get()) return;
if (!obj) return; if (!obj) return;
if (obj->type == E_MANAGER_TYPE) if (obj->type == E_MANAGER_TYPE)
zone = e_util_zone_current_get((E_Manager *)obj);
else if (obj->type == E_ZONE_TYPE)
zone = (E_Zone *)obj;
if (zone)
{ {
zone = e_util_zone_current_get((E_Manager *)obj); if (params)
if (zone)
{ {
if (params) E_Menu *m = NULL;
m = _e_actions_menu_find(params);
if (m)
{ {
E_Menu *m = NULL; int x, y;
m = _e_actions_menu_find(params); /* FIXME: this is a bit of a hack... setting m->con - bad hack */
if (m) m->zone = zone;
{ x = ev->root.x;
int x, y; y = ev->root.y;
x -= zone->container->x;
/* FIXME: this is a bit of a hack... setting m->con - bad hack */ y -= zone->container->y;
m->zone = zone; e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
x = ev->root.x; e_menu_activate_mouse(m, zone, x, y, 1, 1,
y = ev->root.y; E_MENU_POP_DIRECTION_DOWN);
x -= zone->container->x; e_util_container_fake_mouse_up_all_later(zone->container);
y -= zone->container->y;
e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
e_menu_activate_mouse(m, zone, x, y, 1, 1,
E_MENU_POP_DIRECTION_DOWN);
}
} }
} }
} }
} }
ACT_FN_GO_KEY(menu_show) ACT_FN_GO_KEY(menu_show)
{ {
E_Zone *zone; E_Zone *zone = NULL;
/* menu is active - abort */ /* menu is active - abort */
if (e_menu_grab_window_get()) return; if (e_menu_grab_window_get()) return;
if (!obj) return; if (!obj) return;
if (obj->type == E_MANAGER_TYPE) if (obj->type == E_MANAGER_TYPE)
zone = e_util_zone_current_get((E_Manager *)obj);
else if (obj->type == E_ZONE_TYPE)
zone = (E_Zone *)obj;
if (zone)
{ {
zone = e_util_zone_current_get((E_Manager *)obj); if (params)
if (zone)
{ {
if (params) E_Menu *m = NULL;
m = _e_actions_menu_find(params);
if (m)
{ {
E_Menu *m = NULL; int x, y;
m = _e_actions_menu_find(params); /* FIXME: this is a bit of a hack... setting m->con - bad hack */
if (m) m->zone = zone;
{ ecore_x_pointer_xy_get(zone->container->win, &x, &y);
int x, y; e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
e_menu_activate_key(m, zone, x, y, 1, 1,
/* FIXME: this is a bit of a hack... setting m->con - bad hack */ E_MENU_POP_DIRECTION_DOWN);
m->zone = zone;
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
e_menu_activate_key(m, zone, x, y, 1, 1,
E_MENU_POP_DIRECTION_DOWN);
}
} }
} }
} }

View File

@ -240,6 +240,33 @@ e_config_init(void)
eb->action = strdup("window_menu"); eb->action = strdup("window_menu");
eb->params = strdup(""); eb->params = strdup("");
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->context = E_BINDING_CONTEXT_ZONE;
eb->button = 1;
eb->modifiers = 0;
eb->any_mod = 0;
eb->action = strdup("menu_show");
eb->params = strdup("main");
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->context = E_BINDING_CONTEXT_ZONE;
eb->button = 2;
eb->modifiers = 0;
eb->any_mod = 0;
eb->action = strdup("menu_show");
eb->params = strdup("clients");
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->context = E_BINDING_CONTEXT_ZONE;
eb->button = 3;
eb->modifiers = 0;
eb->any_mod = 0;
eb->action = strdup("menu_show");
eb->params = strdup("favorites");
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
} }
{ {
E_Config_Binding_Key *eb; E_Config_Binding_Key *eb;

View File

@ -328,7 +328,20 @@ _e_zone_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_i
ev = (Evas_Event_Mouse_Down *)event_info; ev = (Evas_Event_Mouse_Down *)event_info;
zone = data; zone = data;
if (e_menu_grab_window_get()) return; if (e_menu_grab_window_get()) return;
if (!zone->cur_mouse_action)
{
if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_DOWN)
{
Ecore_X_Event_Mouse_Button_Down *ev2;
ev2 = ecore_event_current_event_get();
zone->cur_mouse_action =
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_ZONE,
E_OBJECT(zone), ev2);
}
}
#if 0 /* FIXME: nuke this later once the new configurable bindings settle */
if (ev->button == 1) if (ev->button == 1)
{ {
E_Menu *m; E_Menu *m;
@ -361,6 +374,7 @@ _e_zone_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_i
E_MENU_POP_DIRECTION_DOWN); E_MENU_POP_DIRECTION_DOWN);
e_util_container_fake_mouse_up_all_later(zone->container); e_util_container_fake_mouse_up_all_later(zone->container);
} }
#endif
} }
static void static void
@ -371,6 +385,31 @@ _e_zone_cb_bg_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_inf
ev = (Evas_Event_Mouse_Up *)event_info; ev = (Evas_Event_Mouse_Up *)event_info;
zone = data; zone = data;
if (zone->cur_mouse_action)
{
if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_UP)
{
Ecore_X_Event_Mouse_Button_Up *ev2;
ev2 = ecore_event_current_event_get();
if (zone->cur_mouse_action->func.end_mouse)
zone->cur_mouse_action->func.end_mouse(E_OBJECT(zone), "", ev2);
else if (zone->cur_mouse_action->func.end)
zone->cur_mouse_action->func.end(E_OBJECT(zone), "");
}
zone->cur_mouse_action = NULL;
}
else
{
if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_UP)
{
Ecore_X_Event_Mouse_Button_Up *ev2;
ev2 = ecore_event_current_event_get();
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_ZONE,
E_OBJECT(zone), ev2);
}
}
} }
static void static void

View File

@ -39,6 +39,8 @@ struct _E_Zone
Ecore_Timer *timer; Ecore_Timer *timer;
E_Direction direction; E_Direction direction;
} flip; } flip;
E_Action *cur_mouse_action;
}; };
struct _E_Event_Zone_Desk_Count_Set struct _E_Event_Zone_Desk_Count_Set