{
Ecore_X_Window root = 0;
Ecore_X_Randr_Crtc *crtcs = NULL;
+ Ecore_X_Randr_Output primary = 0;
int ncrtcs = 0, i = 0;
/* create new randr cfg */
/* grab the root window once */
root = ecore_x_window_root_first_get();
+ /* get which output is primary */
+ primary = ecore_x_randr_primary_output_get(root);
+
/* record the current screen size in our config */
ecore_x_randr_screen_current_size_get(root, &e_randr_cfg->screen.width,
&e_randr_cfg->screen.height,
/* assign crtc for this output */
output_cfg->crtc = crtcs[i];
output_cfg->exists = EINA_TRUE;
+ if (outputs[j] == primary)
+ output_cfg->primary = EINA_TRUE;
+
+ if (!primary)
+ {
+ /* X has no primary output set */
+ if (j == 0)
+ {
+ /* if no primary is set, then we should
+ * use the first output listed by xrandr */
+ output_cfg->primary = EINA_TRUE;
+ primary = outputs[j];
+
+ ecore_x_randr_primary_output_set(root,
+ primary);
+ }
+ }
/* add this output to the list for this crtc */
crtc_cfg->outputs =
crtc_cfg->y,
crtc_cfg->mode,
crtc_cfg->orient);
+
+ EINA_LIST_FOREACH(valid_outputs, o, out)
+ if (out->primary)
+ {
+ ecore_x_randr_primary_output_set(root, out->xid);
+ break;
+ }
+
free(couts);
}
}
E_Smart_Data *sd;
Ecore_X_Randr_Mode_Info *mode;
Ecore_X_Window root = 0;
+ Ecore_X_Randr_Output primary = 0;
char *name = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* get the root window */
root = ecore_x_window_root_first_get();
+ /* get the primary output */
+ primary = ecore_x_randr_primary_output_get(root);
+
/* get output name */
if (!(name = ecore_x_randr_output_name_get(root, sd->output, NULL)))
{
}
}
+ /* set if it's primary */
+ if (output == primary)
+ edje_object_signal_emit(sd->o_frame, "e,state,primary,on", "e");
+ else
+ edje_object_signal_emit(sd->o_frame, "e,state,primary,off", "e");
+
/* set monitor name */
edje_object_part_text_set(sd->o_frame, "e.text.name", name);