xcb: Be able to compile without xlib support

Use XCB types for events instead of indirectly depending
on Xlib includes because of the GLX includes. Manually verified
the right values.

ButtonPressMask			(1L<<2)
XCB_EVENT_MASK_BUTTON_PRESS = 4,

define ButtonReleaseMask		(1L<<3)
XCB_EVENT_MASK_BUTTON_RELEASE = 8,

ButtonMotionMask		(1L<<13)
XCB_EVENT_MASK_BUTTON_MOTION = 8192,

EnterWindowMask			(1L<<4)
XCB_EVENT_MASK_ENTER_WINDOW = 16,

LeaveWindowMask			(1L<<5)
XCB_EVENT_MASK_LEAVE_WINDOW = 32,

PointerMotionMask		(1L<<6)
XCB_EVENT_MASK_POINTER_MOTION = 64,

GrabModeAsync		1
XCB_GRAB_MODE_ASYNC = 1

Change-Id: I1fade68947b1e2f39ca3514573c10fae7ee2dfb1
Reviewed-on: http://codereview.qt.nokia.com/3664
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-08-24 21:09:16 +08:00 committed by Lars Knoll
parent ca56c9400c
commit a1909f834b

View File

@ -1304,7 +1304,7 @@ bool QXcbWindow::setKeyboardGrabEnabled(bool grab)
} }
xcb_grab_keyboard_cookie_t cookie = xcb_grab_keyboard(xcb_connection(), false, xcb_grab_keyboard_cookie_t cookie = xcb_grab_keyboard(xcb_connection(), false,
m_window, XCB_TIME_CURRENT_TIME, m_window, XCB_TIME_CURRENT_TIME,
GrabModeAsync, GrabModeAsync); XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
xcb_generic_error_t *err; xcb_generic_error_t *err;
xcb_grab_keyboard_reply_t *reply = xcb_grab_keyboard_reply(xcb_connection(), cookie, &err); xcb_grab_keyboard_reply_t *reply = xcb_grab_keyboard_reply(xcb_connection(), cookie, &err);
bool result = !(err || !reply || reply->status != XCB_GRAB_STATUS_SUCCESS); bool result = !(err || !reply || reply->status != XCB_GRAB_STATUS_SUCCESS);
@ -1320,9 +1320,10 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
return true; return true;
} }
xcb_grab_pointer_cookie_t cookie = xcb_grab_pointer(xcb_connection(), false, m_window, xcb_grab_pointer_cookie_t cookie = xcb_grab_pointer(xcb_connection(), false, m_window,
(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
| EnterWindowMask | LeaveWindowMask | PointerMotionMask), | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW
GrabModeAsync, GrabModeAsync, | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_POINTER_MOTION),
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
XCB_WINDOW_NONE, XCB_CURSOR_NONE, XCB_WINDOW_NONE, XCB_CURSOR_NONE,
XCB_TIME_CURRENT_TIME); XCB_TIME_CURRENT_TIME);
xcb_generic_error_t *err; xcb_generic_error_t *err;