ignore events.

Should we add extra windows to the ignore list (ecore_x_window_ignore_set)?


SVN revision: 17317
This commit is contained in:
sebastid 2005-10-08 12:41:59 +00:00 committed by sebastid
parent a4c3c2868f
commit ae491b7811
3 changed files with 79 additions and 12 deletions

View File

@ -1517,6 +1517,46 @@ ecore_evas_sticky_get(Ecore_Evas *ee)
return ee->prop.sticky ? 1:0;
}
/**
* Set if this evas should ignore events
*
* @param ee The Ecore_Evas whose window's to ignore events
* @param sticky The Ecore_Evas new ignore state
*
*/
void
ecore_evas_ignore_events_set(Ecore_Evas *ee, int ignore)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_ignore_events_set");
return;
}
IFC(ee, fn_ignore_events_set) (ee, ignore);
IFE;
}
/**
* Returns the ignore state of an Ecore_Evas' window.
*
* @param ee The Ecore_Evas whose window's ignore events state is returned.
* @return The Ecore_Evas window's ignore state.
*
*/
int
ecore_evas_ignore_events_get(Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_ignore_events_get");
return 0;
} else
return ee->ignore_events ? 1 : 0;
}
#ifndef WIN32
/* fps debug calls - for debugging how much time your app actually spends */
/* rendering graphics... :) */

View File

@ -82,6 +82,7 @@ struct _Ecore_Evas_Engine_Func
void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
};
struct _Ecore_Evas_Engine
@ -205,6 +206,8 @@ struct _Ecore_Evas
Ecore_Evas_Engine engine;
Evas_List *sub_ecore_evas;
unsigned char ignore_events : 1;
};
#ifdef BUILD_ECORE_X

View File

@ -333,7 +333,7 @@ _ecore_evas_x_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *e
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
evas_event_feed_key_down(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, e->time, NULL);
return 1;
@ -347,7 +347,7 @@ _ecore_evas_x_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *eve
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
evas_event_feed_key_up(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, e->time, NULL);
return 1;
@ -362,7 +362,7 @@ _ecore_evas_x_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
@ -378,7 +378,7 @@ _ecore_evas_x_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
evas_event_feed_mouse_up(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
return 1;
@ -393,8 +393,7 @@ _ecore_evas_x_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee)
return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
@ -410,7 +409,7 @@ _ecore_evas_x_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
_ecore_evas_x_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
@ -424,7 +423,7 @@ _ecore_evas_x_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *e
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
if (e->event_win == ee->engine.x.win_container) return 0;
/* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
@ -442,7 +441,7 @@ _ecore_evas_x_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
if (e->event_win == ee->engine.x.win_container) return 0;
/* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
_ecore_evas_x_modifier_locks_update(ee, e->modifiers);
@ -461,7 +460,7 @@ _ecore_evas_x_event_window_focus_in(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
ee->prop.focused = 1;
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
return 1;
@ -475,7 +474,7 @@ _ecore_evas_x_event_window_focus_out(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_x_match(e->win);
if (!ee) return 1; /* pass on event */
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
if (ee->prop.fullscreen)
ecore_x_window_focus(ee->engine.x.win);
ee->prop.focused = 0;
@ -1384,6 +1383,30 @@ _ecore_evas_x_sticky_set(Ecore_Evas *ee, int sticky)
_ecore_evas_x_state_update(ee);
}
static void
_ecore_evas_x_ignore_events_set(Ecore_Evas *ee, int ignore)
{
if ((ee->ignore_events && ignore) ||
(!ee->ignore_events && !ignore)) return;
if (ignore)
{
ee->ignore_events = 1;
if (ee->engine.x.win_container)
ecore_x_window_ignore_set(ee->engine.x.win_container, 1);
if (ee->engine.x.win)
ecore_x_window_ignore_set(ee->engine.x.win, 1);
}
else
{
ee->ignore_events = 0;
if (ee->engine.x.win_container)
ecore_x_window_ignore_set(ee->engine.x.win_container, 0);
if (ee->engine.x.win)
ecore_x_window_ignore_set(ee->engine.x.win, 0);
}
}
static void
_ecore_evas_x_override_set(Ecore_Evas *ee, int on)
{
@ -1605,7 +1628,8 @@ static const Ecore_Evas_Engine_Func _ecore_x_engine_func =
_ecore_evas_x_fullscreen_set,
_ecore_evas_x_avoid_damage_set,
_ecore_evas_x_withdrawn_set,
_ecore_evas_x_sticky_set
_ecore_evas_x_sticky_set,
_ecore_evas_x_ignore_events_set
};
#endif