diff --git a/src/edge.c b/src/edge.c index 53c9de75..a86c7e44 100644 --- a/src/edge.c +++ b/src/edge.c @@ -45,7 +45,7 @@ EdgeTimeout(int val, void *data __UNUSED__) return; /* Quit if pointer has left screen */ - if (!EXQueryPointer(None, NULL, NULL, NULL, NULL)) + if (!EQueryPointer(NULL, NULL, NULL, NULL, NULL)) return; /* Quit if in fullscreen window */ diff --git a/src/ewins.c b/src/ewins.c index 70606e5f..40c08b2b 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -466,7 +466,7 @@ GetEwinByCurrentPointer(void) { Window child; - EXQueryPointer(EoGetXwin(DesksGetCurrent()), NULL, NULL, &child, NULL); + EQueryPointer(EoGetWin(DesksGetCurrent()), NULL, NULL, &child, NULL); return EwinFindByFrame(child); } @@ -480,7 +480,7 @@ GetEwinPointerInClient(void) Desk *dsk; dsk = DesktopAt(Mode.events.x, Mode.events.y); - EXQueryPointer(EoGetXwin(dsk), &px, &py, NULL, NULL); + EQueryPointer(EoGetWin(dsk), &px, &py, NULL, NULL); lst = EwinListGetForDesk(&num, dsk); for (i = 0; i < num; i++) @@ -832,7 +832,7 @@ AddToFamily(EWin * ewin, Window xwin) /* the window there */ DeskGoto(dsk); - EXQueryPointer(VRoot.xwin, &rx, &ry, NULL, NULL); + EQueryPointer(NULL, &rx, &ry, NULL, NULL); Mode.events.x = rx; Mode.events.y = ry; ewin->state.placed = 1; @@ -882,7 +882,7 @@ AddToFamily(EWin * ewin, Window xwin) /* the window there */ DeskGoto(dsk); - EXQueryPointer(VRoot.xwin, &rx, &ry, NULL, NULL); + EQueryPointer(NULL, &rx, &ry, NULL, NULL); Mode.events.x = rx; Mode.events.y = ry; ewin->state.placed = 1; diff --git a/src/focus.c b/src/focus.c index ad4c2446..692c9554 100644 --- a/src/focus.c +++ b/src/focus.c @@ -430,7 +430,7 @@ doFocusToEwin(EWin * ewin, int why) ICCCM_Cmap(ewin); /* Quit if pointer is not on our screen */ - if (!EXQueryPointer(None, NULL, NULL, NULL, NULL)) + if (!EQueryPointer(NULL, NULL, NULL, NULL, NULL)) { Mode.focuswin = NULL; return; diff --git a/src/hiwin.c b/src/hiwin.c index a8cf39b4..1e88fee9 100644 --- a/src/hiwin.c +++ b/src/hiwin.c @@ -467,7 +467,7 @@ HiwinShow(Hiwin * phi, EWin * ewin, int zoom, int confine) EoMoveResize(phi, xx, yy, ww, hh); pz->draw(phi); - on_screen = EXQueryPointer(None, &px, &py, NULL, NULL); + on_screen = EQueryPointer(NULL, &px, &py, NULL, NULL); if (!on_screen || (px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) { diff --git a/src/ipc.c b/src/ipc.c index 9cebf919..76bb7c40 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1269,7 +1269,7 @@ IPC_Warp(const char *params, Client * c __UNUSED__) x = y = 0; if (!strcmp(params, "?")) { - EXQueryPointer(None, &x, &y, NULL, NULL); + EQueryPointer(NULL, &x, &y, NULL, NULL); IpcPrintf("Pointer location: %d %d\n", x, y); } else if (!strncmp(params, "abs", 3)) diff --git a/src/pager.c b/src/pager.c index f909377d..51b7bc1b 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1110,7 +1110,7 @@ PagerHandleMotion(Pager * p, int x, int y) if (!Conf_pagers.enable) return; - on_screen = EXQueryPointer(WinGetXwin(p->win), &x, &y, NULL, NULL); + on_screen = EQueryPointer(p->win, &x, &y, NULL, NULL); if (on_screen && x >= 0 && x < p->w && y >= 0 && y < p->h) ewin = EwinInPagerAt(p, x, y); diff --git a/src/screen.c b/src/screen.c index fbff5747..86e84d86 100644 --- a/src/screen.c +++ b/src/screen.c @@ -241,7 +241,7 @@ GetPointerScreenGeometry(int *px, int *py, int *pw, int *ph) { int pointer_x, pointer_y; - EXQueryPointer(VRoot.xwin, &pointer_x, &pointer_y, NULL, NULL); + EQueryPointer(NULL, &pointer_x, &pointer_y, NULL, NULL); return ScreenGetGeometry(pointer_x, pointer_y, px, py, pw, ph); } @@ -251,7 +251,7 @@ GetPointerScreenAvailableArea(int *px, int *py, int *pw, int *ph) { int pointer_x, pointer_y; - EXQueryPointer(VRoot.xwin, &pointer_x, &pointer_y, NULL, NULL); + EQueryPointer(NULL, &pointer_x, &pointer_y, NULL, NULL); return ScreenGetAvailableArea(pointer_x, pointer_y, px, py, pw, ph); } diff --git a/src/tooltips.c b/src/tooltips.c index 2b3a50d9..039d247c 100644 --- a/src/tooltips.c +++ b/src/tooltips.c @@ -767,7 +767,7 @@ ToolTipTimeout(int val __UNUSED__, void *data __UNUSED__) /* In the case of multiple screens, check to make sure * the root window is still where the mouse is... */ - if (!EXQueryPointer(VRoot.xwin, &x, &y, NULL, &mask)) + if (!EQueryPointer(NULL, &x, &y, NULL, &mask)) return; /* In case this is a virtual root */ diff --git a/src/x.c b/src/x.c index 4f714325..cb7d5084 100644 --- a/src/x.c +++ b/src/x.c @@ -1027,7 +1027,7 @@ EXWarpPointer(Window xwin, int x, int y) XWarpPointer(disp, None, xwin, 0, 0, 0, 0, x, y); } -Bool +static Bool EXQueryPointer(Window xwin, int *px, int *py, Window * pchild, unsigned int *pmask) { @@ -1051,6 +1051,17 @@ EXQueryPointer(Window xwin, int *px, int *py, Window * pchild, pmask); } +Bool +EQueryPointer(Win win, int *px, int *py, Window * pchild, unsigned int *pmask) +{ + EXID *xid = win; + Window xwin; + + xwin = (xid) ? xid->xwin : VRoot.xwin; + + return EXQueryPointer(xwin, px, py, pchild, pmask); +} + void ESelectInputAdd(Win win, long mask) { diff --git a/src/xwin.h b/src/xwin.h index d574ca8a..57a9aa29 100644 --- a/src/xwin.h +++ b/src/xwin.h @@ -141,6 +141,9 @@ int EShapePropagate(Win win); int EShapeCheck(Win win); Pixmap EWindowGetShapePixmap(Win win); +Bool EQueryPointer(Win win, int *px, int *py, + Window * pchild, unsigned int *pmask); + void EAllocColor(Colormap colormap, XColor * pxc); void ESetColor(XColor * pxc, int r, int g, int b); void EGetColor(const XColor * pxc, int *pr, int *pg, int *pb); @@ -155,8 +158,6 @@ int EXGetGeometry(Window xwin, Window * root_return, void EXCopyArea(Drawable src, Drawable dst, int sx, int sy, unsigned int w, unsigned int h, int dx, int dy); -Bool EXQueryPointer(Window xwin, int *px, int *py, - Window * pchild, unsigned int *pmask); void EXWarpPointer(Window xwin, int x, int y); #define EXCreatePixmap(win, w, h, d) \