Commit e01b9177 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.5.0-5.tar.gz

Summary: Imported nxagent-3.5.0-5.tar.gz Keywords: Imported nxagent-3.5.0-5.tar.gz into Git repository
parent 39b738a6
...@@ -135,6 +135,8 @@ char *nxagentKeyboard = NULL; ...@@ -135,6 +135,8 @@ char *nxagentKeyboard = NULL;
Bool nxagentOnce = True; Bool nxagentOnce = True;
int nxagentRemoteMajor = -1;
static void nxagentParseOptionString(char*); static void nxagentParseOptionString(char*);
/* /*
...@@ -1578,6 +1580,8 @@ N/A ...@@ -1578,6 +1580,8 @@ N/A
nxagentAlphaCompat = 0; nxagentAlphaCompat = 0;
} }
nxagentRemoteMajor = remoteMajor;
if (nxagentPackMethod == -1) if (nxagentPackMethod == -1)
{ {
nxagentPackMethod = packMethod; nxagentPackMethod = packMethod;
......
...@@ -81,4 +81,6 @@ void nxagentSetCoalescence(void); ...@@ -81,4 +81,6 @@ void nxagentSetCoalescence(void);
extern int nxagentUserDefinedFontPath; extern int nxagentUserDefinedFontPath;
extern int nxagentRemoteMajor;
#endif /* __Args_H__ */ #endif /* __Args_H__ */
ChangeLog: ChangeLog:
nxagent-3.5.0-5
- The NX agent failed to resize its own window to fit the desktop size
in shadow sessions. TR07I02561 is now fixed also in shadow mode.
nxagent-3.5.0-4
- Fixed TR07I02530. Solved a buffer overflow occurring when the '-fp'
option value exceeds 1024 characters.
- Extended list of the available screen geometries.
nxagent-3.5.0-3
- Fixed TR08I02572. Upgraded RandR extension to version 1.2.
- Fixed TR07I02561. The NX agent failed to resize its own window to
fit the desktop size.
nxagent-3.5.0-2 nxagent-3.5.0-2
- Fixed TR0502449. Initialized font server path even if font server - Fixed TR0502449. Initialized font server path even if font server
......
...@@ -293,31 +293,7 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, ...@@ -293,31 +293,7 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor,
Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y,
Bool generateEvent) Bool generateEvent)
{ {
/* return 1;
* Don't warp the cursor if the requesting client
* is the server client itself or a shadow agent.
*/
if (requestingClient != NULL &&
requestingClient != serverClient &&
nxagentClientHint(requestingClient) != NXAGENT_SHADOW)
{
int i;
#ifdef TEST
fprintf(stderr, "nxagentSetCursorPosition: Moving the cursor at position [%d,%d].\n",
x, y);
#endif
for (i = 0; i < nxagentNumScreens; i++)
{
XWarpPointer(nxagentDisplay, nxagentDefaultWindows[i],
nxagentDefaultWindows[pScreen->myNum],
0, 0, 0, 0, x, y);
}
}
return True;
} }
void nxagentReconnectCursor(pointer p0, XID x1, pointer p2) void nxagentReconnectCursor(pointer p0, XID x1, pointer p2)
......
...@@ -2406,6 +2406,8 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2406,6 +2406,8 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentPackQuality = -1; nxagentPackQuality = -1;
nxagentSplitThreshold = -1; nxagentSplitThreshold = -1;
nxagentRemoteMajor = -1;
nxagentInstallSignalHandlers(); nxagentInstallSignalHandlers();
nxagentInstallDisplayHandlers(); nxagentInstallDisplayHandlers();
......
...@@ -591,8 +591,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) ...@@ -591,8 +591,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE);
nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentChangeScreenConfig(0, nxagentOption(Width), nxagentOption(Height),
nxagentOption(Height)); 0, 0);
if (nxagentOption(ClientOs) == ClientOsWinnt) if (nxagentOption(ClientOs) == ClientOsWinnt)
{ {
...@@ -3461,8 +3461,8 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3461,8 +3461,8 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentOption(Width), nxagentOption(Height)); nxagentOption(Width), nxagentOption(Height));
#endif #endif
nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], nxagentChangeScreenConfig(0, nxagentOption(Width),
nxagentOption(Width), nxagentOption(Height)); nxagentOption(Height), 0, 0);
} }
} }
......
...@@ -22,11 +22,19 @@ ...@@ -22,11 +22,19 @@
#include "Agent.h" #include "Agent.h"
#include "Display.h" #include "Display.h"
#include "Screen.h" #include "Screen.h"
#include "Options.h"
#include "Extensions.h" #include "Extensions.h"
#include "Windows.h"
void GlxExtensionInit(void); void GlxExtensionInit(void);
void GlxWrapInitVisuals(void *procPtr); void GlxWrapInitVisuals(void *procPtr);
static int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width,
CARD16 height, CARD32 mmWidth,
CARD32 mmHeight);
static int nxagentRandRInitSizes(ScreenPtr pScreen);
#ifdef __DARWIN__ #ifdef __DARWIN__
void DarwinHandleGUI(int argc, char *argv[]) void DarwinHandleGUI(int argc, char *argv[])
...@@ -75,6 +83,8 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) ...@@ -75,6 +83,8 @@ void nxagentInitRandRExtension(ScreenPtr pScreen)
fprintf(stderr, "Warning: Failed to initialize the RandR extension.\n"); fprintf(stderr, "Warning: Failed to initialize the RandR extension.\n");
} }
nxagentRandRInitSizes(pScreen);
/* /*
* RRScreenInit sets these pointers to NULL, * RRScreenInit sets these pointers to NULL,
* so requiring the server to set up its own * so requiring the server to set up its own
...@@ -84,12 +94,31 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) ...@@ -84,12 +94,31 @@ void nxagentInitRandRExtension(ScreenPtr pScreen)
pRandRScrPriv = rrGetScrPriv(pScreen); pRandRScrPriv = rrGetScrPriv(pScreen);
pRandRScrPriv -> rrGetInfo = nxagentRandRGetInfo; pRandRScrPriv -> rrGetInfo = nxagentRandRGetInfo;
#if RANDR_12_INTERFACE
pRandRScrPriv -> rrScreenSetSize = nxagentRandRScreenSetSize;
#endif
#if RANDR_10_INTERFACE
pRandRScrPriv -> rrSetConfig = nxagentRandRSetConfig; pRandRScrPriv -> rrSetConfig = nxagentRandRSetConfig;
#endif
} }
int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
{ {
/*
* Rotation is not supported.
*/
*pRotations = RR_Rotate_0;
return 1;
}
static int nxagentRandRInitSizes(ScreenPtr pScreen)
{
RRScreenSizePtr pSize; RRScreenSizePtr pSize;
rrScrPrivPtr pRandRScrPriv = rrGetScrPriv(pScreen);
int width; int width;
int height; int height;
...@@ -97,8 +126,16 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) ...@@ -97,8 +126,16 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
int maxWidth; int maxWidth;
int maxHeight; int maxHeight;
int w[] = {0, 160, 320, 640, 800, 1024, 0, 0}; /*
int h[] = {0, 120, 240, 480, 600, 768, 0, 0}; int w[] = {0, 160, 320, 640, 800, 1024, 1152, 1280, 1280, 1280, 1280, 1280,
1280, 1360, 1440, 1600, 1600, 1680, 1920, 1920, 0, 0};
int h[] = {0, 120, 240, 480, 600, 768, 864, 600, 720, 800, 854, 960,
1024, 768, 900, 900, 1200, 1050, 1080, 1200, 0, 0};
*/
int w[] = {0, 320, 640, 640, 800, 800, 1024, 1024, 1152, 1280, 1280, 1280, 1360,
1440, 1600, 1600, 1680, 1920, 1920, 0, 0};
int h[] = {0, 240, 360, 480, 480, 600, 600, 768, 864, 720, 800, 1024, 768,
900, 900, 1200, 1050, 1080, 1200, 0, 0};
int i; int i;
int nSizes; int nSizes;
...@@ -107,12 +144,6 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) ...@@ -107,12 +144,6 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
int mmHeight; int mmHeight;
/* /*
* Rotation is not supported.
*/
*pRotations = RR_Rotate_0;
/*
* Register all the supported sizes. The third * Register all the supported sizes. The third
* parameter is the refresh rate. * parameter is the refresh rate.
*/ */
...@@ -185,13 +216,106 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) ...@@ -185,13 +216,106 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
return 1; return 1;
} }
#if RANDR_10_INTERFACE
int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
int rate, RRScreenSizePtr pSize) int rate, RRScreenSizePtr pSize)
{ {
int r;
rrScrPrivPtr pRandRScrPriv;
UpdateCurrentTime();
/* /*
* Whatever size is OK for us. * Whatever size is OK for us.
*/ */
return nxagentResizeScreen(pScreen, pSize -> width, pSize -> height, r = nxagentResizeScreen(pScreen, pSize -> width, pSize -> height,
pSize -> mmWidth, pSize -> mmHeight); pSize -> mmWidth, pSize -> mmHeight);
nxagentMoveViewport(pScreen, 0, 0);
return r;
} }
#endif
#if RANDR_12_INTERFACE
void nxagentRandRSetWindowsSize(int width, int height)
{
if (width == 0)
{
if (nxagentOption(Fullscreen) == 1)
{
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
width = nxagentOption(Width);
}
}
if (height == 0)
{
if (nxagentOption(Fullscreen) == 1)
{
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
height = nxagentOption(Height);
}
}
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0)
{
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height);
}
}
int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight)
{
int result;
rrScrPrivPtr pRandRScrPriv;
UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 &&
(nxagentOption(Fullscreen) == 1 ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{
if (nxagentOption(ClientOs) != ClientOsWinnt
/*&& nxagentOption(ClientOs) != ClientNXPlayer*/)
{
nxagentChangeOption(DesktopResize, 0);
}
}
if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 &&
nxagentOption(AllScreens) == 0)
{
nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height);
}
result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight);
if (result == 1 && nxagentOption(DesktopResize) == 1 &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)
{
nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum);
}
nxagentMoveViewport(pScreen, 0, 0);
return result;
}
#endif
...@@ -7,8 +7,7 @@ SRCS1 = os2Stub.c ...@@ -7,8 +7,7 @@ SRCS1 = os2Stub.c
OBJS1 = os2Stub.o OBJS1 = os2Stub.o
#endif #endif
SRCS = NXrandr.c \ SRCS = NXwindow.c \
NXwindow.c \
NXevents.c \ NXevents.c \
NXproperty.c \ NXproperty.c \
NXdixfonts.c \ NXdixfonts.c \
...@@ -70,8 +69,7 @@ SRCS = NXrandr.c \ ...@@ -70,8 +69,7 @@ SRCS = NXrandr.c \
miinitext.c \ miinitext.c \
$(SRCS1) $(SRCS1)
OBJS = NXrandr.o \ OBJS = NXwindow.o \
NXwindow.o \
NXevents.o \ NXevents.o \
NXproperty.o \ NXproperty.o \
NXdixfonts.o \ NXdixfonts.o \
...@@ -206,6 +204,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ ...@@ -206,6 +204,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
-DNXAGENT_SPLASH \ -DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \ -DNXAGENT_ARTSD \
-UNX_DEBUG_INPUT \ -UNX_DEBUG_INPUT \
-DRANDR_10_INTERFACE \
-DRANDR_12_INTERFACE \
-UPANORAMIX \ -UPANORAMIX \
-UDEBUG_TREE -UDEBUG_TREE
......
...@@ -128,6 +128,10 @@ void OsVendorEndRedirectErrorFFunction(); ...@@ -128,6 +128,10 @@ void OsVendorEndRedirectErrorFFunction();
* new X server tree. * new X server tree.
*/ */
static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data,
pointer args);
#ifdef NXAGENT_UPGRADE #ifdef NXAGENT_UPGRADE
void ddxInitGlobals(void) void ddxInitGlobals(void)
...@@ -209,6 +213,11 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) ...@@ -209,6 +213,11 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
NXUnsetLibraryPath(1); NXUnsetLibraryPath(1);
if (serverGeneration == 1)
{
AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL);
}
if (nxagentUserDefinedFontPath == 0) if (nxagentUserDefinedFontPath == 0)
{ {
#ifdef TEST #ifdef TEST
...@@ -479,6 +488,17 @@ void OsVendorEndRedirectErrorFFunction() ...@@ -479,6 +488,17 @@ void OsVendorEndRedirectErrorFFunction()
int SelectWaitTime = 10000; /* usec */ int SelectWaitTime = 10000; /* usec */
#endif #endif
ServerGrabInfoRec nxagentGrabServerInfo;
static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data,
pointer args)
{
ServerGrabInfoRec *grab = (ServerGrabInfoRec*)args;
nxagentGrabServerInfo.client = grab->client;
nxagentGrabServerInfo.grabstate = grab->grabstate;
}
#ifdef DPMSExtension #ifdef DPMSExtension
void DPMSSet(int level) void DPMSSet(int level)
......
...@@ -37,4 +37,6 @@ extern int nxagentDoFullGeneration; ...@@ -37,4 +37,6 @@ extern int nxagentDoFullGeneration;
extern int nxagentBackingStore; extern int nxagentBackingStore;
extern int nxagentSaveUnder; extern int nxagentSaveUnder;
extern ServerGrabInfoRec nxagentGrabServerInfo;
#endif /* __Init_H__ */ #endif /* __Init_H__ */
...@@ -598,7 +598,8 @@ Bool nxagentReconnectSession(void) ...@@ -598,7 +598,8 @@ Bool nxagentReconnectSession(void)
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True)
{ {
nxagentRRSetScreenConfig(nxagentDefaultScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), 0, 0);
nxagentResizeDesktopAtStartup = False; nxagentResizeDesktopAtStartup = False;
} }
......
...@@ -2120,8 +2120,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) ...@@ -2120,8 +2120,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
if (anyMarked) if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther); (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
} }
if (pWin->backStorage && if (pWin->backStorage && pOldClip &&
((pWin->backingStore == Always) || WasViewable)) ((pWin->backingStore == Always) || WasViewable))
{ {
if (!WasViewable) if (!WasViewable)
...@@ -2266,6 +2266,52 @@ FIXME: We should try to restore the previously ...@@ -2266,6 +2266,52 @@ FIXME: We should try to restore the previously
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
/* /*
* Change agent window size and size hints.
*/
if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0))
{
sizeHints.flags = PPosition | PMinSize | PMaxSize;
sizeHints.x = nxagentOption(X);
sizeHints.y = nxagentOption(Y);
sizeHints.min_width = MIN_NXAGENT_WIDTH;
sizeHints.min_height = MIN_NXAGENT_HEIGHT;
sizeHints.width = width;
sizeHints.height = height;
if (nxagentOption(DesktopResize) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);
}
if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
{
sizeHints.flags |= USPosition;
}
if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue)
{
sizeHints.flags |= USSize;
}
XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &sizeHints);
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
if (nxagentOption(Rootless) == 0)
{
XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height);
}
}
/*
* Set properties for the agent root window. * Set properties for the agent root window.
*/ */
...@@ -2654,9 +2700,12 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2654,9 +2700,12 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
nxagentShadowCreateMainWindow(pScreen, pWin, nxagentShadowWidth, nxagentShadowHeight); nxagentShadowCreateMainWindow(pScreen, pWin, nxagentShadowWidth, nxagentShadowHeight);
nxagentShadowSetWindowsSize(); if (nxagentRemoteMajor <= 3)
{
nxagentShadowSetWindowsSize();
nxagentSetWMNormalHints(0); nxagentSetWMNormalHints(0);
}
XMapWindow(nxagentDisplay, nxagentDefaultWindows[0]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[0]);
...@@ -3453,118 +3502,123 @@ Bool nxagentReconnectScreen(void *p0) ...@@ -3453,118 +3502,123 @@ Bool nxagentReconnectScreen(void *p0)
return True; return True;
} }
int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) RRModePtr nxagentRRCustomMode = NULL;
{
rrScrPrivPtr pScrPriv;
RRScreenSizePtr pSize;
Rotation rotation;
int rate;
short oldWidth, oldHeight;
int mmWidth, mmHeight;
int oldSize;
RRScreenSizePtr oldSizes;
pScrPriv = rrGetScrPriv(pScreen); int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, int mmHeight)
{
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
RROutputPtr output;
RRCrtcPtr crtc;
RRModePtr mode;
xRRModeInfo modeInfo;
char name[100];
int r, c, m;
int refresh = 60;
int doNotify = 1;
if (WindowTable[screen] == NULL)
{
return 0;
}
oldWidth = pScreen->width; UpdateCurrentTime();
oldHeight = pScreen->height;
if (!pScrPriv) if (nxagentGrabServerInfo.grabstate == SERVER_GRABBED)
{ {
return 1; /*
} * If any client grabbed the server it won't expect that screen
* configuration changes until it releases the grab. That could
* get an X error because available modes are chanded meanwhile.
*/
if (!RRGetInfo (pScreen)) #ifdef TEST
{ fprintf(stderr, "nxagentChangeScreenConfig: Cancel with grabbed server.\n");
return 1; #endif
}
rotation = RR_Rotate_0; return 0;
}
rate = 0; pScreen = WindowTable[screen] -> drawable.pScreen;
mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10); #ifdef TEST
fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %dx%d.\n", width, height);
#endif
if (mmWidth < 1) r = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight);
{
mmWidth = 1;
}
mmHeight = (height * 254 + monitorResolution * 5) / (monitorResolution * 10); if (r != 0)
{
pScrPriv = rrGetScrPriv(pScreen);
if (mmHeight < 1) if (pScrPriv)
{ {
mmHeight = 1; output = RRFirstOutput(pScreen);
}
pSize = xalloc(sizeof(RRScreenSize));
pSize -> width = width;
pSize -> height = height;
pSize -> mmWidth = mmWidth;
pSize -> mmHeight = mmHeight;
/* if (output && output -> crtc)
* call out to ddx routine to effect the change {
*/ crtc = output -> crtc;
if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate,
pSize))
{
/*
* unknown DDX failure.
*/
xfree(pSize); for (c = 0; c < pScrPriv -> numCrtcs; c++)
{
RRCrtcSet(pScrPriv -> crtcs[c], NULL, 0, 0, RR_Rotate_0, 0, NULL);
}
return 1; memset(&modeInfo, '\0', sizeof(modeInfo));
} sprintf(name, "%dx%d", width, height);
/* modeInfo.width = width;
* TellChanged uses this privates. modeInfo.height = height;
*/ modeInfo.hTotal = width;
modeInfo.vTotal = height;
modeInfo.dotClock = ((CARD32) width * (CARD32) height *
(CARD32) refresh);
modeInfo.nameLength = strlen(name);
oldSize = pScrPriv->size; if (nxagentRRCustomMode != NULL)
oldSizes = pScrPriv->pSizes; {
RROutputDeleteUserMode(output, nxagentRRCustomMode);
FreeResource(nxagentRRCustomMode -> mode.id, 0);
pScrPriv->size = 0; if (crtc != NULL && crtc -> mode == nxagentRRCustomMode)
pScrPriv->pSizes = pSize; {
RRCrtcSet(crtc, NULL, 0, 0, RR_Rotate_0, 0, NULL);
}
/* #ifdef TEST
* Deliver ScreenChangeNotify events whenever fprintf(stderr, "nxagentChangeScreenConfig: "
* the configuration is updated "Going to destroy mode %p with refcnt %d.\n",
*/ nxagentRRCustomMode, nxagentRRCustomMode->refcnt);
#endif
WalkTree (pScreen, TellChanged, (pointer) pScreen); RRModeDestroy(nxagentRRCustomMode);
}
/* nxagentRRCustomMode = RRModeGet(&modeInfo, name);
* Deliver ConfigureNotify events when root changes
* pixel size
*/
if (oldWidth != pScreen->width || oldHeight != pScreen->height) RROutputAddUserMode(output, nxagentRRCustomMode);
{
RRSendConfigNotify (pScreen);
}
RREditConnectionInfo (pScreen); RRCrtcSet(crtc, nxagentRRCustomMode, 0, 0, RR_Rotate_0, 1, &output);
/* RROutputChanged(output, 1);
* Fix pointer bounds and location
*/
ScreenRestructured (pScreen); doNotify = 0;
}
/* pScrPriv -> lastSetTime = currentTime;
* Restore old privates.
*/
pScrPriv->pSizes = oldSizes; pScrPriv->changed = 1;
pScrPriv->size = oldSize; pScrPriv->configChanged = 1;
}
xfree(pSize); if (doNotify
)
{
RRScreenSizeNotify(pScreen);
}
}
return 0; return r;
} }
void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin) void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin)
......
...@@ -100,7 +100,7 @@ Bool nxagentMagicPixelZone(int x, int y); ...@@ -100,7 +100,7 @@ Bool nxagentMagicPixelZone(int x, int y);
Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
int mmWidth, int mmHeight); int mmWidth, int mmHeight);
int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height); int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, int mmHeight);
extern Bool nxagentReconnectScreen(void *p0); extern Bool nxagentReconnectScreen(void *p0);
......
...@@ -899,8 +899,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -899,8 +899,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
{ {
if (nxagentOption(Shadow) == 0) if (nxagentOption(Shadow) == 0)
{ {
nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), 0, 0);
} }
else else
{ {
...@@ -953,7 +953,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -953,7 +953,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if (nxagentOption(Shadow) == 0) if (nxagentOption(Shadow) == 0)
{ {
nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), 0, 0);
} }
} }
......
...@@ -148,7 +148,8 @@ static const char *_NXGetFontPath(const char *path) ...@@ -148,7 +148,8 @@ static const char *_NXGetFontPath(const char *path)
_NXGetFontPathError: _NXGetFontPathError:
strcpy(_NXFontPath, path); strncpy(_NXFontPath, path, 1023);
_NXFontPath[1023] = '\0';
#ifdef NX_TRANS_TEST #ifdef NX_TRANS_TEST
fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath);
......
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