}
if ((ret = ecore_x_randr_crtc_mode_set(e_randr_screen_info.root, usable_crtc->xid, &output_info->xid, 1, mode_info->xid)))
{
- ret &= _crtc_move_policy(usable_crtc);
+ //WORKAROUND
+ //Reason: the CRTC event, that'd bring the new info about the set
+ //mode is arriving too late here.
+ usable_crtc->current_mode = mode_info;
+ crtc_info->geometry.x = 0;
+ crtc_info->geometry.y = 0;
+ crtc_info->geometry.w = mode_info->width;
+ crtc_info->geometry.h = mode_info->height;
+ //WORKAROUND END
+ ret &= _crtc_move_policy(usable_crtc, output_info->policy);
}
}
if (ret)
* other crtcs are accordingly moved instead, so the result is the same.
*/
Eina_Bool
-_crtc_move_policy(E_Randr_Crtc_Info *new_crtc)
+_crtc_move_policy(E_Randr_Crtc_Info *new_crtc, Ecore_X_Randr_Output_Policy policy)
{
const E_Randr_Crtc_Info *crtc_rel;
- E_Randr_Output_Info *first_output = NULL;
int dx = Ecore_X_Randr_None, dy = Ecore_X_Randr_None;
Eina_Bool ret = EINA_TRUE;
- //use the policy of the new crtc's first output
- first_output = (E_Randr_Output_Info *)eina_list_data_get(new_crtc->outputs);
- if (!first_output)
- return EINA_FALSE;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(new_crtc, EINA_FALSE);
+
//get the crtc we will place our's relative to. If it's NULL, this is the
//only output attached, work done.
- if (!(crtc_rel = _crtc_according_to_policy_get(new_crtc, first_output->policy)))
- return EINA_TRUE;
+ if (!(crtc_rel = _crtc_according_to_policy_get(new_crtc, policy)))
+ {
+ fprintf(stderr, "E_RANDR: Moving CRTC %d, there is no other CRTC to move this one relative to.\n", new_crtc->xid);
+ return EINA_TRUE;
+ }
+ fprintf(stderr, "E_RANDR: Moved CRTC %d has geometry (x,y,wxh): %d, %d, %dx%d.\n", new_crtc->xid, new_crtc->geometry.x, new_crtc->geometry.y, new_crtc->geometry.w, new_crtc->geometry.h);
//following is policy dependend.
- switch (first_output->policy)
+ switch (policy)
{
case ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
dy = (crtc_rel->geometry.y - new_crtc->geometry.h);
1,
dx,
dy);
+ fprintf(stderr, "E_RANDR: Moving all CRTCs but %d, by %dx%d delta.\n", new_crtc->xid, dx, dy);
}
break;
1,
dx,
dy);
+ fprintf(stderr, "E_RANDR: Moving all CRTCs but %d, by %dx%d delta.\n", new_crtc->xid, dx, dy);
}
break;
default:
break;
}
- ret &= ecore_x_randr_crtc_pos_relative_set(e_randr_screen_info.root, new_crtc->xid, crtc_rel->xid, first_output->policy, e_randr_screen_info.rrvd_info.randr_info_12->alignment);
+ ret &= ecore_x_randr_crtc_pos_relative_set(e_randr_screen_info.root, new_crtc->xid, crtc_rel->xid, policy, e_randr_screen_info.rrvd_info.randr_info_12->alignment);
return ret;
}
mode_info = ecore_x_randr_mode_info_get(e_randr_screen_info.root, modes[nmodes]);
e_randr_screen_info.rrvd_info.randr_info_12->modes = eina_list_append(e_randr_screen_info.rrvd_info.randr_info_12->modes, mode_info);
}
- mi->modes = eina_list_append(mi->modes, mode_info);
- if (nmodes >= npreferred)
- mi->preferred_modes = eina_list_append(mi->preferred_modes, mode_info);
+ mi->modes = eina_list_prepend(mi->modes, mode_info);
+ if (nmodes <= npreferred)
+ mi->preferred_modes = eina_list_prepend(mi->preferred_modes, mode_info);
}
free(modes);
}
output_info->signalformats = Ecore_X_Randr_Unset;
output_info->signalformat = Ecore_X_Randr_Unset;
output_info->connector_number = 0;
+ output_info->monitor = NULL;
output_info->connector_type = Ecore_X_Randr_Unset;
output_info->policy = ECORE_X_RANDR_OUTPUT_POLICY_NONE;
output_info->compatibility_list = NULL;