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
......@@ -79,6 +79,8 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
"CLIPBOARD", /* 10 */
"TIMESTAMP", /* 11 */
"UTF8_STRING", /* 12 */
"_NET_WM_STATE", /* 13 */
"_NET_WM_STATE_FULLSCREEN", /* 14 */
NULL,
NULL
};
......
......@@ -22,7 +22,7 @@
#include "../../include/window.h"
#include "screenint.h"
#define NXAGENT_NUMBER_OF_ATOMS 14
#define NXAGENT_NUMBER_OF_ATOMS 16
extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
......
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
- Updated copyright to year 2010.
......
......@@ -29,6 +29,7 @@ enum HandleEventResult
{
doNothing = 0,
doMinimize,
doDebugTree,
doCloseSession,
doStartKbd,
doSwitchFullscreen,
......
......@@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
-DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \
-UNX_DEBUG_INPUT \
-UPANORAMIX
-UPANORAMIX \
-UDEBUG_TREE
all:: $(OBJS)
......
......@@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
{
switch (sym)
{
#ifdef DEBUG_TREE
case XK_q:
case XK_Q:
{
*result = doDebugTree;
break;
}
#endif /* DEBUG_TREE */
case XK_t:
case XK_T:
{
......
......@@ -108,6 +108,12 @@ FIXME: The condition checking for the render
avoid problems with the render composi-
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) \
((nxagentRenderVersionMajor == 0 && \
nxagentRenderVersionMinor == 8 && \
......@@ -118,6 +124,18 @@ FIXME: The condition checking for the render
nxagentOption(DeferLevel) == 1) || \
(nxagentOption(DeferLevel) >= 2 && \
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) \
(nxagentSplitTrap == 0 && \
......
......@@ -57,6 +57,13 @@ is" without express or implied warranty.
#undef TEST
#undef DEBUG
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
unsigned char nxagentReversePointerMap[MAXBUTTONS];
void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
{
/*
......@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success;
}
nxagentInitPointerMap();
nxagentEnablePointerEvents();
break;
......@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
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.
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
EnterWindowMask | LeaveWindowMask)
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
extern unsigned char nxagentReversePointerMap[MAXBUTTONS];
void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl);
int nxagentPointerProc(DeviceIntPtr pDev, int onoff);
void nxagentInitPointerMap(void);
#endif /* __Pointer_H__ */
......@@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void);
extern void nxagentRemoveXConnection(void);
extern void nxagentInitPointerMap(void);
static char *nxagentGetReconnectError(void);
void nxagentInitializeRecLossyLevel(void);
......@@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard = NULL;
}
nxagentInitPointerMap();
nxagentDeactivatePointerGrab();
nxagentWakeupByReconnect();
......
......@@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen,
int nxagentCreatePicture(PicturePtr pPicture, Mask mask);
void nxagentDestroyPicture(PicturePtr pPicture);
int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects,
xRectangle *rects, int xOrigin, int yOrigin);
......@@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
#ifdef DEBUG
if (pSrc -> pDrawable != NULL)
{
fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentPicturePriv(pSrc) -> picture, (void *) pSrc,
(pSrc -> pDrawable -> type == DRAWABLE_PIXMAP &&
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",
nxagentPicturePriv(pDst) -> picture, (void *) pDst,
......@@ -1064,6 +1065,8 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
* the wrong data.
*/
if (pSrc -> pDrawable != NULL)
{
nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height);
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
......@@ -1075,6 +1078,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL);
}
}
if (pDst -> pDrawable != pSrc -> pDrawable)
{
......@@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture()
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);
void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2);
void nxagentDestroyPicture(PicturePtr pPicture);
#endif /* __Render_H__ */
......@@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
XlibAtom *atoms = malloc(nUnits * sizeof(*atoms));
Atom *input = value;
int i;
int j = 0;
freeMem = True;
export = True;
......@@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
for (i = 0; i < nUnits; i++)
{
atoms[i] = nxagentLocalToRemoteAtom(input[i]);
/*
* Exporting the _NET_WM_PING property could
* result in rootless windows being grayed out
* when the compiz window manager is running.
*
* Better solution would probably be to handle
* the communication with the window manager
* instead of just getting rid of the property.
*/
if (atoms[i] == None)
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)
{
......
......@@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen;
extern Pixmap nxagentPixmapLogo;
extern Window nxagentIconWindow;
extern Window nxagentFullscreenWindow;
extern RegionRec nxagentShadowUpdateRegion;
......@@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void);
void nxagentMinimizeFromFullScreen(ScreenPtr pScreen);
void nxagentMaximizeToFullScreen(ScreenPtr pScreen);
Window nxagentCreateIconWindow(void);
Bool nxagentMagicPixelZone(int x, int y);
Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
......
......@@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{
Window w;
XSetWindowAttributes attributes;
unsigned long valuemask;
XEvent e;
XSizeHints sizeHints;
if (nxagentOption(Rootless))
if (nxagentOption(Rootless) == 1)
{
return;
}
if (!switchOn)
if (switchOn == 0)
{
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.
* 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.
*/
struct timeval timeout;
int i;
XEvent e;
/*
* Wait for window manager reparenting the default window.
*/
isItTimeToYield = 1;
for (i = 0; i < 100 && nxagentWMIsRunning; i++)
if (nxagentWMIsRunning == 0)
{
#ifdef TEST
fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n");
#ifdef WARNING
fprintf(stderr, "Warning: Can't switch to window mode, no window manager "
"has been detected.\n");
#endif
if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e))
{
break;
return;
}
/*
* 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)
{
nxagentIconWindow = nxagentCreateIconWindow();
XMapWindow(nxagentDisplay, nxagentIconWindow);
}
#ifdef TEST
fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n",
switchOn ? "fullscreen" : "windowed");
#endif
XMapRaised(nxagentDisplay, w);
XSetInputFocus(nxagentDisplay, w, RevertToParent, CurrentTime);
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w;
nxagentChangeOption(Fullscreen, switchOn);
if (nxagentOption(DesktopResize) == 1)
{
if (nxagentOption(Shadow) == 0)
sizeHints.flags = PSize;
if (switchOn == 1)
{
nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
sizeHints.width =
WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.height =
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
nxagentShadowAdaptToRatio();
sizeHints.width = nxagentOption(RootWidth);
sizeHints.height = nxagentOption(RootHeight);
}
}
}
else
{
/*
* We have waited for a reparent event unsuccessfully.
* Something happened to the window manager.
*/
#ifdef WARNING
fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.\n");
#endif
nxagentWMIsRunning = False;
attributes.override_redirect = False;
XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes);
XMapWindow(nxagentDisplay, w);
XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum],
&sizeHints);
}
}
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.
*/
memset(&e, 0, sizeof(e));
nxagentChangeOption(Fullscreen, False);
XDestroyWindow(nxagentDisplay, nxagentIconWindow);
nxagentIconWindow = nxagentFullscreenWindow = None;
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 */
if (nxagentOption(DesktopResize) == 1)
{
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0)
{
nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight));
}
}
XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False,
SubstructureRedirectMask, &e);
if (nxagentOption(WMBorderWidth) > 0 && nxagentOption(WMTitleHeight) > 0)
if (switchOn == 1)
{
nxagentChangeOption(X, nxagentOption(SavedX) -
nxagentOption(WMBorderWidth));
nxagentChangeOption(Y, nxagentOption(SavedY) -
nxagentOption(WMTitleHeight));
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum];
}
else
{
nxagentChangeOption(X, nxagentOption(SavedX));
nxagentChangeOption(Y, nxagentOption(SavedY));
}
nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1)
{
nxagentShadowAdaptToRatio();
nxagentFullscreenWindow = None;
}
XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y),
nxagentOption(Width), nxagentOption(Height));
nxagentUpdateViewportFrame(0, 0, nxagentOption(Width), nxagentOption(Height));
XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), 0, 0);
XMapWindow(nxagentDisplay, w);
nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0);
}
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
nxagentOption(Width), nxagentOption(Height));
nxagentSetPrintGeometry(pScreen -> myNum);
}
#ifdef VIEWPORT_FRAME
......@@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows()
#endif
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1)
{
nxagentSwitchFullscreen(pScreen, 1);
}
}
/*
......@@ -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.
*/
......
......@@ -62,6 +62,7 @@
#include "Screen.h"
#include "Pixmaps.h"
#include "Drawable.h"
#include "Render.h"
#define PANIC
#define WARNING
......@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
{
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->pFormat = 0;
pPicture->pNext = 0;
......@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0)
{
#ifdef NXAGENT_SERVER
nxagentDestroyPicture(pPicture);
#endif
if (pPicture->transform)
xfree (pPicture->transform);
if (!pPicture->pDrawable) {
......
......@@ -62,6 +62,7 @@
#include "Screen.h"
#include "Pixmaps.h"
#include "Drawable.h"
#include "Render.h"
#define PANIC
#define WARNING
......@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
{
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->pFormat = 0;
pPicture->pNext = 0;
......@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0)
{
#ifdef NXAGENT_SERVER
nxagentDestroyPicture(pPicture);
#endif
if (pPicture->transform)
xfree (pPicture->transform);
if (!pPicture->pDrawable) {
......
......@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentCreatePicture(PicturePtr, Mask);
void nxagentDestroyPicture(PicturePtr pPicture);
void nxagentChangePicture(PicturePtr, Mask);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
......@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
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.
*/
......@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
RenderErrBase + BadPicture);
nxagentDestroyPicture(pPicture);
FreeResource (stuff->picture, RT_NONE);
return(client->noClientException);
}
......@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
RenderErrBase + BadPicture);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
*/
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
ValidatePicture (pSrc);
if (pMask)
......@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateSolidFill(pPicture, &stuff -> color);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return Success;
......@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return Success;
......@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
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))
return BadAlloc;
return Success;
......@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient(pPicture, &stuff->center,
stuff->angle, stuff->nStops, stops,
colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return Success;
......
......@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentCreatePicture(PicturePtr, Mask);
void nxagentDestroyPicture(PicturePtr pPicture);
void nxagentChangePicture(PicturePtr, Mask);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
......@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
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.
*/
......@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
RenderErrBase + BadPicture);
nxagentDestroyPicture(pPicture);
FreeResource (stuff->picture, RT_NONE);
return(client->noClientException);
}
......@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
RenderErrBase + BadPicture);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
*/
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
ValidatePicture (pSrc);
if (pMask)
......@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateSolidFill(pPicture, &stuff -> color);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return Success;
......@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return Success;
......@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
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))
return BadAlloc;
return Success;
......@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
if (!pPicture)
return error;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient(pPicture, &stuff->center,
stuff->angle, stuff->nStops, stops,
colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
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