Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/maximum size #475

Open
wants to merge 7 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions nx-X11/programs/Xserver/hw/nxagent/Events.c
Expand Up @@ -616,8 +616,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}

sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
&sizeHints);
Expand Down Expand Up @@ -657,8 +657,8 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
screenInfo.screens[0]->root, screenInfo.screens[0]->root -> drawable.width,
screenInfo.screens[0]->root -> drawable.height);

sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

fprintf(stderr,"Info: Enabled resize mode in shadow agent.\n");
}
Expand Down
27 changes: 13 additions & 14 deletions nx-X11/programs/Xserver/hw/nxagent/Extensions.c
Expand Up @@ -124,7 +124,8 @@ void nxagentInitRandRExtension(ScreenPtr pScreen)
fprintf(stderr, "Warning: Failed to initialize the RandR extension.\n");
}


/*RRGetInfo(pScreen, FALSE);*/
/*RRScanOldConfig(pScreen, RR_Rotate_0);*/
/* FIXME: do we need this at all with the new rand/xinerama stuff? */
nxagentRandRInitSizes(pScreen);

Expand Down Expand Up @@ -251,6 +252,12 @@ nxagentRandRCrtcSet (ScreenPtr pScreen,
int numOutputs,
RROutputPtr *outputs)
{
if (crtc->gammaSize == 0) {
CARD16 gamma = 0;
RRCrtcGammaSetSize(crtc, 1);
RRCrtcGammaSet(crtc, &gamma, &gamma, &gamma);
RRCrtcGammaNotify(crtc);
}
return RRCrtcNotify(crtc, mode, x, y, rotation, NULL, numOutputs, outputs);
}
#endif
Expand All @@ -270,23 +277,18 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
static int nxagentRandRInitSizes(ScreenPtr pScreen)
{
RRScreenSizePtr pSize;

int width;
int height;

int maxWidth;
int maxHeight;

/*
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};
*/
/* the second to last resolution is here to extend the maximum
screen size to 32767x32767 */
int w[] = {0, 320, 640, 640, 800, 800, 1024, 1024, 1152, 1280, 1280, 1280, 1360,
1440, 1600, 1600, 1680, 1920, 1920, 0, 0};
1440, 1600, 1600, 1680, 1920, 1920, MAXSHORT, 0};
int h[] = {0, 240, 360, 480, 480, 600, 600, 768, 864, 720, 800, 1024, 768,
900, 900, 1200, 1050, 1080, 1200, 0, 0};
900, 900, 1200, 1050, 1080, 1200, MAXSHORT, 0};

int i;
int nSizes;
Expand All @@ -311,9 +313,6 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen)
w[nSizes - 1] = pScreen -> width;
h[nSizes - 1] = pScreen -> height;

w[nSizes - 2] = maxWidth;
h[nSizes - 2] = maxHeight;

/*
* Compute default size.
*/
Expand Down Expand Up @@ -363,7 +362,7 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen)
}

RRSetCurrentConfig(pScreen, RR_Rotate_0, 60, pSize);

/* RRScreenSetSizeRange(pScreen, w[1], h[1], MAXSHORT, MAXSHORT);*/
return 1;
}

Expand Down
26 changes: 19 additions & 7 deletions nx-X11/programs/Xserver/hw/nxagent/Screen.c
Expand Up @@ -1864,8 +1864,8 @@ N/A

if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;
}
else
{
Expand Down Expand Up @@ -2387,8 +2387,8 @@ FIXME: We should try to restore the previously

if (nxagentOption(DesktopResize) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;
}
else
{
Expand Down Expand Up @@ -3818,6 +3818,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in
}

#ifdef DEBUG
nxagentPrintAgentGeometry("Current geometry", "nxagentChangeScreenConfig:");
fprintf(stderr, "nxagentChangeScreenConfig: current geometry: %d,%d %dx%d\n", nxagentOption(X), nxagentOption(Y), nxagentOption(Width), nxagentOption(Height));
fprintf(stderr, "nxagentChangeScreenConfig: returning [%d]\n", r);
#endif
Expand All @@ -3834,7 +3835,7 @@ void nxagentDropOutput(RROutputPtr o) {
for (int i = 0; i < c->numOutputs; i++) {
if (c->outputs[i] == o) {
#ifdef DEBUG
fprintf(stderr, "nxagentDropOutput: output [%s] is in use by crtc [%p], removing it from there\n", o->name, c);
fprintf(stderr, "nxagentDropOutput: output [%s] is in use by crtc [%p], removing it from there\n", o->name, (void *)c);
#endif
RRCrtcSet(c, NULL, 0, 0, RR_Rotate_0, 0, NULL);
}
Expand Down Expand Up @@ -4109,6 +4110,17 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)

RROutputSetConnection(pScrPriv->outputs[i], RR_Connected);

/* calculate the size in mm based on the current dpi. If
nxagent is run with a different dpi than the real X server
the result will look wrong but it is mathematically correct. */
/* RRRegisterSize(pScreen, bbx2-bbx1, bby2-bby1,
((bbx2-bbx1) * 254 + monitorResolution * 5) / (monitorResolution * 10),
((bby2-bby1) * 254 + monitorResolution * 5) / (monitorResolution * 10));*/

RROutputSetPhysicalSize(pScrPriv->outputs[i],
(new_w * 254 + monitorResolution * 5) / (monitorResolution * 10),
(new_h * 254 + monitorResolution * 5) / (monitorResolution * 10));

memset(&modeInfo, '\0', sizeof(modeInfo));

#ifdef NXAGENT_RANDR_MODE_PREFIX
Expand Down Expand Up @@ -4491,8 +4503,8 @@ void nxagentSetWMNormalHints(int screen)

if (nxagentOption(DesktopResize) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;
}
else
{
Expand Down