This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix mwextwm mode to build again


This fixes multiwindow external window manager('-mwextwm') mode to build again.


Note this depends on Apple's Xplugin.h to build the rootless extension (just for some typedefs I think), which is no longer included in the X.Org tree, as an old version once was.


Google can find you a copy.

Cygwin: Fix multiwindow extwm mode to build again

Note: this depends on the rootless extension, which in turn depends on Apple's Xplugin.h :D

I'm sure there is a better way of doing this configure.ac stuff

Based on somebody else's patch, I'm can't remember who's...

---
 xserver/configure.ac                      |   20 ++++++++++++++++----
 xserver/hw/xwin/Makefile.am               |    2 +-
 xserver/hw/xwin/winmultiwindowwm.c        |    2 +-
 xserver/hw/xwin/winscrinit.c              |   16 ----------------
 xserver/hw/xwin/winwin32rootless.c        |    2 +-
 xserver/hw/xwin/winwin32rootlesswndproc.c |    2 +-
 xserver/hw/xwin/winwindowswm.c            |    3 ++-
 xserver/miext/Makefile.am                 |    2 +-
 xserver/miext/rootless/rootlessConfig.h   |    2 +-
 xserver/miext/rootless/rootlessWindow.c   |    9 +++++++--
 10 files changed, 31 insertions(+), 29 deletions(-)

Index: xorg-server-1.5.3/xserver/configure.ac
===================================================================
--- xorg-server-1.5.3.orig/xserver/configure.ac
+++ xorg-server-1.5.3/xserver/configure.ac
@@ -1667,7 +1667,6 @@ if test "x$XWIN" = xyes; then
 			XWIN_SERVER_NAME=XWin
 			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"
 			;;
 		mingw*)
@@ -1708,7 +1707,12 @@ 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])
+dnl if we have windowswmproto, build rootless extension and with multiwindow extwm enabled
+if test "x$XWIN" = xyes; then
+   PKG_CHECK_MODULES(WINDOWSWM, [windowswmproto], [windowswm="yes"], [windowswm="no"] )
+   AC_DEFINE(ROOTLESS,1,[Build Rootless code])
+fi
+AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [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])
@@ -1741,8 +1745,8 @@ if test "x$XQUARTZ" = xyes; then
 	AC_SUBST([DARWIN_LIBS])
 
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
-
-	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+	AC_DEFINE(ROOTLESS,1,[Build Rootless code])
+	CFLAGS="${CFLAGS} -DNO_ALLOCA"
 
 	if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
 		AC_MSG_NOTICE([Disabling XF86Misc extension])
@@ -1994,6 +1998,14 @@ AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [te
 AM_CONDITIONAL(XEPHYR_HAS_DRI, [test x$XEPHYR_DRI = xyes])
 AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
 
+dnl if server is rootless, we want to build the rootless code
+MIEXT_ROOTLESS_INC='-I$(top_srcdir)/miext/rootless'
+MIEXT_ROOTLESS_LIB='$(top_builddir)/miext/rootless/librootless.la'
+if [ test -n $ROOTLESS ] ; then
+   CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND"
+fi
+AM_CONDITIONAL(WANT_ROOTLESS, [test "x$ROOTLESS" = xyes])
+
 dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
 AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules])
 AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
Index: xorg-server-1.5.3/xserver/hw/xwin/Makefile.am
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/Makefile.am
+++ xorg-server-1.5.3/xserver/hw/xwin/Makefile.am
@@ -154,7 +154,7 @@ XWin_SOURCES = $(SRCS)
 INCLUDES = -I$(top_srcdir)/miext/rootless
 
 XWin_DEPENDENCIES = $(XWIN_LIBS)
-XWin_LDADD = $(XWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) $(XWIN_GL_LIBS)
+XWin_LDADD = $(XWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) $(XWIN_GL_LIBS) $(top_builddir)/miext/rootless/librootless.la
 XWin_LDFLAGS = -mwindows
 
 .rc.o:
Index: xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwm.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winmultiwindowwm.c
+++ xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwm.c
@@ -64,7 +64,7 @@
 #include "window.h"
 #include "windowstr.h"
 #ifdef XWIN_MULTIWINDOWEXTWM
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #endif
 
 extern void winDebug(const char *format, ...);
Index: xorg-server-1.5.3/xserver/hw/xwin/winscrinit.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winscrinit.c
+++ xorg-server-1.5.3/xserver/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))
Index: xorg-server-1.5.3/xserver/hw/xwin/winwin32rootless.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winwin32rootless.c
+++ xorg-server-1.5.3/xserver/hw/xwin/winwin32rootless.c
@@ -38,7 +38,7 @@
 #include "win.h"
 #include <winuser.h>
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #include "dixevents.h"
 #include "winmultiwindowclass.h"
 #include "winprefs.h"
Index: xorg-server-1.5.3/xserver/hw/xwin/winwin32rootlesswndproc.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winwin32rootlesswndproc.c
+++ xorg-server-1.5.3/xserver/hw/xwin/winwin32rootlesswndproc.c
@@ -35,7 +35,7 @@
 #include "win.h"
 #include <winuser.h>
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #include "dixevents.h"
 #include "propertyst.h"
 #include <X11/Xatom.h>
Index: xorg-server-1.5.3/xserver/hw/xwin/winwindowswm.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winwindowswm.c
+++ xorg-server-1.5.3/xserver/hw/xwin/winwindowswm.c
@@ -42,7 +42,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #include "servermd.h"
 #include "swaprep.h"
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
+
 
 static int WMErrorBase;
 
Index: xorg-server-1.5.3/xserver/miext/Makefile.am
===================================================================
--- xorg-server-1.5.3.orig/xserver/miext/Makefile.am
+++ xorg-server-1.5.3/xserver/miext/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = damage shadow
 if COMPOSITE
 SUBDIRS += cw
 endif
-if XQUARTZ
+if WANT_ROOTLESS
 SUBDIRS += rootless
 endif
 DIST_SUBDIRS = damage shadow cw rootless
Index: xorg-server-1.5.3/xserver/miext/rootless/rootlessConfig.h
===================================================================
--- xorg-server-1.5.3.orig/xserver/miext/rootless/rootlessConfig.h
+++ xorg-server-1.5.3/xserver/miext/rootless/rootlessConfig.h
@@ -50,7 +50,7 @@
 
 #endif /* __APPLE__ */
 
-#if defined(__CYGWIN__) || defined(WIN32)
+#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(WIN32)
 
 # define ROOTLESS_ACCEL YES
 # define ROOTLESS_GLOBAL_COORDS TRUE
Index: xorg-server-1.5.3/xserver/miext/rootless/rootlessWindow.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/miext/rootless/rootlessWindow.c
+++ xorg-server-1.5.3/xserver/miext/rootless/rootlessWindow.c
@@ -36,16 +36,16 @@
 #include <stddef.h> /* For NULL */
 #include <limits.h> /* For CHAR_BIT */
 #include <assert.h>
+#include <X11/Xatom.h>
 #ifdef __APPLE__
 //#include <X11/Xlib.h>
-#include <X11/Xatom.h>
 #include "mi.h"
 #include "pixmapstr.h"
 #include "windowstr.h"
-#include <Xplugin.h>
 //#include <X11/extensions/applewm.h>
 extern int darwinMainScreenX, darwinMainScreenY;
 #endif
+#include <Xplugin.h>
 #include "fb.h"
 
 #define AppleWMNumWindowLevels 5
@@ -93,9 +93,11 @@ static inline int
 configure_window (xp_window_id id, unsigned int mask,
                   const xp_window_changes *values)
 {
+#ifdef __APPLE__
   if (!no_configure_window)
     return xp_configure_window (id, mask, values);
   else
+#endif
     return XP_Success;
 }
 
@@ -116,6 +118,7 @@ rootlessHasRoot (ScreenPtr pScreen)
   return WINREC (WindowTable[pScreen->myNum]) != NULL;
 }
 
+#ifdef __APPLE__
 void
 RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state)
 {
@@ -165,6 +168,7 @@ RootlessNativeWindowMoved (WindowPtr pWi
   no_configure_window = FALSE;
 }
 
+
 /* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
 static void
 set_screen_origin (WindowPtr pWin)
@@ -184,6 +188,7 @@ set_screen_origin (WindowPtr pWin)
   dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
 			  XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
 }
+#endif
 
 /*
  * RootlessCreateWindow

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]