princeamd pushed a commit to branch ecore-1.7.
commit 58ba9b09df45b5e3eea9d7c09c177e84073cd307
Author: Christopher Michael <[email protected]>
Date: Thu Feb 7 12:43:46 2013 +0000
Backport: 2fe1fa0 :: Fix crtc_info_get function (memcpy fails here in some
cases, so manually allocate and copy things over).
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 83737
Signed-off-by: Deon Thomas <[email protected]>
---
src/lib/ecore_x/xlib/ecore_x_randr.c | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c
b/src/lib/ecore_x/xlib/ecore_x_randr.c
index 1d003a7..63dd2d2 100644
--- a/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -1800,7 +1800,38 @@ ecore_x_randr_crtc_info_get(Ecore_X_Window root, const
Ecore_X_Randr_Crtc crtc)
if ((info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
if ((ret = malloc(sizeof(Ecore_X_Randr_Crtc_Info))))
- memcpy(ret, info, sizeof(Ecore_X_Randr_Crtc_Info));
+ {
+ /* copy the mode information into our return structure */
+ ret->timestamp = info->timestamp;
+ ret->x = info->x;
+ ret->y = info->y;
+ ret->width = info->width;
+ ret->height = info->height;
+ ret->mode = info->mode;
+ ret->rotation = info->rotation;
+ ret->noutput = info->noutput;
+ ret->npossible = info->npossible;
+
+ if ((ret->outputs =
+ malloc(info->noutput * sizeof(Ecore_X_Randr_Output))))
+ {
+ int i = 0;
+
+ /* loop the outputs on this crtc */
+ for (i = 0; i < info->noutput; i++)
+ ret->outputs[i] = info->outputs[i];
+ }
+
+ if ((ret->possible =
+ malloc(info->npossible * sizeof(Ecore_X_Randr_Output))))
+ {
+ int i = 0;
+
+ /* loop the outputs on this crtc */
+ for (i = 0; i < info->npossible; i++)
+ ret->possible[i] = info->possible[i];
+ }
+ }
/* free the crtc info */
XRRFreeCrtcInfo(info);
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev