aaah.. much better way of handling click pass-thru allowance :)

SVN revision: 5595
This commit is contained in:
Carsten Haitzler 2001-10-30 11:06:46 +00:00
parent 467a45e0eb
commit caf1c2fcca
3 changed files with 35 additions and 32 deletions

View File

@ -56,23 +56,6 @@ enum _ecore_ev_modifiers
typedef enum _ecore_ev_modifiers Ecore_Event_Key_Modifiers;
struct _ecore_xid
{
Window win;
Window parent;
Window root;
int children_num;
Window *children;
int x, y, w, h;
int mapped;
int mouse_in;
int depth;
int gravity;
int coords_invalid;
int bw;
int grab_button_auto_replay;
};
#ifdef __cplusplus
extern "C"
{
@ -332,9 +315,6 @@ extern "C"
int bb);
void ecore_cursor_free(Cursor c);
void ecore_cursor_set(Window win, Cursor c);
void ecore_window_button_grab_auto_replay_set(Window win,
int on);
int ecore_window_button_grab_auto_replay_get(Window win);
typedef struct _ecore_event Ecore_Event;
typedef struct _ecore_event_fd_handler Ecore_Event_Fd_Handler;
@ -765,6 +745,24 @@ extern "C"
Ecore_Event_Ipc_Service *next;
};
struct _ecore_xid
{
Window win;
Window parent;
Window root;
int children_num;
Window *children;
int x, y, w, h;
int mapped;
int mouse_in;
int depth;
int gravity;
int coords_invalid;
int bw;
int (*grab_button_auto_replay) (Ecore_Event_Mouse_Down *ev);
};
void ecore_add_event(Ecore_Event_Type type, void *event,
void (*ev_free) (void *event));
void ecore_del_event(void *event);
@ -801,6 +799,10 @@ extern "C"
void ecore_event_x_init(void);
char *ecore_keypress_translate_into_typeable(Ecore_Event_Key_Down * e);
void ecore_window_button_grab_auto_replay_set(Window win,
int (*func) (Ecore_Event_Mouse_Down *ev));
void *ecore_window_button_grab_auto_replay_get(Window win);
#define ECORE_ATOM(atom, name) \
if (!atom) (atom) = ecore_atom_get(name);
#define MEMCPY(src, dst, type, num) \

View File

@ -413,7 +413,8 @@ ecore_event_x_handle_button_press(XEvent * xevent)
if (XFindContext(xevent->xbutton.display, e->win,
xid_context, (XPointer *) & xid) != XCNOENT)
{
if (xid->grab_button_auto_replay)
if ((xid->grab_button_auto_replay) &&
(xid->grab_button_auto_replay(e)))
{
ecore_pointer_replay(e->time);
}

View File

@ -216,7 +216,7 @@ ecore_add_xid(Window win, int x, int y, int w, int h, int depth, Window parent)
xid->children = NULL;
xid->gravity = ecore_window_get_gravity(win);
xid->bw = 0;
xid->grab_button_auto_replay = 0;
xid->grab_button_auto_replay = NULL;
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
ecore_add_child(parent, win);
return xid;
@ -277,7 +277,7 @@ ecore_validate_xid(Window win)
xid->mouse_in = 0;
xid->gravity = att.win_gravity;
xid->bw = att.border_width;
xid->grab_button_auto_replay = 0;
xid->grab_button_auto_replay = NULL;
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
ecore_add_child(xid->parent, win);
}
@ -916,7 +916,7 @@ void
ecore_event_allow(int mode, Time t)
{
if (!disp) return;
XAllowEvents(disp, mode, t);
XAllowEvents(disp, mode, t);
}
int
@ -2933,24 +2933,24 @@ ecore_window_get_root_relative_location(Window win, int *x, int *y)
}
void
ecore_window_button_grab_auto_replay_set(Window win, int on)
ecore_window_button_grab_auto_replay_set(Window win, int (*func) (Ecore_Event_Mouse_Down *ev))
{
Ecore_XID *xid = NULL;
if (!disp) return;
xid = ecore_validate_xid(win);
if (!xid) return;
xid->grab_button_auto_replay = on;
xid->grab_button_auto_replay = func;
}
int
void *
ecore_window_button_grab_auto_replay_get(Window win)
{
Ecore_XID *xid = NULL;
if (!disp) return 0;
if (!disp) return NULL;
xid = ecore_validate_xid(win);
if (!xid) return 0;
if (!xid) return NULL;
return xid->grab_button_auto_replay;
}
@ -3041,9 +3041,9 @@ void
ecore_pointer_replay(Time t)
{
if (!disp) return;
XSync(disp, False);
XAllowEvents(disp, ReplayPointer, t);
XSync(disp, False);
XSync(disp, False);
XAllowEvents(disp, ReplayPointer, t);
XSync(disp, False);
}
void