-------- Original Message --------
Subject: xorg server 1.3.0 (was Re: Still seeking a Cygwin/X maintainer)
Date: Tue, 30 Sep 2008 21:46:25 +0100
From: Jon TURNEY <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]>

Jon TURNEY wrote:
Yaakov (Cygwin Ports) wrote:
I really need another set of eyes to figure out what I'm missing.  If
anyone can figure out what's wrong with XWin, I'll be happy to look into
it further.

I'd also quite like to see this working, so I took a look at this

Attached is an updated patch & cygport

I had a couple of problems, but when I updated cygwin DLL from 1.5.25, to
the most recent snapshot (2008-09-15) to get debug symbols, they seem to stop happening :S I'm not sure what to make of that...

* "_XSERVTransSocketUNIXAccept: accept() failed", occasionally seen when
a new client tries to connect
* -multiwindow mode seems to deadlock randomly

These problems seem to be caused by the "smart scheduler" in the X server
being enabled (which it was not in 6.8.99), which causes a SIGALRM every 20ms,
which doesn't seem to work reliably.  Disabling this and using the dumb
scheduler works fine.

If you like living dangerously, you can point your setup.exe at
http://www.dronecode.org.uk/cygwin, where I've uploaded a package containing
the server.

The package has no install dependencies specified at the moment: from Cygports
you'll need libX11_6, libXau6, libXdmcp7, libfontenc1, libfreetype26 runtimes,
and xorg-fonts-misc-misc and xorg-font-cursor-misc fonts to start the server.

You'll probably want some clients as well. Note that some X things in cygports
have a dependency on the 6.8.99 server, but this should not be a problem since
that is installed as /usr/X11R6/bin/XWin.exe, not /usr/bin/XWin.exe

I'd really like some feedback if this works for anyone else :-)

Known problems are:
Clipboard integration is broken
Window names are always shown as "Cygwin/X"

--- origsrc/xorg-server-1.3.0.0/CYGWIN-PATCHES/setup.hint       1970-01-01 
00:00:00.000000000 +0000
+++ src/xorg-server-1.3.0.0/CYGWIN-PATCHES/setup.hint   2008-09-28 
21:32:53.265625000 +0100
@@ -0,0 +1,6 @@
+sdesc: "Cygwin/X X server"
+category: X11
+requires: cygwin
+
+ldesc: "X server for Cygwin.  This package is optional, but required
+if you want to run the Cygwin/X X Server."



--- origsrc/xorg-server-1.3.0.0/GL/glx/indirect_dispatch_swap.c 2007-03-05 
18:38:58.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/indirect_dispatch_swap.c     2008-09-28 
21:32:53.687500000 +0100
@@ -28,7 +28,7 @@
 #include <X11/Xmd.h>
 #include <GL/gl.h>
 #include <GL/glxproto.h>
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #include <byteswap.h>
 #elif defined(__OpenBSD__)
 #include <sys/endian.h>
--- origsrc/xorg-server-1.3.0.0/GL/glx/indirect_program.c       2007-03-05 
18:38:58.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/indirect_program.c   2008-09-28 
21:32:53.687500000 +0100
@@ -46,7 +46,7 @@
 #include "dispatch.h"
 #include "glapioffsets.h"
 
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #include <byteswap.h>
 #elif defined(__OpenBSD__)
 #include <sys/endian.h>
--- origsrc/xorg-server-1.3.0.0/GL/glx/indirect_reqsize.c       2007-01-30 
06:03:18.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/indirect_reqsize.c   2008-09-28 
21:32:53.703125000 +0100
@@ -31,7 +31,7 @@
 #include "indirect_size.h"
 #include "indirect_reqsize.h"
 
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #  include <byteswap.h>
 #  define SWAP_32(v)  do { (v) = bswap_32(v); } while(0)
 #else
--- origsrc/xorg-server-1.3.0.0/GL/glx/indirect_texture_compression.c   
2007-03-05 18:38:58.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/indirect_texture_compression.c       
2008-09-28 21:32:53.703125000 +0100
@@ -39,7 +39,7 @@
 #include "glthread.h"
 #include "dispatch.h"
 
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #include <byteswap.h>
 #elif defined(__OpenBSD__)
 #include <sys/endian.h>
--- origsrc/xorg-server-1.3.0.0/GL/glx/indirect_util.c  2007-01-30 
06:03:18.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/indirect_util.c      2008-09-28 
21:32:53.703125000 +0100
@@ -28,7 +28,7 @@
 #include <X11/Xmd.h>
 #include <GL/gl.h>
 #include <GL/glxproto.h>
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #include <byteswap.h>
 #elif defined(__OpenBSD__)
 #include <sys/endian.h>
--- origsrc/xorg-server-1.3.0.0/GL/glx/swap_interval.c  2007-03-05 
18:38:58.000000000 +0000
+++ src/xorg-server-1.3.0.0/GL/glx/swap_interval.c      2008-09-28 
21:32:53.703125000 +0100
@@ -40,7 +40,7 @@
 #include "dispatch.h"
 #include "glapioffsets.h"
 
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) || 
defined(__CYGWIN__)
 #include <byteswap.h>
 #elif defined(__OpenBSD__)
 #include <sys/endian.h>
--- origsrc/xorg-server-1.3.0.0/Xi/stubs.c      2006-11-16 18:01:22.000000000 
+0000
+++ src/xorg-server-1.3.0.0/Xi/stubs.c  2008-09-28 21:32:53.703125000 +0100
@@ -59,6 +59,10 @@
 #include <dix-config.h>
 #endif
 
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include "inputstr.h"
--- origsrc/xorg-server-1.3.0.0/configure.ac    2007-04-20 02:23:40.000000000 
+0100
+++ src/xorg-server-1.3.0.0/configure.ac        2008-09-28 21:32:53.703125000 
+0100
@@ -319,11 +319,11 @@
 AC_ARG_WITH(int10,           AS_HELP_STRING([--with-int10=BACKEND], [int10 
backend: vm86, x86emu or stub]),
                                [INT10="$withval"],
                                [INT10="$DEFAULT_INT10"])
-AC_ARG_WITH(vendor-name,     AS_HELP_STRING([--with-vendor-string=VENDOR],
+AC_ARG_WITH(vendor-name,     AS_HELP_STRING([--with-vendor-name=VENDOR],
                                  [Vendor string reported by the server]),
                                [ VENDOR_STRING="$withval" ],
                                [ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ])
-AC_ARG_WITH(vendor-name-short, 
AS_HELP_STRING([--with-vendor-string-short=VENDOR],
+AC_ARG_WITH(vendor-name-short, 
AS_HELP_STRING([--with-vendor-name-short=VENDOR],
                                  [Short version of vendor string reported by 
the server]),
                                [ VENDOR_STRING_SHORT="$withval" ],
                                [ 
VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ])
@@ -844,7 +844,6 @@
 
 AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
 AC_DEFINE(SERVER_LOCK, 1, [Use a lock to prevent multiple servers on a 
display])
-AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
 AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the 
libcwrapper])
 AM_CONDITIONAL(DEBUG, test "x$DEBUGGING" = xyes)
 
@@ -1426,13 +1425,14 @@
                mingw*) XWIN="yes" ;;
                *) XWIN="no" ;;
        esac
-       XWIN_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB 
$COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $OS_LIB $SHADOW_LIB"
+       XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XI_LIB 
$RANDR_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB 
$COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB 
$XPSTUBS_LIB $OS_LIB $LBX_LIB"
        AC_SUBST([XWIN_LIBS])
 fi
 AC_MSG_RESULT([$XWIN])
 
 if test "x$XWIN" = xyes; then
        XWIN_SERVER_NAME=XWin
+       AC_CHECK_TOOL(WINDRES, windres)
        case $host_os in
                cygwin*)
                        PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
--- origsrc/xorg-server-1.3.0.0/fb/fbcmap.c     2006-09-18 07:04:17.000000000 
+0100
+++ src/xorg-server-1.3.0.0/fb/fbcmap.c 2008-09-28 21:32:53.703125000 +0100
@@ -32,6 +32,10 @@
 #include <dix-config.h>
 #endif
 
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include "scrnintstr.h"
--- origsrc/xorg-server-1.3.0.0/hw/xwin/InitInput.c     2006-11-16 
18:01:26.000000000 +0000
+++ src/xorg-server-1.3.0.0/hw/xwin/InitInput.c 2008-09-28 21:32:53.718750000 
+0100
@@ -31,9 +31,6 @@
 #include <xwin-config.h>
 #endif
 #include "win.h"
-#ifdef XWIN_CLIPBOARD
-# include "../../Xext/xf86miscproc.h"
-#endif
 #include "dixstruct.h"
 
 
--- origsrc/xorg-server-1.3.0.0/hw/xwin/Makefile.am     2006-11-16 
18:01:26.000000000 +0000
+++ src/xorg-server-1.3.0.0/hw/xwin/Makefile.am 2008-09-28 21:32:53.718750000 
+0100
@@ -121,6 +121,8 @@
        winpriv.h \
        winresource.h \
        winwindow.h \
+       XWin.rc \
+       $(top_srcdir)/Xi/stubs.c \
        $(top_srcdir)/mi/miinitext.c \
        $(top_srcdir)/fb/fbcmap.c \
        $(SRCS_CLIPBOARD) \
@@ -149,9 +151,13 @@
 XWin_LDADD = $(XORG_CORE_LIBS) \
             $(top_builddir)/fb/libfb.la \
              $(XWIN_LIBS) \
-             $(XWINMODULES_LIBS)
+             $(XWINMODULES_LIBS) \
+             XWin.o
+
+.rc.o:
+       $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff 
-DPROJECT_NAME=\"$(VENDOR_STRING_SHORT)\"
 
-XWin_LDFLAGS = -mwindows -static
+XWin_LDFLAGS = -lgdi32
 
 winprefsyacc.h: winprefsyacc.c
 winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
@@ -162,6 +168,7 @@
 AM_YFLAGS = -d
 AM_LFLAGS = -i
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H \
+            -DXFree86Server \
             $(XWINMODULES_CFLAGS)
 
 dist_man1_MANS = XWin.man XWinrc.man
--- origsrc/xorg-server-1.3.0.0/hw/xwin/win.h   2006-09-18 07:04:18.000000000 
+0100
+++ src/xorg-server-1.3.0.0/hw/xwin/win.h       2008-09-28 21:32:53.718750000 
+0100
@@ -314,6 +314,7 @@
 
 typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
 
+typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr);
 
 /* Typedef for DIX wrapper functions */
 typedef int (*winDispatchProcPtr) (ClientPtr);
@@ -564,6 +565,8 @@
   winCreatePrimarySurfaceProcPtr       pwinCreatePrimarySurface;
   winReleasePrimarySurfaceProcPtr      pwinReleasePrimarySurface;
 
+  winCreateScreenResourcesProc       pwinCreateScreenResources;
+
 #ifdef XWIN_MULTIWINDOW
   /* Window Procedures for MultiWindow mode */
   winFinishCreateWindowsWindowProcPtr  pwinFinishCreateWindowsWindow;
--- origsrc/xorg-server-1.3.0.0/hw/xwin/winmultiwindowwm.c      2006-09-18 
07:04:18.000000000 +0100
+++ src/xorg-server-1.3.0.0/hw/xwin/winmultiwindowwm.c  2008-09-28 
21:32:53.718750000 +0100
@@ -52,14 +52,7 @@
 #include <X11/cursorfont.h>
 
 /* Windows headers */
-#ifdef __CYGWIN__
-/* Fixups to prevent collisions between Windows and X headers */
-#define ATOM DWORD
-
-#include <windows.h>
-#else
-#include <Xwindows.h>
-#endif
+#include <X11/Xwindows.h>
 
 /* Local headers */
 #include "objbase.h"
--- origsrc/xorg-server-1.3.0.0/hw/xwin/winscrinit.c    2006-09-18 
07:04:18.000000000 +0100
+++ src/xorg-server-1.3.0.0/hw/xwin/winscrinit.c        2008-09-28 
21:32:53.718750000 +0100
@@ -248,6 +248,25 @@
   return TRUE;
 }
 
+Bool
+winCreateScreenResources(ScreenPtr pScreen)
+{
+  winScreenPriv(pScreen);
+  Bool result;
+
+  result = pScreenPriv->pwinCreateScreenResources(pScreen);
+
+  /* Now the screen bitmap has been wrapped in a pixmap,
+     add that to the Shadow framebuffer */
+  if (!shadowAdd(pScreen, pScreen->devPrivate,
+                pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
+    {
+      ErrorF ("winCreateScreenResources - shadowAdd () failed\n");
+      return FALSE;
+    }
+
+  return result;
+}
 
 /* See Porting Layer Definition - p. 20 */
 Bool
@@ -438,15 +457,14 @@
       )
     {
 #if CYGDEBUG
-      winDebug ("winFinishScreenInitFB - Calling shadowInit ()\n");
+      winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n");
 #endif
-      if (!shadowInit (pScreen,
-                      pScreenPriv->pwinShadowUpdate,
-                      NULL))
-       {
-         ErrorF ("winFinishScreenInitFB - shadowInit () failed\n");
-         return FALSE;
-       }
+      shadowSetup(pScreen);
+
+      /* Wrap CreateScreenResources so we can add the screen pixmap
+         to the Shadow framebuffer after it's been created */
+      pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources;
+      pScreen->CreateScreenResources = winCreateScreenResources;
     }
 
 #ifdef XWIN_MULTIWINDOWEXTWM
--- origsrc/xorg-server-1.3.0.0/hw/xwin/winshaddd.c     2006-09-18 
07:04:18.000000000 +0100
+++ src/xorg-server-1.3.0.0/hw/xwin/winshaddd.c 2008-09-28 21:32:53.718750000 
+0100
@@ -508,7 +508,7 @@
 {
   winScreenPriv(pScreen);
   winScreenInfo                *pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr            damage = &pBuf->damage;
+  RegionPtr            damage = shadowDamage(pBuf);
   HRESULT              ddrval = DD_OK;
   RECT                 rcDest, rcSrc;
   POINT                        ptOrigin;
--- origsrc/xorg-server-1.3.0.0/hw/xwin/winshadddnl.c   2006-09-18 
07:04:18.000000000 +0100
+++ src/xorg-server-1.3.0.0/hw/xwin/winshadddnl.c       2008-09-28 
21:32:53.718750000 +0100
@@ -584,7 +584,7 @@
 {
   winScreenPriv(pScreen);
   winScreenInfo                *pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr            damage = &pBuf->damage;
+  RegionPtr            damage = shadowDamage(pBuf);
   HRESULT              ddrval = DD_OK;
   RECT                 rcDest, rcSrc;
   POINT                        ptOrigin;
--- origsrc/xorg-server-1.3.0.0/hw/xwin/winshadgdi.c    2006-09-18 
07:04:18.000000000 +0100
+++ src/xorg-server-1.3.0.0/hw/xwin/winshadgdi.c        2008-09-28 
21:32:53.718750000 +0100
@@ -498,7 +498,7 @@
 {
   winScreenPriv(pScreen);
   winScreenInfo                *pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr            damage = &pBuf->damage;
+  RegionPtr            damage = shadowDamage(pBuf);
   DWORD                        dwBox = REGION_NUM_RECTS (damage);
   BoxPtr               pBox = REGION_RECTS (damage);
   int                  x, y, w, h;
--- origsrc/xorg-server-1.3.0.0/mi/miinitext.c  2006-11-16 18:01:26.000000000 
+0000
+++ src/xorg-server-1.3.0.0/mi/miinitext.c      2008-09-28 21:32:53.734375000 
+0100
@@ -79,6 +79,11 @@
 #undef XF86VIDMODE
 #endif
 
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#undef XFreeXDGA
+#endif
+
 #include "misc.h"
 #include "extension.h"
 #include "micmap.h"



inherit xorg

MESA_VERSION=6.5.2
SRC_URI+=" mirror://sourceforge/mesa3d/MesaLib-${MESA_VERSION}.tar.bz2"

DIFF_EXCLUDES="xf86Build.h include"

FONTPATH="/usr/share/fonts"

#CFLAGS="-O0 -g3"
#--enable-debug \
#--disable-xinerama \ # doesn't seem to work for some reason....

src_compile() {
        cd ${S}
        cygautoreconf

        cd ${B}
        cygconf \
                --disable-static \
                --disable-builddocs \
                --disable-composite \
                --disable-dmx \
                --disable-fontcache \
                --disable-install-libxf86config \
                --disable-install-setuid \
                --disable-xf86dga \
                --disable-xf86misc \
                --disable-xf86vidmode \
                --disable-dpms \
                --disable-screensaver \
                --disable-xv \
                --disable-xorgcfg \
                --disable-xprint \
                --enable-appgroup \
                --with-fontdir=${FONTPATH} \
                --with-log-dir=/tmp \
                --with-mesa-source=${S}/../Mesa-${MESA_VERSION} \
                --with-os-name='Cygwin' \
                --with-os-vendor='Cygwin' \
                --with-builder-addr='[EMAIL PROTECTED]' \
                --with-vendor-name='The Cygwin/X Project' \
                --with-vendor-name-short='Cygwin/X' \
                --with-vendor-web='http://x.cygwin.com/'

        cygmake
}

src_install() {
        cd ${B}
        cyginstall sdkdir=/usr/include/xorg

        # The SDK is only used for building Xorg drivers (which aren't
        # applicable to XWin), so we remove it to avoid confusion
        rm -fr ${D}/usr/include ${D}/usr/lib/pkgconfig ${D}/usr/share/aclocal

        dosym XWin.exe /usr/bin/X

        newdoc ${S}/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc sample.XWinrc
}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cygwin-ports-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cygwin-ports-general

Reply via email to