diff --git a/src/edge.c b/src/edge.c index 83ed6ccb..bde26bae 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 (!EQueryPointer(None, NULL, NULL, NULL, NULL)) + if (!EXQueryPointer(None, NULL, NULL, NULL, NULL)) return; /* Quit if in fullscreen window */ @@ -96,7 +96,7 @@ EdgeTimeout(int val, void *data __UNUSED__) Mode.events.py = Mode.events.y; Mode.events.x += dx; Mode.events.y += dy; - EWarpPointer(VRoot.win, Mode.events.x, Mode.events.y); + EXWarpPointer(VRoot.win, Mode.events.x, Mode.events.y); DeskCurrentMoveAreaBy(dax, day); Mode.events.px = Mode.events.x; Mode.events.py = Mode.events.y; diff --git a/src/ewins.c b/src/ewins.c index 43c12d9d..a36e0b72 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -463,7 +463,7 @@ GetEwinByCurrentPointer(void) { Window child; - EQueryPointer(EoGetWin(DesksGetCurrent()), NULL, NULL, &child, NULL); + EXQueryPointer(EoGetXwin(DesksGetCurrent()), NULL, NULL, &child, NULL); return EwinFindByFrame(child); } @@ -477,7 +477,7 @@ GetEwinPointerInClient(void) Desk *dsk; dsk = DesktopAt(Mode.events.x, Mode.events.y); - EQueryPointer(EoGetWin(dsk), &px, &py, NULL, NULL); + EXQueryPointer(EoGetXwin(dsk), &px, &py, NULL, NULL); lst = EwinListGetForDesk(&num, dsk); for (i = 0; i < num; i++) @@ -830,7 +830,7 @@ AddToFamily(EWin * ewin, Window win) /* the window there */ DeskGoto(dsk); - EQueryPointer(VRoot.win, &rx, &ry, NULL, NULL); + EXQueryPointer(VRoot.win, &rx, &ry, NULL, NULL); Mode.events.x = rx; Mode.events.y = ry; ewin->state.placed = 1; @@ -880,7 +880,7 @@ AddToFamily(EWin * ewin, Window win) /* the window there */ DeskGoto(dsk); - EQueryPointer(VRoot.win, &rx, &ry, NULL, NULL); + EXQueryPointer(VRoot.win, &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 49353da4..1538058c 100644 --- a/src/focus.c +++ b/src/focus.c @@ -400,7 +400,7 @@ doFocusToEwin(EWin * ewin, int why) do_warp = 1; if (do_warp && ewin != Mode.mouse_over_ewin) { - EWarpPointer(EoGetWin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); + EXWarpPointer(EoGetXwin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); Mode.mouse_over_ewin = ewin; } @@ -430,7 +430,7 @@ doFocusToEwin(EWin * ewin, int why) ICCCM_Cmap(ewin); /* Quit if pointer is not on our screen */ - if (!EQueryPointer(None, NULL, NULL, NULL, NULL)) + if (!EXQueryPointer(None, NULL, NULL, NULL, NULL)) { Mode.focuswin = NULL; return; diff --git a/src/hiwin.c b/src/hiwin.c index 7ac323e4..a183fe86 100644 --- a/src/hiwin.c +++ b/src/hiwin.c @@ -443,7 +443,7 @@ HiwinShow(Hiwin * phi, EWin * ewin, int zoom, int confine) EoMoveResize(phi, xx, yy, ww, hh); pz->draw(phi); - on_screen = EQueryPointer(None, &px, &py, NULL, NULL); + on_screen = EXQueryPointer(None, &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 2b90eb8a..85b57a6a 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1136,31 +1136,31 @@ IPC_Warp(const char *params, Client * c __UNUSED__) x = y = 0; if (!strcmp(params, "?")) { - EQueryPointer(None, &x, &y, NULL, NULL); + EXQueryPointer(None, &x, &y, NULL, NULL); IpcPrintf("Pointer location: %d %d\n", x, y); } else if (!strncmp(params, "abs", 3)) { sscanf(params, "%*s %i %i", &x, &y); - EWarpPointer(VRoot.win, x, y); + EXWarpPointer(VRoot.win, x, y); } else if (!strncmp(params, "rel", 3)) { sscanf(params, "%*s %i %i", &x, &y); - EWarpPointer(None, x, y); + EXWarpPointer(None, x, y); } else if (!strncmp(params, "scr", 3)) { x = (VRoot.scr + 1) % ScreenCount(disp); sscanf(params, "%*s %i", &x); if (x >= 0 && x < ScreenCount(disp)) - EWarpPointer(RootWindow(disp, x), DisplayWidth(disp, x) / 2, - DisplayHeight(disp, x) / 2); + EXWarpPointer(RootWindow(disp, x), DisplayWidth(disp, x) / 2, + DisplayHeight(disp, x) / 2); } else { sscanf(params, "%i %i", &x, &y); - EWarpPointer(None, x, y); + EXWarpPointer(None, x, y); } } diff --git a/src/menus.c b/src/menus.c index b8653637..ca98da3d 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1413,7 +1413,7 @@ MenusHandleMotion(void) Conf.shadespeed); if (((xdist != 0) || (ydist != 0)) && (Conf.menus.warp)) - EWarpPointer(None, xdist, ydist); + EXWarpPointer(None, xdist, ydist); #ifdef HAS_XINERAMA } #endif @@ -1573,7 +1573,7 @@ SubmenuShowTimeout(int val __UNUSED__, void *dat) MenusSetEvents(1); if (Conf.menus.warp) - EWarpPointer(mi->win, mi->text_w / 2, mi->text_h / 2); + EXWarpPointer(mi->win, mi->text_w / 2, mi->text_h / 2); } } diff --git a/src/pager.c b/src/pager.c index c5cc0b59..70ed661e 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1107,7 +1107,7 @@ PagerHandleMotion(Pager * p, int x, int y) if (!Conf_pagers.enable) return; - on_screen = EQueryPointer(p->win, &x, &y, NULL, NULL); + on_screen = EXQueryPointer(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 655cd329..d5798a9f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -242,7 +242,7 @@ GetPointerScreenGeometry(int *px, int *py, int *pw, int *ph) { int pointer_x, pointer_y; - EQueryPointer(VRoot.win, &pointer_x, &pointer_y, NULL, NULL); + EXQueryPointer(VRoot.win, &pointer_x, &pointer_y, NULL, NULL); return ScreenGetGeometry(pointer_x, pointer_y, px, py, pw, ph); } @@ -252,7 +252,7 @@ GetPointerScreenAvailableArea(int *px, int *py, int *pw, int *ph) { int pointer_x, pointer_y; - EQueryPointer(VRoot.win, &pointer_x, &pointer_y, NULL, NULL); + EXQueryPointer(VRoot.win, &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 4972972e..562c6870 100644 --- a/src/tooltips.c +++ b/src/tooltips.c @@ -748,7 +748,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 (!EQueryPointer(VRoot.win, &x, &y, NULL, &mask)) + if (!EXQueryPointer(VRoot.win, &x, &y, NULL, &mask)) return; /* In case this is a virtual root */ diff --git a/src/warp.c b/src/warp.c index f6fb9528..2b60e345 100644 --- a/src/warp.c +++ b/src/warp.c @@ -339,7 +339,7 @@ WarpFocus(int delta) if (Conf.focus.warp_on_next) if (ewin != Mode.mouse_over_ewin && !ewin->state.iconified) { - EWarpPointer(EoGetWin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); + EXWarpPointer(EoGetXwin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); Mode.mouse_over_ewin = ewin; } if (Conf.warplist.warpfocused) @@ -385,7 +385,7 @@ WarpFocusFinish(void) if (Conf.warplist.warp_on_select) if (ewin != Mode.mouse_over_ewin) { - EWarpPointer(EoGetWin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); + EXWarpPointer(EoGetXwin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2); Mode.mouse_over_ewin = ewin; } FocusToEWin(ewin, FOCUS_SET); diff --git a/src/x.c b/src/x.c index 62b8f557..864ecc36 100644 --- a/src/x.c +++ b/src/x.c @@ -852,21 +852,19 @@ ETranslateCoordinates(Window src_w, Window dst_w, } void -EWarpPointer(Window win, int x, int y) +EXWarpPointer(Window xwin, int x, int y) { - XWarpPointer(disp, None, win, 0, 0, 0, 0, x, y); + XWarpPointer(disp, None, xwin, 0, 0, 0, 0, x, y); } Bool -EQueryPointer(Window win, int *px, int *py, Window * pchild, - unsigned int *pmask) +EXQueryPointer(Window xwin, int *px, int *py, Window * pchild, + unsigned int *pmask) { Window root, child; int root_x, root_y; unsigned int mask; - if (win == None) - win = VRoot.win; if (!px) px = &root_x; if (!py) @@ -876,7 +874,7 @@ EQueryPointer(Window win, int *px, int *py, Window * pchild, if (!pmask) pmask = &mask; - return XQueryPointer(disp, win, &root, pchild, &root_x, &root_y, px, py, + return XQueryPointer(disp, xwin, &root, pchild, &root_x, &root_y, px, py, pmask); } diff --git a/src/xwin.h b/src/xwin.h index f8c8a146..66478b1e 100644 --- a/src/xwin.h +++ b/src/xwin.h @@ -78,9 +78,6 @@ int ETranslateCoordinates(Window src_w, Window dst_w, int *dest_x_return, int *dest_y_return, Window * child_return); -void EWarpPointer(Window win, int x, int y); -Bool EQueryPointer(Window win, int *px, int *py, Window * pchild, - unsigned int *pmask); int EDrawableCheck(Drawable draw, int grab); #define ESelectInput(win, mask) XSelectInput(disp, win, mask) @@ -117,6 +114,10 @@ void ECopyArea(Drawable src, Drawable dst, int sx, int sy, #define EXGetGeometry EGetGeometry +void EXWarpPointer(Window xwin, int x, int y); +Bool EXQueryPointer(Window xwin, int *px, int *py, + Window * pchild, unsigned int *pmask); + GC EXCreateGC(Drawable draw, unsigned long mask, XGCValues * val); int EXFreeGC(GC gc); diff --git a/src/zoom.c b/src/zoom.c index 1d4fabb2..6990809f 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -218,8 +218,8 @@ Zoom(EWin * ewin) if (zoom_mask_4) EDestroyWindow(zoom_mask_4); SwitchRes(0, 0, 0, 0, 0); - EWarpPointer(_EwinGetClientWin(ewin), ewin->client.w / 2, - ewin->client.h / 2); + EXWarpPointer(_EwinGetClientXwin(ewin), ewin->client.w / 2, + ewin->client.h / 2); ESync(); zoom_last_ewin = NULL; } @@ -250,8 +250,8 @@ Zoom(EWin * ewin) EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); EwinMove(ewin, -bl + x1, -bt + y1); FocusToEWin(ewin, FOCUS_SET); - EWarpPointer(_EwinGetClientWin(ewin), ewin->client.w / 2, - ewin->client.h / 2); + EXWarpPointer(_EwinGetClientXwin(ewin), ewin->client.w / 2, + ewin->client.h / 2); #if 0 /* Doesn't work as intended */ XGrabPointer(disp, _EwinGetClientXwin(ewin), True, ButtonPressMask | ButtonReleaseMask |