Window handling function api rename/rewrap continued.
SVN revision: 22329
This commit is contained in:
parent
f7f0293cbc
commit
4f4c6523e4
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)))
|
||||
{
|
||||
|
|
12
src/ipc.c
12
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
12
src/x.c
12
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 |
|
||||
|
|
Loading…
Reference in New Issue