forked from enlightenment/enlightenment
randr: allocate hot-plugged outputs
This commit is contained in:
parent
11e21fd1ff
commit
5c6eed2307
|
@ -622,10 +622,26 @@ _e_randr_event_cb_output_change(void *data EINA_UNUSED, int type EINA_UNUSED, vo
|
||||||
output = _e_randr_output_find(ev->output);
|
output = _e_randr_output_find(ev->output);
|
||||||
if (!output)
|
if (!output)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "E_RANDR: Weird, a new output?\n");
|
E_Config_Randr_Output *output_cfg = NULL;
|
||||||
|
Ecore_X_Window root;
|
||||||
|
|
||||||
|
root = ecore_x_window_root_first_get();
|
||||||
|
|
||||||
|
output = E_NEW(E_Randr_Output, 1);
|
||||||
|
if (!output) goto error;
|
||||||
|
output_cfg = _e_randr_config_output_find(ev->output);
|
||||||
|
if (!output_cfg)
|
||||||
|
output_cfg = _e_randr_config_output_new(root, ev->output);
|
||||||
|
if (!output_cfg) goto error;
|
||||||
|
|
||||||
|
e_randr->outputs = eina_list_append(e_randr->outputs, output);
|
||||||
|
output->cfg = output_cfg;
|
||||||
|
|
||||||
|
output->name = ecore_x_randr_output_name_get(root, output->cfg->xid, NULL);
|
||||||
|
output->is_lid = _e_randr_is_lid(output);
|
||||||
|
changed = EINA_TRUE;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* we know this output */
|
/* we know this output */
|
||||||
if (output->is_lid && _e_randr_lid_is_closed)
|
if (output->is_lid && _e_randr_lid_is_closed)
|
||||||
{
|
{
|
||||||
|
@ -672,7 +688,6 @@ _e_randr_event_cb_output_change(void *data EINA_UNUSED, int type EINA_UNUSED, vo
|
||||||
changed = EINA_TRUE;
|
changed = EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* save the config if anything changed or we added a new one */
|
/* save the config if anything changed or we added a new one */
|
||||||
if (changed)
|
if (changed)
|
||||||
|
@ -684,6 +699,9 @@ _e_randr_event_cb_output_change(void *data EINA_UNUSED, int type EINA_UNUSED, vo
|
||||||
}
|
}
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
error:
|
||||||
|
free(output);
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
|
Loading…
Reference in New Issue