aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver
diff options
context:
space:
mode:
authorPeter Åstrand (astrand) <astrand@cendio.se>2018-04-02 22:15:47 +0200
committerPeter Åstrand (astrand) <astrand@cendio.se>2018-04-09 11:02:20 +0200
commitffeda0767ff1c61c72627f4aacb1526764630161 (patch)
tree925dabe37f11c5d72e10ddd35a8c6b8068548238 /unix/xserver
parentab98f7657b715a991023fc5e98ba2c58103d40d6 (diff)
downloadtigervnc-ffeda0767ff1c61c72627f4aacb1526764630161.tar.gz
tigervnc-ffeda0767ff1c61c72627f4aacb1526764630161.zip
Remove "screen" argument from Randr glue functions
Screen is a Xvnc thing and not relevant for x0vncserver etc.
Diffstat (limited to 'unix/xserver')
-rw-r--r--unix/xserver/hw/vnc/RandrGlue.c43
-rw-r--r--unix/xserver/hw/vnc/XorgGlue.h1
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc13
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc9
-rw-r--r--unix/xserver/hw/vnc/vncModule.c2
-rw-r--r--unix/xserver/hw/vnc/xvnc.c2
6 files changed, 49 insertions, 21 deletions
diff --git a/unix/xserver/hw/vnc/RandrGlue.c b/unix/xserver/hw/vnc/RandrGlue.c
index 54a035d5..86ec8bcc 100644
--- a/unix/xserver/hw/vnc/RandrGlue.c
+++ b/unix/xserver/hw/vnc/RandrGlue.c
@@ -28,18 +28,28 @@
#include "randrstr.h"
#include "RandrGlue.h"
+#include "XorgGlue.h"
-int vncGetScreenWidth(int scrIdx)
+static int scrIdx;
+
+void vncSetGlueContext(int screenIndex);
+
+void vncSetGlueContext(int screenIndex)
+{
+ scrIdx = screenIndex;
+}
+
+int vncGetScreenWidth(void)
{
return screenInfo.screens[scrIdx]->width;
}
-int vncGetScreenHeight(int scrIdx)
+int vncGetScreenHeight(void)
{
return screenInfo.screens[scrIdx]->height;
}
-int vncRandRResizeScreen(int scrIdx, int width, int height)
+int vncRandRResizeScreen(int width, int height)
{
ScreenPtr pScreen = screenInfo.screens[scrIdx];
/* Try to retain DPI when we resize */
@@ -48,13 +58,13 @@ int vncRandRResizeScreen(int scrIdx, int width, int height)
pScreen->mmHeight * height / pScreen->height);
}
-void vncRandRUpdateSetTime(int scrIdx)
+void vncRandRUpdateSetTime(void)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
rp->lastSetTime = currentTime;
}
-int vncRandRHasOutputClones(int scrIdx)
+int vncRandRHasOutputClones(void)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
for (int i = 0;i < rp->numCrtcs;i++) {
@@ -64,13 +74,13 @@ int vncRandRHasOutputClones(int scrIdx)
return 0;
}
-int vncRandRGetOutputCount(int scrIdx)
+int vncRandRGetOutputCount(void)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return rp->numOutputs;
}
-int vncRandRGetAvailableOutputs(int scrIdx)
+int vncRandRGetAvailableOutputs(void)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
@@ -125,13 +135,13 @@ int vncRandRGetAvailableOutputs(int scrIdx)
return availableOutputs;
}
-char *vncRandRGetOutputName(int scrIdx, int outputIdx)
+char *vncRandRGetOutputName(int outputIdx)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return strdup(rp->outputs[outputIdx]->name);
}
-int vncRandRIsOutputEnabled(int scrIdx, int outputIdx)
+int vncRandRIsOutputEnabled(int outputIdx)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
@@ -143,7 +153,7 @@ int vncRandRIsOutputEnabled(int scrIdx, int outputIdx)
return 1;
}
-int vncRandRIsOutputUsable(int scrIdx, int outputIdx)
+int vncRandRIsOutputUsable(int outputIdx)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
@@ -163,7 +173,7 @@ int vncRandRIsOutputUsable(int scrIdx, int outputIdx)
return 0;
}
-int vncRandRDisableOutput(int scrIdx, int outputIdx)
+int vncRandRDisableOutput(int outputIdx)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
RRCrtcPtr crtc;
@@ -175,13 +185,13 @@ int vncRandRDisableOutput(int scrIdx, int outputIdx)
return RRCrtcSet(crtc, NULL, crtc->x, crtc->y, crtc->rotation, 0, NULL);
}
-unsigned int vncRandRGetOutputId(int scrIdx, int outputIdx)
+unsigned int vncRandRGetOutputId(int outputIdx)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return rp->outputs[outputIdx]->id;
}
-void vncRandRGetOutputDimensions(int scrIdx, int outputIdx,
+void vncRandRGetOutputDimensions(int outputIdx,
int *x, int *y, int *width, int *height)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
@@ -202,7 +212,7 @@ void vncRandRGetOutputDimensions(int scrIdx, int outputIdx,
}
}
-int vncRandRReconfigureOutput(int scrIdx, int outputIdx, int x, int y,
+int vncRandRReconfigureOutput(int outputIdx, int x, int y,
int width, int height)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
@@ -239,3 +249,8 @@ int vncRandRReconfigureOutput(int scrIdx, int outputIdx, int x, int y,
/* Reconfigure new mode and position */
return RRCrtcSet(crtc, mode, x, y, crtc->rotation, 1, &output);
}
+
+int vncRandRCreateOutputs(int extraOutputs)
+{
+ return vncRandRCreateScreenOutputs(scrIdx, extraOutputs);
+}
diff --git a/unix/xserver/hw/vnc/XorgGlue.h b/unix/xserver/hw/vnc/XorgGlue.h
index 8cf29350..68d66686 100644
--- a/unix/xserver/hw/vnc/XorgGlue.h
+++ b/unix/xserver/hw/vnc/XorgGlue.h
@@ -48,6 +48,7 @@ int vncGetScreenY(int scrIdx);
// These hide in xvnc.c or vncModule.c
void vncClientGone(int fd);
+int vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs);
#ifdef __cplusplus
}
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 19a09fc9..080943d0 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -48,6 +48,10 @@
#include "XorgGlue.h"
#include "Input.h"
+extern "C" {
+void vncSetGlueContext(int screenIndex);
+}
+
using namespace rfb;
using namespace network;
@@ -185,14 +189,16 @@ void XserverDesktop::setFramebuffer(int w, int h, void* fbptr, int stride_)
data = (rdr::U8*)fbptr;
stride = stride_;
- layout = ::computeScreenLayout(screenIndex, &outputIdMap);
+ vncSetGlueContext(screenIndex);
+ layout = ::computeScreenLayout(&outputIdMap);
server->setPixelBuffer(this, layout);
}
void XserverDesktop::refreshScreenLayout()
{
- server->setScreenLayout(::computeScreenLayout(screenIndex, &outputIdMap));
+ vncSetGlueContext(screenIndex);
+ server->setScreenLayout(::computeScreenLayout(&outputIdMap));
}
char* XserverDesktop::substitute(const char* varName)
@@ -557,7 +563,8 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height,
layout.print(buffer, sizeof(buffer));
vlog.debug("%s", buffer);
- return ::setScreenLayout(screenIndex, fb_width, fb_height, layout, &outputIdMap);
+ vncSetGlueContext(screenIndex);
+ return ::setScreenLayout(fb_width, fb_height, layout, &outputIdMap);
}
void XserverDesktop::grabRegion(const rfb::Region& region)
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index 52e270a3..54cca953 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -44,6 +44,10 @@
#include "RandrGlue.h"
#include "xorg-version.h"
+extern "C" {
+void vncSetGlueContext(int screenIndex);
+}
+
using namespace rfb;
static rfb::LogWriter vlog("vncext");
@@ -212,13 +216,14 @@ void vncExtensionInit(void)
CharArray desktopNameStr(desktopName.getData());
PixelFormat pf = vncGetPixelFormat(scr);
+ vncSetGlueContext(scr);
desktop[scr] = new XserverDesktop(scr,
listeners,
httpListeners,
desktopNameStr.buf,
pf,
- vncGetScreenWidth(scr),
- vncGetScreenHeight(scr),
+ vncGetScreenWidth(),
+ vncGetScreenHeight(),
vncFbptr[scr],
vncFbstride[scr]);
vlog.info("created VNC server for screen %d", scr);
diff --git a/unix/xserver/hw/vnc/vncModule.c b/unix/xserver/hw/vnc/vncModule.c
index 5d95ef06..2a6e73c9 100644
--- a/unix/xserver/hw/vnc/vncModule.c
+++ b/unix/xserver/hw/vnc/vncModule.c
@@ -110,7 +110,7 @@ void vncClientGone(int fd)
{
}
-int vncRandRCreateOutputs(int scrIdx, int extraOutputs)
+int vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs)
{
return 0;
}
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index 0f17095d..f06e0b15 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -1377,7 +1377,7 @@ static RRCrtcPtr vncRandRCrtcCreate(ScreenPtr pScreen)
}
/* Used from XserverDesktop when it needs more outputs... */
-int vncRandRCreateOutputs(int scrIdx, int extraOutputs)
+int vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs)
{
RRCrtcPtr crtc;