diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/xfixes | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/xfixes')
-rw-r--r-- | xorg-server/xfixes/Makefile.am | 4 | ||||
-rw-r--r-- | xorg-server/xfixes/Makefile.in | 102 | ||||
-rw-r--r-- | xorg-server/xfixes/cursor.c | 140 | ||||
-rw-r--r-- | xorg-server/xfixes/region.c | 2 | ||||
-rw-r--r-- | xorg-server/xfixes/select.c | 7 | ||||
-rw-r--r-- | xorg-server/xfixes/xfixes.c | 42 | ||||
-rw-r--r-- | xorg-server/xfixes/xfixes.h | 28 | ||||
-rw-r--r-- | xorg-server/xfixes/xfixesint.h | 42 |
8 files changed, 247 insertions, 120 deletions
diff --git a/xorg-server/xfixes/Makefile.am b/xorg-server/xfixes/Makefile.am index 2a95c065b..a8425e8ea 100644 --- a/xorg-server/xfixes/Makefile.am +++ b/xorg-server/xfixes/Makefile.am @@ -2,6 +2,10 @@ noinst_LTLIBRARIES = libxfixes.la AM_CFLAGS = $(DIX_CFLAGS) +if XORG +sdk_HEADERS = xfixes.h +endif + libxfixes_la_SOURCES = \ cursor.c \ region.c \ diff --git a/xorg-server/xfixes/Makefile.in b/xorg-server/xfixes/Makefile.in index 9d1c5f6d3..85a22a80a 100644 --- a/xorg-server/xfixes/Makefile.in +++ b/xorg-server/xfixes/Makefile.in @@ -15,6 +15,7 @@ @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -35,10 +36,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = xfixes -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -48,7 +53,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @@ -68,6 +74,30 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libxfixes_la_SOURCES) DIST_SOURCES = $(libxfixes_la_SOURCES) +am__sdk_HEADERS_DIST = xfixes.h +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(sdkdir)" +HEADERS = $(sdk_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -76,6 +106,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -96,9 +127,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -127,7 +161,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -136,9 +172,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -177,12 +217,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -202,7 +243,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -212,6 +252,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -225,11 +266,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -265,6 +305,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -289,7 +330,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -312,6 +352,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -343,7 +384,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -351,6 +394,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libxfixes.la AM_CFLAGS = $(DIX_CFLAGS) +@XORG_TRUE@sdk_HEADERS = xfixes.h libxfixes_la_SOURCES = \ cursor.c \ region.c \ @@ -444,6 +488,26 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-sdkHEADERS: $(sdk_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(sdkdir)" || $(MKDIR_P) "$(DESTDIR)$(sdkdir)" + @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \ + done + +uninstall-sdkHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sdkdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sdkdir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -529,8 +593,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: + for dir in "$(DESTDIR)$(sdkdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -579,7 +646,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-sdkHEADERS install-dvi: install-dvi-am @@ -625,7 +692,7 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-sdkHEADERS .MAKE: install-am install-strip @@ -637,10 +704,11 @@ uninstall-am: install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + install-sdkHEADERS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-sdkHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c index fc83f0a4b..bd2856500 100644 --- a/xorg-server/xfixes/cursor.c +++ b/xorg-server/xfixes/cursor.c @@ -1,23 +1,30 @@ /* - * Copyright © 2006 Sun Microsystems + * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Sun Microsystems not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Sun Microsystems makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. * - * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. * * Copyright © 2002 Keith Packard * @@ -58,7 +65,7 @@ static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; -static CursorPtr CursorCurrent; +static CursorPtr CursorCurrent[MAXDEVICES]; static CursorPtr pInvisibleCursor = NULL; static int CursorScreenPrivateKeyIndex; @@ -66,14 +73,19 @@ static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKeyIndex; static void deleteCursorHideCountsForScreen (ScreenPtr pScreen); -#define VERIFY_CURSOR(pCursor, cursor, client, access) { \ - pCursor = (CursorPtr)SecurityLookupIDByType((client), (cursor), \ - RT_CURSOR, (access)); \ - if (!pCursor) { \ - (client)->errorValue = (cursor); \ - return BadCursor; \ - } \ -} +#define VERIFY_CURSOR(pCursor, cursor, client, access) \ + do { \ + int err; \ + err = dixLookupResourceByType((pointer *) &pCursor, cursor, \ + RT_CURSOR, client, access); \ + if (err == BadValue) { \ + client->errorValue = cursor; \ + return BadCursor; \ + } else if (err != Success) { \ + client->errorValue = cursor; \ + return err; \ + } \ + } while (0) /* * There is a global list of windows selecting for cursor events @@ -121,11 +133,13 @@ typedef struct _CursorScreen { #define GetCursorScreenIfSet(s) GetCursorScreen(s) #define SetCursorScreen(s,p) dixSetPrivate(&(s)->devPrivates, CursorScreenPrivateKey, p) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) -#define Unwrap(as,s,elt) ((s)->elt = (as)->elt) +#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt) /* The cursor doesn't show up until the first XDefineCursor() */ static Bool CursorVisible = FALSE; +Bool EnableCursor = TRUE; + static Bool CursorDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, @@ -133,15 +147,16 @@ CursorDisplayCursor (DeviceIntPtr pDev, { CursorScreenPtr cs = GetCursorScreen(pScreen); Bool ret; + DisplayCursorProcPtr backupProc; - Unwrap (cs, pScreen, DisplayCursor); + Unwrap (cs, pScreen, DisplayCursor, backupProc); /* * Have to check ConnectionInfo to distinguish client requests from * initial root window setup. Not a great way to do it, I admit. */ if (ConnectionInfo) - CursorVisible = TRUE; + CursorVisible = EnableCursor; if (cs->pCursorHideCounts != NULL || !CursorVisible) { ret = ((*pScreen->RealizeCursor)(pDev, pScreen, pInvisibleCursor) && @@ -150,11 +165,11 @@ CursorDisplayCursor (DeviceIntPtr pDev, ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); } - if (pCursor != CursorCurrent) + if (pCursor != CursorCurrent[pDev->id]) { CursorEventPtr e; - CursorCurrent = pCursor; + CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { if ((e->eventMask & XFixesDisplayCursorNotifyMask) && @@ -172,7 +187,8 @@ CursorDisplayCursor (DeviceIntPtr pDev, } } } - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); + Wrap (cs, pScreen, DisplayCursor, backupProc); + return ret; } @@ -181,9 +197,11 @@ CursorCloseScreen (int index, ScreenPtr pScreen) { CursorScreenPtr cs = GetCursorScreen (pScreen); Bool ret; + CloseScreenProcPtr close_proc; + DisplayCursorProcPtr display_proc; - Unwrap (cs, pScreen, CloseScreen); - Unwrap (cs, pScreen, DisplayCursor); + Unwrap (cs, pScreen, CloseScreen, close_proc); + Unwrap (cs, pScreen, DisplayCursor, display_proc); deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (index, pScreen); xfree (cs); @@ -198,6 +216,8 @@ XFixesSelectCursorInput (ClientPtr pClient, CARD32 eventMask) { CursorEventPtr *prev, e; + pointer val; + int rc; for (prev = &cursorEvents; (e = *prev); prev = &e->next) { @@ -230,7 +250,10 @@ XFixesSelectCursorInput (ClientPtr pClient, * Add a resource hanging from the window to * catch window destroy */ - if (!LookupIDByType(pWindow->drawable.id, CursorWindowType)) + rc = dixLookupResourceByType( &val, pWindow->drawable.id, + CursorWindowType, serverClient, + DixGetAttrAccess); + if (rc != Success) if (!AddResource (pWindow->drawable.id, CursorWindowType, (pointer) pWindow)) { @@ -363,7 +386,7 @@ ProcXFixesGetCursorImage (ClientPtr client) int npixels, width, height, rc, x, y; REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq); - pCursor = CursorCurrent; + pCursor = CursorCurrent[PickPointer(client)->id]; if (!pCursor) return BadCursor; rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, @@ -406,7 +429,7 @@ ProcXFixesGetCursorImage (ClientPtr client) swapl (&rep->cursorSerial, n); SwapLongs (image, npixels); } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + + WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + (npixels << 2), (char *) rep); xfree (rep); return client->noClientException; @@ -459,7 +482,7 @@ ProcXFixesGetCursorName (ClientPtr client) CursorPtr pCursor; xXFixesGetCursorNameReply reply; REQUEST(xXFixesGetCursorNameReq); - char *str; + const char *str; int len; REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); @@ -471,7 +494,7 @@ ProcXFixesGetCursorName (ClientPtr client) len = strlen (str); reply.type = X_Reply; - reply.length = (len + 3) >> 2; + reply.length = bytes_to_int32(len); reply.sequenceNumber = client->sequence; reply.atom = pCursor->name; reply.nbytes = len; @@ -484,7 +507,7 @@ ProcXFixesGetCursorName (ClientPtr client) swaps (&reply.nbytes, n); } WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); - (void)WriteToClient(client, len, str); + WriteToClient(client, len, str); return(client->noClientException); } @@ -509,13 +532,13 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) CursorPtr pCursor; CARD32 *image; int npixels; - char *name; + const char *name; int nbytes, nbytesRound; int width, height; int rc, x, y; REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq); - pCursor = CursorCurrent; + pCursor = CursorCurrent[PickPointer(client)->id]; if (!pCursor) return BadCursor; rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, @@ -528,7 +551,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) npixels = width * height; name = pCursor->name ? NameForAtom (pCursor->name) : ""; nbytes = strlen (name); - nbytesRound = (nbytes + 3) & ~3; + nbytesRound = pad_to_int32(nbytes); rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) + npixels * sizeof (CARD32) + nbytesRound); if (!rep) @@ -536,7 +559,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) rep->type = X_Reply; rep->sequenceNumber = client->sequence; - rep->length = npixels + (nbytesRound >> 2); + rep->length = npixels + bytes_to_int32(nbytesRound); rep->width = width; rep->height = height; rep->x = x; @@ -566,7 +589,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) swaps (&rep->nbytes, n); SwapLongs (image, npixels); } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + + WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + (npixels << 2) + nbytesRound, (char *) rep); xfree (rep); return client->noClientException; @@ -895,7 +918,12 @@ ProcXFixesHideCursor (ClientPtr client) ret = createCursorHideCount(client, pWin->drawable.pScreen); if (ret == Success) { - (void) CursorDisplayCursor(PickPointer(client), pWin->drawable.pScreen, CursorCurrent); + DeviceIntPtr dev; + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (IsMaster(dev) && IsPointerDevice(dev)) + CursorDisplayCursor(dev, pWin->drawable.pScreen, CursorCurrent[dev->id]); + } } return ret; @@ -987,9 +1015,14 @@ CursorFreeHideCount (pointer data, XID id) { CursorHideCountPtr pChc = (CursorHideCountPtr) data; ScreenPtr pScreen = pChc->pScreen; + DeviceIntPtr dev; deleteCursorHideCount(pChc, pChc->pScreen); - (void) CursorDisplayCursor(inputInfo.pointer, pScreen, CursorCurrent); + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (IsMaster(dev) && IsPointerDevice(dev)) + CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]); + } return 1; } @@ -1015,12 +1048,11 @@ static CursorPtr createInvisibleCursor (void) { CursorPtr pCursor; - static unsigned int *psrcbits, *pmaskbits; + unsigned char *psrcbits, *pmaskbits; CursorMetricRec cm; - int rc; - psrcbits = (unsigned int *) xalloc(4); - pmaskbits = (unsigned int *) xalloc(4); + psrcbits = (unsigned char *) xalloc(4); + pmaskbits = (unsigned char *) xalloc(4); if (psrcbits == NULL || pmaskbits == NULL) { return NULL; } @@ -1032,9 +1064,7 @@ createInvisibleCursor (void) cm.xhot = 0; cm.yhot = 0; - rc = AllocARGBCursor( - (unsigned char *)psrcbits, - (unsigned char *)pmaskbits, + AllocARGBCursor(psrcbits, pmaskbits, NULL, &cm, 0, 0, 0, 0, 0, 0, @@ -1049,7 +1079,7 @@ XFixesCursorInit (void) int i; if (party_like_its_1989) - CursorVisible = TRUE; + CursorVisible = EnableCursor; for (i = 0; i < screenInfo.numScreens; i++) { diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c index 2ab98fcef..966eda051 100644 --- a/xorg-server/xfixes/region.c +++ b/xorg-server/xfixes/region.c @@ -34,7 +34,7 @@ extern int RenderErrBase; #include <gcstruct.h> #include <window.h> -RESTYPE RegionResType; +RESTYPE RegionResType; static int RegionResFree (pointer data, XID id) diff --git a/xorg-server/xfixes/select.c b/xorg-server/xfixes/select.c index 12a165fd0..a5811bdc0 100644 --- a/xorg-server/xfixes/select.c +++ b/xorg-server/xfixes/select.c @@ -83,6 +83,7 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) { xXFixesSelectionNotifyEvent ev; + memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent)); ev.type = XFixesEventBase + XFixesSelectionNotify; ev.subtype = subtype; ev.sequenceNumber = e->pClient->sequence; @@ -132,6 +133,7 @@ XFixesSelectSelectionInput (ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) { + pointer val; int rc; SelectionEventPtr *prev, e; @@ -172,7 +174,10 @@ XFixesSelectSelectionInput (ClientPtr pClient, * Add a resource hanging from the window to * catch window destroy */ - if (!LookupIDByType(pWindow->drawable.id, SelectionWindowType)) + rc = dixLookupResourceByType (&val, pWindow->drawable.id, + SelectionWindowType, serverClient, + DixGetAttrAccess); + if (rc != Success) if (!AddResource (pWindow->drawable.id, SelectionWindowType, (pointer) pWindow)) { diff --git a/xorg-server/xfixes/xfixes.c b/xorg-server/xfixes/xfixes.c index d1225c6f3..25c92ea93 100644 --- a/xorg-server/xfixes/xfixes.c +++ b/xorg-server/xfixes/xfixes.c @@ -1,23 +1,30 @@ /* - * Copyright © 2006 Sun Microsystems + * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Sun Microsystems not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Sun Microsystems makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. * - * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. * * Copyright © 2002 Keith Packard * @@ -69,6 +76,7 @@ ProcXFixesQueryVersion(ClientPtr client) REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); + memset(&rep, 0, sizeof(xXFixesQueryVersionReply)); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; diff --git a/xorg-server/xfixes/xfixes.h b/xorg-server/xfixes/xfixes.h index 81dd83daf..69d162ffe 100644 --- a/xorg-server/xfixes/xfixes.h +++ b/xorg-server/xfixes/xfixes.h @@ -29,23 +29,29 @@ #include "resource.h" -extern RESTYPE RegionResType; -extern int XFixesErrorBase; - -#define VERIFY_REGION(pRegion, rid, client, mode) { \ - pRegion = SecurityLookupIDByType (client, rid, RegionResType, mode); \ - if (!pRegion) { \ - client->errorValue = rid; \ - return XFixesErrorBase + BadRegion; \ - } \ -} +extern _X_EXPORT RESTYPE RegionResType; +extern _X_EXPORT int XFixesErrorBase; + +#define VERIFY_REGION(pRegion, rid, client, mode) \ + do { \ + int err; \ + err = dixLookupResourceByType((pointer *) &pRegion, rid, \ + RegionResType, client, mode); \ + if (err == BadValue) { \ + client->errorValue = rid; \ + return XFixesErrorBase + BadRegion; \ + } else if (err != Success) { \ + client->errorValue = rid; \ + return err; \ + } \ + } while (0) #define VERIFY_REGION_OR_NONE(pRegion, rid, client, mode) { \ pRegion = 0; \ if (rid) VERIFY_REGION(pRegion, rid, client, mode); \ } -RegionPtr +extern _X_EXPORT RegionPtr XFixesRegionCopy (RegionPtr pRegion); diff --git a/xorg-server/xfixes/xfixesint.h b/xorg-server/xfixes/xfixesint.h index 33a3205ed..d7c53ee07 100644 --- a/xorg-server/xfixes/xfixesint.h +++ b/xorg-server/xfixes/xfixesint.h @@ -1,23 +1,30 @@ /* - * Copyright © 2006 Sun Microsystems + * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Sun Microsystems not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Sun Microsystems makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. * - * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. * * Copyright © 2002 Keith Packard * @@ -47,7 +54,6 @@ #ifndef _XFIXESINT_H_ #define _XFIXESINT_H_ -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" |