summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <rand.chars@gmail.com>2006-06-12 23:32:20 -0500
committerOri Bernstein <ori@localhost.(none)>2006-06-12 23:32:20 -0500
commitb1eb6817e41d4e5b7f2f8db2b4c2c39c01f357c6 (patch)
treebb4bb7d7e016aa513b55a8509f3664e67717256b
parentc15aa3a0cf772622e3271015dc53f6822cd9dce9 (diff)
Some changes made
-rw-r--r--configure.ac2
-rw-r--r--hw/xnest/Cursor.c64
-rw-r--r--hw/xnest/Display.c7
-rw-r--r--hw/xnest/Events.c39
-rw-r--r--hw/xnest/GCOps.c4
-rw-r--r--hw/xnest/Handlers.c2
-rw-r--r--hw/xnest/Window.c4
7 files changed, 69 insertions, 53 deletions
diff --git a/configure.ac b/configure.ac
index f4503e7e3..53edbd3c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index 00f4611b9..384a771e3 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -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);
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index db158f66f..4a23da58b 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -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*/
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 9c30a1834..c6a3cf6dd 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -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);
}
}
+
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 6dac0c527..51678c788 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -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);
}
diff --git a/hw/xnest/Handlers.c b/hw/xnest/Handlers.c
index 2cb84617c..a17ee547f 100644
--- a/hw/xnest/Handlers.c
+++ b/hw/xnest/Handlers.c
@@ -37,7 +37,7 @@ is" without express or implied warranty.
void
xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
{
- xnestCollectExposures();
+ xnestCollectEvents();
XCBFlush(xnestConnection);
}
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index ddcec9dff..bd0f31c43 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -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,
&param);
xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);