Revert "e randr - x - only apply/modify randr if xurrent config not the same"

This reverts commit cf0a43b844.

This seems to cause some issues on restore at startup.
devs/bu5hm4n/recognition
Carsten Haitzler 2 years ago
parent b519c44c67
commit 18c522fb24
  1. 2
      src/bin/e_comp.h
  2. 91
      src/bin/e_comp_x_randr.c
  3. 2
      src/bin/e_comp_x_randr.h
  4. 10
      src/bin/e_randr2.c
  5. 2
      src/modules/wl_drm/e_mod_main.c

@ -68,7 +68,7 @@ typedef struct E_Comp_Screen_Iface
/* gather screen info */
E_Randr2 *(*create)(void);
/* apply current config */
void (*apply)(Eina_Bool can_skip);
void (*apply)(void);
/* set dpms (on, standby, suspend, off) */
void (*dpms)(int);
/* is key event eaten */

@ -478,7 +478,7 @@ e_comp_x_randr_shutdown(void)
}
E_API void
e_comp_x_randr_config_apply(Eina_Bool can_skip)
e_comp_x_randr_config_apply(void)
{
Eina_List *l;
E_Randr2_Screen *s;
@ -580,13 +580,11 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
{
Ecore_X_Rectangle *scrs = alloca(crtcs_num * sizeof(Ecore_X_Rectangle));
int scrs_num;
Eina_Bool do_it;
scrs_num = 0;
// set up a crtc to drive each output (or not)
for (i = 0; i < crtcs_num; i++)
{
do_it = EINA_FALSE;
// XXX: find clones and set them as outputs in an array
if (outconf[i])
{
@ -610,6 +608,12 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
screenconf[i]->config.geom.w,
screenconf[i]->config.geom.h,
orient, mode, outconf[i]);
if (!ecore_x_randr_crtc_settings_set
(root, crtcs[i], &(outconf[i]), 1,
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
mode, orient))
printf("RRR: failed to set crtc!!!!!!\n");
if (E_INSIDE(px, py,
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
@ -620,54 +624,12 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
(screenconf[i]->config.geom.w / 2);
py = screenconf[i]->config.geom.y +
(screenconf[i]->config.geom.h / 2);
if (!can_skip) do_it = EINA_TRUE;
else
{
Ecore_X_Randr_Crtc_Info *inf;
inf = ecore_x_randr_crtc_info_get(root, crtcs[i]);
if (inf)
{
// current setup differs
if ((inf->noutput == 0) ||
(inf->mode != mode) ||
(inf->x != screenconf[i]->config.geom.x) ||
(inf->y != screenconf[i]->config.geom.y) ||
(inf->width != (unsigned int)screenconf[i]->config.geom.w) ||
(inf->height != (unsigned int)screenconf[i]->config.geom.h) ||
(inf->rotation != orient))
{
if (inf->noutput != 1)
do_it = EINA_TRUE;
else
{
if (inf->outputs[0] != outconf[0])
do_it = EINA_TRUE;
}
}
ecore_x_randr_crtc_info_free(inf);
}
else do_it = EINA_TRUE;
}
if (do_it)
{
printf("RRR: crtc configure: %i ...\n", i);
if (!ecore_x_randr_crtc_settings_set
(root, crtcs[i], &(outconf[i]), 1,
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
mode, orient))
printf("RRR: failed to set crtc!!!!!!\n");
ecore_x_randr_crtc_panning_area_set
(root, crtcs[i],
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
screenconf[i]->config.geom.w,
screenconf[i]->config.geom.h);
}
else
printf("RRR: (SKIP) crtc configure: %i\n", i);
ecore_x_randr_crtc_panning_area_set
(root, crtcs[i],
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
screenconf[i]->config.geom.w,
screenconf[i]->config.geom.h);
if (screenconf[i]->config.priority == top_priority)
{
ecore_x_randr_primary_output_set(root, outconf[i]);
@ -681,29 +643,10 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
}
else
{
if (!can_skip) do_it = EINA_TRUE;
else
{
Ecore_X_Randr_Crtc_Info *inf;
inf = ecore_x_randr_crtc_info_get(root, crtcs[i]);
if (inf)
{
// it's somehow on - we need to turn it off
if (inf->noutput != 0) do_it = EINA_TRUE;
ecore_x_randr_crtc_info_free(inf);
}
// else -> already nort enabled
}
if (do_it)
{
printf("RRR: crtc off: %i\n", i);
ecore_x_randr_crtc_settings_set
(root, crtcs[i], NULL, 0, 0, 0, 0,
ECORE_X_RANDR_ORIENTATION_ROT_0);
}
else
printf("RRR: (SKIP) crtc off: %i\n", i);
printf("RRR: crtc off: %i\n", i);
ecore_x_randr_crtc_settings_set
(root, crtcs[i], NULL, 0, 0, 0, 0,
ECORE_X_RANDR_ORIENTATION_ROT_0);
}
}
ecore_x_root_screen_barriers_set(scrs, scrs_num);

@ -3,7 +3,7 @@
E_API void e_comp_x_randr_init(void);
E_API void e_comp_x_randr_shutdown(void);
E_API void e_comp_x_randr_config_apply(Eina_Bool can_ckip);
E_API void e_comp_x_randr_config_apply(void);
E_API Eina_Bool e_comp_x_randr_available(void);
E_API E_Randr2 *e_comp_x_randr_create(void);

@ -9,7 +9,7 @@ static void _cb_delay_init_save(void *data);
static Eina_Bool _cb_delay_timer(void *data);
static Eina_Bool _cb_fade_animator(void *data);
static void _animated_apply(void);
static void _do_apply(Eina_Bool at_init);
static void _do_apply(void);
static void _info_free(E_Randr2 *r);
static E_Config_Randr2 *_config_load(void);
static void _config_free(E_Config_Randr2 *cfg);
@ -107,7 +107,7 @@ e_randr2_init(void)
if (_config_update(e_randr2, e_randr2_cfg, 1))
e_randr2_config_save();
}
_do_apply(EINA_TRUE);
_do_apply();
}
else
{
@ -226,7 +226,7 @@ _cb_fade_animator(void *data EINA_UNUSED)
if (_target_to == 255)
{
_apply_delay = ecore_timer_loop_add(1.0, _cb_delay_timer, NULL);
_do_apply(EINA_FALSE);
_do_apply();
}
else
{
@ -263,7 +263,7 @@ _animated_apply(void)
}
static void
_do_apply(Eina_Bool at_init)
_do_apply(void)
{
// take current screen config and apply it to the driver
printf("RRR: re-get info before applying..\n");
@ -277,7 +277,7 @@ _do_apply(Eina_Bool at_init)
printf("RRR: eval config...\n");
_screen_config_eval();
printf("RRR: really apply config...\n");
e_comp->screen->apply(at_init);
e_comp->screen->apply();
printf("RRR: done config...\n");
}

@ -574,7 +574,7 @@ _drm2_rotation_exists(Ecore_Drm2_Output *output, int rot)
}
static void
_drm2_randr_apply(Eina_Bool can_skip EINA_UNUSED)
_drm2_randr_apply(void)
{
Ecore_Drm2_Device *dev;
Ecore_Drm2_Output **outconf, *out;

Loading…
Cancel
Save