Commit b7494f08 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.4.0-8.tar.gz

Summary: Imported nxagent-3.4.0-8.tar.gz Keywords: Imported nxagent-3.4.0-8.tar.gz into Git repository
parent c0780240
...@@ -66,19 +66,21 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; ...@@ -66,19 +66,21 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
{ {
"NX_IDENTITY", /* 0 */ "NX_IDENTITY", /* 0 */
"WM_PROTOCOLS", /* 1 */ "WM_PROTOCOLS", /* 1 */
"WM_DELETE_WINDOW", /* 2 */ "WM_DELETE_WINDOW", /* 2 */
"WM_NX_READY", /* 3 */ "WM_NX_READY", /* 3 */
"MCOPGLOBALS", /* 4 */ "MCOPGLOBALS", /* 4 */
"NX_CUT_BUFFER_SERVER", /* 5 */ "NX_CUT_BUFFER_SERVER", /* 5 */
"TARGETS", /* 6 */ "TARGETS", /* 6 */
"TEXT", /* 7 */ "TEXT", /* 7 */
"NX_AGENT_SIGNATURE", /* 8 */ "NX_AGENT_SIGNATURE", /* 8 */
"NXDARWIN", /* 9 */ "NXDARWIN", /* 9 */
"CLIPBOARD", /* 10 */ "CLIPBOARD", /* 10 */
"TIMESTAMP", /* 11 */ "TIMESTAMP", /* 11 */
"UTF8_STRING", /* 12 */ "UTF8_STRING", /* 12 */
"_NET_WM_STATE", /* 13 */
"_NET_WM_STATE_FULLSCREEN", /* 14 */
NULL, NULL,
NULL NULL
}; };
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "../../include/window.h" #include "../../include/window.h"
#include "screenint.h" #include "screenint.h"
#define NXAGENT_NUMBER_OF_ATOMS 14 #define NXAGENT_NUMBER_OF_ATOMS 16
extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
......
ChangeLog: ChangeLog:
nxagent-3.4.0-8
- Grab the keyboard in fullscreen mode on EnterNotify only if mode is
'NotifyNormal'.
- Yield control in the dispatch loop in case we stop the smart sche-
duler timer while waiting for a reply from the remote display.
nxagent-3.4.0-7
- Fixed TR08D01478. The communication with the compiz window manager
by means of the _NET_WM_PING property was not handled properly.
- Fixed a type mismatch in XKB events on 64 bit platforms.
- Moved grab/ungrab keyboard from focus in/out event to enter/leave
notify event.
- Removed nxagentIconWindow because it's not longer used.
nxagent-3.4.0-6
- Fixed TR09F02102. Problem was with pointer buttons map.
- Fixed TR02H02327. Some KeyRelease events was discarded.
- Fixed up Num and Caps locks.
- Fixed TR03H02335. Emulated right mouse button for Mac clients.
- Added utilities to print info about internal and remote windows.
- Fixed TR01F01995. Solved a picture resource leak by destroying remo-
te pictures only when their reference counter returns to zero.
- Fixed TR04H02337. Errors occurred because pictures with no drawable
were handled badly.
- Implemented handling nxagent's private for gradient pictures and so-
lid fill picture.
- Fixed BadMatch condition check in function ProcRenderComposite.
- Fixed nxagentComposite() to handle situations with source picture
drawable pointing to NULL.
- Implemented render acceleration for requests: CreateSolidFill,
CreateLinearGradient, CreateRadialGradient, CreateConicalGradient.
- Fixed TR03G02196. Dialogs are shown to the fore when the NX session
is in fullscreen mode.
- Changed mechanism to switch to fullscreen mode. Now the override
redirect attribute is no longer used and _NET_WM_STATE_FULLSCREEN
hint is sent to the WM.
nxagent-3.4.0-5 nxagent-3.4.0-5
- Updated copyright to year 2010. - Updated copyright to year 2010.
......
...@@ -29,6 +29,7 @@ enum HandleEventResult ...@@ -29,6 +29,7 @@ enum HandleEventResult
{ {
doNothing = 0, doNothing = 0,
doMinimize, doMinimize,
doDebugTree,
doCloseSession, doCloseSession,
doStartKbd, doStartKbd,
doSwitchFullscreen, doSwitchFullscreen,
......
...@@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ ...@@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
-DNXAGENT_SPLASH \ -DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \ -DNXAGENT_ARTSD \
-UNX_DEBUG_INPUT \ -UNX_DEBUG_INPUT \
-UPANORAMIX -UPANORAMIX \
-UDEBUG_TREE
all:: $(OBJS) all:: $(OBJS)
......
...@@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
{ {
switch (sym) switch (sym)
{ {
#ifdef DEBUG_TREE
case XK_q:
case XK_Q:
{
*result = doDebugTree;
break;
}
#endif /* DEBUG_TREE */
case XK_t: case XK_t:
case XK_T: case XK_T:
{ {
......
...@@ -108,6 +108,12 @@ FIXME: The condition checking for the render ...@@ -108,6 +108,12 @@ FIXME: The condition checking for the render
avoid problems with the render composi- avoid problems with the render composi-
te on XFree86 remote server. te on XFree86 remote server.
*/ */
/*
FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
to handle situation, when pSrc -> pDrawable
is NULL. This case happens with gradients
and solid fill.
#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ #define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \
((nxagentRenderVersionMajor == 0 && \ ((nxagentRenderVersionMajor == 0 && \
nxagentRenderVersionMinor == 8 && \ nxagentRenderVersionMinor == 8 && \
...@@ -118,6 +124,18 @@ FIXME: The condition checking for the render ...@@ -118,6 +124,18 @@ FIXME: The condition checking for the render
nxagentOption(DeferLevel) == 1) || \ nxagentOption(DeferLevel) == 1) || \
(nxagentOption(DeferLevel) >= 2 && \ (nxagentOption(DeferLevel) >= 2 && \
nxagentOption(LinkType) < LINK_TYPE_ADSL)) nxagentOption(LinkType) < LINK_TYPE_ADSL))
*/
#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \
((nxagentRenderVersionMajor == 0 && \
nxagentRenderVersionMinor == 8 && \
(pDst) -> pDrawable -> type == DRAWABLE_PIXMAP) || \
(nxagentOption(DeferLevel) >= 2 && \
nxagentOption(LinkType) < LINK_TYPE_ADSL) || \
(nxagentOption(DeferLevel) == 1 && \
(pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \
(((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \
((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized))))
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \ (nxagentSplitTrap == 0 && \
......
...@@ -57,6 +57,13 @@ is" without express or implied warranty. ...@@ -57,6 +57,13 @@ is" without express or implied warranty.
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
unsigned char nxagentReversePointerMap[MAXBUTTONS];
void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
{ {
/* /*
...@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success; return Success;
} }
nxagentInitPointerMap();
nxagentEnablePointerEvents(); nxagentEnablePointerEvents();
break; break;
...@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success; return Success;
} }
void nxagentInitPointerMap(void)
{
int numButtons;
int i;
unsigned char pointerMap[MAXBUTTONS];
#ifdef DEBUG
fprintf(stderr, "nxagentInitPointerMap: Going to retrieve the "
"pointer map from remote display.\n");
#endif
numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS);
/*
* Computing revers pointer map.
*/
for (i = 1; i <= numButtons; i++)
{
nxagentReversePointerMap[pointerMap[i - 1] - 1] = i;
}
}
...@@ -38,8 +38,17 @@ is" without express or implied warranty. ...@@ -38,8 +38,17 @@ is" without express or implied warranty.
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
EnterWindowMask | LeaveWindowMask) EnterWindowMask | LeaveWindowMask)
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
extern unsigned char nxagentReversePointerMap[MAXBUTTONS];
void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl); void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl);
int nxagentPointerProc(DeviceIntPtr pDev, int onoff); int nxagentPointerProc(DeviceIntPtr pDev, int onoff);
void nxagentInitPointerMap(void);
#endif /* __Pointer_H__ */ #endif /* __Pointer_H__ */
...@@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void); ...@@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void);
extern void nxagentRemoveXConnection(void); extern void nxagentRemoveXConnection(void);
extern void nxagentInitPointerMap(void);
static char *nxagentGetReconnectError(void); static char *nxagentGetReconnectError(void);
void nxagentInitializeRecLossyLevel(void); void nxagentInitializeRecLossyLevel(void);
...@@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void) ...@@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard = NULL; nxagentOldKeyboard = NULL;
} }
nxagentInitPointerMap();
nxagentDeactivatePointerGrab(); nxagentDeactivatePointerGrab();
nxagentWakeupByReconnect(); nxagentWakeupByReconnect();
......
...@@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen, ...@@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen,
int nxagentCreatePicture(PicturePtr pPicture, Mask mask); int nxagentCreatePicture(PicturePtr pPicture, Mask mask);
void nxagentDestroyPicture(PicturePtr pPicture);
int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects, int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects,
xRectangle *rects, int xOrigin, int yOrigin); xRectangle *rects, int xOrigin, int yOrigin);
...@@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", if (pSrc -> pDrawable != NULL)
nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, {
(pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", nxagentPicturePriv(pSrc) -> picture, (void *) pSrc,
pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP &&
(void *) pSrc -> pDrawable); nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "",
pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window",
(void *) pSrc -> pDrawable);
}
fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n", fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentPicturePriv(pDst) -> picture, (void *) pDst, nxagentPicturePriv(pDst) -> picture, (void *) pDst,
...@@ -1064,16 +1065,19 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1064,16 +1065,19 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
* the wrong data. * the wrong data.
*/ */
nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); if (pSrc -> pDrawable != NULL)
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{ {
#ifdef TEST nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height);
fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n",
(void *) pSrc -> pDrawable);
#endif
nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n",
(void *) pSrc -> pDrawable);
#endif
nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL);
}
} }
if (pDst -> pDrawable != pSrc -> pDrawable) if (pDst -> pDrawable != pSrc -> pDrawable)
...@@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture() ...@@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture()
return True; return True;
} }
void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color)
{
Picture id;
if (nxagentRenderEnable == False)
{
return;
}
#ifdef DEBUG
fprintf(stderr, "nxagentRenderCreateSolidFill: Got called.\n");
if (pPicture == NULL)
{
fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! pPicture pointer is NULL.\n");
}
if (color == NULL)
{
fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! color pointer is NULL.\n");
}
#endif /* #ifdef DEBUG */
memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0,
sizeof(XRenderPictureAttributes_));
id = XRenderCreateSolidFill(nxagentDisplay, (XRenderColor *) color);
#ifdef DEBUG
XSync(nxagentDisplay, 0);
#endif
#ifdef TEST
fprintf(stderr, "nxagentRenderCreateSolidFill: Created solid fill xid [%lu].\n", id);
#endif
nxagentPicturePriv(pPicture) -> picture = id;
}
void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1,
xPointFixed *p2, int nStops,
xFixed *stops,
xRenderColor *colors)
{
Picture id;
XLinearGradient linearGradient;
if (nxagentRenderEnable == False)
{
return;
}
#ifdef DEBUG
fprintf(stderr, "nxagentRenderCreateLinearGradient: Got called.\n");
if (pPicture == NULL)
{
fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! pPicture pointer is NULL.\n");
}
if (p1 == NULL)
{
fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p1 pointer is NULL.\n");
}
if (p2 == NULL)
{
fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p2 pointer is NULL.\n");
}
if (stops == NULL)
{
fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! stops pointer is NULL.\n");
}
if (colors == NULL)
{
fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! colors pointer is NULL.\n");
}
#endif /* #ifdef DEBUG */
memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0,
sizeof(XRenderPictureAttributes_));
linearGradient.p1.x = (XFixed) p1 -> x;
linearGradient.p1.y = (XFixed) p1 -> y;
linearGradient.p2.x = (XFixed) p2 -> x;
linearGradient.p2.y = (XFixed) p2 -> y;
id = XRenderCreateLinearGradient(nxagentDisplay, &linearGradient,
(XFixed *) stops,
(XRenderColor *) colors, nStops);
#ifdef DEBUG
XSync(nxagentDisplay, 0);
#endif
#ifdef TEST
fprintf(stderr, "nxagentRenderCreateLinearGradient: Created linear gradient xid [%lu].\n", id);
#endif
nxagentPicturePriv(pPicture) -> picture = id;
}
void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner,
xPointFixed *outer,
xFixed innerRadius,
xFixed outerRadius,
int nStops,
xFixed *stops,
xRenderColor *colors)
{
Picture id;
XRadialGradient radialGradient;
if (nxagentRenderEnable == False)
{
return;
}
#ifdef DEBUG
fprintf(stderr, "nxagentRenderCreateRadialGradient: Got called.\n");
if (pPicture == NULL)
{
fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! pPicture pointer is NULL.\n");
}
if (inner == NULL)
{
fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! inner pointer is NULL.\n");
}
if (outer == NULL)
{
fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! outer pointer is NULL.\n");
}
if (stops == NULL)
{
fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! stops pointer is NULL.\n");
}
if (colors == NULL)
{
fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! colors pointer is NULL.\n");
}
#endif /* #ifdef DEBUG */
memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0,
sizeof(XRenderPictureAttributes_));
radialGradient.inner.x = (XFixed) inner -> x;
radialGradient.inner.y = (XFixed) inner -> y;
radialGradient.inner.radius = (XFixed) innerRadius;
radialGradient.outer.x = (XFixed) outer -> x;
radialGradient.outer.y = (XFixed) outer -> y;
radialGradient.outer.radius = (XFixed) outerRadius;
id = XRenderCreateRadialGradient(nxagentDisplay, &radialGradient,
(XFixed *) stops,
(XRenderColor *) colors, nStops);
#ifdef DEBUG
XSync(nxagentDisplay, 0);
#endif
#ifdef TEST
fprintf(stderr, "nxagentRenderCreateRadialGradient: Created radial gradient xid [%lu].\n", id);
#endif
nxagentPicturePriv(pPicture) -> picture = id;
}
void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xPointFixed *center,
xFixed angle, int nStops,
xFixed *stops,
xRenderColor *colors)
{
Picture id;
XConicalGradient conicalGradient;
if (nxagentRenderEnable == False)
{
return;
}
#ifdef DEBUG
fprintf(stderr, "nxagentRenderCreateConicalGradient: Got called.\n");
if (pPicture == NULL)
{
fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! pPicture pointer is NULL.\n");
}
if (center == NULL)
{
fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! center pointer is NULL.\n");
}
if (stops == NULL)
{
fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! stops pointer is NULL.\n");
}
if (colors == NULL)
{
fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! colors pointer is NULL.\n");
}
#endif /* #ifdef DEBUG */
memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0,
sizeof(XRenderPictureAttributes_));
conicalGradient.center.x = (XFixed) center -> x;
conicalGradient.center.y = (XFixed) center -> y;
conicalGradient.angle = (XFixed) angle;
id = XRenderCreateConicalGradient(nxagentDisplay, &conicalGradient,
(XFixed *) stops,
(XRenderColor *) colors, nStops);
#ifdef DEBUG
XSync(nxagentDisplay, 0);
#endif
#ifdef TEST
fprintf(stderr, "nxagentRenderCreateConicalGradient: Created conical gradient xid [%lu].\n", id);
#endif
nxagentPicturePriv(pPicture) -> picture = id;
}
...@@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2); ...@@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2);
void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2); void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2);
void nxagentDestroyPicture(PicturePtr pPicture);
#endif /* __Render_H__ */ #endif /* __Render_H__ */
...@@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
XlibAtom *atoms = malloc(nUnits * sizeof(*atoms)); XlibAtom *atoms = malloc(nUnits * sizeof(*atoms));
Atom *input = value; Atom *input = value;
int i; int i;
int j = 0;
freeMem = True; freeMem = True;
export = True; export = True;
...@@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
for (i = 0; i < nUnits; i++) for (i = 0; i < nUnits; i++)
{ {
atoms[i] = nxagentLocalToRemoteAtom(input[i]); /*
* Exporting the _NET_WM_PING property could
if (atoms[i] == None) * result in rootless windows being grayed out
{ * when the compiz window manager is running.
#ifdef WARNING *
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", * Better solution would probably be to handle
(long int) input[i], validateString(NameForAtom(input[i]))); * the communication with the window manager
#endif * instead of just getting rid of the property.
} */
if (strcmp(NameForAtom(input[i]), "_NET_WM_PING") != 0)
{
atoms[j] = nxagentLocalToRemoteAtom(input[i]);
if (atoms[j] == None)
{
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n",
(long int) input[i], validateString(NameForAtom(input[i])));
#endif
}
j++;
}
#ifdef TEST
else
{
fprintf(stderr, "nxagentExportProperty: WARNING! "
"Not exporting the _NET_WM_PING property.\n");
}
#endif
} }
nUnits = j;
} }
else if (strcmp(typeS, "WINDOW") == 0) else if (strcmp(typeS, "WINDOW") == 0)
{ {
......
...@@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen; ...@@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen;
extern Pixmap nxagentPixmapLogo; extern Pixmap nxagentPixmapLogo;
extern Window nxagentIconWindow;
extern Window nxagentFullscreenWindow; extern Window nxagentFullscreenWindow;
extern RegionRec nxagentShadowUpdateRegion; extern RegionRec nxagentShadowUpdateRegion;
...@@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void); ...@@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void);
void nxagentMinimizeFromFullScreen(ScreenPtr pScreen); void nxagentMinimizeFromFullScreen(ScreenPtr pScreen);
void nxagentMaximizeToFullScreen(ScreenPtr pScreen); void nxagentMaximizeToFullScreen(ScreenPtr pScreen);
Window nxagentCreateIconWindow(void);
Bool nxagentMagicPixelZone(int x, int y); Bool nxagentMagicPixelZone(int x, int y);
Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
......
...@@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) ...@@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{ {
Window w; XEvent e;
XSetWindowAttributes attributes; XSizeHints sizeHints;
unsigned long valuemask;
if (nxagentOption(Rootless)) if (nxagentOption(Rootless) == 1)
{ {
return; return;
} }
if (!switchOn) if (switchOn == 0)
{ {
nxagentWMDetect(); nxagentWMDetect();
if (!nxagentWMIsRunning)
{
#ifdef WARNING
fprintf(stderr, "Warning: Can't switch to window mode, no window manager has been detected.\n");
#endif
return;
}
}
w = nxagentDefaultWindows[pScreen -> myNum];
attributes.override_redirect = switchOn;
valuemask = CWOverrideRedirect;
XUnmapWindow(nxagentDisplay, w);
XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes);
if (switchOn)
{
/*
* Change to fullscreen mode.
*/
struct timeval timeout;
int i;
XEvent e;
/* /*
* Wait for window manager reparenting the default window. * The smart scheduler could be stopped while
* waiting for the reply. In this case we need
* to yield explicitly to avoid to be stuck in
* the dispatch loop forever.
*/ */
for (i = 0; i < 100 && nxagentWMIsRunning; i++) isItTimeToYield = 1;
{
#ifdef TEST
fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n");
#endif
if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e))
{
break;
}
/*
* This should also flush
* the NX link for us.
*/
XSync(nxagentDisplay, 0);
timeout.tv_sec = 0;
timeout.tv_usec = 50 * 1000;
nxagentWaitEvents(nxagentDisplay, &timeout);
}
if (i < 100)
{
/*
* The window manager has done with the reparent
* operation. We can resize and map the window.
*/
nxagentChangeOption(Fullscreen, True);
/*
* Save the window-mode configuration.
*/
nxagentChangeOption(SavedX, nxagentOption(X));
nxagentChangeOption(SavedY, nxagentOption(Y));
nxagentChangeOption(SavedWidth, nxagentOption(Width));
nxagentChangeOption(SavedHeight, nxagentOption(Height));
nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth));
nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight));
/*
* Reconf the Default window.
*/
nxagentChangeOption(X, 0);
nxagentChangeOption(Y, 0);
nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
/*
* Move the root window.
*/
nxagentChangeOption(RootX, (nxagentOption(Width) - nxagentOption(RootWidth)) / 2);
nxagentChangeOption(RootY, (nxagentOption(Height) - nxagentOption(RootHeight)) / 2);
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y),
nxagentOption(Width), nxagentOption(Height));
nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), nxagentOption(RootHeight));
XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]),
nxagentOption(RootX), nxagentOption(RootY));
/*
* We disable the screensaver when changing
* mode to fullscreen. Is it really needed?
*/
XSetScreenSaver(nxagentDisplay, 0, 0, DefaultExposures, DefaultBlanking);
if (nxagentIconWindow == None) if (nxagentWMIsRunning == 0)
{
nxagentIconWindow = nxagentCreateIconWindow();
XMapWindow(nxagentDisplay, nxagentIconWindow);
}
XMapRaised(nxagentDisplay, w);
XSetInputFocus(nxagentDisplay, w, RevertToParent, CurrentTime);
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1)
{
if (nxagentOption(Shadow) == 0)
{
nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
}
else
{
nxagentShadowAdaptToRatio();
}
}
}
else
{ {
/*
* We have waited for a reparent event unsuccessfully.
* Something happened to the window manager.
*/
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.\n"); fprintf(stderr, "Warning: Can't switch to window mode, no window manager "
"has been detected.\n");
#endif #endif
nxagentWMIsRunning = False; return;
attributes.override_redirect = False;
XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes);
XMapWindow(nxagentDisplay, w);
} }
} }
else
{
/*
* FIXME:
* It could be necessary:
* - To restore screensaver.
* - To set or reset nxagentForceBackingStore flag.
* - To grab keyboard.
* - To propagate device settings to the X server if no WM is running.
*/
/*
* Change to windowed mode.
*/
nxagentChangeOption(Fullscreen, False); #ifdef TEST
XDestroyWindow(nxagentDisplay, nxagentIconWindow); fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n",
nxagentIconWindow = nxagentFullscreenWindow = None; switchOn ? "fullscreen" : "windowed");
#endif
if (nxagentOption(DesktopResize) == 1) nxagentChangeOption(Fullscreen, switchOn);
{
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0) if (nxagentOption(DesktopResize) == 1)
{ {
nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); sizeHints.flags = PSize;
}
}
if (nxagentOption(WMBorderWidth) > 0 && nxagentOption(WMTitleHeight) > 0) if (switchOn == 1)
{ {
nxagentChangeOption(X, nxagentOption(SavedX) - sizeHints.width =
nxagentOption(WMBorderWidth)); WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
nxagentChangeOption(Y, nxagentOption(SavedY) - sizeHints.height =
nxagentOption(WMTitleHeight)); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
else else
{ {
nxagentChangeOption(X, nxagentOption(SavedX)); sizeHints.width = nxagentOption(RootWidth);
nxagentChangeOption(Y, nxagentOption(SavedY)); sizeHints.height = nxagentOption(RootHeight);
} }
nxagentChangeOption(Width, nxagentOption(SavedWidth)); XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum],
nxagentChangeOption(Height, nxagentOption(SavedHeight)); &sizeHints);
}
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1)
{
nxagentShadowAdaptToRatio();
}
XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y), memset(&e, 0, sizeof(e));
nxagentOption(Width), nxagentOption(Height));
nxagentUpdateViewportFrame(0, 0, nxagentOption(Width), nxagentOption(Height)); e.xclient.type = ClientMessage;
e.xclient.message_type = nxagentAtoms[13]; /* _NET_WM_STATE */
e.xclient.display = nxagentDisplay;
e.xclient.window = nxagentDefaultWindows[pScreen -> myNum];
e.xclient.format = 32;
e.xclient.data.l[0] = nxagentOption(Fullscreen) ? 1 : 0;
e.xclient.data.l[1] = nxagentAtoms[14]; /* _NET_WM_STATE_FULLSCREEN */
XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), 0, 0); XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False,
XMapWindow(nxagentDisplay, w); SubstructureRedirectMask, &e);
nxagentChangeOption(RootX, 0); if (switchOn == 1)
nxagentChangeOption(RootY, 0); {
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum];
} }
else
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, {
nxagentOption(Width), nxagentOption(Height)); nxagentFullscreenWindow = None;
}
nxagentSetPrintGeometry(pScreen -> myNum);
} }
#ifdef VIEWPORT_FRAME #ifdef VIEWPORT_FRAME
...@@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows() ...@@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows()
#endif #endif
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1)
{
nxagentSwitchFullscreen(pScreen, 1);
}
} }
/* /*
...@@ -2452,26 +2309,6 @@ void nxagentMapDefaultWindows() ...@@ -2452,26 +2309,6 @@ void nxagentMapDefaultWindows()
} }
/* /*
* Map the icon window.
*/
if (nxagentIconWindow != 0)
{
#ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping icon window id [%ld].\n",
nxagentIconWindow);
#endif
XMapWindow(nxagentDisplay, nxagentIconWindow);
if (nxagentIpaq != 0)
{
XIconifyWindow(nxagentDisplay, nxagentIconWindow,
DefaultScreen(nxagentDisplay));
}
}
/*
* Ensure that the fullscreen window gets the focus. * Ensure that the fullscreen window gets the focus.
*/ */
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#include "Screen.h" #include "Screen.h"
#include "Pixmaps.h" #include "Pixmaps.h"
#include "Drawable.h" #include "Drawable.h"
#include "Render.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
...@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, ...@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void) static PicturePtr createSourcePicture(void)
{ {
PicturePtr pPicture; PicturePtr pPicture;
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
extern int nxagentPicturePrivateIndex;
unsigned int totalPictureSize;
DevUnion *ppriv;
char *privPictureRecAddr;
int i;
/*
* Compute size of entire PictureRect, plus privates.
*/
totalPictureSize = sizeof(PictureRec) +
picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec);
pPicture = (PicturePtr) xalloc(totalPictureSize);
if (pPicture != NULL)
{
ppriv = (DevUnion *) (pPicture + 1);
for (i = 0; i < picturePrivateCount; ++i)
{
/*
* Other privates are inaccessible.
*/
ppriv[i].ptr = NULL;
}
privPictureRecAddr = (char *) &ppriv[picturePrivateCount];
ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr;
pPicture -> devPrivates = ppriv;
}
pPicture->pDrawable = 0; pPicture->pDrawable = 0;
pPicture->pFormat = 0; pPicture->pFormat = 0;
pPicture->pNext = 0; pPicture->pNext = 0;
...@@ -1697,6 +1738,10 @@ FreePicture (pointer value, ...@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0) if (--pPicture->refcnt == 0)
{ {
#ifdef NXAGENT_SERVER
nxagentDestroyPicture(pPicture);
#endif
if (pPicture->transform) if (pPicture->transform)
xfree (pPicture->transform); xfree (pPicture->transform);
if (!pPicture->pDrawable) { if (!pPicture->pDrawable) {
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#include "Screen.h" #include "Screen.h"
#include "Pixmaps.h" #include "Pixmaps.h"
#include "Drawable.h" #include "Drawable.h"
#include "Render.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
...@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, ...@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void) static PicturePtr createSourcePicture(void)
{ {
PicturePtr pPicture; PicturePtr pPicture;
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
extern int nxagentPicturePrivateIndex;
unsigned int totalPictureSize;
DevUnion *ppriv;
char *privPictureRecAddr;
int i;
/*
* Compute size of entire PictureRect, plus privates.
*/
totalPictureSize = sizeof(PictureRec) +
picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec);
pPicture = (PicturePtr) xalloc(totalPictureSize);
if (pPicture != NULL)
{
ppriv = (DevUnion *) (pPicture + 1);
for (i = 0; i < picturePrivateCount; ++i)
{
/*
* Other privates are inaccessible.
*/
ppriv[i].ptr = NULL;
}
privPictureRecAddr = (char *) &ppriv[picturePrivateCount];
ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr;
pPicture -> devPrivates = ppriv;
}
pPicture->pDrawable = 0; pPicture->pDrawable = 0;
pPicture->pFormat = 0; pPicture->pFormat = 0;
pPicture->pNext = 0; pPicture->pNext = 0;
...@@ -1697,6 +1738,10 @@ FreePicture (pointer value, ...@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0) if (--pPicture->refcnt == 0)
{ {
#ifdef NXAGENT_SERVER
nxagentDestroyPicture(pPicture);
#endif
if (pPicture->transform) if (pPicture->transform)
xfree (pPicture->transform); xfree (pPicture->transform);
if (!pPicture->pDrawable) { if (!pPicture->pDrawable) {
......
...@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); ...@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentCreatePicture(PicturePtr, Mask); int nxagentCreatePicture(PicturePtr, Mask);
void nxagentDestroyPicture(PicturePtr pPicture);
void nxagentChangePicture(PicturePtr, Mask); void nxagentChangePicture(PicturePtr, Mask);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
...@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, ...@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps);
void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color);
void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1,
xPointFixed *p2, int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner,
xPointFixed *outer,
xFixed innerRadius,
xFixed outerRadius,
int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xPointFixed *center,
xFixed angle, int nStops,
xFixed *stops,
xRenderColor *colors);
/* /*
* The void pointer is actually a XGlyphElt8. * The void pointer is actually a XGlyphElt8.
*/ */
...@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) ...@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
nxagentDestroyPicture(pPicture);
FreeResource (stuff->picture, RT_NONE); FreeResource (stuff->picture, RT_NONE);
return(client->noClientException); return(client->noClientException);
} }
...@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) ...@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch; return BadMatch;
*/
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
ValidatePicture (pSrc); ValidatePicture (pSrc);
if (pMask) if (pMask)
...@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) ...@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateSolidFill(pPicture, &stuff -> color);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) ...@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) ...@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer,
stuff->inner_radius,
stuff->outer_radius,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) ...@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient(pPicture, &stuff->center,
stuff->angle, stuff->nStops, stops,
colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
......
...@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); ...@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentCreatePicture(PicturePtr, Mask); int nxagentCreatePicture(PicturePtr, Mask);
void nxagentDestroyPicture(PicturePtr pPicture);
void nxagentChangePicture(PicturePtr, Mask); void nxagentChangePicture(PicturePtr, Mask);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
...@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, ...@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps);
void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color);
void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1,
xPointFixed *p2, int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner,
xPointFixed *outer,
xFixed innerRadius,
xFixed outerRadius,
int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xPointFixed *center,
xFixed angle, int nStops,
xFixed *stops,
xRenderColor *colors);
/* /*
* The void pointer is actually a XGlyphElt8. * The void pointer is actually a XGlyphElt8.
*/ */
...@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) ...@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
nxagentDestroyPicture(pPicture);
FreeResource (stuff->picture, RT_NONE); FreeResource (stuff->picture, RT_NONE);
return(client->noClientException); return(client->noClientException);
} }
...@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) ...@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch; return BadMatch;
*/
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
ValidatePicture (pSrc); ValidatePicture (pSrc);
if (pMask) if (pMask)
...@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) ...@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateSolidFill(pPicture, &stuff -> color);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) ...@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) ...@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer,
stuff->inner_radius,
stuff->outer_radius,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
...@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) ...@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff->nStops, stops, colors, &error); stuff->nStops, stops, colors, &error);
if (!pPicture) if (!pPicture)
return error; return error;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient(pPicture, &stuff->center,
stuff->angle, stuff->nStops, stops,
colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc; return BadAlloc;
return Success; return Success;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment