summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-02-27 19:51:06 +0100
committerDave Davenport <qball@gmpclient.org>2016-02-27 19:51:06 +0100
commit305829fcc841b41ef0441c6a7ea2ee845f66aa64 (patch)
tree6202f8f2eb4b4a1d810c915d656011d4cfe96730 /source
parentdce35ba4ef92020b685616d18bd9d29f3d954ceb (diff)
query pointer to xcb
Diffstat (limited to 'source')
-rw-r--r--source/x11-helper.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index aa19d906..c79857d2 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -80,6 +80,8 @@ const char *netatom_names[] = { EWMH_ATOMS ( ATOM_CHAR ) };
static unsigned int x11_mod_masks[NUM_X11MOD];
extern xcb_ewmh_connection_t xcb_ewmh;
+extern xcb_connection_t *xcb_connection;
+
// retrieve a property of any type from a window
int window_get_prop ( Display *display, Window w, Atom prop, Atom *type, int *items, void *buffer, unsigned int bytes )
{
@@ -245,13 +247,12 @@ static int pointer_get ( Display *display, Window root, int *x, int *y )
{
*x = 0;
*y = 0;
- Window rr, cr;
- int rxr, ryr, wxr, wyr;
- unsigned int mr;
-
- if ( XQueryPointer ( display, root, &rr, &cr, &rxr, &ryr, &wxr, &wyr, &mr ) ) {
- *x = rxr;
- *y = ryr;
+ xcb_query_pointer_cookie_t c = xcb_query_pointer ( xcb_connection, root );
+ xcb_query_pointer_reply_t *r = xcb_query_pointer_reply ( xcb_connection, c, NULL );
+ if ( r ) {
+ *x = r->root_x;
+ *y = r->root_y;
+ free(r);
return 1;
}
@@ -259,7 +260,6 @@ static int pointer_get ( Display *display, Window root, int *x, int *y )
}
// determine which monitor holds the active window, or failing that the mouse pointer
-extern xcb_connection_t *xcb_connection;
void monitor_active ( Display *display, workarea *mon )
{
Screen *screen = DefaultScreenOfDisplay ( display );