From: Peter Åstrand (astrand) Date: Wed, 7 Mar 2018 07:21:42 +0000 (+0100) Subject: Make vncRandRGetOutputId return the actual id; not a pointer X-Git-Tag: v1.8.90~25^2~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e3aece4bac1b8c7cc2aadd824dbba4231665479f;p=tigervnc.git Make vncRandRGetOutputId return the actual id; not a pointer Less confusing, and compatible with libXrandr. --- 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