static void
_ecore_evas_x_protocols_set(Ecore_Evas *ee)
{
- Ecore_X_Atom protos[10];
+ Ecore_X_Atom protos[3];
unsigned int num = 0, tmp = 0;
if (ee->func.fn_delete_request)
- protos[num++] = ECORE_X_ATOM_WM_DELETE_WINDOW;
+ protos[num++] = ECORE_X_ATOM_WM_DELETE_WINDOW;
protos[num++] = ECORE_X_ATOM_NET_WM_PING;
protos[num++] = ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
ecore_x_icccm_protocol_atoms_set(ee->prop.window, protos, num);
if (!ee->engine.x.netwm_sync_counter)
- ee->engine.x.netwm_sync_counter = ecore_x_sync_counter_new(0);
+ ee->engine.x.netwm_sync_counter = ecore_x_sync_counter_new(0);
tmp = ee->engine.x.netwm_sync_counter;
ecore_x_window_prop_card32_set(ee->prop.window,
static void
_ecore_evas_x_sync_set(Ecore_Evas *ee)
{
+ Ecore_X_Sync_Counter sync_counter = ee->engine.x.sync_counter;
+
if (((ee->should_be_visible) || (ee->visible)) &&
((ecore_x_e_comp_sync_supported_get(ee->engine.x.win_root)) &&
(!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)))
else
{
if (ee->engine.x.sync_counter)
- ecore_x_sync_counter_free(ee->engine.x.sync_counter);
+ {
+ ecore_x_sync_counter_free(ee->engine.x.sync_counter);
+ ee->engine.x.sync_val = 0;
+ }
ee->engine.x.sync_counter = 0;
}
- ecore_x_e_comp_sync_counter_set(ee->prop.window, ee->engine.x.sync_counter);
+ if (sync_counter != ee->engine.x.sync_counter)
+ ecore_x_e_comp_sync_counter_set(ee->prop.window, ee->engine.x.sync_counter);
}
static void
{
if (!ee->engine.x.sync_counter) return;
ecore_x_sync_counter_free(ee->engine.x.sync_counter);
+ ee->engine.x.sync_val = 0;
ee->engine.x.sync_counter = 0;
}
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (ee->engine.x.direct_resize) return ECORE_CALLBACK_PASS_ON;
+ ee->engine.x.configure_coming = 0;
if ((e->from_wm) || (ee->prop.override))
{
if ((ee->x != e->x) || (ee->y != e->y))
ee = ecore_event_window_match(e->win);
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ /* some GL drivers are doing buffer copy in a separate thread.
+ * we need to check whether GL driver sends SYNC_DRAW_DONE msg afger copying
+ * that are required in order to exactly render. - added by gl77.lee
+ */
+ if (ee->gl_sync_draw_done < 0)
+ {
+ if (getenv("ECORE_EVAS_GL_SYNC_DRAW_DONE"))
+ ee->gl_sync_draw_done = atoi(getenv("ECORE_EVAS_GL_SYNC_DRAW_DONE"));
+ else
+ ee->gl_sync_draw_done = 0;
+ }
if (first_map_bug < 0)
{
char *bug = NULL;
}
if ((first_map_bug) && (!strcmp(ee->driver, "opengl_x11")))
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- if (ee->visible) return ECORE_CALLBACK_DONE;
+ if (ee->visible) return ECORE_CALLBACK_PASS_ON;
+// if (ee->visible) return ECORE_CALLBACK_DONE;
// printf("SHOW EVENT %p\n", ee);
ee->visible = 1;
if (ee->func.fn_show) ee->func.fn_show(ee);
ee = ecore_event_window_match(e->win);
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- if (!ee->visible) return ECORE_CALLBACK_DONE;
+ if (!ee->visible) return ECORE_CALLBACK_PASS_ON;
+// if (!ee->visible) return ECORE_CALLBACK_DONE;
// printf("HIDE EVENT %p\n", ee);
ee->visible = 0;
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
else
{
- if ((ee->x != x) || (ee->y != y))
+ if (((ee->x != x) || (ee->y != y)) ||
+ (ee->engine.x.configure_coming))
{
+ ee->engine.x.configure_coming = 1;
if (!ee->engine.x.managed)
{
ee->x = x;
if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
}
- else if ((ee->w != w) || (ee->h != h))
- ecore_x_window_resize(ee->prop.window, w, h);
+ else if (((ee->w != w) || (ee->h != h)) ||
+ (ee->engine.x.configure_coming))
+ {
+ ee->engine.x.configure_coming = 1;
+ ecore_x_window_resize(ee->prop.window, w, h);
+ }
}
static void
}
}
}
- else
+ else if (((ee->w != w) || (ee->h != h) || (ee->x != x) || (ee->y != y)) ||
+ (ee->engine.x.configure_coming))
{
+ ee->engine.x.configure_coming = 1;
ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!ee->engine.x.managed)
{
if (!resize)
{
+ ee->engine.x.configure_coming = 1;
if (!ee->prop.fullscreen)
{
ecore_x_window_resize(ee->prop.window, ee->req.h, ee->req.w);
}
}
+#define _USE_WIN_ROT_EFFECT 1
+
+#if _USE_WIN_ROT_EFFECT
+static void _ecore_evas_x_flush_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__);
+
+typedef struct _Ecore_Evas_X_Rotation_Effect Ecore_Evas_X_Rotation_Effect;
+struct _Ecore_Evas_X_Rotation_Effect
+{
+ Eina_Bool wait_for_comp_reply;
+};
+
+static Ecore_Evas_X_Rotation_Effect _rot_effect =
+{
+ EINA_FALSE
+};
+
+static void
+_ecore_evas_x_rotation_effect_setup(void)
+{
+ _rot_effect.wait_for_comp_reply = EINA_TRUE;
+}
+#endif /* end of _USE_WIN_ROT_EFFECT */
+
static void
_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
if (ee->rotation == rotation) return;
+ if (!strcmp(ee->driver, "xrender_x11")) return;
+
+#if _USE_WIN_ROT_EFFECT
+ int angles[2];
+ angles[0] = rotation;
+ angles[1] = ee->rotation;
+#endif /* end of _USE_WIN_ROT_EFFECT */
+
if (!strcmp(ee->driver, "opengl_x11"))
{
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
(Evas_Engine_Info *)einfo);
+# if _USE_WIN_ROT_EFFECT
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
+# else
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
+# endif
#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
}
else if (!strcmp(ee->driver, "software_x11"))
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
(Evas_Engine_Info *)einfo);
+# if _USE_WIN_ROT_EFFECT
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
+# else
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
+# endif
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
}
else if (!strcmp(ee->driver, "software_16_x11"))
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
(Evas_Engine_Info *)einfo);
+# if _USE_WIN_ROT_EFFECT
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
+# else
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
+# endif
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
}
else if (!strcmp(ee->driver, "software_8_x11"))
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
(Evas_Engine_Info *)einfo);
+# if _USE_WIN_ROT_EFFECT
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
+# else
+ ecore_x_window_prop_property_set(ee->prop.window,
+ ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+ ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
+# endif
#endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
}
+
+#if _USE_WIN_ROT_EFFECT
+ if ((ee->visible) &&
+ ((ecore_x_e_comp_sync_supported_get(ee->engine.x.win_root)) &&
+ (!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)) &&
+ (ee->engine.x.sync_counter) &&
+ (ee->engine.x.sync_val > 0))
+ {
+ _ecore_evas_x_rotation_effect_setup();
+ _ecore_evas_x_flush_pre(ee, NULL, NULL);
+ }
+#endif /* end of _USE_WIN_ROT_EFFECT */
}
static void
_ecore_evas_x_override_set(Ecore_Evas *ee, int on)
{
if (ee->prop.override == on) return;
- ecore_x_window_hide(ee->prop.window);
+ if (ee->should_be_visible) ecore_x_window_hide(ee->prop.window);
ecore_x_window_override_set(ee->prop.window, on);
- if (ee->visible) ecore_x_window_show(ee->prop.window);
+ if (ee->should_be_visible) ecore_x_window_show(ee->prop.window);
if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
ee->prop.override = on;
}
{
Ecore_Evas *ee = data;
- if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync))
+ if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
+ (!ee->gl_sync_draw_done)) // added by gl77.lee
{
if (ee->engine.x.sync_counter)
{
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
+ ee->gl_sync_draw_done = -1; // added by gl77.lee
+
_ecore_evas_x_init();
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
ee->driver = "opengl_x11";
- ee->semi_sync = 1; // gl engine doesn't need to sync - its whole swaps
+#if 1
+ ee->semi_sync = 0; // gl engine doesn't need to sync - its whole swaps
+#else
+ if (!getenv("ECORE_EVAS_COMP_NOSEMISYNC"))
+ ee->semi_sync = 1; // gl engine doesn't need to sync - its whole swaps
// ee->no_comp_sync = 1; // gl engine doesn't need to sync - its whole swaps
+#endif
if (disp_name) ee->name = strdup(disp_name);
if (w < 1) w = 1;