xserver: Branch 'orib-soc-2006'

Ori Bernstein orib at kemper.freedesktop.org
Tue Jun 13 06:26:35 EEST 2006


 configure.ac        |    2 -
 hw/xnest/Cursor.c   |   64 +++++++++++++++++-----------------------------------
 hw/xnest/Display.c  |    7 +++--
 hw/xnest/Events.c   |   39 +++++++++++++++++++++++++++++--
 hw/xnest/GCOps.c    |    4 ++-
 hw/xnest/Handlers.c |    2 -
 hw/xnest/Window.c   |    4 +--
 7 files changed, 69 insertions(+), 53 deletions(-)

New commits:
diff-tree b1eb6817e41d4e5b7f2f8db2b4c2c39c01f357c6 (from c15aa3a0cf772622e3271015dc53f6822cd9dce9)
Author: Ori Bernstein <rand.chars at gmail.com>
Date:   Mon Jun 12 23:32:20 2006 -0500

    Some changes made

diff --git a/configure.ac b/configure.ac
index f4503e7..53edbd3 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 00f4611..384a771 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 pScree
     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 db158f6..4a23da5 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -133,6 +133,7 @@ void xnestOpenDisplay(int argc, char *ar
     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 *ar
         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 *ar
 
     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 9c30a18..c6a3cf6 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 6dac0c5..51678c7 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -126,6 +126,7 @@ static Bool xnestBitBlitPredicate(XCBGen
 
 static RegionPtr xnestBitBlitHelper(GCPtr pGC)
 {
+    int err;
     if (!pGC->graphicsExposures) 
         return NullRegion;
     else {
@@ -142,7 +143,7 @@ static RegionPtr xnestBitBlitHelper(GCPt
 
         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(GCPt
                     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 2cb8461..a17ee54 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 ddcec9d..bd0f31c 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);



More information about the xorg-commit mailing list