forked from enlightenment/enlightenment
When we create monitors and are checking for clones, just use x/y
position, not size for comparison. When we create monitors, assign the proper crtc to the monitor. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 82330
This commit is contained in:
parent
721d4385a9
commit
11ab438c80
|
@ -174,9 +174,9 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
{
|
||||
Eina_List *outputs = NULL;
|
||||
|
||||
printf("Checking Crtc: %d\n", crtc->xid);
|
||||
printf("\tGeom: %d %d %d %d\n", crtc->geometry.x,
|
||||
crtc->geometry.y, crtc->geometry.w, crtc->geometry.h);
|
||||
/* printf("Checking Crtc: %d\n", crtc->xid); */
|
||||
/* printf("\tGeom: %d %d %d %d\n", crtc->geometry.x, */
|
||||
/* crtc->geometry.y, crtc->geometry.w, crtc->geometry.h); */
|
||||
|
||||
EINA_LIST_FOREACH(crtc->outputs, ll, output)
|
||||
outputs = eina_list_append(outputs, output);
|
||||
|
@ -191,14 +191,15 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
{
|
||||
if (!(eina_list_data_find(outputs, output) == output))
|
||||
{
|
||||
E_Randr_Crtc_Info *pcrtc;
|
||||
E_Randr_Crtc_Info *pcrtc = NULL;
|
||||
|
||||
if (!(pcrtc =
|
||||
eina_list_last_data_get(output->possible_crtcs)))
|
||||
continue;
|
||||
|
||||
pcrtc = eina_list_last_data_get(output->possible_crtcs);
|
||||
if (!output->crtc) output->crtc = pcrtc;
|
||||
if ((output->crtc) &&
|
||||
(output->crtc != pcrtc)) continue;
|
||||
printf("\tAssigned Crtc %d To Output: %d\n",
|
||||
pcrtc->xid, output->xid);
|
||||
outputs = eina_list_append(outputs, output);
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +230,8 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
* if we are in a cloned situation here, and what output
|
||||
* we are cloned to */
|
||||
if ((!e_config->randr_serialized_setup) &&
|
||||
(output->policy == ECORE_X_RANDR_OUTPUT_POLICY_NONE))
|
||||
((output->policy == ECORE_X_RANDR_OUTPUT_POLICY_CLONE) ||
|
||||
(output->policy == ECORE_X_RANDR_OUTPUT_POLICY_NONE)))
|
||||
{
|
||||
/* if we have a previous crtc, check if that is the
|
||||
* one we are cloned to */
|
||||
|
@ -237,9 +239,7 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
{
|
||||
/* we have a previous crtc. compare geometry */
|
||||
if ((crtc->geometry.x == pcrtc->geometry.x) &&
|
||||
(crtc->geometry.y == pcrtc->geometry.y) &&
|
||||
(crtc->geometry.w == pcrtc->geometry.w) &&
|
||||
(crtc->geometry.h == pcrtc->geometry.h))
|
||||
(crtc->geometry.y == pcrtc->geometry.y))
|
||||
{
|
||||
pmon =
|
||||
_e_smart_randr_monitor_find(sd, pcrtc->xid);
|
||||
|
@ -250,7 +250,8 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
* output is set to cloned, then see if we can create the
|
||||
* cloned representation */
|
||||
else if ((e_config->randr_serialized_setup) &&
|
||||
(output->policy == ECORE_X_RANDR_OUTPUT_POLICY_CLONE))
|
||||
((output->policy == ECORE_X_RANDR_OUTPUT_POLICY_CLONE) ||
|
||||
(output->policy == ECORE_X_RANDR_OUTPUT_POLICY_NONE)))
|
||||
{
|
||||
/* if we have a previous crtc, check if that is the
|
||||
* one we are cloned to */
|
||||
|
@ -258,9 +259,7 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
{
|
||||
/* we have a previous crtc. compare geometry */
|
||||
if ((crtc->geometry.x == pcrtc->geometry.x) &&
|
||||
(crtc->geometry.y == pcrtc->geometry.y) &&
|
||||
(crtc->geometry.w == pcrtc->geometry.w) &&
|
||||
(crtc->geometry.h == pcrtc->geometry.h))
|
||||
(crtc->geometry.y == pcrtc->geometry.y))
|
||||
{
|
||||
pmon =
|
||||
_e_smart_randr_monitor_find(sd, pcrtc->xid);
|
||||
|
@ -346,10 +345,10 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
/* find a crtc that matches the geometry of this output's crtc */
|
||||
EINA_LIST_FOREACH(E_RANDR_12->crtcs, ll, crtc)
|
||||
{
|
||||
if (crtc->xid == output->crtc->xid) continue;
|
||||
|
||||
if ((crtc->geometry.x == output->crtc->geometry.x) &&
|
||||
(crtc->geometry.y == output->crtc->geometry.y) &&
|
||||
(crtc->geometry.w == output->crtc->geometry.w) &&
|
||||
(crtc->geometry.h == output->crtc->geometry.h))
|
||||
(crtc->geometry.y == output->crtc->geometry.y))
|
||||
{
|
||||
if ((pmon = _e_smart_randr_monitor_find(sd, crtc->xid)))
|
||||
break;
|
||||
|
@ -370,6 +369,9 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
/* tell the monitor which output it references */
|
||||
e_smart_monitor_output_set(mon, output);
|
||||
|
||||
/* tell the monitor which crtc it references */
|
||||
e_smart_monitor_crtc_set(mon, output->crtc);
|
||||
|
||||
/* with the layout and output assigned, we can
|
||||
* tell the monitor to setup
|
||||
*
|
||||
|
@ -383,15 +385,20 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
cw = output->crtc->geometry.w;
|
||||
ch = output->crtc->geometry.h;
|
||||
|
||||
if ((cw == 0) || (ch == 0))
|
||||
{
|
||||
cw = 640;
|
||||
ch = 480;
|
||||
}
|
||||
if ((cw == 0) || (ch == 0))
|
||||
e_smart_monitor_current_geometry_get(mon, NULL, NULL,
|
||||
&cw, &ch);
|
||||
|
||||
/* set geometry so that when we "unclone" this
|
||||
/* set geometry so that when we "unclone" this
|
||||
* one, it will unclone to the right */
|
||||
if ((pmon) && (crtc)) cx += crtc->geometry.w;
|
||||
if (pmon)
|
||||
{
|
||||
E_Randr_Output_Info *poutput;
|
||||
|
||||
/* get the output from this previous monitor */
|
||||
if ((poutput = e_smart_monitor_output_get(pmon)))
|
||||
cx += poutput->crtc->geometry.w;
|
||||
}
|
||||
|
||||
/* resize this monitor to it's current size */
|
||||
e_layout_child_resize(mon, cw, ch);
|
||||
|
@ -400,7 +407,11 @@ e_smart_randr_monitors_create(Evas_Object *obj)
|
|||
e_layout_child_move(mon, cx, cy);
|
||||
|
||||
/* if we are cloned, then tell randr */
|
||||
if (pmon) e_smart_monitor_clone_add(pmon, mon);
|
||||
if (pmon)
|
||||
{
|
||||
e_smart_monitor_cloned_set(mon, EINA_TRUE);
|
||||
e_smart_monitor_clone_add(pmon, mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue