From a667131e2846355b7b2099635761a79e22bcbe68 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 31 Oct 2017 01:54:47 +0100 Subject: Lift XFIXES to xorg-xserver-7.1/1.1.0 state (XFIXES 4.0) --- nx-X11/include/extensions/Imakefile | 1 + nx-X11/include/extensions/shapeconst.h | 55 +++++ nx-X11/include/extensions/xfixesproto.h | 56 ++++- nx-X11/include/extensions/xfixeswire.h | 20 +- .../programs/Xserver/include/protocol-versions.h | 2 +- nx-X11/programs/Xserver/xfixes/cursor.c | 275 ++++++++++++++++++++- nx-X11/programs/Xserver/xfixes/xfixes.c | 7 + nx-X11/programs/Xserver/xfixes/xfixesint.h | 14 ++ 8 files changed, 421 insertions(+), 9 deletions(-) create mode 100644 nx-X11/include/extensions/shapeconst.h diff --git a/nx-X11/include/extensions/Imakefile b/nx-X11/include/extensions/Imakefile index f1760d274..cdd2446fb 100644 --- a/nx-X11/include/extensions/Imakefile +++ b/nx-X11/include/extensions/Imakefile @@ -62,6 +62,7 @@ HEADERS = \ security.h securstr.h \ sync.h syncstr.h \ dpms.h dpmsstr.h \ + shapeconst.h \ $(NULL) all:: diff --git a/nx-X11/include/extensions/shapeconst.h b/nx-X11/include/extensions/shapeconst.h new file mode 100644 index 000000000..9088956f1 --- /dev/null +++ b/nx-X11/include/extensions/shapeconst.h @@ -0,0 +1,55 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +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. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the 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. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +********************************************************/ + +#ifndef _SHAPECONST_H_ +#define _SHAPECONST_H_ + +/* + * Protocol requests constants and alignment values + * These would really be in SHAPE's X.h and Xproto.h equivalents + */ + +#define SHAPENAME "SHAPE" + +#define SHAPE_MAJOR_VERSION 1 /* current version numbers */ +#define SHAPE_MINOR_VERSION 1 + +#define ShapeSet 0 +#define ShapeUnion 1 +#define ShapeIntersect 2 +#define ShapeSubtract 3 +#define ShapeInvert 4 + +#define ShapeBounding 0 +#define ShapeClip 1 +#define ShapeInput 2 + +#define ShapeNotifyMask (1L << 0) +#define ShapeNotify 0 + +#define ShapeNumberEvents (ShapeNotify + 1) + +#endif /* _SHAPECONST_H_ */ diff --git a/nx-X11/include/extensions/xfixesproto.h b/nx-X11/include/extensions/xfixesproto.h index b3f35e878..2cde20498 100644 --- a/nx-X11/include/extensions/xfixesproto.h +++ b/nx-X11/include/extensions/xfixesproto.h @@ -27,9 +27,7 @@ #include #include -#define _SHAPE_SERVER_ -#include -#undef _SHAPE_SERVER_ +#include #define Window CARD32 #define Drawable CARD32 @@ -462,6 +460,58 @@ typedef struct { #define sz_xXFixesExpandRegionReq 20 +/*************** Version 4.0 ******************/ + +typedef struct { + CARD8 reqType; + CARD8 xfixesReqType; + CARD16 length B16; + Window window B32; +} xXFixesHideCursorReq; + +#define sz_xXFixesHideCursorReq sizeof(xXFixesHideCursorReq) + +typedef struct { + CARD8 reqType; + CARD8 xfixesReqType; + CARD16 length B16; + Window window B32; +} xXFixesShowCursorReq; + +#define sz_xXFixesShowCursorReq sizeof(xXFixesShowCursorReq) + +/*************** Version 5.0 ******************/ + +#define Barrier CARD32 + +typedef struct { + CARD8 reqType; + CARD8 xfixesReqType; + CARD16 length B16; + Barrier barrier B32; + Window window B32; + INT16 x1 B16; + INT16 y1 B16; + INT16 x2 B16; + INT16 y2 B16; + CARD32 directions; + CARD16 pad B16; + CARD16 num_devices B16; + /* array of CARD16 devices */ +} xXFixesCreatePointerBarrierReq; + +#define sz_xXFixesCreatePointerBarrierReq 28 + +typedef struct { + CARD8 reqType; + CARD8 xfixesReqType; + CARD16 length B16; + Barrier barrier B32; +} xXFixesDestroyPointerBarrierReq; + +#define sz_xXFixesDestroyPointerBarrierReq 8 + +#undef Barrier #undef Region #undef Picture #undef Window diff --git a/nx-X11/include/extensions/xfixeswire.h b/nx-X11/include/extensions/xfixeswire.h index 60851f2ae..4d86bdda1 100644 --- a/nx-X11/include/extensions/xfixeswire.h +++ b/nx-X11/include/extensions/xfixeswire.h @@ -27,7 +27,7 @@ #define _XFIXESWIRE_H_ #define XFIXES_NAME "XFIXES" -#define XFIXES_MAJOR 3 +#define XFIXES_MAJOR 4 #define XFIXES_MINOR 0 /*************** Version 1 ******************/ @@ -62,8 +62,14 @@ #define X_XFixesChangeCursorByName 27 /*************** Version 3 ******************/ #define X_XFixesExpandRegion 28 +/*************** Version 4 ******************/ +#define X_XFixesHideCursor 29 +#define X_XFixesShowCursor 30 +/*************** Version 5 ******************/ +#define X_XFixesCreatePointerBarrier 31 +#define X_XFixesDestroyPointerBarrier 32 -#define XFixesNumberRequests 29 +#define XFixesNumberRequests (X_XFixesDestroyPointerBarrier+1) /* Selection events share one event number */ #define XFixesSelectionNotify 0 @@ -88,7 +94,8 @@ /* errors */ #define BadRegion 0 -#define XFixesNumberErrors (BadRegion+1) +#define BadBarrier 1 +#define XFixesNumberErrors (BadBarrier+1) #define SaveSetNearest 0 #define SaveSetRoot 1 @@ -101,4 +108,11 @@ #define WindowRegionBounding 0 #define WindowRegionClip 1 +/*************** Version 5 ******************/ + +#define BarrierPositiveX (1L << 0) +#define BarrierPositiveY (1L << 1) +#define BarrierNegativeX (1L << 2) +#define BarrierNegativeY (1L << 3) + #endif /* _XFIXESWIRE_H_ */ diff --git a/nx-X11/programs/Xserver/include/protocol-versions.h b/nx-X11/programs/Xserver/include/protocol-versions.h index 9b9319fd2..7c5ea6483 100644 --- a/nx-X11/programs/Xserver/include/protocol-versions.h +++ b/nx-X11/programs/Xserver/include/protocol-versions.h @@ -148,7 +148,7 @@ #define SERVER_XFIXES_MAJOR_VERSION 5 #define SERVER_XFIXES_MINOR_VERSION 0 #else /* !defined(NXAGENT_SERVER) */ -#define SERVER_XFIXES_MAJOR_VERSION 3 +#define SERVER_XFIXES_MAJOR_VERSION 4 #define SERVER_XFIXES_MINOR_VERSION 0 #endif /* !defined(NXAGENT_SERVER) */ diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 00a912be3..e0705ed0a 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -35,10 +35,14 @@ #include "windowstr.h" static RESTYPE CursorClientType; +static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; static int CursorScreenPrivateIndex = -1; static int CursorGeneration; static CursorPtr CursorCurrent; +static CursorPtr pInvisibleCursor = NULL; + +static void deleteCursorHideCountsForScreen (ScreenPtr pScreen); #define VERIFY_CURSOR(pCursor, cursor, client, access) { \ pCursor = (CursorPtr)SecurityLookupIDByType((client), (cursor), \ @@ -65,6 +69,22 @@ typedef struct _CursorEvent { static CursorEventPtr cursorEvents; +/* + * Each screen has a list of clients which have requested + * that the cursor be hid, and the number of times each + * client has requested. +*/ + +typedef struct _CursorHideCountRec *CursorHideCountPtr; + +typedef struct _CursorHideCountRec { + CursorHideCountPtr pNext; + ClientPtr pClient; + ScreenPtr pScreen; + int hideCount; + XID resource; +} CursorHideCountRec; + /* * Wrap DisplayCursor to catch cursor change events */ @@ -72,6 +92,7 @@ static CursorEventPtr cursorEvents; typedef struct _CursorScreen { DisplayCursorProcPtr DisplayCursor; CloseScreenProcPtr CloseScreen; + CursorHideCountPtr pCursorHideCounts; } CursorScreenRec, *CursorScreenPtr; #define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) @@ -88,7 +109,13 @@ CursorDisplayCursor (ScreenPtr pScreen, Bool ret; Unwrap (cs, pScreen, DisplayCursor); - ret = (*pScreen->DisplayCursor) (pScreen, pCursor); + + if (cs->pCursorHideCounts != NULL) { + ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor); + } else { + ret = (*pScreen->DisplayCursor) (pScreen, pCursor); + } + if (pCursor != CursorCurrent) { CursorEventPtr e; @@ -96,7 +123,7 @@ CursorDisplayCursor (ScreenPtr pScreen, CursorCurrent = pCursor; for (e = cursorEvents; e; e = e->next) { - if ((e->eventMask & XFixesDisplayCursorNotifyMask)) + if (e->eventMask & XFixesDisplayCursorNotifyMask) { xXFixesCursorNotifyEvent ev; ev.type = XFixesEventBase + XFixesCursorNotify; @@ -121,6 +148,7 @@ CursorCloseScreen (ScreenPtr pScreen) Unwrap (cs, pScreen, CloseScreen); Unwrap (cs, pScreen, DisplayCursor); + deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (pScreen); free (cs); if (screenInfo.numScreens <= 1) @@ -674,6 +702,197 @@ SProcXFixesChangeCursorByName (ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } +/* + * Routines for manipulating the per-screen hide counts list. + * This list indicates which clients have requested cursor hiding + * for that screen. + */ + +/* Return the screen's hide-counts list element for the given client */ +static CursorHideCountPtr +findCursorHideCount (ClientPtr pClient, ScreenPtr pScreen) +{ + CursorScreenPtr cs = GetCursorScreen(pScreen); + CursorHideCountPtr pChc; + + for (pChc = cs->pCursorHideCounts; pChc != NULL; pChc = pChc->pNext) { + if (pChc->pClient == pClient) { + return pChc; + } + } + + return NULL; +} + +static int +createCursorHideCount (ClientPtr pClient, ScreenPtr pScreen) +{ + CursorScreenPtr cs = GetCursorScreen(pScreen); + CursorHideCountPtr pChc; + + pChc = (CursorHideCountPtr) malloc(sizeof(CursorHideCountRec)); + if (pChc == NULL) { + return BadAlloc; + } + pChc->pClient = pClient; + pChc->pScreen = pScreen; + pChc->hideCount = 1; + pChc->resource = FakeClientID(pClient->index); + pChc->pNext = cs->pCursorHideCounts; + cs->pCursorHideCounts = pChc; + + /* + * Create a resource for this element so it can be deleted + * when the client goes away. + */ + if (!AddResource (pChc->resource, CursorHideCountType, + (void *) pChc)) { + free(pChc); + return BadAlloc; + } + + return Success; +} + +/* + * Delete the given hide-counts list element from its screen list. + */ +static void +deleteCursorHideCount (CursorHideCountPtr pChcToDel, ScreenPtr pScreen) +{ + CursorScreenPtr cs = GetCursorScreen(pScreen); + CursorHideCountPtr pChc, pNext; + CursorHideCountPtr pChcLast = NULL; + + pChc = cs->pCursorHideCounts; + while (pChc != NULL) { + pNext = pChc->pNext; + if (pChc == pChcToDel) { + free(pChc); + if (pChcLast == NULL) { + cs->pCursorHideCounts = pNext; + } else { + pChcLast->pNext = pNext; + } + return; + } + pChcLast = pChc; + pChc = pNext; + } +} + +/* + * Delete all the hide-counts list elements for this screen. + */ +static void +deleteCursorHideCountsForScreen (ScreenPtr pScreen) +{ + CursorScreenPtr cs = GetCursorScreen(pScreen); + CursorHideCountPtr pChc, pTmp; + + pChc = cs->pCursorHideCounts; + while (pChc != NULL) { + pTmp = pChc->pNext; + FreeResource(pChc->resource, 0); + pChc = pTmp; + } + cs->pCursorHideCounts = NULL; +} + +int +ProcXFixesHideCursor (ClientPtr client) +{ + WindowPtr pWin; + CursorHideCountPtr pChc; + REQUEST(xXFixesHideCursorReq); + int ret; + + REQUEST_SIZE_MATCH (xXFixesHideCursorReq); + + pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); + if (!pWin) { + client->errorValue = stuff->window; + return BadWindow; + } + + /* + * Has client hidden the cursor before on this screen? + * If so, just increment the count. + */ + + pChc = findCursorHideCount(client, pWin->drawable.pScreen); + if (pChc != NULL) { + pChc->hideCount++; + return client->noClientException; + } + + /* + * This is the first time this client has hid the cursor + * for this screen. + */ + ret = createCursorHideCount(client, pWin->drawable.pScreen); + + if (ret == Success) { + (void) CursorDisplayCursor(pWin->drawable.pScreen, CursorCurrent); + } + + return ret; +} + +int +SProcXFixesHideCursor (ClientPtr client) +{ + REQUEST(xXFixesHideCursorReq); + + swaps (&stuff->length); + REQUEST_SIZE_MATCH (xXFixesHideCursorReq); + swapl (&stuff->window); + return (*ProcXFixesVector[stuff->xfixesReqType]) (client); +} + +int +ProcXFixesShowCursor (ClientPtr client) +{ + WindowPtr pWin; + CursorHideCountPtr pChc; + REQUEST(xXFixesShowCursorReq); + + REQUEST_SIZE_MATCH (xXFixesShowCursorReq); + + pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); + if (!pWin) { + client->errorValue = stuff->window; + return BadWindow; + } + + /* + * Has client hidden the cursor on this screen? + * If not, generate an error. + */ + pChc = findCursorHideCount(client, pWin->drawable.pScreen); + if (pChc == NULL) { + return BadMatch; + } + + pChc->hideCount--; + if (pChc->hideCount <= 0) { + FreeResource(pChc->resource, 0); + } + + return (client->noClientException); +} + +int +SProcXFixesShowCursor (ClientPtr client) +{ + REQUEST(xXFixesShowCursorReq); + + swaps (&stuff->length); + REQUEST_SIZE_MATCH (xXFixesShowCursorReq); + swapl (&stuff->window); + return (*ProcXFixesVector[stuff->xfixesReqType]) (client); +} + static int CursorFreeClient (void * data, XID id) { @@ -692,6 +911,18 @@ CursorFreeClient (void * data, XID id) return 1; } +static int +CursorFreeHideCount (void * data, XID id) +{ + CursorHideCountPtr pChc = (CursorHideCountPtr) data; + ScreenPtr pScreen = pChc->pScreen; + + deleteCursorHideCount(pChc, pChc->pScreen); + (void) CursorDisplayCursor(pScreen, CursorCurrent); + + return 1; +} + static int CursorFreeWindow (void * data, XID id) { @@ -709,6 +940,36 @@ CursorFreeWindow (void * data, XID id) return 1; } +static CursorPtr +createInvisibleCursor (void) +{ + CursorPtr pCursor; + static unsigned int *psrcbits, *pmaskbits; + CursorMetricRec cm; + + psrcbits = (unsigned int *) malloc(4); + pmaskbits = (unsigned int *) malloc(4); + if (psrcbits == NULL || pmaskbits == NULL) { + return NULL; + } + *psrcbits = 0; + *pmaskbits = 0; + + cm.width = 1; + cm.height = 1; + cm.xhot = 0; + cm.yhot = 0; + + pCursor = AllocCursor( + (unsigned char *)psrcbits, + (unsigned char *)pmaskbits, + &cm, + 0, 0, 0, + 0, 0, 0); + + return pCursor; +} + Bool XFixesCursorInit (void) { @@ -731,10 +992,20 @@ XFixesCursorInit (void) return FALSE; Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); + cs->pCursorHideCounts = NULL; SetCursorScreen (pScreen, cs); } CursorClientType = CreateNewResourceType(CursorFreeClient); + CursorHideCountType = CreateNewResourceType(CursorFreeHideCount); CursorWindowType = CreateNewResourceType(CursorFreeWindow); + + if (pInvisibleCursor == NULL) { + pInvisibleCursor = createInvisibleCursor(); + if (pInvisibleCursor == NULL) { + return BadAlloc; + } + } + return CursorClientType && CursorWindowType; } diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 1403be8c5..3b5815167 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -75,6 +75,7 @@ static const int version_requests[] = { X_XFixesGetCursorImage, /* Version 1 */ X_XFixesChangeCursorByName, /* Version 2 */ X_XFixesExpandRegion, /* Version 3 */ + X_XFixesShowCursor, /* Version 4 */ }; #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) @@ -112,6 +113,9 @@ int (*ProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { ProcXFixesChangeCursorByName, /*************** Version 3 ******************/ ProcXFixesExpandRegion, +/*************** Version 4 ****************/ + ProcXFixesHideCursor, + ProcXFixesShowCursor, }; static int @@ -171,6 +175,9 @@ int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { SProcXFixesChangeCursorByName, /*************** Version 3 ******************/ SProcXFixesExpandRegion, +/*************** Version 4 ****************/ + SProcXFixesHideCursor, + SProcXFixesShowCursor, }; static int diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index 70550f5f1..fcbc77b89 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -239,4 +239,18 @@ ProcXFixesExpandRegion (ClientPtr client); int SProcXFixesExpandRegion (ClientPtr client); +/* Cursor Visibility (Version 4) */ + +int +ProcXFixesHideCursor (ClientPtr client); + +int +SProcXFixesHideCursor (ClientPtr client); + +int +ProcXFixesShowCursor (ClientPtr client); + +int +SProcXFixesShowCursor (ClientPtr client); + #endif /* _XFIXESINT_H_ */ -- cgit v1.2.3 From 5706005f72d79716fadaabdb6d560bfeb30ff6df Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 26 Feb 2018 02:44:10 +0100 Subject: Lift XFIXES to xorg-xserver-7.1/1.1.0 state (XFIXES 4.0) - non-functional changes only --- nx-X11/include/extensions/xfixesproto.h | 23 ++++++++++++++++++++++- nx-X11/include/extensions/xfixeswire.h | 23 ++++++++++++++++++++++- nx-X11/programs/Xserver/xfixes/cursor.c | 22 +++++++++++++++++++++- nx-X11/programs/Xserver/xfixes/region.c | 2 +- nx-X11/programs/Xserver/xfixes/saveset.c | 2 +- nx-X11/programs/Xserver/xfixes/select.c | 2 +- nx-X11/programs/Xserver/xfixes/xfixes.c | 22 +++++++++++++++++++++- nx-X11/programs/Xserver/xfixes/xfixes.h | 2 +- nx-X11/programs/Xserver/xfixes/xfixesint.h | 28 ++++++++++++++++++++++++---- 9 files changed, 114 insertions(+), 12 deletions(-) diff --git a/nx-X11/include/extensions/xfixesproto.h b/nx-X11/include/extensions/xfixesproto.h index 2cde20498..3a8305973 100644 --- a/nx-X11/include/extensions/xfixesproto.h +++ b/nx-X11/include/extensions/xfixesproto.h @@ -1,6 +1,27 @@ /* - * $XFree86: xc/include/extensions/xfixesproto.h,v 1.1 2002/11/30 06:21:43 keithp Exp $ + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. * + * 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, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * 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. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/* * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/include/extensions/xfixeswire.h b/nx-X11/include/extensions/xfixeswire.h index 4d86bdda1..a4c1f89f2 100644 --- a/nx-X11/include/extensions/xfixeswire.h +++ b/nx-X11/include/extensions/xfixeswire.h @@ -1,6 +1,27 @@ /* - * $XFree86: xc/include/extensions/xfixeswire.h,v 1.1 2002/11/30 06:21:43 keithp Exp $ + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. * + * 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, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * 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. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/* * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index e0705ed0a..d372b476e 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -1,5 +1,25 @@ /* - * $Id: cursor.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ + * $Id$ + * + * Copyright © 2006 Sun Microsystems + * + * 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. + * + * 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. * * Copyright © 2002 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 18b1d3ff4..4abe9083d 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -1,5 +1,5 @@ /* - * $Id: region.c,v 1.7 2005/07/03 07:37:35 daniels Exp $ + * $Id$ * * Copyright © 2003 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/saveset.c b/nx-X11/programs/Xserver/xfixes/saveset.c index 0a5b2b8da..a992ab306 100644 --- a/nx-X11/programs/Xserver/xfixes/saveset.c +++ b/nx-X11/programs/Xserver/xfixes/saveset.c @@ -1,5 +1,5 @@ /* - * $Id: saveset.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ + * $Id$ * * Copyright © 2002 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index b21301d1c..98c71020d 100644 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -1,5 +1,5 @@ /* - * $Id: select.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ + * $Id$ * * Copyright © 2002 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 3b5815167..c4977b634 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -1,5 +1,25 @@ /* - * $Id: xfixes.c,v 1.7 2005/07/03 07:37:35 daniels Exp $ + * $Id$ + * + * Copyright © 2006 Sun Microsystems + * + * 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. + * + * 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. * * Copyright © 2002 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.h b/nx-X11/programs/Xserver/xfixes/xfixes.h index fcd941778..0f1e3b070 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.h +++ b/nx-X11/programs/Xserver/xfixes/xfixes.h @@ -1,5 +1,5 @@ /* - * $Id: xfixes.h,v 1.6 2005/07/03 07:02:08 daniels Exp $ + * $Id$ * * Copyright © 2002 Keith Packard * diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index fcbc77b89..2e1ac143e 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -1,5 +1,25 @@ /* - * $Id: xfixesint.h,v 1.7 2005/07/03 08:53:54 daniels Exp $ + * $Id$ + * + * Copyright © 2006 Sun Microsystems + * + * 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. + * + * 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. * * Copyright © 2002 Keith Packard * @@ -62,10 +82,10 @@ XFixesExtensionInit(void); /* Save set */ int ProcXFixesChangeSaveSet(ClientPtr client); - + int SProcXFixesChangeSaveSet(ClientPtr client); - + /* Selection events */ int ProcXFixesSelectSelectionInput (ClientPtr client); @@ -82,7 +102,7 @@ XFixesSelectionInit (void); /* Cursor notification */ Bool XFixesCursorInit (void); - + int ProcXFixesSelectCursorInput (ClientPtr client); -- cgit v1.2.3 From d59e8d7f43d8a39155cb4d1884cf65b871fd3de6 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 5 Nov 2017 23:59:22 +0100 Subject: Lift XFIXES to xorg-xserver-1.4.2 state --- nx-X11/programs/Xserver/xfixes/cursor.c | 9 +++++++++ nx-X11/programs/Xserver/xfixes/region.c | 19 +++++++++++++++++++ nx-X11/programs/Xserver/xfixes/saveset.c | 6 ++++++ nx-X11/programs/Xserver/xfixes/select.c | 9 +++++++++ nx-X11/programs/Xserver/xfixes/xfixes.c | 6 +++--- nx-X11/programs/Xserver/xfixes/xfixesint.h | 3 --- 6 files changed, 46 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index d372b476e..12efbd75f 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -238,12 +238,21 @@ ProcXFixesSelectCursorInput (ClientPtr client) { REQUEST (xXFixesSelectCursorInputReq); WindowPtr pWin; +#ifndef NXAGENT_SERVER + int rc; +#endif REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); +#ifndef NXAGENT_SERVER + rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); + if (rc != Success) + return rc; +#else pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, DixReadAccess); if (!pWin) return(BadWindow); +#endif if (stuff->eventMask & ~CursorAllEvents) { client->errorValue = stuff->eventMask; diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 4abe9083d..9ac1fae3f 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -217,12 +217,21 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) { RegionPtr pRegion, pClip; GCPtr pGC; +#ifndef NXAGENT_SERVER + int rc; +#endif REQUEST (xXFixesCreateRegionFromGCReq); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); LEGAL_NEW_RESOURCE (stuff->region, client); +#ifndef NXAGENT_SERVER + rc = dixLookupGC(&pGC, stuff->gc, client, DixReadAccess); + if (rc != Success) + return rc; +#else SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess); +#endif switch (pGC->clientClipType) { case CT_PIXMAP: @@ -615,10 +624,20 @@ ProcXFixesSetGCClipRegion (ClientPtr client) GCPtr pGC; RegionPtr pRegion; XID vals[2]; +#ifndef NXAGENT_SERVER + int rc; +#endif REQUEST(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); + +#ifndef NXAGENT_SERVER + rc = dixLookupGC(&pGC, stuff->gc, client, DixWriteAccess); + if (rc != Success) + return rc; +#else SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); +#endif VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, DixReadAccess); if (pRegion) diff --git a/nx-X11/programs/Xserver/xfixes/saveset.c b/nx-X11/programs/Xserver/xfixes/saveset.c index a992ab306..57d9afc2e 100644 --- a/nx-X11/programs/Xserver/xfixes/saveset.c +++ b/nx-X11/programs/Xserver/xfixes/saveset.c @@ -37,10 +37,16 @@ ProcXFixesChangeSaveSet(ClientPtr client) REQUEST(xXFixesChangeSaveSetReq); REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq); +#ifndef NXAGENT_SERVER + result = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); + if (result != Success) + return result; +#else pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, DixReadAccess); if (!pWin) return(BadWindow); +#endif if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) return BadMatch; if ((stuff->mode != SetModeInsert) && (stuff->mode != SetModeDelete)) diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index 98c71020d..f05c72c2e 100644 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -195,12 +195,21 @@ ProcXFixesSelectSelectionInput (ClientPtr client) { REQUEST (xXFixesSelectSelectionInputReq); WindowPtr pWin; +#ifndef NXAGENT_SERVER + int rc; +#endif REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); +#ifndef NXAGENT_SERVER + rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); + if (rc != Success) + return rc; +#else pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, DixReadAccess); if (!pWin) return(BadWindow); +#endif if (stuff->eventMask & ~SelectionAllEvents) { client->errorValue = stuff->eventMask; diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index c4977b634..7447c5873 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -49,10 +49,10 @@ #include "xfixesint.h" #include "protocol-versions.h" -unsigned char XFixesReqCode; +static unsigned char XFixesReqCode; int XFixesEventBase; int XFixesErrorBase; -int XFixesClientPrivateIndex; +static int XFixesClientPrivateIndex; static int ProcXFixesQueryVersion(ClientPtr client) @@ -162,7 +162,7 @@ SProcXFixesQueryVersion(ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } -int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { +static int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { /*************** Version 1 ******************/ SProcXFixesQueryVersion, SProcXFixesChangeSaveSet, diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index 2e1ac143e..17f0dbeac 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -60,9 +60,7 @@ #include "selection.h" #include "xfixes.h" -extern unsigned char XFixesReqCode; extern int XFixesEventBase; -extern int XFixesClientPrivateIndex; typedef struct _XFixesClient { CARD32 major_version; @@ -72,7 +70,6 @@ typedef struct _XFixesClient { #define GetXFixesClient(pClient) ((XFixesClientPtr) (pClient)->devPrivates[XFixesClientPrivateIndex].ptr) extern int (*ProcXFixesVector[XFixesNumberRequests])(ClientPtr); -extern int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr); /* Initialize extension at server startup time */ -- cgit v1.2.3 From 35d166b808939a1518c011d0469125b69dc768d7 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 26 Feb 2018 02:56:58 +0100 Subject: Lift XFIXES to xorg-xserver-1.4.2 state - non-functional changes only --- nx-X11/programs/Xserver/xfixes/cursor.c | 2 -- nx-X11/programs/Xserver/xfixes/region.c | 2 -- nx-X11/programs/Xserver/xfixes/saveset.c | 2 -- nx-X11/programs/Xserver/xfixes/select.c | 4 +--- nx-X11/programs/Xserver/xfixes/xfixes.c | 2 -- nx-X11/programs/Xserver/xfixes/xfixes.h | 2 -- nx-X11/programs/Xserver/xfixes/xfixesint.h | 2 -- 7 files changed, 1 insertion(+), 15 deletions(-) diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 12efbd75f..152bda500 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2006 Sun Microsystems * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 9ac1fae3f..ba8c62835 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2003 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/saveset.c b/nx-X11/programs/Xserver/xfixes/saveset.c index 57d9afc2e..4d4cf5628 100644 --- a/nx-X11/programs/Xserver/xfixes/saveset.c +++ b/nx-X11/programs/Xserver/xfixes/saveset.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index f05c72c2e..e457fd5cc 100644 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -206,7 +204,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client) return rc; #else pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - DixReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); #endif diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 7447c5873..fadaf73b2 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2006 Sun Microsystems * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.h b/nx-X11/programs/Xserver/xfixes/xfixes.h index 0f1e3b070..81dd83daf 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.h +++ b/nx-X11/programs/Xserver/xfixes/xfixes.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index 17f0dbeac..6dc5d39c5 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2006 Sun Microsystems * * Permission to use, copy, modify, distribute, and sell this software and its -- cgit v1.2.3