mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-17 14:00:24 +01:00
Some changes made
This commit is contained in:
parent
c15aa3a0cf
commit
b1eb6817e4
7 changed files with 69 additions and 53 deletions
|
|
@ -933,7 +933,7 @@ fi
|
|||
dnl Xnest DDX
|
||||
|
||||
AC_MSG_CHECKING([whether to build Xnest DDX])
|
||||
PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
|
||||
PKG_CHECK_MODULES(XNESTMODULES, [xfont xext xau xcb xcb-shape xcb-image xcb-aux xcb-icccm $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
|
||||
if test "x$XNEST" = xauto; then
|
||||
XNEST="$have_xnest"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@
|
|||
|
||||
Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
XCBImage *ximage;
|
||||
XCBPIXMAP source, mask;
|
||||
int pad;
|
||||
int size;
|
||||
XCBCURSOR c;
|
||||
unsigned long valuemask;
|
||||
XCBParamsGC values;
|
||||
|
|
@ -67,64 +67,44 @@ Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
|||
mask = XCBPIXMAPNew(xnestConnection);
|
||||
|
||||
XCBCreatePixmap(xnestConnection,
|
||||
1,
|
||||
xnestDefaultDepth,
|
||||
source,
|
||||
(XCBDRAWABLE)xnestDefaultWindows[pScreen->myNum],
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height);
|
||||
|
||||
XCBCreatePixmap(xnestConnection,
|
||||
1,
|
||||
xnestDefaultDepth,
|
||||
mask,
|
||||
(XCBDRAWABLE) xnestDefaultWindows[pScreen->myNum],
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height);
|
||||
|
||||
pad = XCBGetSetup(xnestConnection)->bitmap_format_scanline_pad;
|
||||
ximage = XCBImageCreate(xnestConnection,
|
||||
1,
|
||||
XCBImageFormatXYBitmap,
|
||||
0,
|
||||
(BYTE *)pCursor->bits->source,
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height,
|
||||
pad,//8,//BitmapPad(xnestConnection),
|
||||
0);
|
||||
XCBImageInit(ximage);
|
||||
|
||||
XCBImagePut(xnestConnection,
|
||||
(XCBDRAWABLE) source,
|
||||
/*not sure if this is right*/
|
||||
size = (((pCursor->bits->width + pad - 1) & -pad) >> 3) * pCursor->bits->height;
|
||||
XCBPutImage(xnestConnection,
|
||||
XCBImageFormatXYBitmap,
|
||||
(XCBDRAWABLE)source,
|
||||
xnestBitmapGC,
|
||||
ximage,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height);
|
||||
|
||||
XFree(ximage);
|
||||
|
||||
ximage = XCBImageCreate(xnestConnection,
|
||||
1,
|
||||
XCBImageFormatXYBitmap,
|
||||
0,
|
||||
(BYTE *)pCursor->bits->mask,
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height,
|
||||
pad,//8,//BitmapPad(xnestConnection),
|
||||
0);
|
||||
XCBImageInit(ximage);
|
||||
|
||||
XCBImagePut(xnestConnection,
|
||||
pCursor->bits->height,
|
||||
0,0, /*dst_x, dst_y*/
|
||||
pad,
|
||||
1, /*depth*/
|
||||
size, /*length..correct??*/
|
||||
pCursor->bits->source); /*bits*/
|
||||
XCBPutImage(xnestConnection,
|
||||
XCBImageFormatXYBitmap,
|
||||
(XCBDRAWABLE)mask,
|
||||
xnestBitmapGC,
|
||||
ximage,
|
||||
0, 0, 0, 0,
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height);
|
||||
|
||||
XFree(ximage);
|
||||
pCursor->bits->height,
|
||||
0,0, /*dst_x, dst_y*/
|
||||
pad,
|
||||
1, /*depth*/
|
||||
size, /*length..correct??*/
|
||||
pCursor->bits->mask); /*bits*/
|
||||
|
||||
pCursor->devPriv[pScreen->myNum] = (pointer)xalloc(sizeof(xnestPrivCursor));
|
||||
c = XCBCURSORNew(xnestConnection);
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ void xnestOpenDisplay(int argc, char *argv[])
|
|||
xnestVisuals = xnestListVisuals(xnestConnection, &xnestDepthForVisual, &xnestNumVisuals);
|
||||
screen = XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data;
|
||||
root = (XCBDRAWABLE)XCBSetupRootsIter(XCBGetSetup(xnestConnection)).data->root;
|
||||
xnestDefaultDepth = screen->root_depth;
|
||||
|
||||
if (!xnestVisuals)
|
||||
FatalError("Unable to find any visuals");
|
||||
|
|
@ -220,7 +221,7 @@ void xnestOpenDisplay(int argc, char *argv[])
|
|||
xnestBorderWidth = 1;
|
||||
xnestIconBitmap = XCBPIXMAPNew(xnestConnection);
|
||||
XCBCreatePixmap(xnestConnection, /*connection*/
|
||||
1, /*depth*/
|
||||
xnestDefaultDepth,/*depth*/
|
||||
xnestIconBitmap, /*pixmap*/
|
||||
root, /*drawable*/
|
||||
icon_width,icon_height); /*width,height*/
|
||||
|
|
@ -237,12 +238,12 @@ void xnestOpenDisplay(int argc, char *argv[])
|
|||
|
||||
xnestScreenSaverPixmap = XCBPIXMAPNew(xnestConnection);
|
||||
XCBCreatePixmap(xnestConnection, /*connection*/
|
||||
1, /*depth*/
|
||||
xnestDefaultDepth, /*depth*/
|
||||
xnestScreenSaverPixmap, /*pixmap*/
|
||||
root, /*drawable*/
|
||||
icon_width,icon_height); /*width,height*/
|
||||
XCBPutImage(xnestConnection, /*connection*/
|
||||
XCBImageFormatXYPixmap, /*format*/
|
||||
XCBImageFormatXYBitmap, /*format*/
|
||||
(XCBDRAWABLE)xnestScreenSaverPixmap,/*drawable*/
|
||||
xnestBitmapGC, /*gc*/
|
||||
icon_width,icon_height, /*width, height*/
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
break;
|
||||
|
||||
case XCBFocusIn:
|
||||
if (((XFocusInEvent *)e)->detail != XCBNotifyDetailInferior) {
|
||||
if (((XCBFocusInEvent *)e)->detail != XCBNotifyDetailInferior) {
|
||||
pScreen = xnestScreen(((XCBFocusInEvent *)e)->event);
|
||||
if (pScreen)
|
||||
xnestDirectInstallColormaps(pScreen);
|
||||
|
|
@ -168,7 +168,7 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
break;
|
||||
|
||||
case XCBFocusOut:
|
||||
if (((XFocusOutEvent *)e)->detail != XCBNotifyDetailInferior) {
|
||||
if (((XCBFocusOutEvent *)e)->detail != XCBNotifyDetailInferior) {
|
||||
pScreen = xnestScreen(((XCBFocusOutEvent *)e)->event);
|
||||
if (pScreen)
|
||||
xnestDirectInstallColormaps(pScreen);
|
||||
|
|
@ -239,6 +239,7 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
|
||||
default:
|
||||
ErrorF("xnest warning: unhandled event %d\n", e->response_type & ~0x80);
|
||||
ErrorF("Sequence number: %d\n", e->sequence);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -246,8 +247,40 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
void xnestCollectEvents()
|
||||
{
|
||||
XCBGenericEvent *e;
|
||||
XCBGenericError *err;
|
||||
XCBRequestError *re;
|
||||
XCBIDChoiceError *ide;
|
||||
XCBFontError *fe;
|
||||
XCBWindowError *we;
|
||||
|
||||
e = XCBWaitForEvent(xnestConnection);
|
||||
while ((e = XCBPollForEvent(xnestConnection, NULL)) != NULL) {
|
||||
xnestHandleEvent(e);
|
||||
if (!e->response_type) {
|
||||
err = (XCBGenericError *)e;
|
||||
ErrorF("File: %s Error: %d\n", __FILE__, err->error_code);
|
||||
switch(err->error_code){
|
||||
case XCBMatch:
|
||||
re = (XCBRequestError *)err;
|
||||
ErrorF("XCBMatch: Bad Value %x (Decimal %d)\n", re->bad_value, re->bad_value);
|
||||
break;
|
||||
case XCBIDChoice:
|
||||
ide = (XCBIDChoiceError *)err;
|
||||
ErrorF("XCBIDChoice: Bad Value %x (Decimal %d)\n", ide->bad_value, ide->bad_value);
|
||||
break;
|
||||
case XCBFont:
|
||||
fe = (XCBFontError *)err;
|
||||
ErrorF("XCBFont: Bad Value %x (Decimal %d)\n", fe->bad_value, fe->bad_value);
|
||||
break;
|
||||
case XCBWindow:
|
||||
we = (XCBWindowError *)err;
|
||||
ErrorF("XCBWindow: Bad Value %x (Decimal %d)\n", we->bad_value, we->bad_value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
xnestHandleEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ static Bool xnestBitBlitPredicate(XCBGenericEvent *event)
|
|||
|
||||
static RegionPtr xnestBitBlitHelper(GCPtr pGC)
|
||||
{
|
||||
int err;
|
||||
if (!pGC->graphicsExposures)
|
||||
return NullRegion;
|
||||
else {
|
||||
|
|
@ -142,7 +143,7 @@ static RegionPtr xnestBitBlitHelper(GCPtr pGC)
|
|||
|
||||
pending = True;
|
||||
while (pending) {
|
||||
event = XCBWaitForEvent(xnestConnection);
|
||||
event = XCBPollForEvent(xnestConnection, &err);
|
||||
switch (event->response_type) {
|
||||
case XCBNoExposure:
|
||||
pending = False;
|
||||
|
|
@ -159,6 +160,7 @@ static RegionPtr xnestBitBlitHelper(GCPtr pGC)
|
|||
pending = exp->count;
|
||||
break;
|
||||
default:
|
||||
ErrorF("File: %s Error: %d\n", __FILE__, err);
|
||||
xnestHandleEvent(event);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ is" without express or implied warranty.
|
|||
void
|
||||
xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
|
||||
{
|
||||
xnestCollectExposures();
|
||||
xnestCollectEvents();
|
||||
XCBFlush(xnestConnection);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ Bool xnestCreateWindow(WindowPtr pWin)
|
|||
param.colormap = xnestDefaultVisualColormap(visual).xid;
|
||||
}
|
||||
else
|
||||
visual = XCBCopyFromParent;
|
||||
vid.id = XCBCopyFromParent;
|
||||
}
|
||||
else { /* root windows have their own colormaps at creation time */
|
||||
vid.id = wVisual(pWin);
|
||||
|
|
@ -126,7 +126,7 @@ Bool xnestCreateWindow(WindowPtr pWin)
|
|||
pWin->drawable.height,
|
||||
pWin->borderWidth,
|
||||
pWin->drawable.class,
|
||||
visual->visual_id,
|
||||
vid,
|
||||
mask,
|
||||
¶m);
|
||||
xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue