Trivial re-wrapping of XQueryPointer().

SVN revision: 25092
This commit is contained in:
Kim Woelders 2006-08-24 21:52:28 +00:00
parent 603ee950d7
commit 07acdc4c7a
10 changed files with 27 additions and 15 deletions

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

@ -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)))
{

View File

@ -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))

View File

@ -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);

View File

@ -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);
}

View File

@ -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 */

13
src/x.c
View File

@ -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)
{

View File

@ -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) \