Add COMPOSITE change to fbCopyWindow (not needed yet)

Xnest was half-using midispcur and doing a bad job of it. Replace all of
    that code with mipointer which does a lot of the work.
Support DDXen which don't provide GetWindowPixmap, or which return NULL for
    the root pixmap.
This commit is contained in:
Keith Packard 2004-08-11 22:40:14 +00:00
commit fd439afdfe
8 changed files with 134 additions and 133 deletions

View file

@ -33,59 +33,6 @@ is" without express or implied warranty.
#include "Keyboard.h"
#include "Args.h"
void
xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
{
#ifdef _XSERVER64
Window64 wroot;
#else
Window wroot;
#endif
int wx, wy;
unsigned int wwidth, wheight;
unsigned int wborderwidth;
unsigned int wdepth;
XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot,
&wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth);
if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
pBox->x2 >= wwidth && pBox->y2 >= wheight)
XUngrabPointer(xnestDisplay, CurrentTime);
else {
XReparentWindow(xnestDisplay, xnestConfineWindow,
xnestDefaultWindows[pScreen->myNum],
pBox->x1, pBox->y1);
XResizeWindow(xnestDisplay, xnestConfineWindow,
pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
XGrabPointer(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
True,
xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask),
GrabModeAsync, GrabModeAsync,
xnestConfineWindow,
None, CurrentTime);
}
}
void
xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
BoxPtr pTopLeftBox)
{
*pTopLeftBox = *pHotBox;
}
Bool
xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
XDefineCursor(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
xnestCursor(pCursor, pScreen));
return True;
}
Bool
xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
@ -192,15 +139,17 @@ xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
&fg_color, &bg_color);
}
Bool
xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent)
void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
if (pCursor)
{
XDefineCursor(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
xnestCursor(pCursor, pScreen));
}
}
void
xnestMoveCursor (ScreenPtr pScreen, int x, int y)
{
int i;
for (i = 0; i < xnestNumScreens; i++)
XWarpPointer(xnestDisplay, xnestDefaultWindows[i],
xnestDefaultWindows[pScreen->myNum],
0, 0, 0, 0, x, y);
return True;
}