ecore-evas x - solve internal window size flickrs in e

so there is an issue that e brings out where configure events get
queued and deferred AND e ends up requesting a new size, but new size
is wrong as its read from an old event (requested size is updated) and
in the end ecore-evas doesnt request the actual new size because
current w/h is "the same" even though it isn't... bah - it's complex
and a self-feeding event issue. just doing the move/resize solves it.

@fix
This commit is contained in:
Carsten Haitzler 2015-10-09 12:52:41 +09:00
parent 210c6b9b7c
commit 6a90df70bf
1 changed files with 31 additions and 11 deletions

View File

@ -83,6 +83,7 @@ struct _Ecore_Evas_Engine_Data_X11 {
Ecore_X_Sync_Counter sync_counter; Ecore_X_Sync_Counter sync_counter;
Ecore_X_Window leader; Ecore_X_Window leader;
Ecore_X_Sync_Counter netwm_sync_counter; Ecore_X_Sync_Counter netwm_sync_counter;
int configure_reqs;
int netwm_sync_val_hi; int netwm_sync_val_hi;
unsigned int netwm_sync_val_lo; unsigned int netwm_sync_val_lo;
int sync_val; // bigger! this will screw up at 2 billion fram~ int sync_val; // bigger! this will screw up at 2 billion fram~
@ -1577,6 +1578,8 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (edata->direct_resize) return ECORE_CALLBACK_PASS_ON; if (edata->direct_resize) return ECORE_CALLBACK_PASS_ON;
if (edata->configure_reqs > 0) edata->configure_reqs--;
edata->configure_coming = 0; edata->configure_coming = 0;
if ((e->from_wm) || (ee->prop.override)) if ((e->from_wm) || (ee->prop.override))
{ {
@ -1594,8 +1597,11 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
{ {
ee->w = e->w; ee->w = e->w;
ee->h = e->h; ee->h = e->h;
ee->req.w = ee->w; if (edata->configure_reqs == 0)
ee->req.h = ee->h; {
ee->req.w = ee->w;
ee->req.h = ee->h;
}
if (ECORE_EVAS_PORTRAIT(ee)) if (ECORE_EVAS_PORTRAIT(ee))
{ {
evas_output_size_set(ee->evas, ee->w, ee->h); evas_output_size_set(ee->evas, ee->w, ee->h);
@ -2038,6 +2044,7 @@ _ecore_evas_x_move(Ecore_Evas *ee, int x, int y)
{ {
ee->x = x; ee->x = x;
ee->y = y; ee->y = y;
edata->configure_reqs++;
ecore_x_window_move(ee->prop.window, x, y); ecore_x_window_move(ee->prop.window, x, y);
if (!ee->should_be_visible) if (!ee->should_be_visible)
{ {
@ -2060,6 +2067,7 @@ _ecore_evas_x_move(Ecore_Evas *ee, int x, int y)
ee->x = x; ee->x = x;
ee->y = y; ee->y = y;
} }
edata->configure_reqs++;
ecore_x_window_move(ee->prop.window, x, y); ecore_x_window_move(ee->prop.window, x, y);
} }
if (!ee->should_be_visible) if (!ee->should_be_visible)
@ -2118,6 +2126,7 @@ _ecore_evas_x_resize(Ecore_Evas *ee, int w, int h)
{ {
ee->w = w; ee->w = w;
ee->h = h; ee->h = h;
edata->configure_reqs++;
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h); if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h);
if (ECORE_EVAS_PORTRAIT(ee)) if (ECORE_EVAS_PORTRAIT(ee))
{ {
@ -2142,10 +2151,10 @@ _ecore_evas_x_resize(Ecore_Evas *ee, int w, int h)
if (ee->func.fn_resize) ee->func.fn_resize(ee); if (ee->func.fn_resize) ee->func.fn_resize(ee);
} }
} }
else if (((ee->w != w) || (ee->h != h)) || else
(edata->configure_coming))
{ {
edata->configure_coming = 1; edata->configure_coming = 1;
edata->configure_reqs++;
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h); if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h);
} }
} }
@ -2159,6 +2168,7 @@ _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
ee->req.y = y; ee->req.y = y;
ee->req.w = w; ee->req.w = w;
ee->req.h = h; ee->req.h = h;
if (edata->direct_resize) if (edata->direct_resize)
{ {
if ((ee->w != w) || (ee->h != h) || (x != ee->x) || (y != ee->y)) if ((ee->w != w) || (ee->h != h) || (x != ee->x) || (y != ee->y))
@ -2170,6 +2180,7 @@ _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
{ {
if ((x != ee->x) || (y != ee->y)) change_pos = 1; if ((x != ee->x) || (y != ee->y)) change_pos = 1;
} }
edata->configure_reqs++;
ecore_x_window_move_resize(ee->prop.window, x, y, w, h); ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!edata->managed) if (!edata->managed)
{ {
@ -2208,15 +2219,24 @@ _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
} }
} }
} }
else if (((ee->w != w) || (ee->h != h) || (ee->x != x) || (ee->y != y)) || else
(edata->configure_coming))
{ {
edata->configure_coming = 1; if ((ee->x != x) || (ee->y != y) || (edata->configure_coming))
ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!edata->managed)
{ {
ee->x = x; edata->configure_coming = 1;
ee->y = y; edata->configure_reqs++;
ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!edata->managed)
{
ee->x = x;
ee->y = y;
}
}
else
{
edata->configure_coming = 1;
edata->configure_reqs++;
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h);
} }
} }
} }