- XWindowAttributes attribs_1;
- XSetWindowAttributes attribs_2;
-
- XGetWindowAttributes(dpy, win, &attribs_1);
- attribs_2.event_mask = attribs_1.your_event_mask | KEY_MASK | MOUSE_MASK;
- XChangeWindowAttributes(dpy, win, CWEventMask, &attribs_2);
-
-// inviso cursor
- XDefineCursor(dpy, win, CreateNullCursor(dpy, win));
-
- XGrabPointer(dpy, win, True, 0, GrabModeAsync, GrabModeAsync,
- win, None, CurrentTime);
-
-/* if (in_dgamouse.value) {
- int MajorVersion, MinorVersion;
-
- if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) {
- // unable to query, probalby not supported
- Con_Printf( "Failed to detect XF86DGA Mouse\n" );
- in_dgamouse.value = 0;
- } else {
- dgamouse = true;
- XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse);
- XWarpPointer(dpy, None, win, 0, 0, 0, 0, 0, 0);
- }
- } else {*/
- XWarpPointer(dpy, None, win,
- 0, 0, 0, 0,
- vid.width / 2, vid.height / 2);
-/* }*/
-
- XGrabKeyboard(dpy, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);