Ecore_X: Fix more memcpy madness causing problems in randr. This fixes
crtc_possible_outputs_get and crtc_outputs_get. SVN revision: 76454
This commit is contained in:
parent
90f9d623fe
commit
4b1e2578b0
|
@ -681,19 +681,19 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
|
||||||
Ecore_X_Randr_Output *ret = NULL;
|
Ecore_X_Randr_Output *ret = NULL;
|
||||||
XRRCrtcInfo *crtc_info = NULL;
|
XRRCrtcInfo *crtc_info = NULL;
|
||||||
|
|
||||||
if (_ecore_x_randr_crtc_validate(root,
|
if (_ecore_x_randr_crtc_validate(root, crtc) &&
|
||||||
crtc) &&
|
|
||||||
(res =
|
(res =
|
||||||
_ecore_x_randr_get_screen_resources (_ecore_x_disp,
|
_ecore_x_randr_get_screen_resources (_ecore_x_disp, root)) &&
|
||||||
root)) &&
|
|
||||||
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
|
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
|
||||||
{
|
{
|
||||||
if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput)))
|
if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput)))
|
||||||
{
|
{
|
||||||
memcpy(ret, crtc_info->outputs,
|
int i = 0;
|
||||||
(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput));
|
|
||||||
if (num)
|
if (num) *num = crtc_info->noutput;
|
||||||
*num = crtc_info->noutput;
|
|
||||||
|
for (i = 0; i < crtc_info->noutput; i++)
|
||||||
|
ret[i] = crtc_info->outputs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crtc_info)
|
if (crtc_info)
|
||||||
|
@ -725,8 +725,7 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
|
||||||
Ecore_X_Randr_Output *ret = NULL;
|
Ecore_X_Randr_Output *ret = NULL;
|
||||||
XRRCrtcInfo *crtc_info = NULL;
|
XRRCrtcInfo *crtc_info = NULL;
|
||||||
|
|
||||||
if (_ecore_x_randr_crtc_validate(root,
|
if (_ecore_x_randr_crtc_validate(root, crtc) &&
|
||||||
crtc) &&
|
|
||||||
(res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
|
(res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
|
||||||
{
|
{
|
||||||
if ((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
|
if ((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
|
||||||
|
@ -734,10 +733,12 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
|
||||||
if ((ret =
|
if ((ret =
|
||||||
malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
|
malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
|
||||||
{
|
{
|
||||||
memcpy(ret, crtc_info->possible,
|
int i = 0;
|
||||||
(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible));
|
|
||||||
if (num)
|
if (num) *num = crtc_info->npossible;
|
||||||
*num = res->ncrtc;
|
|
||||||
|
for (i = 0; i < crtc_info->npossible; i++)
|
||||||
|
ret[i] = crtc_info->possible[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
XRRFreeCrtcInfo(crtc_info);
|
XRRFreeCrtcInfo(crtc_info);
|
||||||
|
|
Loading…
Reference in New Issue