xprint support to weed out xprint screens from the root list - they arent

real roots - they are special... :)


SVN revision: 13873
This commit is contained in:
Carsten Haitzler 2005-03-23 11:49:48 +00:00
parent 90eccc9123
commit 4f00524964
4 changed files with 100 additions and 2 deletions

View File

@ -295,6 +295,38 @@ CFLAGS=$PCFLAGS
AC_SUBST(Xcursor_cflags)
AC_SUBST(Xcursor_libs)
Xprint_libs=""
Xprint_cflags=""
use_Xprint="no"
PCFLAGS=$CFLAGS
CFLAGS=$x_cflags" "$x_includes
AC_CHECK_HEADER(X11/extensions/Print.h, [
AC_CHECK_LIB(Xp, XpQueryScreens, [
AC_DEFINE(ECORE_XPRINT, 1, [Build support for Xprint])
Xprint_cflags=""
Xprint_libs="-lXp"
use_Xprint="yes"
], [
Xprint_cflags=""
Xprint_libs=""
use_Xprint="no"
], [
$x_libs $x_ldflags
]
)
], [
Xprint_cflags=""
Xprint_libs=""
use_Xprint="no"
], [
#include <X11/Xlib.h>
]
)
CFLAGS=$PCFLAGS
AC_SUBST(Xprint_cflags)
AC_SUBST(Xprint_libs)
Xinerama_libs=""
Xinerama_cflags=""
use_Xinerama="no"
@ -844,7 +876,7 @@ echo
echo " Ecore_Job...............: $have_ecore_job"
echo " Ecore_Con...............: $have_ecore_con (OpenSSL: $use_openssl)"
echo " Ecore_Txt...............: $have_ecore_txt"
echo " Ecore_X.................: $have_ecore_x (Xcursor: $use_Xcursor) (Xinerama: $use_Xinerama)"
echo " Ecore_X.................: $have_ecore_x (Xcursor: $use_Xcursor) (Xprint: $use_Xprint) (Xinerama: $use_Xinerama)"
echo " Ecore_FB................: $have_ecore_fb"
echo " Ecore_Evas..............: $have_ecore_evas"
echo " Ecore_Evas GL Support...: $have_ecore_evas_gl"

View File

@ -2,6 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
INCLUDES = \
@Xcursor_cflags@ \
@Xprint_cflags@ \
@Xinerama_cflags@ \
@x_cflags@ \
-I$(top_srcdir)/src/lib/ecore \
@ -44,6 +45,7 @@ ecore_x_private.h
libecore_x_la_LIBADD = \
@Xcursor_libs@ \
@Xprint_libs@ \
@Xinerama_libs@ \
@x_ldflags@ \
@x_libs@ \

View File

@ -788,11 +788,72 @@ ecore_x_window_root_list(int *num_ret)
if (!num_ret) return NULL;
*num_ret = 0;
#ifdef ECORE_XPRINT
{
Screen **ps = NULL;
int psnum = 0;
num = ScreenCount(_ecore_x_disp);
ps = XpQueryScreens(_ecore_x_disp, &psnum);
if (ps)
{
int overlap, j;
overlap = 0;
for (i = 0; i < num; i++)
{
for (j = 0; j < psnum; j++)
{
if (ScreenOfDisplay(_ecore_x_disp, i) == ps[j])
overlap++;
}
}
roots = malloc((num - overlap) * sizeof(Window));
if (roots)
{
int k;
k = 0;
for (i = 0; i < num; i++)
{
int is_print;
is_print = 0;
for (j = 0; j < psnum; j++)
{
if (ScreenOfDisplay(_ecore_x_disp, i) == ps[j])
{
is_print = 1;
break;
}
}
if (!is_print)
{
roots[k] = RootWindow(_ecore_x_disp, i);
k++;
}
}
*num_ret = k;
}
XFree(ps);
}
else
{
roots = malloc(num * sizeof(Window));
if (!roots) return NULL;
*num_ret = num;
for (i = 0; i < num; i++)
roots[i] = RootWindow(_ecore_x_disp, i);
}
}
#else
num = ScreenCount(_ecore_x_disp);
roots = malloc(num * sizeof(Window));
if (!roots) return NULL;
*num_ret = num;
for (i = 0; i < num; i++) roots[i] = RootWindow(_ecore_x_disp, i);
for (i = 0; i < num; i++)
roots[i] = RootWindow(_ecore_x_disp, i);
#endif
return roots;
}

View File

@ -20,6 +20,9 @@
#ifdef ECORE_XCURSOR
#include <X11/Xcursor/Xcursor.h>
#endif
#ifdef ECORE_XPRINT
#include <X11/extensions/Print.h>
#endif
#ifdef ECORE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif