Re: Solaris Xinerama support

2004-08-26 Thread Dominik Vogt
On Fri, Aug 20, 2004 at 09:32:35AM -0400, Chris Ross wrote:
 Dan Espen wrote:
 If the #define'd stuff is only used on Solaris, when the header
 isn't there, and the library support is there,  I'd say that was
 OK.
 
   Yup.  That's how it's done.  Only if the libXinerama stuff
 isn't found will it look for Solaris' calls, and only if those
 are found will it look for the header.  If the header is found,
 the few lines (to replace the header) I added don't get used.
 
   The following should be the full diff against CVS HEAD for
 this patch.  Thanks for all your help!
 
  - Chris
 
 

 Index: configure.in
 ===
 RCS file: /home/cvs/fvwm/fvwm/configure.in,v
 retrieving revision 1.294
 diff -u -u -r1.294 configure.in
 --- configure.in  23 May 2004 16:20:23 -  1.294
 +++ configure.in  20 Aug 2004 13:26:58 -
 @@ -298,8 +298,18 @@
$UNSET ac_cv_lib_Xinerama_XineramaIsActive
AC_CHECK_LIB(Xinerama, XineramaIsActive,
  with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
 +AC_CHECK_LIB(Xext, XineramaGetState,
 +  [ AC_DEFINE(HAVE_XINERAMA) AC_DEFINE(HAVE_SOLARIS_XINERAMA)
 +  with_xinerama=yes; Xinerama_LIBS=-lXext
 +  my_CPPFLAGS=$CPPFLAGS; CPPFLAGS=$X_CPPFLAGS $CPPFLAGS
 +  my_hdr=X11/extensions/xinerama.h
 +  AC_CHECK_HEADER($my_hdr, AC_DEFINE(HAVE_SOLARIS_XINERAMA_H)
 + problem_xinerama= (Using Solaris Xinerama calls),
 + problem_xinerama= (Failed to find Sun's $my_hdr))
 +  CPPFLAGS=$my_CPPFLAGS],
  with_xinerama=no; Xinerama_LIBS=
  problem_xinerama=: Failed to detect libXinerama,
 +[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]),
  [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
  fi
  AC_SUBST(Xinerama_LIBS)

Note that this nesting of AC_CHECK_LIB calls did not work with my
autoconf/automake versions.  I have split it in two separate
calls.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]


pgpNYa7L80UQF.pgp
Description: PGP signature


Re: Solaris Xinerama support

2004-08-26 Thread Dan Espen
Dominik Vogt [EMAIL PROTECTED] writes:
 Note that this nesting of AC_CHECK_LIB calls did not work with my
 autoconf/automake versions.  I have split it in two separate
 calls.

Darn.  And I tested this on Linux and Solaris.


I woke up in the middle of the night and it dawned on me that I never
updated NEWS.  I figured no one would notice and I could
take care of it when I got up.

-- 
Dan Espen   E-mail: [EMAIL PROTECTED]
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-26 Thread Thomas Adam
On Thu, Aug 26, 2004 at 06:48:22AM -0400, Dan Espen wrote:

 I woke up in the middle of the night and it dawned on me that I never
 updated NEWS.  I figured no one would notice and I could
 take care of it when I got up.

Heh, now *that*'s what I call being passionate about one's work. :)

-- Thomas Adam

-- 
Quis custodiet ipsos custodes?
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-26 Thread Dominik Vogt
On Thu, Aug 26, 2004 at 06:48:22AM -0400, Dan Espen wrote:
 Dominik Vogt [EMAIL PROTECTED] writes:
  Note that this nesting of AC_CHECK_LIB calls did not work with my
  autoconf/automake versions.  I have split it in two separate
  calls.
 
 Darn.  And I tested this on Linux and Solaris.

They changed something with quoting in autoconf/automake a while
ago.  Unfortunately you have to test with the old and new auto*
versions to make sure some things in configure work fine.

 I woke up in the middle of the night and it dawned on me that I never
 updated NEWS.  I figured no one would notice and I could
 take care of it when I got up.

If all else fails, I will notice missing NEWS entries sooner or
later ;-)

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]


pgpbpOM2yel87.pgp
Description: PGP signature


Re: Solaris Xinerama support

2004-08-26 Thread Chris Ross

  Thanks Dominik.

Dominik Vogt wrote:

They changed something with quoting in autoconf/automake a while
ago.  Unfortunately you have to test with the old and new auto*
versions to make sure some things in configure work fine.


  Odd.  It worked for me, too, using the same version of
autoconf that'd previously generated the configure.  Guess
that must've changed on your system and not mine.  Thanks
for fixing it!

  There were a couple issues with your changes to libs/FScreen.c.
I don't know that I agree with the all code should be
compiled opinion, but that's certainly your call to make.
And the #ifdef'd code is now more sensible than it was, and
than I'd made it.  Thanks.

  But, there was one typo (capitalization error), and one
error in the #def's.  Solaris' xinerama.h does *not* define
XineramaScreenInfo, since Solaris' xinerama system API is
*completely* different.  I just moved the relevant #def out
one level.  A patch to libs/FScreen.c is attached.  It will
now link both with and without the Solaris xinerama.h
header.

  Thanks again!

 - Chris
Index: libs/FScreen.c
===
RCS file: /home/cvs/fvwm/fvwm/libs/FScreen.c,v
retrieving revision 1.24
diff -u -r1.24 FScreen.c
--- libs/FScreen.c  26 Aug 2004 09:40:42 -  1.24
+++ libs/FScreen.c  26 Aug 2004 15:52:53 -
@@ -73,10 +73,10 @@
 # define FScreenHaveXinerama 1
 # ifdef HAVE_SOLARIS_XINERAMA
 #  define FScreenHaveSolarisXinerama 1
+#  define FSCREEN_NEED_SCREENINFO
 #  ifdef HAVE_SOLARIS_XINERAMA_H
 #   include X11/extensions/xinerama.h
 #  else
-#   define FSCREEN_NEED_SCREENINFO
 #   define FSCREEN_NEED_SOLARIS_PROTOTYPES
 #  endif
 # else
@@ -114,7 +114,7 @@
 #if FScreenHaveXinerama
 # if FScreenHaveSolarisXinerama
 #  define XineramaQueryExtension(d,b,c) 1 /* Lie, for now */
-#  define XineramaIsActive(d) Xineramagetstate((d),0)
+#  define XineramaIsActive(d) XineramaGetState((d),0)
 # endif
 #else
 # define XineramaQueryExtension(da, b, c) 0


Re: Solaris Xinerama support

2004-08-20 Thread Chris Ross

Dan Espen wrote:

If the #define'd stuff is only used on Solaris, when the header
isn't there, and the library support is there,  I'd say that was
OK.


  Yup.  That's how it's done.  Only if the libXinerama stuff
isn't found will it look for Solaris' calls, and only if those
are found will it look for the header.  If the header is found,
the few lines (to replace the header) I added don't get used.

  The following should be the full diff against CVS HEAD for
this patch.  Thanks for all your help!

 - Chris


Index: configure.in
===
RCS file: /home/cvs/fvwm/fvwm/configure.in,v
retrieving revision 1.294
diff -u -u -r1.294 configure.in
--- configure.in23 May 2004 16:20:23 -  1.294
+++ configure.in20 Aug 2004 13:26:58 -
@@ -298,8 +298,18 @@
   $UNSET ac_cv_lib_Xinerama_XineramaIsActive
   AC_CHECK_LIB(Xinerama, XineramaIsActive,
 with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
+AC_CHECK_LIB(Xext, XineramaGetState,
+  [ AC_DEFINE(HAVE_XINERAMA) AC_DEFINE(HAVE_SOLARIS_XINERAMA)
+  with_xinerama=yes; Xinerama_LIBS=-lXext
+  my_CPPFLAGS=$CPPFLAGS; CPPFLAGS=$X_CPPFLAGS $CPPFLAGS
+  my_hdr=X11/extensions/xinerama.h
+  AC_CHECK_HEADER($my_hdr, AC_DEFINE(HAVE_SOLARIS_XINERAMA_H)
+   problem_xinerama= (Using Solaris Xinerama calls),
+   problem_xinerama= (Failed to find Sun's $my_hdr))
+  CPPFLAGS=$my_CPPFLAGS],
 with_xinerama=no; Xinerama_LIBS=
 problem_xinerama=: Failed to detect libXinerama,
+[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]),
 [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
 fi
 AC_SUBST(Xinerama_LIBS)
Index: acconfig.h
===
RCS file: /home/cvs/fvwm/fvwm/acconfig.h,v
retrieving revision 1.72
diff -u -u -r1.72 acconfig.h
--- acconfig.h  8 Jul 2004 10:08:09 -   1.72
+++ acconfig.h  20 Aug 2004 13:26:58 -
@@ -32,6 +32,14 @@
 /* Define if Xinerama library is used. */
 #undef HAVE_XINERAMA
 
+/* Define if Solaris' Xinerama calls are being used. */
+/* (Solaris 7 11/99 and later) */
+#undef HAVE_SOLARIS_XINERAMA
+
+/* Define if Solaris' X11/extensions/xinerama.h header is provided. */
+/* (Solaris 9 and later) */
+#undef HAVE_SOLARIS_XINERAMA_H
+
 /* Define if Xrender library is used. */
 #undef HAVE_XRENDER
 
Index: fvwm/fvwm.c
===
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.c,v
retrieving revision 1.368
diff -u -u -r1.368 fvwm.c
--- fvwm/fvwm.c 15 Jul 2004 13:12:28 -  1.368
+++ fvwm/fvwm.c 20 Aug 2004 13:26:59 -
@@ -1312,6 +1312,9 @@
strcat(support_str,  Bidi text,);
 #endif
 #ifdef HAVE_XINERAMA
+# ifdef HAVE_SOLARIS_XINERAMA
+   strcat(support_str,  [Solaris' odd-ball]);
+# endif
strcat(support_str,  Xinerama,);
 #endif
 #ifdef HAVE_XRENDER
Index: libs/FScreen.c
===
RCS file: /home/cvs/fvwm/fvwm/libs/FScreen.c,v
retrieving revision 1.22
diff -u -u -r1.22 FScreen.c
--- libs/FScreen.c  17 Mar 2004 14:42:54 -  1.22
+++ libs/FScreen.c  20 Aug 2004 13:26:59 -
@@ -69,8 +69,62 @@
 #include PictureBase.h
 
 #ifdef HAVE_XINERAMA
-#define FScreenHaveXinerama 1
-#include X11/extensions/Xinerama.h
+# define FScreenHaveXinerama 1
+# ifdef HAVE_SOLARIS_XINERAMA
+#  ifdef HAVE_SOLARIS_XINERAMA_H
+#   include X11/extensions/xinerama.h
+#  else
+/* Copied from Solaris 9's X11/extensions/xinerama.h */
+#defineMAXFRAMEBUFFERS 16
+Bool XineramaGetState(Display*, int);
+Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*);
+Status XineramaGetCenterHint(Display*, int, int*, int*);
+#  endif /* HAVE_SOLARIS_XINERAMA_H */
+typedef struct
+{
+   int   screen_number;
+   short x_org;
+   short y_org;
+   short width;
+   short height;
+} XineramaScreenInfo;
+#  define XineramaIsActive(d)  XineramaGetState((d),0)
+#  define XineramaQueryScreens(d,b)solaris_XineramaQueryScreens((d),(b))
+#  define XineramaQueryExtension(d,b,c)1   /* Lie, for now */
+static XineramaScreenInfo *
+solaris_XineramaQueryScreens(Display *d, int *xin_nscreens)
+{
+   XineramaScreenInfo *screens = NULL;
+   XRectangle monitors[MAXFRAMEBUFFERS];
+   unsigned char hints[16];
+
+   int result = XineramaGetInfo(d, DefaultScreen(d), monitors, hints,
+xin_nscreens);
+   if (result)
+   {
+   int m;
+
+   screens = (XineramaScreenInfo 
*)malloc(sizeof(XineramaScreenInfo) * (*xin_nscreens));
+   for (m = 0; m  *xin_nscreens; ++m)
+   {
+   screens[m].screen_number = m;
+   screens[m].x_org = monitors[m].x;
+   screens[m].y_org = monitors[m].y;
+   

Re: Solaris Xinerama support

2004-08-16 Thread Chris Ross

Dan Espen wrote:

I guess I can answer my own question, it configures but doesn't
compile:

gcc -DHAVE_CONFIG_H -I. -I../../version-2_5_11/libs -I.. -I../../version-2_5_11 
-I/opt/public/include  -I/usr/openwin/include  -I/opt/public/include -g 
-O2 -Wall -Wno-implicit-int -c ../../version-2_5_11/libs/FScreen.c
../../version-2_5_11/libs/FScreen.c:74: X11/extensions/xinerama.h: No such file 
or directory

You can send any additional patches to the list.


  I'm not sure what to do to fix that.  I suppose there may
be some way to check for the header in configure, and if
it's not present (Solaris 7 11/99, or Solaris 8) I could
just sub in the contents.  They're quite minimal.

  This seem to objectionable to people?

   - Chris

--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-16 Thread Dan Espen
Chris Ross [EMAIL PROTECTED] writes:
 Dan Espen wrote:
  I guess I can answer my own question, it configures but doesn't
  compile:
  
  gcc -DHAVE_CONFIG_H -I. -I../../version-2_5_11/libs -I.. -I../../version-2_
 5_11 -I/opt/public/include  -I/usr/openwin/include  -I/opt/public/include
  -g -O2 -Wall -Wno-implicit-int -c ../../version-2_5_11/libs/FScreen.c
  ../../version-2_5_11/libs/FScreen.c:74: X11/extensions/xinerama.h: No such 
 file or directory
  
  You can send any additional patches to the list.
 
I'm not sure what to do to fix that.  I suppose there may
 be some way to check for the header in configure, and if
 it's not present (Solaris 7 11/99, or Solaris 8) I could
 just sub in the contents.  They're quite minimal.
 
This seem to objectionable to people?

I don't see any problem with Xinerama only working on only Sol 9 or later.
In other words, requiring the header.

Getting compile errors on a default configure on Sol 8 is no good.

-- 
Dan Espen   E-mail: [EMAIL PROTECTED]
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-16 Thread Chris Ross

Dan Espen wrote:


Didn't you say the Sol 9/10 header would work on Sol 8.
Why not make the header required.  If someone wants Xinerama
on Sol 8, make them supply the header.


  It does, but it seems like having the xinerama support enabled
with no user effort for Solaris 8 users would be worth having.
You don't need to be an admin, or even very smart, to build
a window manager.  Making sure you can put an extension somewhere
and have auto-conf'd programs find them requires more of the
user.

  It only requires putting 4 lines in FScreen.c.  One #def,
and three prototypes.  Actually, we're only using two of the
functions, so we could take out the other prototype.

  - Chris
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-16 Thread Dan Espen
Chris Ross [EMAIL PROTECTED] writes:
 Dan Espen wrote:
  
  Didn't you say the Sol 9/10 header would work on Sol 8.
  Why not make the header required.  If someone wants Xinerama
  on Sol 8, make them supply the header.
 
It does, but it seems like having the xinerama support enabled
 with no user effort for Solaris 8 users would be worth having.
 You don't need to be an admin, or even very smart, to build
 a window manager.  Making sure you can put an extension somewhere
 and have auto-conf'd programs find them requires more of the
 user.
 
It only requires putting 4 lines in FScreen.c.  One #def,
 and three prototypes.  Actually, we're only using two of the
 functions, so we could take out the other prototype.

If the #define'd stuff is only used on Solaris, when the header
isn't there, and the library support is there,  I'd say that was
OK.

-- 
Dan Espen   E-mail: [EMAIL PROTECTED]
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-15 Thread Dan Espen
Chris Ross [EMAIL PROTECTED] writes:
 Chris Ross wrote:
  
Okay.  I don't know how many of you know this, but Solaris ships
  an Xsun that has Xinerama support in it (as of the last dist.
  of Solaris 7).  *But*, in typical Sun Microsystems style, there
  is no Xinerama library, nor header file.
 
Oops.  I should've mentioned that this patch was tested
 with Solaris 8, but will only work on Solaris 8 with
 the X11/extensions/xinerama.h header copied from Solaris 9.
 Solaris' 9 and 10 ship with this header in place, so
 will work with no additional effort.

On my Solaris 8 machine without that header, I got:

With Xinerama multi-head support?   yes (Using Solaris Xinerama calls)

In what sense won't it work?

-- 
Dan Espen   E-mail: [EMAIL PROTECTED]
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: Solaris Xinerama support

2004-08-15 Thread Dan Espen
Dan Espen [EMAIL PROTECTED] writes:
 Chris Ross [EMAIL PROTECTED] writes:
  Chris Ross wrote:
   
 Okay.  I don't know how many of you know this, but Solaris ships
   an Xsun that has Xinerama support in it (as of the last dist.
   of Solaris 7).  *But*, in typical Sun Microsystems style, there
   is no Xinerama library, nor header file.
  
 Oops.  I should've mentioned that this patch was tested
  with Solaris 8, but will only work on Solaris 8 with
  the X11/extensions/xinerama.h header copied from Solaris 9.
  Solaris' 9 and 10 ship with this header in place, so
  will work with no additional effort.
 
 On my Solaris 8 machine without that header, I got:
 
 With Xinerama multi-head support?   yes (Using Solaris Xinerama calls)
 
 In what sense won't it work?

I guess I can answer my own question, it configures but doesn't
compile:

gcc -DHAVE_CONFIG_H -I. -I../../version-2_5_11/libs -I.. -I../../version-2_5_11 
-I/opt/public/include  -I/usr/openwin/include  -I/opt/public/include -g 
-O2 -Wall -Wno-implicit-int -c ../../version-2_5_11/libs/FScreen.c
../../version-2_5_11/libs/FScreen.c:74: X11/extensions/xinerama.h: No such file 
or directory

You can send any additional patches to the list.

-- 
Dan Espen   E-mail: [EMAIL PROTECTED]
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Solaris Xinerama support

2004-08-13 Thread Chris Ross


  Okay.  I don't know how many of you know this, but Solaris ships
an Xsun that has Xinerama support in it (as of the last dist.
of Solaris 7).  *But*, in typical Sun Microsystems style, there
is no Xinerama library, nor header file.

  So, in doing some research, it appears there are a few functions
in libXext, that while providing a totally different API, will
allow the needed access to the Xinerama extension in the server.

  So, I updated acconfig.h, configure.in, fvwm/fvwm.c (which
is an avoidable change, if you want to ignore it), and
libs/FScreen.c.

  Patch for the above is attached.  Should I gen diffs to
configure and config.h.in, or will those get taken care
of (either automatically, or by someone else with the blessed
autoconf installation)?

  Thanks...

   - Chris


Index: acconfig.h
===
RCS file: /home/cvs/fvwm/fvwm/acconfig.h,v
retrieving revision 1.72
diff -u -u -r1.72 acconfig.h
--- acconfig.h  8 Jul 2004 10:08:09 -   1.72
+++ acconfig.h  13 Aug 2004 15:31:23 -
@@ -32,6 +32,9 @@
 /* Define if Xinerama library is used. */
 #undef HAVE_XINERAMA
 
+/* Define if Solaris' Xinerama calls are being used. */
+#undef HAVE_SOLARIS_XINERAMA
+
 /* Define if Xrender library is used. */
 #undef HAVE_XRENDER
 
Index: configure.in
===
RCS file: /home/cvs/fvwm/fvwm/configure.in,v
retrieving revision 1.294
diff -u -u -r1.294 configure.in
--- configure.in23 May 2004 16:20:23 -  1.294
+++ configure.in13 Aug 2004 15:31:23 -
@@ -298,9 +298,13 @@
   $UNSET ac_cv_lib_Xinerama_XineramaIsActive
   AC_CHECK_LIB(Xinerama, XineramaIsActive,
 with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
+AC_CHECK_LIB(Xext, XineramaGetState,
+with_xinerama=yes; Xinerama_LIBS=-lXext; AC_DEFINE(HAVE_XINERAMA)
+AC_DEFINE(HAVE_SOLARIS_XINERAMA)
+problem_xinerama= (Using Solaris Xinerama calls),
 with_xinerama=no; Xinerama_LIBS=
 problem_xinerama=: Failed to detect libXinerama,
-[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
+[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]))
 fi
 AC_SUBST(Xinerama_LIBS)
 AC_SUBST(Xinerama_CFLAGS)
Index: fvwm/fvwm.c
===
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.c,v
retrieving revision 1.368
diff -u -u -r1.368 fvwm.c
--- fvwm/fvwm.c 15 Jul 2004 13:12:28 -  1.368
+++ fvwm/fvwm.c 13 Aug 2004 15:31:23 -
@@ -1312,6 +1312,9 @@
strcat(support_str,  Bidi text,);
 #endif
 #ifdef HAVE_XINERAMA
+# ifdef HAVE_SOLARIS_XINERAMA
+   strcat(support_str,  [Solaris' odd-ball]);
+# endif
strcat(support_str,  Xinerama,);
 #endif
 #ifdef HAVE_XRENDER
Index: libs/FScreen.c
===
RCS file: /home/cvs/fvwm/fvwm/libs/FScreen.c,v
retrieving revision 1.22
diff -u -u -r1.22 FScreen.c
--- libs/FScreen.c  17 Mar 2004 14:42:54 -  1.22
+++ libs/FScreen.c  13 Aug 2004 15:31:23 -
@@ -69,8 +69,54 @@
 #include PictureBase.h
 
 #ifdef HAVE_XINERAMA
-#define FScreenHaveXinerama 1
-#include X11/extensions/Xinerama.h
+# define FScreenHaveXinerama 1
+# ifdef HAVE_SOLARIS_XINERAMA
+#  include X11/extensions/xinerama.h
+typedef struct
+{
+   int   screen_number;
+   short x_org;
+   short y_org;
+   short width;
+   short height;
+} XineramaScreenInfo;
+#  define XineramaIsActive(d)  XineramaGetState((d),0)
+#  define XineramaQueryScreens(d,b)solaris_XineramaQueryScreens((d),(b))
+#  define XineramaQueryExtension(d,b,c)1   /* Lie, for now */
+static XineramaScreenInfo *
+solaris_XineramaQueryScreens(Display *d, int *xin_nscreens)
+{
+   XineramaScreenInfo *screens = NULL;
+   XRectangle monitors[MAXFRAMEBUFFERS];
+   unsigned char hints[16];
+
+   int result = XineramaGetInfo(d, DefaultScreen(d), monitors, hints,
+xin_nscreens);
+   if (result)
+   {
+   int m;
+
+   screens = (XineramaScreenInfo 
*)malloc(sizeof(XineramaScreenInfo) * (*xin_nscreens));
+   for (m = 0; m  *xin_nscreens; ++m)
+   {
+   screens[m].screen_number = m;
+   screens[m].x_org = monitors[m].x;
+   screens[m].y_org = monitors[m].y;
+   screens[m].width = monitors[m].width;
+   screens[m].height = monitors[m].height;
+   }
+   }
+   else
+   {
+   fprintf(stderr, Error getting Xinerama information\n);
+   *xin_nscreens = 0;
+   }
+
+   return (screens);
+}
+# else /* Must be XFree86 Xinerama */
+#  include X11/extensions/Xinerama.h
+# endif
 #else
 #define FScreenHaveXinerama 0
 typedef struct


Re: Solaris Xinerama support

2004-08-13 Thread Chris Ross

Chris Ross wrote:


  Okay.  I don't know how many of you know this, but Solaris ships
an Xsun that has Xinerama support in it (as of the last dist.
of Solaris 7).  *But*, in typical Sun Microsystems style, there
is no Xinerama library, nor header file.


  Oops.  I should've mentioned that this patch was tested
with Solaris 8, but will only work on Solaris 8 with
the X11/extensions/xinerama.h header copied from Solaris 9.
Solaris' 9 and 10 ship with this header in place, so
will work with no additional effort.

  That should be noted somewhere, I'm sure.  :-)

   - Chris
--
Visit the official FVWM web page at URL:http://www.fvwm.org/.
To unsubscribe from the list, send unsubscribe fvwm-workers in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]