Let me introduce you to Ecore_Input. The idea is to share as much as possible event

between all ecore graphic engine to ease porting of application and reduce the amount of
specific code per engine. This patch does just that.
	All your application should continu to work has previously, if it's not the case
please report any new behaviour regarding mouse and keyboard.


SVN revision: 39505
devs/princeamd/enlightenment-0.17-elive
Cedric BAIL 14 years ago
parent 684fbe122c
commit 46e8efcd8c
  1. 1
      configure.ac
  2. 1
      src/bin/e.h
  3. 24
      src/bin/e_actions.c
  4. 10
      src/bin/e_actions.h
  5. 191
      src/bin/e_bindings.c
  6. 16
      src/bin/e_bindings.h
  7. 169
      src/bin/e_border.c
  8. 10
      src/bin/e_border.h
  9. 84
      src/bin/e_container.c
  10. 32
      src/bin/e_desklock.c
  11. 28
      src/bin/e_dnd.c
  12. 8
      src/bin/e_dnd.h
  13. 4
      src/bin/e_fm.c
  14. 16
      src/bin/e_manager.c
  15. 104
      src/bin/e_menu.c
  16. 16
      src/bin/e_pointer.c
  17. 24
      src/bin/e_popup.c
  18. 3
      src/bin/e_widget_toolbar.c
  19. 40
      src/bin/e_zone.c
  20. 36
      src/modules/conf_keybindings/e_int_config_keybindings.c
  21. 48
      src/modules/conf_mousebindings/e_int_config_mousebindings.c
  22. 72
      src/modules/exebuf/e_exebuf.c
  23. 6
      src/modules/illume/e_appwin.c
  24. 6
      src/modules/illume/e_busywin.c
  25. 20
      src/modules/illume/e_simplelock.c
  26. 6
      src/modules/illume/e_slipshelf.c
  27. 6
      src/modules/illume/e_slipwin.c
  28. 6
      src/modules/illume/e_syswin.c
  29. 14
      src/modules/mixer/e_mod_main.c
  30. 26
      src/modules/pager/e_mod_config.c
  31. 106
      src/modules/pager/e_mod_main.c
  32. 46
      src/modules/syscon/e_syscon.c
  33. 8
      src/modules/winlist/e_mod_main.c
  34. 128
      src/modules/winlist/e_winlist.c

@ -238,6 +238,7 @@ PKG_CHECK_MODULES(E, [
ecore
ecore-x
ecore-evas
ecore-input
ecore-con
ecore-ipc
ecore-job

@ -69,6 +69,7 @@
#include <Ecore_X_Atoms.h>
#include <Ecore_X_Cursor.h>
#include <Ecore_Evas.h>
#include <Ecore_Input.h>
#include <Ecore_Con.h>
#include <Ecore_Ipc.h>
#include <Ecore_Job.h>

@ -21,14 +21,14 @@
if (act) act->func.go_mouse = _e_actions_act_##name##_go_mouse; \
}
#define ACT_FN_GO_MOUSE(act) \
static void _e_actions_act_##act##_go_mouse(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev)
static void _e_actions_act_##act##_go_mouse(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
#define ACT_GO_WHEEL(name) \
{ \
act = e_action_add(#name); \
if (act) act->func.go_wheel = _e_actions_act_##name##_go_wheel; \
}
#define ACT_FN_GO_WHEEL(act) \
static void _e_actions_act_##act##_go_wheel(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Wheel *ev)
static void _e_actions_act_##act##_go_wheel(E_Object *obj, const char *params, Ecore_Event_Mouse_Wheel *ev)
#define ACT_GO_EDGE(name) \
{ \
act = e_action_add(#name); \
@ -49,7 +49,7 @@
if (act) act->func.go_key = _e_actions_act_##name##_go_key; \
}
#define ACT_FN_GO_KEY(act) \
static void _e_actions_act_##act##_go_key(E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev)
static void _e_actions_act_##act##_go_key(E_Object *obj, const char *params, Ecore_Event_Key *ev)
#define ACT_END(name) \
{ \
act = e_action_add(#name); \
@ -63,14 +63,14 @@
if (act) act->func.end_mouse = _e_actions_act_##name##_end_mouse; \
}
#define ACT_FN_END_MOUSE(act) \
static void _e_actions_act_##act##_end_mouse(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Up *ev)
static void _e_actions_act_##act##_end_mouse(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
#define ACT_END_KEY(name) \
{ \
act = e_action_add(#name); \
if (act) act->func.end_key = _e_actions_act_##name##_end_key; \
}
#define ACT_FN_END_KEY(act) \
static void _e_actions_act_##act##_end_key(E_Object *obj, const char *params, Ecore_X_Event_Key_Up *ev)
static void _e_actions_act_##act##_end_key(E_Object *obj, const char *params, Ecore_Event_Key *ev)
/* local subsystem functions */
static void _e_action_free(E_Action *act);
@ -1614,7 +1614,7 @@ ACT_FN_GO_MOUSE(menu_show)
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, ev->time);
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
}
}
}
@ -2332,7 +2332,7 @@ _delayed_action_list_parse(Delayed_Action *da, const char *params)
}
static void
_delayed_action_key_add(E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev)
_delayed_action_key_add(E_Object *obj, const char *params, Ecore_Event_Key *ev)
{
Delayed_Action *da;
@ -2350,7 +2350,7 @@ _delayed_action_key_add(E_Object *obj, const char *params, Ecore_X_Event_Key_Dow
}
static void
_delayed_action_key_del(E_Object *obj, const char *params, Ecore_X_Event_Key_Up *ev)
_delayed_action_key_del(E_Object *obj, const char *params, Ecore_Event_Key *ev)
{
Eina_List *l;
@ -2371,7 +2371,7 @@ _delayed_action_key_del(E_Object *obj, const char *params, Ecore_X_Event_Key_Up
}
static void
_delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev)
_delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
{
Delayed_Action *da;
@ -2383,13 +2383,13 @@ _delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_X_Event_Mouse
e_object_ref(da->obj);
}
da->mouse = 1;
da->button = ev->button;
da->button = ev->buttons;
if (params) _delayed_action_list_parse(da, params);
_delayed_actions = eina_list_append(_delayed_actions, da);
}
static void
_delayed_action_mouse_del(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Up *ev)
_delayed_action_mouse_del(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
{
Eina_List *l;
@ -2399,7 +2399,7 @@ _delayed_action_mouse_del(E_Object *obj, const char *params, Ecore_X_Event_Mouse
da = l->data;
if ((da->obj == obj) && (da->mouse) &&
(ev->button == da->button))
(ev->buttons == da->button))
{
_delayed_action_do(da);
_delayed_action_free(da);

@ -20,14 +20,14 @@ struct _E_Action
const char *name;
struct {
void (*go) (E_Object *obj, const char *params);
void (*go_mouse) (E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev);
void (*go_wheel) (E_Object *obj, const char *params, Ecore_X_Event_Mouse_Wheel *ev);
void (*go_mouse) (E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
void (*go_wheel) (E_Object *obj, const char *params, Ecore_Event_Mouse_Wheel *ev);
void (*go_edge) (E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
void (*go_key) (E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev);
void (*go_key) (E_Object *obj, const char *params, Ecore_Event_Key *ev);
void (*go_signal) (E_Object *obj, const char *params, const char *sig, const char *src);
void (*end) (E_Object *obj, const char *params);
void (*end_mouse) (E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Up *ev);
void (*end_key) (E_Object *obj, const char *params, Ecore_X_Event_Key_Up *ev);
void (*end_mouse) (E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
void (*end_key) (E_Object *obj, const char *params, Ecore_Event_Key *ev);
} func;
};

@ -11,6 +11,8 @@ static void _e_bindings_edge_free(E_Binding_Edge *bind);
static void _e_bindings_signal_free(E_Binding_Signal *bind);
static void _e_bindings_wheel_free(E_Binding_Wheel *bind);
static int _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt);
static E_Binding_Modifier _e_bindings_modifiers(unsigned int modifiers);
static int _e_ecore_modifiers(E_Binding_Modifier modifiers);
static int _e_bindings_edge_cb_timer(void *data);
/* local subsystem globals */
@ -199,18 +201,12 @@ e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
ecore_x_window_button_grab(win, bind->button,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE,
mod, bind->any_mod);
ecore_x_window_button_grab(win, bind->button,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE,
_e_ecore_modifiers(bind->mod),
bind->any_mod);
}
}
}
@ -227,35 +223,25 @@ e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
ecore_x_window_button_ungrab(win, bind->button,
mod, bind->any_mod);
_e_ecore_modifiers(bind->mod), bind->any_mod);
}
}
}
EAPI E_Action *
e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev, E_Binding_Mouse **bind_ret)
e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret)
{
E_Binding_Modifier mod = 0;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
mod = _e_bindings_modifiers(ev->modifiers);
for (l = mouse_bindings; l; l = l->next)
{
E_Binding_Mouse *bind;
bind = l->data;
if ((bind->button == ev->button) &&
if ((bind->button == ev->buttons) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
@ -272,7 +258,7 @@ e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_
}
EAPI E_Action *
e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev)
e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
{
E_Action *act;
E_Binding_Mouse *bind;
@ -290,21 +276,18 @@ e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_
}
EAPI E_Action *
e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev, E_Binding_Mouse **bind_ret)
e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret)
{
E_Binding_Modifier mod = 0;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
mod = _e_bindings_modifiers(ev->modifiers);
for (l = mouse_bindings; l; l = l->next)
{
E_Binding_Mouse *bind;
bind = l->data;
if ((bind->button == ev->button) &&
if ((bind->button == ev->buttons) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
@ -321,7 +304,7 @@ e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mo
}
EAPI E_Action *
e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev)
e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev)
{
E_Action *act;
E_Binding_Mouse *bind;
@ -407,18 +390,8 @@ e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
/* see comment in e_bindings on numlock
if (bind->mod & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
ecore_x_window_key_grab(win, bind->key,
mod, bind->any_mod);
_e_ecore_modifiers(bind->mod), bind->any_mod);
}
}
}
@ -435,48 +408,19 @@ e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
/* see comment in e_bindings on numlock
if (bind->mod & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
ecore_x_window_key_ungrab(win, bind->key,
mod, bind->any_mod);
_e_ecore_modifiers(bind->mod), bind->any_mod);
}
}
}
EAPI E_Action *
e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev)
e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev)
{
E_Binding_Modifier mod = 0;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
/* FIXME: there is a good reason numlock was ignored. sometimes people
* have it on, sometimes they don't, and often they have no idea. waaaay
* back in E 0.1->0.13 or so days this caused issues thus numlock,
* scrollock and capslock are not usable modifiers.
*
* if we REALLY want to be able to use numlock we need to add more binding
* flags and config that says "REALLY pay attention to numlock for this
* binding" field in the binding (like there is a "any_mod" flag - we need a
* "num_lock_respect" field)
*
* also it should be an E_BINDING_MODIFIER_LOCK_NUM as the ecore lock flag
* may vary from system to system as different xservers may have differing
* modifier masks for numlock (it is queried at startup).
*
if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
mod = _e_bindings_modifiers(ev->modifiers);
for (l = key_bindings; l; l = l->next)
{
E_Binding_Key *bind;
@ -506,18 +450,12 @@ e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_
}
EAPI E_Action *
e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev)
e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev)
{
E_Binding_Modifier mod = 0;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
/* see comment in e_bindings on numlock
if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
mod = _e_bindings_modifiers(ev->modifiers);
for (l = key_bindings; l; l = l->next)
{
E_Binding_Key *bind;
@ -842,15 +780,8 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
int button = 0;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
if (bind->direction == 0)
{
if (bind->z < 0) button = 4;
@ -864,7 +795,7 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win)
if (button != 0)
ecore_x_window_button_grab(win, button,
ECORE_X_EVENT_MASK_MOUSE_DOWN,
mod, bind->any_mod);
_e_ecore_modifiers(bind->mod), bind->any_mod);
}
}
}
@ -881,14 +812,8 @@ e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
bind = l->data;
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
int mod;
int button = 0;
mod = 0;
if (bind->mod & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_X_MODIFIER_SHIFT;
if (bind->mod & E_BINDING_MODIFIER_CTRL) mod |= ECORE_X_MODIFIER_CTRL;
if (bind->mod & E_BINDING_MODIFIER_ALT) mod |= ECORE_X_MODIFIER_ALT;
if (bind->mod & E_BINDING_MODIFIER_WIN) mod |= ECORE_X_MODIFIER_WIN;
if (bind->direction == 0)
{
if (bind->z < 0) button = 4;
@ -901,21 +826,18 @@ e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
}
if (button != 0)
ecore_x_window_button_ungrab(win, button,
mod, bind->any_mod);
_e_ecore_modifiers(bind->mod), bind->any_mod);
}
}
}
EAPI E_Action *
e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret)
e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret)
{
E_Binding_Modifier mod = 0;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
mod = _e_bindings_modifiers(ev->modifiers);
for (l = wheel_bindings; l; l = l->next)
{
E_Binding_Wheel *bind;
@ -939,7 +861,7 @@ e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse
}
EAPI E_Action *
e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Wheel *ev)
e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev)
{
E_Action *act;
E_Binding_Wheel *bind;
@ -1017,6 +939,51 @@ _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt)
return 0;
}
static E_Binding_Modifier
_e_bindings_modifiers(unsigned int modifiers)
{
E_Binding_Modifier mod = 0;
if (modifiers & ECORE_EVENT_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (modifiers & ECORE_EVENT_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (modifiers & ECORE_EVENT_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (modifiers & ECORE_EVENT_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
/* FIXME: there is a good reason numlock was ignored. sometimes people
* have it on, sometimes they don't, and often they have no idea. waaaay
* back in E 0.1->0.13 or so days this caused issues thus numlock,
* scrollock and capslock are not usable modifiers.
*
* if we REALLY want to be able to use numlock we need to add more binding
* flags and config that says "REALLY pay attention to numlock for this
* binding" field in the binding (like there is a "any_mod" flag - we need a
* "num_lock_respect" field)
*
* also it should be an E_BINDING_MODIFIER_LOCK_NUM as the ecore lock flag
* may vary from system to system as different xservers may have differing
* modifier masks for numlock (it is queried at startup).
*
if (ev->modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
return mod;
}
static int
_e_ecore_modifiers(E_Binding_Modifier modifiers)
{
int mod = 0;
if (modifiers & E_BINDING_MODIFIER_SHIFT) mod |= ECORE_EVENT_MODIFIER_SHIFT;
if (modifiers & E_BINDING_MODIFIER_CTRL) mod |= ECORE_EVENT_MODIFIER_CTRL;
if (modifiers & E_BINDING_MODIFIER_ALT) mod |= ECORE_EVENT_MODIFIER_ALT;
if (modifiers & E_BINDING_MODIFIER_WIN) mod |= ECORE_EVENT_MODIFIER_WIN;
/* see comment in e_bindings on numlock
if (modifiers & ECORE_X_LOCK_NUM) mod |= ECORE_X_LOCK_NUM;
*/
return mod;
}
static int
_e_bindings_edge_cb_timer(void *data)
{

@ -102,18 +102,18 @@ 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, const char *action, const 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 E_Action *e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev, E_Binding_Mouse **bind_ret);
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_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev, E_Binding_Mouse **bind_ret);
EAPI E_Action *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_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret);
EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
EAPI E_Action *e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret);
EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev);
EAPI void e_bindings_key_add(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
EAPI void e_bindings_key_del(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
EAPI E_Binding_Key *e_bindings_key_get(const char *action);
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 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 E_Action *e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev);
EAPI E_Action *e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev);
EAPI void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge);
@ -130,8 +130,8 @@ EAPI void e_bindings_wheel_add(E_Binding_Context ctxt, int direction, int
EAPI void e_bindings_wheel_del(E_Binding_Context ctxt, int direction, int z, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
EAPI void e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win);
EAPI void e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
EAPI E_Action *e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret);
EAPI E_Action *e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Wheel *ev);
EAPI E_Action *e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret);
EAPI E_Action *e_bindings_wheel_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev);
#endif
#endif

@ -279,12 +279,13 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
free(bd);
return NULL;
}
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_border_cb_mouse_in, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_border_cb_mouse_out, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_border_cb_mouse_down, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _e_border_cb_mouse_up, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _e_border_cb_mouse_move, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_border_cb_mouse_down, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _e_border_cb_mouse_up, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_border_cb_mouse_move, bd));
bd->handlers = eina_list_append(bd->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd));
bd->client.win = win;
@ -2729,10 +2730,10 @@ _e_border_action_move_timeout_add(void)
static int
_e_border_move_key_down(void *data, int type, void *event)
{
Ecore_X_Event_Key_Down *ev = event;
Ecore_Event_Key *ev = event;
int x, y;
if (ev->event_win != action_input_win)
if (ev->event_window != action_input_win)
return 1;
if (!action_border)
{
@ -2743,23 +2744,23 @@ _e_border_move_key_down(void *data, int type, void *event)
x = action_border->x;
y = action_border->y;
if (strcmp(ev->keysymbol, "Up") == 0)
if (strcmp(ev->key, "Up") == 0)
y -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dy);
else if (strcmp(ev->keysymbol, "Down") == 0)
else if (strcmp(ev->key, "Down") == 0)
y += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dy);
else if (strcmp(ev->keysymbol, "Left") == 0)
else if (strcmp(ev->key, "Left") == 0)
x -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dx);
else if (strcmp(ev->keysymbol, "Right") == 0)
else if (strcmp(ev->key, "Right") == 0)
x += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dx);
else if (strcmp(ev->keysymbol, "Return") == 0)
else if (strcmp(ev->key, "Return") == 0)
goto stop;
else if (strcmp(ev->keysymbol, "Escape") == 0)
else if (strcmp(ev->key, "Escape") == 0)
{
_e_border_action_restore_orig(action_border);
goto stop;
}
else if ((strncmp(ev->keysymbol, "Control", sizeof("Control") - 1) != 0) &&
(strncmp(ev->keysymbol, "Alt", sizeof("Alt") - 1) != 0))
else if ((strncmp(ev->key, "Control", sizeof("Control") - 1) != 0) &&
(strncmp(ev->key, "Alt", sizeof("Alt") - 1) != 0))
goto stop;
e_border_move(action_border, x, y);
@ -2776,9 +2777,9 @@ _e_border_move_key_down(void *data, int type, void *event)
static int
_e_border_move_mouse_down(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Down *ev = event;
Ecore_Event_Mouse_Button *ev = event;
if (ev->event_win != action_input_win)
if (ev->event_window != action_input_win)
return 1;
if (!action_border)
@ -2810,11 +2811,11 @@ e_border_act_move_keyboard(E_Border *bd)
if (action_handler_key)
ecore_event_handler_del(action_handler_key);
action_handler_key = ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, _e_border_move_key_down, NULL);
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_border_move_key_down, NULL);
if (action_handler_mouse)
ecore_event_handler_del(action_handler_mouse);
action_handler_mouse = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_border_move_mouse_down, NULL);
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_border_move_mouse_down, NULL);
}
static int
@ -2836,10 +2837,10 @@ _e_border_action_resize_timeout_add(void)
static int
_e_border_resize_key_down(void *data, int type, void *event)
{
Ecore_X_Event_Key_Down *ev = event;
Ecore_Event_Key *ev = event;
int w, h, dx, dy;
if (ev->event_win != action_input_win)
if (ev->event_window != action_input_win)
return 1;
if (!action_border)
{
@ -2857,23 +2858,23 @@ _e_border_resize_key_down(void *data, int type, void *event)
if (dy < action_border->client.icccm.step_h)
dy = action_border->client.icccm.step_h;
if (strcmp(ev->keysymbol, "Up") == 0)
if (strcmp(ev->key, "Up") == 0)
h -= _e_border_key_down_modifier_apply(ev->modifiers, dy);
else if (strcmp(ev->keysymbol, "Down") == 0)
else if (strcmp(ev->key, "Down") == 0)
h += _e_border_key_down_modifier_apply(ev->modifiers, dy);
else if (strcmp(ev->keysymbol, "Left") == 0)
else if (strcmp(ev->key, "Left") == 0)
w -= _e_border_key_down_modifier_apply(ev->modifiers, dx);
else if (strcmp(ev->keysymbol, "Right") == 0)
else if (strcmp(ev->key, "Right") == 0)
w += _e_border_key_down_modifier_apply(ev->modifiers, dx);
else if (strcmp(ev->keysymbol, "Return") == 0)
else if (strcmp(ev->key, "Return") == 0)
goto stop;
else if (strcmp(ev->keysymbol, "Escape") == 0)
else if (strcmp(ev->key, "Escape") == 0)
{
_e_border_action_restore_orig(action_border);
goto stop;
}
else if ((strncmp(ev->keysymbol, "Control", sizeof("Control") - 1) != 0) &&
(strncmp(ev->keysymbol, "Alt", sizeof("Alt") - 1) != 0))
else if ((strncmp(ev->key, "Control", sizeof("Control") - 1) != 0) &&
(strncmp(ev->key, "Alt", sizeof("Alt") - 1) != 0))
goto stop;
e_border_resize_limit(action_border, &w, &h);
@ -2891,9 +2892,9 @@ _e_border_resize_key_down(void *data, int type, void *event)
static int
_e_border_resize_mouse_down(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Down *ev = event;
Ecore_Event_Mouse_Button *ev = event;
if (ev->event_win != action_input_win)
if (ev->event_window != action_input_win)
return 1;
if (!action_border)
@ -2925,15 +2926,15 @@ e_border_act_resize_keyboard(E_Border *bd)
if (action_handler_key)
ecore_event_handler_del(action_handler_key);
action_handler_key = ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, _e_border_resize_key_down, NULL);
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_border_resize_key_down, NULL);
if (action_handler_mouse)
ecore_event_handler_del(action_handler_mouse);
action_handler_mouse = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_border_resize_mouse_down, NULL);
action_handler_mouse = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_border_resize_mouse_down, NULL);
}
EAPI void
e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
e_border_act_move_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev)
{
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
@ -2949,13 +2950,13 @@ e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
{
char source[256];
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->buttons);
_e_border_moveinfo_gather(bd, source);
}
}
EAPI void
e_border_act_move_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev)
e_border_act_move_end(E_Border *bd, Ecore_Event_Mouse_Button *ev)
{
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
@ -2968,7 +2969,7 @@ e_border_act_move_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev)
}
EAPI void
e_border_act_resize_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
e_border_act_resize_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev)
{
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
@ -3007,13 +3008,13 @@ e_border_act_resize_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
{
char source[256];
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->buttons);
_e_border_moveinfo_gather(bd, source);
}
}
EAPI void
e_border_act_resize_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev)
e_border_act_resize_end(E_Border *bd, Ecore_Event_Mouse_Button *ev)
{
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
@ -3028,7 +3029,7 @@ e_border_act_resize_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev)
}
EAPI void
e_border_act_menu_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev, int key)
e_border_act_menu_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev, int key)
{
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
@ -3037,7 +3038,7 @@ e_border_act_menu_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev, int k
e_int_border_menu_show(bd,
bd->x + bd->fx.x + ev->x - bd->zone->container->x,
bd->y + bd->fx.y + ev->y - bd->zone->container->y, key,
ev->time);
ev->timestamp);
}
else
{
@ -5120,12 +5121,12 @@ _e_border_cb_mouse_out(void *data, int type, void *event)
static int
_e_border_cb_mouse_wheel(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Wheel *ev;
Ecore_Event_Mouse_Wheel *ev;
E_Border *bd;
ev = event;
bd = data;
if (ev->event_win == bd->win)
if (ev->event_window == bd->win)
{
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
@ -5133,28 +5134,28 @@ _e_border_cb_mouse_wheel(void *data, int type, void *event)
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_BORDER,
E_OBJECT(bd), ev);
}
evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z, ev->time, NULL);
evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z, ev->timestamp, NULL);
return 1;
}
static int
_e_border_cb_mouse_down(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Down *ev;
Ecore_Event_Mouse_Button *ev;
E_Border *bd;
ev = event;
bd = data;
if (ev->event_win == bd->win)
if (ev->event_window == bd->win)
{
if ((ev->button >= 1) && (ev->button <= 3))
if ((ev->buttons >= 1) && (ev->buttons <= 3))
{
bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
bd->mouse.last_down[ev->button - 1].my = ev->root.y;
bd->mouse.last_down[ev->button - 1].x = bd->x + bd->fx.x;
bd->mouse.last_down[ev->button - 1].y = bd->y + bd->fx.y;
bd->mouse.last_down[ev->button - 1].w = bd->w;
bd->mouse.last_down[ev->button - 1].h = bd->h;
bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x;
bd->mouse.last_down[ev->buttons - 1].my = ev->root.y;
bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x;
bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y;
bd->mouse.last_down[ev->buttons - 1].w = bd->w;
bd->mouse.last_down[ev->buttons - 1].h = bd->h;
}
else
{
@ -5181,22 +5182,22 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
}
e_focus_event_mouse_down(bd);
}
if (ev->win != ev->event_win)
if (ev->window != ev->event_window)
{
return 1;
}
if ((ev->win != bd->event_win) && (ev->event_win != bd->win))
if ((ev->window != bd->event_win) && (ev->event_window != bd->win))
{
return 1;
}
if ((ev->button >= 1) && (ev->button <= 3))
if ((ev->buttons >= 1) && (ev->buttons <= 3))
{
bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
bd->mouse.last_down[ev->button - 1].my = ev->root.y;
bd->mouse.last_down[ev->button - 1].x = bd->x + bd->fx.x;
bd->mouse.last_down[ev->button - 1].y = bd->y + bd->fx.y;
bd->mouse.last_down[ev->button - 1].w = bd->w;
bd->mouse.last_down[ev->button - 1].h = bd->h;
bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x;
bd->mouse.last_down[ev->buttons - 1].my = ev->root.y;
bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x;
bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y;
bd->mouse.last_down[ev->buttons - 1].w = bd->w;
bd->mouse.last_down[ev->buttons - 1].h = bd->h;
}
else
{
@ -5221,7 +5222,7 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
evas_event_feed_mouse_down(bd->bg_evas, ev->button, flags, ev->time, NULL);
evas_event_feed_mouse_down(bd->bg_evas, ev->buttons, flags, ev->timestamp, NULL);
}
return 1;
}
@ -5229,19 +5230,19 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
static int
_e_border_cb_mouse_up(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Up *ev;
Ecore_Event_Mouse_Button *ev;
E_Border *bd;
ev = event;
bd = data;
if (ev->event_win == bd->win)
if (ev->event_window == bd->win)
{
if ((ev->button >= 1) && (ev->button <= 3))
if ((ev->buttons >= 1) && (ev->buttons <= 3))
{
bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
bd->mouse.last_up[ev->button - 1].my = ev->root.y;
bd->mouse.last_up[ev->button - 1].x = bd->x + bd->fx.x;
bd->mouse.last_up[ev->button - 1].y = bd->y + bd->fx.y;
bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x;
bd->mouse.last_up[ev->buttons - 1].my = ev->root.y;
bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x;
bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y;
}
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
@ -5262,33 +5263,33 @@ _e_border_cb_mouse_up(void *data, int type, void *event)
e_focus_event_mouse_up(bd);
}
}
if (ev->win != bd->event_win) return 1;
if ((ev->button >= 1) && (ev->button <= 3))
if (ev->window != bd->event_win) return 1;
if ((ev->buttons >= 1) && (ev->buttons <= 3))
{
bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
bd->mouse.last_up[ev->button - 1].my = ev->root.y;
bd->mouse.last_up[ev->button - 1].x = bd->x + bd->fx.x;
bd->mouse.last_up[ev->button - 1].y = bd->y + bd->fx.y;
bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x;
bd->mouse.last_up[ev->buttons - 1].my = ev->root.y;
bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x;
bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y;
}
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
bd->drag.start = 0;
evas_event_feed_mouse_up(bd->bg_evas, ev->button, EVAS_BUTTON_NONE, ev->time, NULL);
evas_event_feed_mouse_up(bd->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL);
return 1;
}
static int
_e_border_cb_mouse_move(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Move *ev;
Ecore_Event_Mouse_Move *ev;
E_Border *bd;
ev = event;
bd = data;
if ((ev->win != bd->event_win) &&
(ev->event_win != bd->win)) return 1;
if ((ev->window != bd->event_win) &&
(ev->event_window != bd->win)) return 1;
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
if (bd->moving)
@ -5399,7 +5400,7 @@ _e_border_cb_mouse_move(void *data, int type, void *event)
}
}
}
evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y, ev->time, NULL);
evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y, ev->timestamp, NULL);
}
return 1;
}
@ -5407,8 +5408,8 @@ _e_border_cb_mouse_move(void *data, int type, void *event)
static int
_e_border_cb_grab_replay(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Down *ev;
if (type != ECORE_X_EVENT_MOUSE_BUTTON_DOWN) return 0;
Ecore_Event_Mouse_Button *ev;
if (type != ECORE_EVENT_MOUSE_BUTTON_DOWN) return 0;
ev = event;
if ((e_config->pass_click_on) || (e_config->always_click_to_raise) ||
@ -5416,12 +5417,12 @@ _e_border_cb_grab_replay(void *data, int type, void *event)
{
E_Border *bd;
bd = e_border_find_by_window(ev->event_win);
bd = e_border_find_by_window(ev->event_window);
if (bd)
{
if (bd->cur_mouse_action)
return 0;
if (ev->event_win == bd->win)
if (ev->event_window == bd->win)
{
if (!e_bindings_mouse_down_find(E_BINDING_CONTEXT_BORDER,
E_OBJECT(bd), ev, NULL))

@ -602,11 +602,11 @@ EAPI Eina_List *e_border_client_list(void);
EAPI void e_border_act_move_keyboard(E_Border *bd);
EAPI void e_border_act_resize_keyboard(E_Border *bd);
EAPI void e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev);
EAPI void e_border_act_move_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev);
EAPI void e_border_act_resize_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev);
EAPI void e_border_act_resize_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev);
EAPI void e_border_act_menu_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev, int key);
EAPI void e_border_act_move_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev);
EAPI void e_border_act_move_end(E_Border *bd, Ecore_Event_Mouse_Button *ev);
EAPI void e_border_act_resize_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev);
EAPI void e_border_act_resize_end(E_Border *bd, Ecore_Event_Mouse_Button *ev);
EAPI void e_border_act_menu_begin(E_Border *bd, Ecore_Event_Mouse_Button *ev, int key);
EAPI void e_border_act_close_begin(E_Border *bd);
EAPI void e_border_act_kill_begin(E_Border *bd);

@ -14,7 +14,6 @@
static void _e_container_free(E_Container *con);
static E_Container *_e_container_find_by_event_window(Ecore_X_Window win);
static void _e_container_modifiers_update(Evas *evas, int modifiers);
static int _e_container_cb_mouse_in(void *data, int type, void *event);
static int _e_container_cb_mouse_out(void *data, int type, void *event);
@ -42,10 +41,10 @@ e_container_init(void)
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_container_cb_mouse_in, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_container_cb_mouse_out, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_container_cb_mouse_down, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _e_container_cb_mouse_up, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _e_container_cb_mouse_move, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL, _e_container_cb_mouse_wheel, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_container_cb_mouse_down, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _e_container_cb_mouse_up, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _e_container_cb_mouse_move, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, _e_container_cb_mouse_wheel, NULL));
return 1;
}
@ -994,45 +993,6 @@ _e_container_find_by_event_window(Ecore_X_Window win)
return NULL;
}
static void
_e_container_modifiers_update(Evas *evas, int modifiers)
{
if (modifiers & ECORE_X_MODIFIER_SHIFT)
evas_key_modifier_on(evas, "Shift");
else
evas_key_modifier_off(evas, "Shift");
if (modifiers & ECORE_X_MODIFIER_CTRL)
evas_key_modifier_on(evas, "Control");
else
evas_key_modifier_off(evas, "Control");
if (modifiers & ECORE_X_MODIFIER_ALT)
evas_key_modifier_on(evas, "Alt");
else
evas_key_modifier_off(evas, "Alt");
if (modifiers & ECORE_X_MODIFIER_WIN)
{
evas_key_modifier_on(evas, "Super");
evas_key_modifier_on(evas, "Hyper");
}
else
{
evas_key_modifier_off(evas, "Super");
evas_key_modifier_off(evas, "Hyper");
}
if (modifiers & ECORE_X_LOCK_SCROLL)
evas_key_lock_on(evas, "Scroll_Lock");
else
evas_key_lock_off(evas, "Scroll_Lock");
if (modifiers & ECORE_X_LOCK_NUM)
evas_key_lock_on(evas, "Num_Lock");
else
evas_key_lock_off(evas, "Num_Lock");
if (modifiers & ECORE_X_LOCK_CAPS)
evas_key_lock_on(evas, "Caps_Lock");
else
evas_key_lock_off(evas, "Caps_Lock");
}
static int
_e_container_cb_mouse_in(void *data, int type, void *event)
{
@ -1046,7 +1006,7 @@ _e_container_cb_mouse_in(void *data, int type, void *event)
{
bd = e_border_focused_get();
if (bd) e_focus_event_mouse_out(bd);
_e_container_modifiers_update(con->bg_evas, ev->modifiers);
ecore_evas_event_modifier_lock_update(con->bg_evas, ev->modifiers);
evas_event_feed_mouse_in(con->bg_evas, ev->time, NULL);
}
return 1;
@ -1062,7 +1022,7 @@ _e_container_cb_mouse_out(void *data, int type, void *event)
con = _e_container_find_by_event_window(ev->event_win);
if (con)
{
_e_container_modifiers_update(con->bg_evas, ev->modifiers);
ecore_evas_event_modifier_lock_update(con->bg_evas, ev->modifiers);
if (ev->mode == ECORE_X_EVENT_MODE_GRAB)
evas_event_feed_mouse_cancel(con->bg_evas, ev->time, NULL);
evas_event_feed_mouse_out(con->bg_evas, ev->time, NULL);
@ -1073,11 +1033,11 @@ _e_container_cb_mouse_out(void *data, int type, void *event)
static int
_e_container_cb_mouse_down(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Down *ev;
Ecore_Event_Mouse_Button *ev;
E_Container *con;
ev = event;
con = _e_container_find_by_event_window(ev->event_win);
con = _e_container_find_by_event_window(ev->event_window);
if (con)
{
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
@ -1086,8 +1046,8 @@ _e_container_cb_mouse_down(void *data, int type, void *event)
E_OBJECT(con), ev);
if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
_e_container_modifiers_update(con->bg_evas, ev->modifiers);
evas_event_feed_mouse_down(con->bg_evas, ev->button, flags, ev->time, NULL);
ecore_evas_event_modifier_lock_update(con->bg_evas, ev->modifiers);
evas_event_feed_mouse_down(con->bg_evas, ev->buttons, flags, ev->timestamp, NULL);
}
return 1;
}
@ -1095,15 +1055,15 @@ _e_container_cb_mouse_down(void *data, int type, void *event)
static int
_e_container_cb_mouse_up(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Button_Up *ev;
Ecore_Event_Mouse_Button *ev;
E_Container *con;
ev = event;
con = _e_container_find_by_event_window(ev->event_win);
con = _e_container_find_by_event_window(ev->event_window);
if (con)
{
evas_event_feed_mouse_up(con->bg_evas, ev->button, EVAS_BUTTON_NONE, ev->time, NULL);
_e_container_modifiers_update(con->bg_evas, ev->modifiers);
evas_event_feed_mouse_up(con->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL);
ecore_evas_event_modifier_lock_update(con->bg_evas, ev->modifiers);
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_CONTAINER,
E_OBJECT(con), ev);
}
@ -1113,15 +1073,15 @@ _e_container_cb_mouse_up(void *data, int type, void *event)
static int
_e_container_cb_mouse_move(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Move *ev;
Ecore_Event_Mouse_Move *ev;