forked from enlightenment/enlightenment
fix up button bindings for windows - return the action found too so we can
track. SVN revision: 14510
This commit is contained in:
parent
51ce3de0c0
commit
350fab40ce
|
@ -72,7 +72,7 @@ e_bindings_init(void)
|
|||
"desk_flip_by", "0 -1");
|
||||
e_bindings_key_add(E_BINDING_CONTEXT_ANY,
|
||||
"Down", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
|
||||
"desk_flip_by", "0 -1");
|
||||
"desk_flip_by", "0 1");
|
||||
e_bindings_key_add(E_BINDING_CONTEXT_ANY,
|
||||
"Up", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
|
||||
"window_raise", "");
|
||||
|
@ -226,7 +226,7 @@ e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
E_Action *
|
||||
e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
|
@ -255,16 +255,16 @@ e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_
|
|||
act->func.go_mouse(obj, bind->params, ev);
|
||||
else if (act->func.go)
|
||||
act->func.go(obj, bind->params);
|
||||
return 1;
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
E_Action *
|
||||
e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
|
@ -293,13 +293,13 @@ e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_
|
|||
act->func.end_mouse(obj, bind->params, ev);
|
||||
else if (act->func.end)
|
||||
act->func.end(obj, bind->params);
|
||||
return 1;
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* FIXME: finish off key bindings */
|
||||
|
@ -394,7 +394,7 @@ e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
E_Action *
|
||||
e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
|
@ -423,16 +423,16 @@ e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_
|
|||
act->func.go_key(obj, bind->params, ev);
|
||||
else if (act->func.go)
|
||||
act->func.go(obj, bind->params);
|
||||
return 1;
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
E_Action *
|
||||
e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev)
|
||||
{
|
||||
E_Binding_Modifier mod = 0;
|
||||
|
@ -461,13 +461,13 @@ e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Ev
|
|||
act->func.end_key(obj, bind->params, ev);
|
||||
else if (act->func.end)
|
||||
act->func.end(obj, bind->params);
|
||||
return 1;
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* FIXME: finish off signal bindings */
|
||||
|
|
|
@ -36,15 +36,15 @@ EAPI void e_bindings_mouse_add(E_Binding_Context ctxt, int button, E_Bind
|
|||
EAPI void e_bindings_mouse_del(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, char *action, char *params);
|
||||
EAPI void e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI void e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI int e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev);
|
||||
EAPI int e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev);
|
||||
EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev);
|
||||
EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev);
|
||||
|
||||
EAPI void e_bindings_key_add(E_Binding_Context ctxt, char *key, E_Binding_Modifier mod, int any_mod, char *action, char *params);
|
||||
EAPI void e_bindings_key_del(E_Binding_Context ctxt, char *key, E_Binding_Modifier mod, int any_mod, char *action, char *params);
|
||||
EAPI void e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI void e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
|
||||
EAPI int e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev);
|
||||
EAPI int e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev);
|
||||
EAPI E_Action *e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev);
|
||||
EAPI E_Action *e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev);
|
||||
|
||||
EAPI int e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, char *sig, char *src);
|
||||
|
||||
|
|
|
@ -2346,8 +2346,11 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
|
|||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
if (e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev))
|
||||
if (!bd->cur_mouse_action)
|
||||
{
|
||||
bd->cur_mouse_action =
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER,
|
||||
E_OBJECT(bd), ev);
|
||||
}
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
|
@ -2399,9 +2402,20 @@ _e_border_cb_mouse_up(void *data, int type, void *event)
|
|||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
if (e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev))
|
||||
/* bug/problem. this action COULD be deleted during a move */
|
||||
/* ... VERY unlikely though... VERY */
|
||||
/* also we dont pass the same params that went in - then again that */
|
||||
/* should be ok as we are just ending the action if it has an end */
|
||||
if (bd->cur_mouse_action)
|
||||
{
|
||||
if (bd->cur_mouse_action->func.end_mouse)
|
||||
bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev);
|
||||
else if (bd->cur_mouse_action->func.end)
|
||||
bd->cur_mouse_action->func.end(E_OBJECT(bd), "");
|
||||
bd->cur_mouse_action = NULL;
|
||||
}
|
||||
else
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev);
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
|
|
|
@ -223,6 +223,7 @@ struct _E_Border
|
|||
} drag;
|
||||
|
||||
unsigned int layer;
|
||||
E_Action *cur_mouse_action;
|
||||
};
|
||||
|
||||
struct _E_Border_Pending_Move_Resize
|
||||
|
|
|
@ -503,7 +503,7 @@ void
|
|||
e_zone_desk_flip_by(E_Zone *zone, int dx, int dy)
|
||||
{
|
||||
dx = zone->desk_x_current + dx;
|
||||
dy = zone->desk_x_current + dy;
|
||||
dy = zone->desk_y_current + dy;
|
||||
e_zone_desk_flip_to(zone, dx, dy);
|
||||
}
|
||||
|
||||
|
@ -539,6 +539,7 @@ e_zone_desk_linear_flip_to(E_Zone *zone, int x)
|
|||
|
||||
y = x / zone->desk_x_count;
|
||||
x = x - (y * zone->desk_x_count);
|
||||
y = y % zone->desk_y_count;
|
||||
e_zone_desk_flip_to(zone, x, y);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue