summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-09-07 13:12:30 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-09-07 13:12:30 +0000
commitaa88c5697d3d45a1db27ed7d6de770f79b4aadf5 (patch)
tree9e1d666fc40b36505dd17acc757d7db955e48b2f /legacy/ecore/src/lib/ecore_x/xlib
parente26ae30eb863c5e442b4ffbf13c31389a8646dea (diff)
Ecore_X (RandR): Fix long outstanding randr bug which caused
ecore_x_randr to not work for pretty much everyone. Short version, don't memcpy something potentially Larger into something Certainly smaller. (read on for the details). NB: This 'should' fix all the randr problems in ecore_x (tho I have not tested Everything). NB: Ok, here goes: XRRGetScreenResources returns a struct. Inside that struct is a list of RROutputs. RROutput is defined as (from randrproto.h): #define RROutput CARD32 CARD32 is defined as (from X11/Xmd.h): # ifdef LONG64 typedef unsigned long CARD64; typedef unsigned int CARD32; # else typedef unsigned long CARD32; # endif so CARD32 can change based on the system (32/64 bit). Ecore_X_Randr_Output is defined as (Ecore_X.h): typedef Ecore_X_ID Ecore_X_Randr_Output; (for reference: typedef unsigned int Ecore_X_ID) Double bonus points if you have already spotted the problem !! ;) SVN revision: 76306
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
index 3be89ac..b839736 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
@@ -642,10 +642,12 @@ ecore_x_randr_outputs_get(Ecore_X_Window root,
642 { 642 {
643 if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * res->noutput))) 643 if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * res->noutput)))
644 { 644 {
645 memcpy(ret, res->outputs, 645 int i = 0;
646 (sizeof(Ecore_X_Randr_Output) * res->noutput)); 646
647 if (num) 647 if (num) *num = res->noutput;
648 *num = res->noutput; 648
649 for (i = 0; i < res->noutput; i++)
650 ret[i] = res->outputs[i];
649 } 651 }
650 652
651 if (res) 653 if (res)