forked from enlightenment/enlightenment
parent
3f1cb52ea4
commit
6cf3ad2b92
|
@ -384,14 +384,14 @@ _output_change_event_cb(void *data __UNUSED__, int type, void *ev)
|
|||
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((output_info = _12_screen_info_output_info_get(oce->output)), ECORE_CALLBACK_RENEW);
|
||||
|
||||
fprintf(stderr, "E_RANDR: Output event: \n"
|
||||
DBG("E_RANDR: Output event: \n"
|
||||
"\t\t: relative to win: %d\n"
|
||||
"\t\t: output (xid): %d\n"
|
||||
"\t\t: used by crtc (xid): %d\n"
|
||||
"\t\t: mode: %d\n"
|
||||
"\t\t: orientation: %d\n"
|
||||
"\t\t: connection state: %s\n"
|
||||
"\t\t: subpixel_order: %d\n",
|
||||
"\t\t: subpixel_order: %d",
|
||||
oce->win,
|
||||
oce->output,
|
||||
oce->crtc,
|
||||
|
@ -441,13 +441,13 @@ _output_change_event_cb(void *data __UNUSED__, int type, void *ev)
|
|||
{
|
||||
//New device connected!
|
||||
output_info->monitor = _monitor_info_new(output_info);
|
||||
fprintf(stderr, "E_RANDR: Output %d was newly connected.\n", output_info->xid);
|
||||
INF("E_RANDR: Output %d was newly connected.", output_info->xid);
|
||||
|
||||
//only try to enable the monitor if there is no serialized setup
|
||||
if(!_12_try_restore_configuration())
|
||||
{
|
||||
policy_success = e_randr_12_try_enable_output(output_info, output_info->policy, EINA_FALSE); //maybe give a success message?
|
||||
fprintf(stderr, "E_RANDR: Policy \"%s\" was enforced %ssuccesfully.\n", _POLICIES_STRINGS[output_info->policy - 1], (policy_success ? "" : "un"));
|
||||
INF("E_RANDR: Policy \"%s\" was enforced %ssuccesfully.", _POLICIES_STRINGS[output_info->policy - 1], (policy_success ? "" : "un"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -493,7 +493,7 @@ _crtc_change_event_cb(void *data __UNUSED__, int type, void *ev)
|
|||
int width;
|
||||
int height;
|
||||
*/
|
||||
fprintf(stderr, "E_RANDR: CRTC event: \n"
|
||||
DBG("E_RANDR: CRTC event: \n"
|
||||
"\t\t: relative to win: %d\n"
|
||||
"\t\t: crtc (xid): %d\n"
|
||||
"\t\t: mode (xid): %d\n"
|
||||
|
@ -501,7 +501,7 @@ _crtc_change_event_cb(void *data __UNUSED__, int type, void *ev)
|
|||
"\t\t: x: %d\n"
|
||||
"\t\t: y: %d\n"
|
||||
"\t\t: width: %d\n"
|
||||
"\t\t: height: %d\n",
|
||||
"\t\t: height: %d",
|
||||
cce->win,
|
||||
cce->crtc,
|
||||
cce->mode,
|
||||
|
@ -699,7 +699,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
if ((mode_info = eina_list_nth(common_modes, 0)))
|
||||
{
|
||||
eina_list_free(common_modes);
|
||||
fprintf(stderr, "Will try to set mode: %dx%d for primary and clone.\n", mode_info->width, mode_info->height);
|
||||
INF("Will try to set mode: %dx%d for primary and clone.", mode_info->width, mode_info->height);
|
||||
ret &= ecore_x_randr_crtc_mode_set(e_randr_screen_info.root, primary_output->crtc->xid, ((Ecore_X_Randr_Output *)Ecore_X_Randr_Unset), Ecore_X_Randr_Unset, mode_info->xid);
|
||||
ret &= ecore_x_randr_crtc_mode_set(e_randr_screen_info.root, usable_crtc->xid, &output_info->xid, 1, mode_info->xid);
|
||||
ret &= ecore_x_randr_crtc_pos_relative_set(e_randr_screen_info.root, usable_crtc->xid, primary_output->crtc->xid, ECORE_X_RANDR_OUTPUT_POLICY_CLONE, e_randr_screen_info.rrvd_info.randr_info_12->alignment);
|
||||
|
@ -710,7 +710,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
}
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "E_RANDR: Failed to clone, because of missing or disabled primary output!\n");
|
||||
ERR("E_RANDR: Failed to clone, because of missing or disabled primary output!");
|
||||
/*
|
||||
* 4. FAIL
|
||||
*/
|
||||
|
@ -720,7 +720,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
//enable and position according to used policies
|
||||
if (!(mode_info = ((Ecore_X_Randr_Mode_Info *)eina_list_data_get(output_info->monitor->preferred_modes))))
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: Could not enable output(%d), as it has no preferred modes (and there for none at all)!\n", output_info->xid);
|
||||
ERR("E_RANDR: Could not enable output(%d), as it has no preferred modes (and there for none at all)!", output_info->xid);
|
||||
ret = EINA_FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
//only output attached, work done.
|
||||
if (!(crtc_rel = _crtc_according_to_policy_get(usable_crtc, policy)))
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: CRTC %d enabled. No other CRTC had to be moved.\n", usable_crtc->xid);
|
||||
INF("E_RANDR: CRTC %d enabled. No other CRTC had to be moved.", usable_crtc->xid);
|
||||
ret &= ecore_x_randr_crtc_mode_set(e_randr_screen_info.root, usable_crtc->xid, &output_info->xid, 1, mode_info->xid);
|
||||
return ret;
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
usable_crtc->geometry.h = mode_info->height;
|
||||
//WORKAROUND END
|
||||
|
||||
fprintf(stderr, "E_RANDR: Moved CRTC %d has geometry (x,y,wxh): %d, %d, %dx%d.\n", usable_crtc->xid, usable_crtc->geometry.x, usable_crtc->geometry.y, usable_crtc->geometry.w, usable_crtc->geometry.h);
|
||||
INF("E_RANDR: Moved CRTC %d has geometry (x,y,wxh): %d, %d, %dx%d.", usable_crtc->xid, usable_crtc->geometry.x, usable_crtc->geometry.y, usable_crtc->geometry.w, usable_crtc->geometry.h);
|
||||
//following is policy dependend.
|
||||
switch (policy)
|
||||
{
|
||||
|
@ -783,7 +783,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
1,
|
||||
dx,
|
||||
dy);
|
||||
fprintf(stderr, "E_RANDR: Moving all CRTCs but %d, by %dx%d delta.\n", usable_crtc->xid, dx, dy);
|
||||
INF("E_RANDR: Moving all CRTCs but %d, by %dx%d delta.", usable_crtc->xid, dx, dy);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -798,7 +798,7 @@ e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Out
|
|||
1,
|
||||
dx,
|
||||
dy);
|
||||
fprintf(stderr, "E_RANDR: Moving all CRTCs but %d, by %dx%d delta.\n", usable_crtc->xid, dx, dy);
|
||||
INF("E_RANDR: Moving all CRTCs but %d, by %dx%d delta.", usable_crtc->xid, dx, dy);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ _crtc_outputs_refs_set(E_Randr_Crtc_Info *crtc_info)
|
|||
output_info = _12_screen_info_output_info_get(outputs[noutputs]);
|
||||
if (!output_info)
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: Could not find output struct for output %d.\n", outputs[noutputs]);
|
||||
ERR("E_RANDR: Could not find output struct for output %d.", outputs[noutputs]);
|
||||
continue;
|
||||
}
|
||||
crtc_info->outputs = eina_list_append(crtc_info->outputs, output_info);
|
||||
|
@ -57,7 +57,7 @@ _crtc_refs_set(E_Randr_Crtc_Info *crtc_info)
|
|||
output_info = _12_screen_info_output_info_get(poutputs[npoutputs]);
|
||||
if (!output_info)
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: Could not find output struct for output %d.\n", poutputs[npoutputs]);
|
||||
ERR("E_RANDR: Could not find output struct for output %d.", poutputs[npoutputs]);
|
||||
continue;
|
||||
}
|
||||
crtc_info->possible_outputs = eina_list_append(crtc_info->possible_outputs, output_info);
|
||||
|
|
|
@ -230,7 +230,7 @@ _serialized_crtc_new(E_Randr_Crtc_Info *crtc_info)
|
|||
if (!(so = _serialized_output_new(output_info)))
|
||||
continue;
|
||||
sc->outputs = eina_list_append(sc->outputs, so);
|
||||
fprintf(stderr, "E_RANDR:\t Serialized output %s.\n", so->name);
|
||||
INF("E_RANDR:\t Serialized output %s.", so->name);
|
||||
}
|
||||
sc->pos.x = crtc_info->geometry.x;
|
||||
sc->pos.y = crtc_info->geometry.y;
|
||||
|
@ -266,7 +266,7 @@ _12_serialized_setup_new(void)
|
|||
if (!sc)
|
||||
continue;
|
||||
ss->crtcs = eina_list_append(ss->crtcs, sc);
|
||||
fprintf(stderr, "E_RANDR: Serialized CRTC %d (index %d) in mode %s.\n", ci->xid, sc->index, (sc->mode_info ? sc->mode_info->name : "(disabled)"));
|
||||
INF("E_RANDR: Serialized CRTC %d (index %d) in mode %s.", ci->xid, sc->index, (sc->mode_info ? sc->mode_info->name : "(disabled)"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -352,7 +352,7 @@ _12_serialized_setup_update(Eina_List *setups_12)
|
|||
*/
|
||||
if ((ss_12 = _matching_serialized_setup_get(setups_12)))
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: Found stored configuration that matches current setup. It was created at %f. Freeing it...\n", ss_12->timestamp);
|
||||
INF("E_RANDR: Found stored configuration that matches current setup. It was created at %f. Freeing it...", ss_12->timestamp);
|
||||
_12_serialized_setup_free(ss_12);
|
||||
setups_12 = eina_list_remove(setups_12, ss_12);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ _12_policies_restore(void)
|
|||
if (!strncmp(sop->name, output->name, output->name_length))
|
||||
{
|
||||
output->policy = sop->policy;
|
||||
fprintf(stderr, "E_RANDR: Policy \"%s\" for output \"%s\" restored.\n", _POLICIES_STRINGS[sop->policy - 1], output->name);
|
||||
INF("E_RANDR: Policy \"%s\" for output \"%s\" restored.", _POLICIES_STRINGS[sop->policy - 1], output->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -407,26 +407,26 @@ _12_try_restore_configuration(void)
|
|||
if (!(ss_12 = _matching_serialized_setup_get(e_config->randr_serialized_setup->serialized_setups_12)))
|
||||
return EINA_FALSE;
|
||||
|
||||
fprintf(stderr, "E_RANDR: Found matching serialized setup.\n");
|
||||
INF("E_RANDR: Found matching serialized setup.");
|
||||
EINA_LIST_FOREACH(ss_12->crtcs, iter, sc)
|
||||
{
|
||||
ci = _find_matching_crtc(sc);
|
||||
if (!ci)
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: Cannot find a matching CRTC for serialized CRTC index %d.\n", sc->index);
|
||||
ERR("E_RANDR: Cannot find a matching CRTC for serialized CRTC index %d.", sc->index);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
outputs_list = _find_matching_outputs(sc->outputs);
|
||||
outputs_array = _outputs_to_array(outputs_list);
|
||||
fprintf(stderr, "E_RANDR: \tSerialized mode ");
|
||||
|
||||
if (!sc->mode_info)
|
||||
{
|
||||
fprintf(stderr, "was disabled.\n");
|
||||
INF("E_RANDR: \tSerialized mode was disabled.");
|
||||
mode = Ecore_X_Randr_None;
|
||||
}
|
||||
else if ((mi = _find_matching_mode_info(sc->mode_info)))
|
||||
{
|
||||
fprintf(stderr, "is now known under the name %s.\n", mi->name);
|
||||
INF("E_RANDR: \tSerialized mode is now known under the name %s.", mi->name);
|
||||
mode = mi->xid;
|
||||
}
|
||||
else
|
||||
|
@ -445,15 +445,14 @@ _12_try_restore_configuration(void)
|
|||
}
|
||||
EINA_LIST_FOREACH(outputs_list, outputs_iter, output_info)
|
||||
ecore_x_randr_output_mode_add(output_info->xid, mode);
|
||||
fprintf(stderr, "was now added to the server manually using the name %s.\n", mi->name);
|
||||
INF("E_RANDR: \tSerialized mode was added to the server manually using the name %s.", mi->name);
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
fprintf(stderr, "E_RANDR: \tRestoring CRTC %d (index %d) in mode %s.\n", ci->xid, sc->index, (mode == Ecore_X_Randr_None) ? "(disabled)" : mi->name);
|
||||
fprintf(stderr, "E_RANDR: \t\tUsed outputs:");
|
||||
DBG("E_RANDR: \tRestoring CRTC %d (index %d) in mode %s.", ci->xid, sc->index, (mode == Ecore_X_Randr_None) ? "(disabled)" : mi->name);
|
||||
DBG("E_RANDR: \t\tUsed outputs:");
|
||||
EINA_LIST_FOREACH(outputs_list, outputs_iter, output_info)
|
||||
fprintf(stderr, " %s", output_info->name);
|
||||
fprintf(stderr, ".\n");
|
||||
DBG("\t\t%s", output_info->name);
|
||||
// DEBUG END
|
||||
|
||||
ret &= ecore_x_randr_crtc_settings_set(e_randr_screen_info.root, ci->xid, outputs_array, eina_list_count(outputs_list), sc->pos.x, sc->pos.y, mode, sc->orientation);
|
||||
|
@ -511,7 +510,7 @@ _find_matching_crtc(E_Randr_Serialized_Crtc *sc)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(sc, NULL);
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(E_RANDR_12_NO, NULL);
|
||||
|
||||
fprintf(stderr, "E_RANDR: Setup restore.. Runtime system knows about %d CRTCs. Requested CRTC has index %d\n", eina_list_count(e_randr_screen_info.rrvd_info.randr_info_12->crtcs), sc->index);
|
||||
INF("E_RANDR: Setup restore.. Runtime system knows about %d CRTCs. Requested CRTC has index %d", eina_list_count(e_randr_screen_info.rrvd_info.randr_info_12->crtcs), sc->index);
|
||||
return eina_list_nth(e_randr_screen_info.rrvd_info.randr_info_12->crtcs, sc->index);
|
||||
}
|
||||
|
||||
|
@ -531,10 +530,10 @@ _find_matching_outputs(Eina_List *sois)
|
|||
|
||||
EINA_LIST_FOREACH(sois, s_output_iter, so)
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: \tLooking for serialized output \"%s\"\n", so->name);
|
||||
INF("E_RANDR: \tLooking for serialized output \"%s\"", so->name);
|
||||
EINA_LIST_FOREACH(e_randr_screen_info.rrvd_info.randr_info_12->outputs, r_output_iter, oi)
|
||||
{
|
||||
fprintf(stderr, "E_RANDR: \t\tComparing to output \"%s\"\n", oi->name);
|
||||
INF("E_RANDR: \t\tComparing to output \"%s\"", oi->name);
|
||||
if (!strncmp(so->name, oi->name, oi->name_length))
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue