From e3aece4bac1b8c7cc2aadd824dbba4231665479f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20=C3=85strand=20=28astrand=29?= Date: Wed, 7 Mar 2018 08:21:42 +0100 Subject: [PATCH] Make vncRandRGetOutputId return the actual id; not a pointer Less confusing, and compatible with libXrandr. --- unix/xserver/hw/vnc/XorgGlue.c | 4 ++-- unix/xserver/hw/vnc/XorgGlue.h | 2 +- unix/xserver/hw/vnc/XserverDesktop.cc | 6 +++--- unix/xserver/hw/vnc/XserverDesktop.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/unix/xserver/hw/vnc/XorgGlue.c b/unix/xserver/hw/vnc/XorgGlue.c index 141023a8..baeac29d 100644 --- a/unix/xserver/hw/vnc/XorgGlue.c +++ b/unix/xserver/hw/vnc/XorgGlue.c @@ -290,11 +290,11 @@ int vncRandRDisableOutput(int scrIdx, int outputIdx) #endif } -intptr_t vncRandRGetOutputId(int scrIdx, int outputIdx) +unsigned int vncRandRGetOutputId(int scrIdx, int outputIdx) { #ifdef RANDR rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]); - return (intptr_t)rp->outputs[outputIdx]; + return rp->outputs[outputIdx]->id; #else return 0; #endif diff --git a/unix/xserver/hw/vnc/XorgGlue.h b/unix/xserver/hw/vnc/XorgGlue.h index 63227ac3..dc78f5eb 100644 --- a/unix/xserver/hw/vnc/XorgGlue.h +++ b/unix/xserver/hw/vnc/XorgGlue.h @@ -65,7 +65,7 @@ int vncRandRDisableOutput(int scrIdx, int outputIdx); int vncRandRReconfigureOutput(int scrIdx, int outputIdx, int x, int y, int width, int height); -intptr_t vncRandRGetOutputId(int scrIdx, int outputIdx); +unsigned int vncRandRGetOutputId(int scrIdx, int outputIdx); void vncRandRGetOutputDimensions(int scrIdx, int outputIdx, int *x, int *y, int *width, int *height); diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 6a428908..c47f507a 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -201,7 +201,7 @@ ScreenSet XserverDesktop::computeScreenLayout() OutputIdMap newIdMap; for (int i = 0;i < vncRandRGetOutputCount(screenIndex);i++) { - intptr_t outputId; + unsigned int outputId; int x, y, width, height; /* Disabled? */ @@ -654,7 +654,7 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height, /* Next, reconfigure all known outputs, and turn off the other ones */ for (int i = 0;i < vncRandRGetOutputCount(screenIndex);i++) { - intptr_t output; + unsigned int output; ScreenSet::const_iterator iter; @@ -702,7 +702,7 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height, ScreenSet::const_iterator iter; for (iter = layout.begin();iter != layout.end();++iter) { OutputIdMap::const_iterator oi; - intptr_t output; + unsigned int output; int i; /* Does this screen have an output already? */ diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index 2a378ea1..b611402a 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -133,7 +133,7 @@ private: rfb::Timer queryConnectTimer; #ifdef RANDR - typedef std::map OutputIdMap; + typedef std::map OutputIdMap; OutputIdMap outputIdMap; #endif -- 2.39.5