- Use XChangeWindowAttributes() instead of XSelectInput()

- Add event_mask_unset to allow deselecting events


SVN revision: 9875
This commit is contained in:
xcomputerman 2004-04-23 22:48:21 +00:00 committed by xcomputerman
parent 23d33a8d4f
commit 55c7533fc8
2 changed files with 16 additions and 1 deletions

View File

@ -698,6 +698,7 @@ int ecore_x_error_request_get(void);
int ecore_x_error_code_get(void);
void ecore_x_event_mask_set(Ecore_X_Window w, long mask);
void ecore_x_event_mask_unset(Ecore_X_Window w, long mask);
int ecore_x_selection_primary_set(Ecore_X_Window w, unsigned char *data, int size);
int ecore_x_selection_primary_clear(void);

View File

@ -19,10 +19,24 @@ void
ecore_x_event_mask_set(Ecore_X_Window w, long mask)
{
XWindowAttributes attr;
XSetWindowAttributes s_attr;
memset(&attr, 0, sizeof(XWindowAttributes));
XGetWindowAttributes(_ecore_x_disp, w, &attr);
XSelectInput(_ecore_x_disp, w, mask | attr.your_event_mask);
s_attr.event_mask = mask | attr.your_event_mask;
XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
}
void
ecore_x_event_mask_unset(Ecore_X_Window w, long mask)
{
XWindowAttributes attr;
XSetWindowAttributes s_attr;
memset(&attr, 0, sizeof(XWindowAttributes));
XGetWindowAttributes(_ecore_x_disp, w, &attr);
s_attr.event_mask = attr.your_event_mask & ~mask;
XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
}
static void