- Use XChangeWindowAttributes() instead of XSelectInput()
- Add event_mask_unset to allow deselecting events SVN revision: 9875
This commit is contained in:
parent
23d33a8d4f
commit
55c7533fc8
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue