From a56b98bb047003a05e26ca9365c212a2da7ac200 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 18 Aug 2006 18:03:41 +0300 Subject: [PATCH] dix: enable null root cursor Enable a blank root cursor, selectable with --enable-null-root-cursor at configure time. --- configure.ac | 7 +++++++ dix/main.c | 12 ++++++++++++ include/dix-config.h.in | 3 +++ 3 files changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index e68021d1c..19ef8d120 100644 --- a/configure.ac +++ b/configure.ac @@ -396,6 +396,9 @@ AC_ARG_ENABLE(install-libxf86config, AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only built-in fonts (default: use external)]), [BUILTIN_FONTS=$enableval], [BUILTIN_FONTS=no]) +AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]), + [NULL_ROOT_CURSOR=$enableval], + [NULL_ROOT_CURSOR=no]) dnl Extensions. AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) @@ -745,6 +748,10 @@ XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, [Do not have `strcasecmp'.])) +if test "x$NULL_ROOT_CURSOR" = xyes; then + AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor]) +fi + PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) if test "x$have_libxdmcp" = xyes; then AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) diff --git a/dix/main.c b/dix/main.c index 7449c5ab9..f2e494ea8 100644 --- a/dix/main.c +++ b/dix/main.c @@ -249,6 +249,7 @@ main(int argc, char *argv[], char *envp[]) int i, j, k, error; char *xauthfile; HWEventQueueType alwaysCheckForInput[2]; + CursorMetricRec cm; display = "0"; @@ -415,9 +416,20 @@ main(int argc, char *argv[], char *envp[]) } if (!SetDefaultFont(defaultTextFont)) FatalError("could not open default font '%s'", defaultTextFont); +#ifdef NULL_ROOT_CURSOR + cm.width = 0; + cm.height = 0; + cm.xhot = 0; + cm.yhot = 0; + + if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) + FatalError("could not create empty root cursor"); + AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor); +#else if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) FatalError("could not open default cursor font '%s'", defaultCursorFont); +#endif #ifdef DPMSExtension /* check all screens, looking for DPMS Capabilities */ DPMSCapableFlag = DPMSSupported(); diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 2cf9eaf01..2e05e04e8 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -445,4 +445,7 @@ /* Avoid using font servers */ #undef NOFONTSERVERACCESS +/* Use an empty root cursor */ +#undef NULL_ROOT_CURSOR + #endif /* _DIX_CONFIG_H_ */