[RFC][PATCH 1/3] Cygwin/X: Fix multiwindow extwm mode to build again

Jon TURNEY jon.turney at dronecode.org.uk
Tue Jun 23 10:54:49 PDT 2009


Build and link with rootless extension
Update Xwin code for removal of RootlessAccelInit()
Fix Xwin code which now has a collision with the type name EventType

Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 configure.ac               |    5 +++--
 hw/xwin/Makefile.am        |    3 ++-
 hw/xwin/winmultiwindowwm.c |    2 +-
 hw/xwin/winscrinit.c       |   16 ----------------
 hw/xwin/winwindowswm.c     |   14 +++++++-------
 miext/Makefile.am          |    3 +++
 6 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/configure.ac b/configure.ac
index f9a967c..78a4ef4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1615,6 +1615,7 @@ fi
 AC_MSG_RESULT([$XWIN])
 
 if test "x$XWIN" = xyes; then
+	PKG_CHECK_EXISTS([windowswmproto], [WINDOWSWM=yes], [WINDOWSWM=no])
 	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
 	AC_CHECK_TOOL(WINDRES, windres)
 	case $host_os in
@@ -1623,7 +1624,7 @@ if test "x$XWIN" = xyes; then
 			PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
 			AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
 			AC_DEFINE(ROOTLESS,1,[Build Rootless code])
-			CFLAGS="$CFLAGS -DFD_SETSIZE=256"
+			CFLAGS="$CFLAGS -DFD_SETSIZE=256 -DROOTLESS_WORKAROUND"
 			;;
 		mingw*)
 			XWIN_SERVER_NAME=Xming
@@ -1656,7 +1657,7 @@ if test "x$XWIN" = xyes; then
 fi
 AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
-AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && false])
+AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
 AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false])
 AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes && false])
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 0ecb526..55e43a1 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -34,6 +34,7 @@ SRCS_MULTIWINDOWEXTWM = \
 	winwin32rootlesswndproc.c \
 	winwindowswm.c
 DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
+MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
 endif
 
 if XWIN_NATIVEGDI
@@ -147,7 +148,7 @@ XWin_SOURCES = $(SRCS)
 INCLUDES = -I$(top_srcdir)/miext/rootless
 
 XWin_DEPENDENCIES = $(XWIN_LIBS)
-XWin_LDADD = $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
+XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
 
 .rc.o:
 	$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -DPROJECT_NAME=\"$(VENDOR_NAME_SHORT)\"
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 194dbf6..7421379 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -57,7 +57,7 @@
 #include "ddraw.h"
 #include "winwindow.h"
 #ifdef XWIN_MULTIWINDOWEXTWM
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #else
 /* We need the native HWND atom for intWM, so for consistency use the
    same name as extWM would if we were building with enabled... */
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 96778ab..eab0c6c 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -378,22 +378,6 @@ winFinishScreenInitFB (int index,
   pScreen->blockData = pScreen;
   pScreen->wakeupData = pScreen;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-  /*
-   * Setup acceleration for multi-window external window manager mode.
-   * To be compatible with the Damage extension, this must be done
-   * before calling miDCInitialize, which calls DamageSetup.
-   */
-  if (pScreenInfo->fMWExtWM)
-    {
-      if (!RootlessAccelInit (pScreen))
-        {
-          ErrorF ("winFinishScreenInitFB - RootlessAccelInit () failed\n");
-          return FALSE;
-        }
-    }
-#endif
-
 #ifdef RENDER
   /* Render extension initialization, calls miPictureInit */
   if (!fbPictureInit (pScreen, NULL, 0))
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 2eecd6b..61972c9 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -50,7 +50,7 @@ static DISPATCH_PROC(SProcWindowsWMDispatch);
 static unsigned char WMReqCode = 0;
 static int WMEventBase = 0;
 
-static RESTYPE ClientType, EventType; /* resource types for event masks */
+static RESTYPE ClientType, eventResourceType; /* resource types for event masks */
 static XID eventResource;
 
 /* Currently selected events */
@@ -85,10 +85,10 @@ winWindowsWMExtensionInit ()
   ExtensionEntry* extEntry;
 
   ClientType = CreateNewResourceType(WMFreeClient);
-  EventType = CreateNewResourceType(WMFreeEvents);
+  eventResourceType = CreateNewResourceType(WMFreeEvents);
   eventResource = FakeClientID(0);
 
-  if (ClientType && EventType &&
+  if (ClientType && eventResourceType &&
       (extEntry = AddExtension(WINDOWSWMNAME,
 			       WindowsWMNumberEvents,
 			       WindowsWMNumberErrors,
@@ -147,7 +147,7 @@ WMFreeClient (pointer data, XID id)
   WMEventPtr   *pHead, pCur, pPrev;
 
   pEvent = (WMEventPtr) data;
-  pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+  pHead = (WMEventPtr *) LookupIDByType(eventResource, eventResourceType);
   if (pHead)
     {
       pPrev = 0;
@@ -193,7 +193,7 @@ ProcWindowsWMSelectInput (register ClientPtr client)
 
   REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq);
   pHead = (WMEventPtr *)SecurityLookupIDByType(client, eventResource,
-					       EventType, DixWriteAccess);
+					       eventResourceType, DixWriteAccess);
   if (stuff->mask != 0)
     {
       if (pHead)
@@ -235,7 +235,7 @@ ProcWindowsWMSelectInput (register ClientPtr client)
 	{
 	  pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr));
 	  if (!pHead ||
-	      !AddResource (eventResource, EventType, (pointer)pHead))
+	      !AddResource (eventResource, eventResourceType, (pointer)pHead))
 	    {
 	      FreeResource (clientResource, RT_NONE);
 	      return BadAlloc;
@@ -293,7 +293,7 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
   ErrorF ("winWindowsWMSendEvent %d %d %d %d,  %d %d - %d %d\n",
 	  type, mask, which, arg, x, y, w, h);
 #endif
-  pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+  pHead = (WMEventPtr *) LookupIDByType(eventResource, eventResourceType);
   if (!pHead)
     return;
   for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
diff --git a/miext/Makefile.am b/miext/Makefile.am
index f138963..73a6577 100644
--- a/miext/Makefile.am
+++ b/miext/Makefile.am
@@ -5,4 +5,7 @@ endif
 if XQUARTZ
 SUBDIRS += rootless
 endif
+if XWIN
+SUBDIRS += rootless
+endif
 DIST_SUBDIRS = damage shadow cw rootless
-- 
1.6.1.2



More information about the xorg-devel mailing list