forked from enlightenment/enlightenment
ecore_x:
* in ecore_x_pointer_xy_get, fill x & y with '-1', if the pointer is not in the same screen as the given window * add 'same_screen' and 'root_win' information for the XEvents dealing with keyboard and mouse events e: * make sure e_manager_current_get returns the correct manager for the current screen * fix various modules to use the correct window, when dealing with events SVN revision: 34705
This commit is contained in:
parent
56dbfb6eb1
commit
aeb7c1642a
|
@ -17,6 +17,7 @@ static int _e_manager_cb_screensaver_notify(void *data, int ev_type, void *ev);
|
||||||
static Evas_Bool _e_manager_frame_extents_free_cb(const Evas_Hash *hash __UNUSED__,
|
static Evas_Bool _e_manager_frame_extents_free_cb(const Evas_Hash *hash __UNUSED__,
|
||||||
const char *key __UNUSED__,
|
const char *key __UNUSED__,
|
||||||
void *data, void *fdata __UNUSED__);
|
void *data, void *fdata __UNUSED__);
|
||||||
|
static E_Manager *_e_manager_get_for_root(Ecore_X_Window root);
|
||||||
#if 0 /* use later - maybe */
|
#if 0 /* use later - maybe */
|
||||||
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev);
|
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev);
|
||||||
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev);
|
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev);
|
||||||
|
@ -456,6 +457,8 @@ e_manager_current_get(void)
|
||||||
{
|
{
|
||||||
man = l->data;
|
man = l->data;
|
||||||
ecore_x_pointer_xy_get(man->win, &x, &y);
|
ecore_x_pointer_xy_get(man->win, &x, &y);
|
||||||
|
if (x == -1 && y == -1)
|
||||||
|
continue;
|
||||||
if (E_INSIDE(x, y, man->x, man->y, man->w, man->h))
|
if (E_INSIDE(x, y, man->x, man->y, man->w, man->h))
|
||||||
return man;
|
return man;
|
||||||
}
|
}
|
||||||
|
@ -584,7 +587,9 @@ _e_manager_cb_key_down(void *data, int ev_type __UNUSED__, void *ev)
|
||||||
|
|
||||||
man = data;
|
man = data;
|
||||||
e = ev;
|
e = ev;
|
||||||
|
|
||||||
if (e->event_win != man->root) return 1;
|
if (e->event_win != man->root) return 1;
|
||||||
|
if (e->root_win != man->root) man = _e_manager_get_for_root(e->root_win);
|
||||||
if (e_bindings_key_down_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev))
|
if (e_bindings_key_down_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev))
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -593,11 +598,6 @@ _e_manager_cb_key_down(void *data, int ev_type __UNUSED__, void *ev)
|
||||||
static int
|
static int
|
||||||
_e_manager_cb_key_up(void *data, int ev_type __UNUSED__, void *ev)
|
_e_manager_cb_key_up(void *data, int ev_type __UNUSED__, void *ev)
|
||||||
{
|
{
|
||||||
E_Manager *man;
|
|
||||||
Ecore_X_Event_Key_Up *e;
|
|
||||||
|
|
||||||
man = data;
|
|
||||||
e = ev;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,6 +783,24 @@ _e_manager_frame_extents_free_cb(const Evas_Hash *hash __UNUSED__, const char *k
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static E_Manager *
|
||||||
|
_e_manager_get_for_root(Ecore_X_Window root)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
E_Manager *man;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
if (!managers) return NULL;
|
||||||
|
for (l = managers; l; l = l->next)
|
||||||
|
{
|
||||||
|
man = l->data;
|
||||||
|
if (man->root == root)
|
||||||
|
return man;
|
||||||
|
}
|
||||||
|
return managers->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0 /* use later - maybe */
|
#if 0 /* use later - maybe */
|
||||||
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev){return 1;}
|
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev){return 1;}
|
||||||
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev){return 1;}
|
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev){return 1;}
|
||||||
|
|
|
@ -1242,7 +1242,7 @@ _e_exebuf_cb_key_down(void *data, int type, void *event)
|
||||||
ev_last_is_mouse = 0;
|
ev_last_is_mouse = 0;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
if (!strcmp(ev->keysymbol, "Up"))
|
if (!strcmp(ev->keysymbol, "Up"))
|
||||||
_e_exebuf_prev();
|
_e_exebuf_prev();
|
||||||
else if (!strcmp(ev->keysymbol, "Down"))
|
else if (!strcmp(ev->keysymbol, "Down"))
|
||||||
|
@ -1295,7 +1295,7 @@ _e_exebuf_cb_mouse_down(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Button_Down *ev;
|
Ecore_X_Event_Mouse_Button_Down *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
if (ev_last_mouse_exe && (exe_sel != ev_last_mouse_exe))
|
if (ev_last_mouse_exe && (exe_sel != ev_last_mouse_exe))
|
||||||
{
|
{
|
||||||
|
@ -1313,7 +1313,7 @@ _e_exebuf_cb_mouse_up(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Button_Up *ev;
|
Ecore_X_Event_Mouse_Button_Up *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
if (ev->button == 1)
|
if (ev->button == 1)
|
||||||
_e_exebuf_exec();
|
_e_exebuf_exec();
|
||||||
else if (ev->button == 2)
|
else if (ev->button == 2)
|
||||||
|
@ -1328,7 +1328,7 @@ _e_exebuf_cb_mouse_move(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Move *ev;
|
Ecore_X_Event_Mouse_Move *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
if (!ev_last_is_mouse)
|
if (!ev_last_is_mouse)
|
||||||
{
|
{
|
||||||
|
@ -1358,7 +1358,7 @@ _e_exebuf_cb_mouse_wheel(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Wheel *ev;
|
Ecore_X_Event_Mouse_Wheel *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
ev_last_is_mouse = 0;
|
ev_last_is_mouse = 0;
|
||||||
|
|
||||||
|
|
|
@ -2526,7 +2526,7 @@ _pager_popup_cb_mouse_down(void *data, int type, void *event)
|
||||||
Pager_Popup *pp = act_popup;
|
Pager_Popup *pp = act_popup;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
evas_event_feed_mouse_down(pp->popup->evas, ev->button,
|
evas_event_feed_mouse_down(pp->popup->evas, ev->button,
|
||||||
0, ev->time, NULL);
|
0, ev->time, NULL);
|
||||||
|
@ -2540,7 +2540,7 @@ _pager_popup_cb_mouse_up(void *data, int type, void *event)
|
||||||
Pager_Popup *pp = act_popup;
|
Pager_Popup *pp = act_popup;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
evas_event_feed_mouse_up(pp->popup->evas, ev->button,
|
evas_event_feed_mouse_up(pp->popup->evas, ev->button,
|
||||||
0, ev->time, NULL);
|
0, ev->time, NULL);
|
||||||
|
@ -2554,7 +2554,7 @@ _pager_popup_cb_mouse_move(void *data, int type, void *event)
|
||||||
Pager_Popup *pp = act_popup;
|
Pager_Popup *pp = act_popup;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
evas_event_feed_mouse_move(pp->popup->evas,
|
evas_event_feed_mouse_move(pp->popup->evas,
|
||||||
ev->x - pp->popup->x + pp->pager->zone->x,
|
ev->x - pp->popup->x + pp->pager->zone->x,
|
||||||
|
@ -2588,7 +2588,7 @@ _pager_popup_cb_key_down(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Key_Down *ev;
|
Ecore_X_Event_Key_Down *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
if (!strcmp(ev->keysymbol, "Up"))
|
if (!strcmp(ev->keysymbol, "Up"))
|
||||||
_pager_popup_desk_switch(0, -1);
|
_pager_popup_desk_switch(0, -1);
|
||||||
else if (!strcmp(ev->keysymbol, "Down"))
|
else if (!strcmp(ev->keysymbol, "Down"))
|
||||||
|
|
|
@ -748,7 +748,7 @@ _e_winlist_cb_key_down(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Key_Down *ev;
|
Ecore_X_Event_Key_Down *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
if (!strcmp(ev->keysymbol, "Up"))
|
if (!strcmp(ev->keysymbol, "Up"))
|
||||||
e_winlist_prev();
|
e_winlist_prev();
|
||||||
else if (!strcmp(ev->keysymbol, "Down"))
|
else if (!strcmp(ev->keysymbol, "Down"))
|
||||||
|
@ -890,7 +890,7 @@ _e_winlist_cb_mouse_down(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Button_Down *ev;
|
Ecore_X_Event_Mouse_Button_Down *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINLIST,
|
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||||
E_OBJECT(winlist->zone), ev);
|
E_OBJECT(winlist->zone), ev);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -902,7 +902,7 @@ _e_winlist_cb_mouse_up(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Button_Up *ev;
|
Ecore_X_Event_Mouse_Button_Up *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINLIST,
|
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||||
E_OBJECT(winlist->zone), ev);
|
E_OBJECT(winlist->zone), ev);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -914,7 +914,7 @@ _e_winlist_cb_mouse_wheel(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Wheel *ev;
|
Ecore_X_Event_Mouse_Wheel *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINLIST,
|
e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINLIST,
|
||||||
E_OBJECT(winlist->zone), ev);
|
E_OBJECT(winlist->zone), ev);
|
||||||
if (ev->z < 0) /* up */
|
if (ev->z < 0) /* up */
|
||||||
|
@ -938,7 +938,7 @@ _e_winlist_cb_mouse_move(void *data, int type, void *event)
|
||||||
Ecore_X_Event_Mouse_Move *ev;
|
Ecore_X_Event_Mouse_Move *ev;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->win != input_window) return 1;
|
if (ev->event_win != input_window) return 1;
|
||||||
|
|
||||||
evas_event_feed_mouse_move(winlist->evas, ev->x - winlist->x +
|
evas_event_feed_mouse_move(winlist->evas, ev->x - winlist->x +
|
||||||
winlist->zone->x, ev->y - winlist->y + winlist->zone->y, ev->time, NULL);
|
winlist->zone->x, ev->y - winlist->y + winlist->zone->y, ev->time, NULL);
|
||||||
|
|
Loading…
Reference in New Issue