/** * Initialize Ecore_X with proper display */ void _eg_init() { Ecore_X_Window *roots; int screens, i; char *dispstr, *subdisp; char newdisp[255]; roots = ecore_x_window_root_list(&screens); dispstr = DisplayString(ecore_x_display_get()); subdisp = strdup(dispstr); for (i = 0; i < screens; i++) { dispstr = strchr(subdisp, ':'); if (dispstr) { dispstr = strchr(dispstr, '.'); if (NULL != dispstr) *dispstr = '\0'; } snprintf(newdisp, sizeof(newdisp), "%s.%d", subdisp, i); ecore_x_init(newdisp); } }