summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-15 14:56:42 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-15 14:56:42 +0100
commit0907aca8f1af7fc5dd184c4ceb856b8568bea1fa (patch)
tree3c915e13a144dc95546316259ebecb67f74739ae
parent70e60f98065165bcdb33e35ef297cb607150a3d4 (diff)
downloadenlightenment-0907aca8f1af7fc5dd184c4ceb856b8568bea1fa.tar.gz
mostly-working clients
-rw-r--r--src/bin/e_client.c43
-rw-r--r--src/bin/e_comp.c87
-rw-r--r--src/bin/e_comp.h1
-rw-r--r--src/bin/e_comp_canvas.c14
-rw-r--r--src/bin/e_comp_object.c158
-rw-r--r--src/bin/e_comp_object.h1
-rw-r--r--src/bin/e_comp_x.c27
-rw-r--r--src/bin/e_moveresize.c7
-rw-r--r--src/bin/e_pixmap.c22
-rw-r--r--src/bin/e_pixmap.h2
10 files changed, 220 insertions, 142 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 6e9c110979..9809385344 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -405,19 +405,6 @@ _e_client_free(E_Client *ec)
if (focusing == ec) focusing = NULL;
focus_next = eina_list_remove(focus_next, ec);
-#warning FIXME GRABS
- if ((focused == ec) ||
- (e_grabinput_last_focus_win_get() == e_client_util_pwin_get(ec)))
- {
- if ((!focus_next) && (!focusing))
- {
- e_grabinput_focus(ec->comp->ee_win,
- E_FOCUS_METHOD_PASSIVE);
- e_hints_active_window_set(ec->comp->man, NULL);
- }
-
- focused = NULL;
- }
if (ec->remember)
{
E_Remember *rem;
@@ -462,10 +449,6 @@ _e_client_free(E_Client *ec)
eina_stringshare_replace(&ec->netwm.icon_name, NULL);
eina_stringshare_replace(&ec->internal_icon, NULL);
eina_stringshare_replace(&ec->internal_icon_key, NULL);
- e_focus_setdown(ec);
-#warning BROKEN
- e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
- e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
focus_stack = eina_list_remove(focus_stack, ec);
raise_stack = eina_list_remove(raise_stack, ec);
@@ -482,7 +465,6 @@ _e_client_del(E_Client *ec)
_e_client_hook_call(E_CLIENT_HOOK_UNREDIRECT, ec);
- if (ec == focused) focused = NULL;
if (ec == focusing) focusing = NULL;
focus_next = eina_list_remove(focus_next, ec);
@@ -527,6 +509,24 @@ _e_client_del(E_Client *ec)
e_int_client_menu_del(ec);
E_FREE_FUNC(ec->raise_timer, ecore_timer_del);
+
+#warning FIXME GRABS
+ if ((focused == ec) ||
+ (e_grabinput_last_focus_win_get() == e_client_util_pwin_get(ec)))
+ {
+ if ((!focus_next) && (!focusing))
+ {
+ e_grabinput_focus(ec->comp->ee_win,
+ E_FOCUS_METHOD_PASSIVE);
+ e_hints_active_window_set(ec->comp->man, NULL);
+ }
+
+ focused = NULL;
+ }
+#warning BROKEN
+ e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
+ e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
+ e_focus_setdown(ec);
/* must be called before parent/child clear */
_e_client_hook_call(E_CLIENT_HOOK_DEL, ec);
@@ -1429,6 +1429,7 @@ _e_client_cb_evas_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
_e_client_event_simple(ec, E_EVENT_CLIENT_MOVE);
_e_client_zone_update(ec);
+ _e_client_hook_call(E_CLIENT_HOOK_MOVE_UPDATE, ec);
}
static void
@@ -2686,8 +2687,7 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
y = ec->moveinfo.down.y +
(ec->mouse.current.my - ec->moveinfo.down.my);
}
- new_x = x;
- new_y = y;
+ e_comp_object_frame_xy_adjust(ec->frame, x, y, &new_x, &new_y);
skiplist = eina_list_append(skiplist, ec);
e_resist_client_position(ec->comp, skiplist,
@@ -3212,7 +3212,7 @@ e_client_move(E_Client *ec, int x, int y)
{
if (ec->fullscreen) return;
- _e_client_move_resize_internal(ec, x, y, 1, 1, 0, 1, 0);
+ _e_client_move_resize_internal(ec, x, y, 1, 1, 1, 1, 0);
}
/**
@@ -4300,7 +4300,6 @@ e_client_act_resize_keyboard(E_Client *ec)
_e_client_action_init(ec);
_e_client_action_resize_timeout_add();
- _e_client_hook_call(E_CLIENT_HOOK_RESIZE_UPDATE, ec);
if (!action_handler_key)
action_handler_key = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_client_resize_key_down, NULL);
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index ea5270b4ab..e6e99f7081 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -87,55 +87,7 @@ _e_comp_fullscreen_check(E_Comp *c)
return NULL;
}
-static void
-_e_comp_client_update(E_Client *ec)
-{
- int pw, ph;
-
- DBG("UPDATE [%p] pm = %p", ec, ec->pixmap);
-
- e_pixmap_size_get(ec->pixmap, &pw, &ph);
- if (e_pixmap_dirty_get(ec->pixmap) && (!ec->comp->nocomp))
- {
- int w, h;
-
- if (e_pixmap_refresh(ec->pixmap) &&
- e_pixmap_size_get(ec->pixmap, &w, &h) &&
- e_pixmap_size_changed(ec->pixmap, pw, ph))
- {
- e_comp_object_native_surface_set(ec->frame, 0);
- e_pixmap_image_clear(ec->pixmap);
- e_comp_object_damage(ec->frame, 0, 0, w, h);
- e_comp_object_render_update_del(ec->frame); //clear update
- }
- else if (!e_pixmap_size_get(ec->pixmap, NULL, NULL))
- {
- e_comp_object_redirected_set(ec->frame, 0);
- e_comp_object_render_update_add(ec->frame);
- }
- }
- if (!e_pixmap_size_get(ec->pixmap, &pw, &ph)) return;
-
- if (ec->comp->gl && conf->texture_from_pixmap && (!ec->shaped))
- {
- e_comp_object_size_set(ec->frame, pw, ph);
- e_comp_object_native_surface_set(ec->frame, 1);
- e_comp_object_render(ec->frame);
- }
- else if (e_pixmap_size_get(ec->pixmap, NULL, NULL))
- {
- e_comp_object_native_surface_set(ec->frame, 0);
- if (e_comp_object_render(ec->frame))
- {
- if (ec->shaped || ec->shape_changed)
- e_comp_object_shape_apply(ec->frame);
- ec->shape_changed = 0;
- }
- }
- if (ec->visible)
- evas_object_show(ec->frame);
-}
static Eina_Bool
_e_comp_cb_delayed_update_timer(void *data)
@@ -262,6 +214,42 @@ _e_comp_cb_nocomp_begin_timeout(void *data)
return EINA_FALSE;
}
+
+static Eina_Bool
+_e_comp_client_update(E_Client *ec)
+{
+ int pw, ph;
+ Eina_Bool post = EINA_FALSE;
+
+ DBG("UPDATE [%p] pm = %p", ec, ec->pixmap);
+
+ e_pixmap_size_get(ec->pixmap, &pw, &ph);
+
+ if (e_pixmap_dirty_get(ec->pixmap) && (!ec->comp->nocomp))
+ {
+ int w, h;
+
+ if (e_pixmap_refresh(ec->pixmap) &&
+ e_pixmap_size_get(ec->pixmap, &w, &h) &&
+ e_pixmap_size_changed(ec->pixmap, pw, ph))
+ {
+ e_comp_object_native_surface_set(ec->frame, 0);
+ e_pixmap_image_clear(ec->pixmap, 0);
+ e_comp_object_size_set(ec->frame, w, h);
+ post = EINA_TRUE;
+ e_comp_object_render_update_del(ec->frame); //clear update
+ }
+ else if (!e_pixmap_size_get(ec->pixmap, NULL, NULL))
+ {
+ e_comp_object_redirected_set(ec->frame, 0);
+ e_comp_object_render_update_add(ec->frame);
+ }
+ }
+ if (e_pixmap_size_get(ec->pixmap, NULL, NULL))
+ e_comp_object_dirty(ec->frame);
+ return post;
+}
+
static Eina_Bool
_e_comp_cb_update(E_Comp *c)
{
@@ -300,7 +288,8 @@ NOT CURRENTLY IN USE
}
else
#endif
- _e_comp_client_update(ec);
+ if (_e_comp_client_update(ec))
+ c->post_updates = eina_list_append(c->post_updates, ec);
}
_e_comp_fps_update(c);
if (conf->fps_show)
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index 8b9e62dc4d..6aa8dca563 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -66,6 +66,7 @@ struct _E_Comp
Eina_List *ignore_wins;
Eina_List *updates;
+ Eina_List *post_updates;
Ecore_Animator *render_animator;
Ecore_Job *shape_job;
Ecore_Job *update_job;
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index b665d6efdb..30d053cd28 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -12,6 +12,18 @@ _e_comp_canvas_event_compositor_resize_free(void *data EINA_UNUSED, void *event)
///////////////////////////////////
static void
+_e_comp_canvas_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ E_Comp *c = data;
+ E_Client *ec;
+
+ EINA_LIST_FREE(c->post_updates, ec)
+ e_pixmap_image_clear(ec->pixmap, 1);
+}
+
+///////////////////////////////////
+
+static void
_e_comp_canvas_cb_mouse_in(E_Comp *c EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec;
@@ -77,6 +89,8 @@ e_comp_canvas_init(E_Comp *c)
// ecore_evas_manual_render_set(c->ee, conf->lock_fps);
ecore_evas_show(c->ee);
+ evas_event_callback_add(c->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, c);
+
c->ee_win = ecore_evas_window_get(c->ee);
e_drop_xdnd_register_set(c->ee_win, 1);
c->pointer = e_pointer_window_new(c->ee_win, 1);
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 7e2090f383..88bf145a2a 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -16,6 +16,10 @@
cw = NULL
#define INTERNAL_ENTRY E_Comp_Object *cw; cw = evas_object_smart_data_get(obj);
+#if 1
+# define e_util_size_debug_set(x, y)
+#endif
+
typedef struct _E_Comp_Object
{
EINA_INLIST;
@@ -65,7 +69,6 @@ typedef struct _E_Comp_Object
Eina_Bool animating : 1; // it's busy animating - defer hides/dels
Eina_Bool force : 1; // force del/hide even if animating
Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide
- Eina_Bool delete_me : 1; // delete me!
Eina_Bool visible : 1; // is visible
Eina_Bool override : 1; // is override-redirect
@@ -599,8 +602,6 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
}
/////////////////////////////////////////////
-/////////////////////////////////////////////
-
static void
_e_comp_object_done_defer(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
@@ -608,20 +609,17 @@ _e_comp_object_done_defer(void *data, Evas_Object *obj EINA_UNUSED, const char *
E_Comp_Object *cw = data;
if (cw->animating)
- cw->comp->animating--;
+ {
+ cw->comp->animating--;
+ e_object_unref(E_OBJECT(cw->ec));
+ }
cw->animating = 0;
cw->force = 1;
if (cw->defer_hide)
evas_object_hide(cw->smart_obj);
- else if (cw->show_ready && (!cw->delete_me))
+ else if (cw->show_ready)
evas_object_show(cw->smart_obj);
- if (cw->delete_me)
- {
-// if (cw->real_obj && cw->eobj)
-// e_object_unref(E_OBJECT(cw->eobj));
- evas_object_del(cw->smart_obj);
- }
- else cw->force = 0;
+ cw->force = 0;
}
/////////////////////////////////////////////
@@ -642,7 +640,7 @@ _e_comp_object_setup(E_Comp_Object *cw)
if (cw->ec->override)
{
- if (cw->shobj) evas_object_name_set(cw->shobj, "cw->shobj::WINDOW");
+ evas_object_name_set(cw->shobj, "cw->shobj::WINDOW");
evas_object_name_set(cw->effect_obj, "cw->effect_obj::WINDOW");
evas_object_name_set(cw->clip, "cw->clip::WINDOW");
}
@@ -655,6 +653,9 @@ _e_comp_object_setup(E_Comp_Object *cw)
}
if (!cw->ec->input_only)
{
+ e_util_size_debug_set(cw->clip, 1);
+ e_util_size_debug_set(cw->effect_obj, 1);
+ e_util_size_debug_set(cw->shobj, 1);
evas_object_event_callback_add(cw->smart_obj, EVAS_CALLBACK_MOUSE_IN, _e_comp_object_cb_mouse_in, cw);
evas_object_event_callback_add(cw->smart_obj, EVAS_CALLBACK_MOUSE_OUT, _e_comp_object_cb_mouse_out, cw);
evas_object_event_callback_add(cw->smart_obj, EVAS_CALLBACK_MOUSE_DOWN, _e_comp_object_cb_mouse_down, cw);
@@ -666,6 +667,41 @@ _e_comp_object_setup(E_Comp_Object *cw)
}
/////////////////////////////////////////////
+
+static void
+_e_comp_object_pixels_get(void *data, Evas_Object *obj EINA_UNUSED)
+{
+ E_Comp_Object *cw = data;
+ E_Client *ec = cw->ec;
+ int pw, ph;
+
+ if (!e_pixmap_size_get(ec->pixmap, &pw, &ph)) return;
+
+ if (ec->comp->gl && e_comp_config_get()->texture_from_pixmap && (!ec->shaped))
+ {
+ e_comp_object_size_set(ec->frame, pw, ph);
+ e_comp_object_native_surface_set(ec->frame, 1);
+ e_comp_object_render(ec->frame);
+ }
+ else
+ {
+ e_comp_object_native_surface_set(ec->frame, 0);
+ if (e_comp_object_render(ec->frame))
+ {
+ if (ec->shaped || ec->shape_changed)
+ e_comp_object_shape_apply(ec->frame);
+ ec->shape_changed = 0;
+ }
+ }
+ e_pixmap_size_get(ec->pixmap, &pw, &ph);
+ e_comp_object_frame_wh_adjust(cw->smart_obj, pw, ph, &pw, &ph);
+ evas_object_resize(ec->frame, pw, ph);
+ if (ec->visible)
+ evas_object_show(ec->frame);
+}
+
+/////////////////////////////////////////////
+
static Eina_Bool
_e_comp_object_cb_show_ready_timeout(void *data)
{
@@ -710,17 +746,27 @@ static void
_e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
{
E_Comp_Object *cw = data;
+ int pw, ph, fw, fh;
- if ((cw->w == w) && (cw->h == h)) return;
cw->ec->w = w, cw->ec->h = h;
if (cw->client_inset.calc && (!cw->ec->shading) && (!cw->ec->shaded))
{
cw->ec->client.w = w - cw->client_inset.l - cw->client_inset.r;
cw->ec->client.h = h - cw->client_inset.t - cw->client_inset.b;
}
+ e_comp_object_frame_wh_adjust(obj, 0, 0, &fw, &fh);
+ if ((!cw->ec->shading) &&
+ ((!e_pixmap_size_get(cw->ec->pixmap, &pw, &ph)) || (w - fw != pw) || (h - fh != ph)))
+ {
+ //INF("CALLBACK");
+ evas_object_smart_callback_call(obj, "client_resize", NULL);
+ }
+ else
+ {
+ //INF("INTERCEPT %dx%d", w, h);
+ evas_object_resize(obj, w, h);
+ }
cw->w = w, cw->h = h;
- e_pixmap_dirty(cw->ec->pixmap);
- evas_object_resize(obj, w, h);
}
static void
@@ -857,6 +903,7 @@ _e_comp_intercept_hide(void *data, Evas_Object *obj)
cw->comp->animating++;
cw->animating = 1;
e_comp_object_render_update_add(obj);
+ e_object_ref(E_OBJECT(cw->ec));
return;
}
cw->defer_hide = 0;
@@ -878,28 +925,29 @@ _e_comp_intercept_show_helper(E_Comp_Object *cw)
e_pixmap_size_get(cw->ec->pixmap, &pw, &ph);
cw->show_anim = EINA_FALSE;
- if (cw->real_hid)
+ if (e_pixmap_refresh(cw->ec->pixmap) && e_pixmap_size_get(cw->ec->pixmap, &w, &h))
+ {
+ _e_comp_object_ready_timeout_setup(cw);
+ e_comp_object_size_set(cw->smart_obj, w, h);
+ }
+ else
+ e_pixmap_clear(cw->ec->pixmap);
+
+ if (cw->real_hid && w && h)
{
DBG(" [%p] real hid - fix", cw->ec);
cw->real_hid = 0;
- e_comp_object_redirected_set(cw->smart_obj, 0);
+ _e_comp_object_pixels_get(cw, cw->obj);
+ cw->comp->post_updates = eina_list_append(cw->comp->post_updates, cw->ec);
}
- else
+ else if (!cw->real_hid)
cw->dmg_updates = 1;
- if (e_pixmap_refresh(cw->ec->pixmap) && e_pixmap_size_get(cw->ec->pixmap, &w, &h))
+ if ((cw->dmg_updates >= 1) && (cw->show_ready))
{
- _e_comp_object_ready_timeout_setup(cw);
- if ((w != pw) || (h != ph))
- e_comp_object_damage(cw->smart_obj, 0, 0, w, h);
+ e_comp_object_damage(cw->smart_obj, 0, 0, cw->w, cw->h);
+ evas_object_show(cw->smart_obj);
}
- else
- e_pixmap_clear(cw->ec->pixmap);
- DBG(" [%p] up resize %ix%i", cw->ec, w, h);
- e_comp_object_size_set(cw->smart_obj, w, h);
- if ((cw->dmg_updates >= 1) && (cw->show_ready))
- evas_object_show(cw->smart_obj);
- e_comp_object_render_update_add(cw->smart_obj);
}
static void
@@ -934,6 +982,7 @@ _e_comp_intercept_show(void *data, Evas_Object *obj EINA_UNUSED)
_e_comp_object_setup(cw);
cw->obj = evas_object_image_filled_add(cw->comp->evas);
e_util_size_debug_set(cw->obj, 1);
+ evas_object_image_pixels_get_callback_set(cw->obj, _e_comp_object_pixels_get, cw);
evas_object_image_smooth_scale_set(cw->obj, e_comp_config_get()->smooth_windows);
evas_object_name_set(cw->obj, "cw->obj");
evas_object_image_colorspace_set(cw->obj, EVAS_COLORSPACE_ARGB8888);
@@ -1393,6 +1442,7 @@ _e_comp_smart_show(Evas_Object *obj)
if (!cw->animating)
cw->comp->animating++;
cw->animating = 1;
+ e_object_ref(E_OBJECT(cw->ec));
}
static void
@@ -1422,6 +1472,14 @@ _e_comp_smart_del(Evas_Object *obj)
evas_object_del(o);
}
}
+ _e_comp_object_layers_remove(cw);
+ evas_object_del(cw->clip);
+ evas_object_del(cw->effect_obj);
+ evas_object_del(cw->shobj);
+ evas_object_del(cw->frame_icon);
+ evas_object_del(cw->frame_object);
+ evas_object_del(cw->zoomobj);
+ evas_object_del(cw->obj);
eina_stringshare_del(cw->frame_theme);
eina_stringshare_del(cw->frame_name);
free(cw);
@@ -1442,6 +1500,7 @@ _e_comp_smart_resize(Evas_Object *obj, int w, int h)
{
INTERNAL_ENTRY;
+ //INF("RSZ");
evas_object_resize(cw->clip, w, h);
evas_object_resize(cw->effect_obj, w, h);
if (cw->zoomobj) e_zoomap_child_resize(cw->zoomobj, cw->ec->client.w, cw->ec->client.h);
@@ -1838,11 +1897,11 @@ e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on)
EINA_SAFETY_ON_NULL_RETURN(on);
evas_object_geometry_get(on, &x, &y, &w, &h);
if (cw)
- e_client_move(cw->ec, ((x + w) / 2) - (cw->w / 2), ((y + h) / 2) - (cw->h / 2));
+ e_client_move(cw->ec, x + (w / 2) - (cw->w / 2), y + (h / 2) - (cw->h / 2));
else
{
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
- evas_object_move(obj, ((x + w) / 2) - (ow / 2), ((y + h) / 2) - (oh / 2));
+ evas_object_move(obj, x + (w / 2) - (ow / 2), y + (h / 2) - (oh / 2));
}
}
@@ -1977,7 +2036,7 @@ e_comp_object_frame_theme_set(Evas_Object *obj, const char *name)
cw->frame_object = o;
eina_stringshare_del(cw->frame_theme);
cw->frame_theme = theme;
- evas_object_smart_member_add(o, cw->smart_obj);
+ evas_object_smart_member_add(cw->frame_object, cw->smart_obj);
evas_object_name_set(o, "cw->frame_object");
if (cw->frame_name)
@@ -2026,6 +2085,7 @@ reshadow:
if (cw->frame_object)
edje_object_signal_callback_add(cw->frame_object, "*", "*",
_e_comp_object_cb_signal_bind, cw);
+e_util_size_debug_set(cw->frame_object, 1);
return EINA_TRUE;
}
@@ -2237,12 +2297,8 @@ e_comp_object_size_set(Evas_Object *obj, int w, int h)
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
if (cw->ec->input_only) return;
evas_object_image_size_set(cw->obj, w, h);
- evas_object_image_data_set(cw->obj, NULL);
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_size_set(o, w, h);
- evas_object_image_data_set(cw->obj, NULL);
- }
+ evas_object_image_size_set(o, w, h);
eina_tiler_area_size_get(cw->updates, &tw, &th);
if ((w == tw) && (h == th)) return;
@@ -2273,6 +2329,14 @@ e_comp_object_native_surface_set(Evas_Object *obj, Eina_Bool set)
evas_object_image_native_surface_set(o, set ? &ns : NULL);
}
+EAPI void
+e_comp_object_dirty(Evas_Object *obj)
+{
+ API_ENTRY;
+
+ evas_object_image_pixels_dirty_set(cw->obj, 1);
+}
+
EAPI Eina_Bool
e_comp_object_render(Evas_Object *obj)
{
@@ -2299,7 +2363,6 @@ e_comp_object_render(Evas_Object *obj)
it = eina_tiler_iterator_new(cw->updates);
EINA_ITERATOR_FOREACH(it, r)
{
-
INF("UPDATE [%p]: %d %d %dx%d", cw->ec, r->x, r->y, r->w, r->h);
evas_object_image_data_update_add(cw->obj, r->x, r->y, r->w, r->h);
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
@@ -2316,23 +2379,20 @@ e_comp_object_render(Evas_Object *obj)
reset = EINA_TRUE;
if (!e_pixmap_image_refresh(cw->ec->pixmap))
{
- evas_object_image_size_set(cw->obj, 1, 1);
- evas_object_image_data_set(cw->obj, NULL);
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_size_set(o, 1, 1);
- evas_object_image_data_set(cw->obj, NULL);
- }
ERR("Could not update pixmap image for client %p!", cw->ec);
return EINA_FALSE;
}
if (reset)
{
+ eina_tiler_clear(cw->updates);
+ eina_tiler_area_size_set(cw->updates, pw, ph);
eina_tiler_rect_add(cw->updates, &(Eina_Rectangle){0, 0, pw, ph});
cw->updates_exist = 1;
}
else if (!cw->updates_exist)
{
+ evas_object_image_size_set(cw->obj, 1, 1);
+ evas_object_image_data_set(cw->obj, NULL);
INF("RENDER [%p]: NO RECTS!", cw->ec);
return EINA_FALSE;
}
@@ -2345,11 +2405,12 @@ e_comp_object_render(Evas_Object *obj)
evas_object_image_data_set(cw->obj, pix);
EINA_ITERATOR_FOREACH(it, r)
{
+ E_RECTS_CLIP_TO_RECT(r->x, r->y, r->w, r->h, 0, 0, pw, ph);
ret = e_pixmap_image_draw(cw->ec->pixmap, r);
if (!ret)
{
WRN("UPDATE [%p]: %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!", cw->ec, r->x, r->y, r->w, r->h);
- e_comp_object_render_update_add(obj);
+ e_comp_object_damage(obj, 0, 0, pw, ph);
break;
}
INF("UPDATE [%p] %i %i %ix%i", cw->ec, r->x, r->y, r->w, r->h);
@@ -2377,11 +2438,12 @@ e_comp_object_render(Evas_Object *obj)
}
EINA_ITERATOR_FOREACH(it, r)
{
+ E_RECTS_CLIP_TO_RECT(r->x, r->y, r->w, r->h, 0, 0, pw, ph);
ret = e_pixmap_image_draw(cw->ec->pixmap, r);
if (!ret)
{
WRN("UPDATE [%p]: %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!", cw->ec, r->x, r->y, r->w, r->h);
- e_comp_object_render_update_add(obj);
+ e_comp_object_damage(obj, 0, 0, pw, ph);
break;
}
e_pixmap_image_data_argb_convert(cw->ec->pixmap, pix, srcpix, r, stride);
diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h
index e11320cf3e..bb97ba6b2a 100644
--- a/src/bin/e_comp_object.h
+++ b/src/bin/e_comp_object.h
@@ -56,6 +56,7 @@ EAPI void e_comp_object_shape_apply(Evas_Object *obj);
EAPI void e_comp_object_redirected_set(Evas_Object *obj, Eina_Bool set);
EAPI void e_comp_object_size_set(Evas_Object *obj, int w, int h);
EAPI void e_comp_object_native_surface_set(Evas_Object *obj, Eina_Bool set);
+EAPI void e_comp_object_dirty(Evas_Object *obj);
EAPI Eina_Bool e_comp_object_render(Evas_Object *obj);
EAPI void e_comp_object_effect_set(Evas_Object *obj, const char *effect);
EAPI void e_comp_object_effect_params_set(Evas_Object *obj, int id, int *params, unsigned int count);
diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index 196508c9aa..b2e9dff6f9 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -218,6 +218,7 @@ _e_comp_x_post_client_idler_cb(void *d EINA_UNUSED)
}
else if ((ec->post_move) && (ec->post_resize))
{
+ INF("X MVRSZ");
ecore_x_window_move_resize(e_client_util_pwin_get(ec),
ec->client.x,
ec->client.y,
@@ -229,10 +230,12 @@ _e_comp_x_post_client_idler_cb(void *d EINA_UNUSED)
}
else if (ec->post_move)
{
+ INF("X MV");
ecore_x_window_move(e_client_util_pwin_get(ec), ec->client.x, ec->client.y);
}
else if (ec->post_resize)
{
+ INF("X RSZ");
ecore_x_window_resize(e_client_util_pwin_get(ec),
ec->client.w, ec->client.h);
ecore_x_window_resize(e_client_util_win_get(ec),
@@ -437,11 +440,12 @@ _e_comp_x_evas_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
}
static void
-_e_comp_x_evas_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+_e_comp_x_evas_resize_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec = data;
if (ec->shading || ec->shaded) return;
+ if (!e_pixmap_size_changed(ec->pixmap, ec->client.w, ec->client.h)) return;
ecore_x_window_shadow_tree_flush();
@@ -470,7 +474,6 @@ _e_comp_x_evas_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
ec->post_resize = 1;
_e_comp_x_post_client_idler_add(ec);
- e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
}
static void
@@ -1426,8 +1429,6 @@ _e_comp_x_mouse_wheel(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_
{
ec = _e_comp_x_client_find_by_window(ev->window);
if (!ec) return ECORE_CALLBACK_RENEW;
- /* event_window here should be ec->win if it isn't the same as window, not sure if this can NOT happen */
- if (ev->window != ev->event_window) return ECORE_CALLBACK_RENEW;
}
e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2);
e_client_mouse_wheel(ec, (Evas_Point*)&ev->root, &ev2);
@@ -1446,9 +1447,12 @@ _e_comp_x_mouse_up(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_But
//else
{
ec = _e_comp_x_client_find_by_window(ev->window);
- if (!ec) return ECORE_CALLBACK_RENEW;
- /* event_window here should be ec->win if it isn't the same as window, not sure if this can NOT happen */
- if (ev->window != ev->event_window) return ECORE_CALLBACK_RENEW;
+ if (!ec)
+ {
+ if (e_client_comp_grabbed_get())
+ ec = e_client_action_get();
+ if (!ec) return ECORE_CALLBACK_RENEW;
+ }
}
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
e_client_mouse_up(ec, ev->buttons, (Evas_Point*)&ev->root, &ev2);
@@ -1467,8 +1471,6 @@ _e_comp_x_mouse_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_B
{
ec = _e_comp_x_client_find_by_window(ev->window);
if (!ec) return ECORE_CALLBACK_RENEW;
- /* event_window here should be ec->win if it isn't the same as window, not sure if this can NOT happen */
- if (ev->window != ev->event_window) return ECORE_CALLBACK_RENEW;
}
e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
e_client_mouse_down(ec, ev->buttons, (Evas_Point*)&ev->root, &ev2);
@@ -1836,7 +1838,6 @@ _e_comp_x_shape(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Wind
{
//FIXME?
if (ec->changes.shape) return ECORE_CALLBACK_RENEW;
- e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
ec->changes.shape = 1;
ec->need_shape_export = 1;
EC_CHANGED(ec);
@@ -1885,7 +1886,8 @@ _e_comp_x_damage(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Dam
ec->comp_data->update_timeout = ecore_timer_add(ecore_animator_frametime_get() * 2, _e_comp_x_damage_timeout, ec);
return ECORE_CALLBACK_RENEW;
}
-
+INF("DAMAGE");
+ e_pixmap_clear(ec->pixmap);
e_comp_object_damage(ec->frame, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
return ECORE_CALLBACK_RENEW;
}
@@ -2054,7 +2056,7 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, _e_comp_x_evas_show_cb, ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE, _e_comp_x_evas_hide_cb, ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOVE, _e_comp_x_evas_move_cb, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESIZE, _e_comp_x_evas_resize_cb, ec);
+ evas_object_smart_callback_add(ec->frame, "client_resize", _e_comp_x_evas_resize_cb, ec);
evas_object_smart_callback_add(ec->frame, "frame_recalc_done", _e_comp_x_evas_frame_recalc_cb, ec);
evas_object_smart_callback_add(ec->frame, "shade_done", _e_comp_x_evas_shade_cb, ec);
evas_object_smart_callback_add(ec->frame, "comp_hidden", _e_comp_x_evas_comp_hidden_cb, ec);
@@ -3313,6 +3315,7 @@ _e_comp_x_hook_client_new(void *d EINA_UNUSED, E_Client *ec)
ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1);
e_pixmap_parent_window_set(ec->pixmap, parent);
ecore_x_window_resize(parent, ec->client.w, ec->client.h);
+ e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
ec->border.changed = 1;
if (!ec->ignored)
ec->ignored = e_comp_ignore_win_find(parent);
diff --git a/src/bin/e_moveresize.c b/src/bin/e_moveresize.c
index 51acbd1158..d449900718 100644
--- a/src/bin/e_moveresize.c
+++ b/src/bin/e_moveresize.c
@@ -62,6 +62,7 @@ _e_resize_begin(void *data __UNUSED__, E_Client *ec)
_e_resize_client_extents(ec, &w, &h);
_disp_content = o = edje_object_add(e_comp_get(ec)->evas);
+ evas_object_name_set(o, "resizeinfo->_disp_content");
e_theme_edje_object_set(o, "base/theme/borders",
"e/widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
@@ -72,6 +73,7 @@ _e_resize_begin(void *data __UNUSED__, E_Client *ec)
edje_object_part_text_set(o, "e.text.label", buf);
_disp_obj = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_POPUP);
+ evas_object_name_set(o, "resizeinfo->_disp_obj");
evas_object_layer_set(_disp_obj, E_LAYER_POPUP);
evas_object_pass_events_set(_disp_obj, 1);
@@ -80,9 +82,6 @@ _e_resize_begin(void *data __UNUSED__, E_Client *ec)
e_comp_object_util_center_on(_disp_obj, ec->frame);
else
e_comp_object_util_center(_disp_obj);
-
- snprintf(buf, sizeof(buf), _("%i×%i"), w, h);
- edje_object_part_text_set(o, "e.text.label", buf);
}
static void
@@ -170,6 +169,7 @@ _e_move_begin(void *data __UNUSED__, E_Client *ec)
return;
_disp_content = o = edje_object_add(e_comp_get(ec)->evas);
+ evas_object_name_set(o, "moveinfo->_disp_content");
e_theme_edje_object_set(o, "base/theme/borders",
"e/widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
@@ -180,6 +180,7 @@ _e_move_begin(void *data __UNUSED__, E_Client *ec)
edje_object_part_text_set(o, "e.text.label", buf);
_disp_obj = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_POPUP);
+ evas_object_name_set(o, "moveinfo->_disp_obj");
evas_object_layer_set(_disp_obj, E_LAYER_POPUP);
evas_object_pass_events_set(_disp_obj, 1);
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 92fd152015..cc1eeb1854 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -13,6 +13,7 @@ struct _E_Pixmap
} region;
void *visual;
void *image;
+ Eina_List *images_cache;
unsigned int cmap;
int ibpp, ibpl;
Ecore_Window parent;
@@ -24,7 +25,7 @@ struct _E_Pixmap
};
static void
-_e_pixmap_clear(E_Pixmap *cp)
+_e_pixmap_clear(E_Pixmap *cp, Eina_Bool cache)
{
cp->w = cp->h = 0;
cp->image_argb = EINA_FALSE;
@@ -36,7 +37,7 @@ _e_pixmap_clear(E_Pixmap *cp)
ecore_x_pixmap_free(cp->pixmap);
cp->pixmap = 0;
ecore_x_e_comp_pixmap_set(cp->parent ?: cp->region.xwin, 0);
- E_FREE_FUNC(cp->image, ecore_x_image_free);
+ e_pixmap_image_clear(cp, cache);
}
break;
case E_PIXMAP_TYPE_WL:
@@ -51,7 +52,7 @@ _e_pixmap_clear(E_Pixmap *cp)
static void
_e_pixmap_free(E_Pixmap *cp)
{
- _e_pixmap_clear(cp);
+ _e_pixmap_clear(cp, 1);
free(cp);
}
@@ -193,8 +194,8 @@ EAPI void
e_pixmap_clear(E_Pixmap *cp)
{
EINA_SAFETY_ON_NULL_RETURN(cp);
- _e_pixmap_clear(cp);
- cp->dirty = 1;
+ _e_pixmap_clear(cp, 0);
+ e_pixmap_dirty(cp);
}
EAPI void
@@ -339,14 +340,21 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns)
}
EAPI void
-e_pixmap_image_clear(E_Pixmap *cp)
+e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache)
{
EINA_SAFETY_ON_NULL_RETURN(cp);
+ if ((!cache) && (!cp->image)) return;
switch (cp->type)
{
case E_PIXMAP_TYPE_X:
- E_FREE_FUNC(cp->image, ecore_x_image_free);
+ if (cache)
+ E_FREE_LIST(cp->images_cache, ecore_x_image_free);
+ else
+ {
+ cp->images_cache = eina_list_append(cp->images_cache, cp->image);
+ cp->image = NULL;
+ }
break;
case E_PIXMAP_TYPE_WL:
default:
diff --git a/src/bin/e_pixmap.h b/src/bin/e_pixmap.h
index 457e5f7f40..4cceb0592a 100644
--- a/src/bin/e_pixmap.h
+++ b/src/bin/e_pixmap.h
@@ -32,7 +32,7 @@ EAPI Ecore_Window e_pixmap_window_get(E_Pixmap *cp);
EAPI Ecore_Window e_pixmap_parent_window_get(E_Pixmap *cp);
EAPI void *e_pixmap_surface_get(E_Pixmap *cp);
EAPI void e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns);
-EAPI void e_pixmap_image_clear(E_Pixmap *cp);
+EAPI void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache);
EAPI Eina_Bool e_pixmap_image_refresh(E_Pixmap *cp);
EAPI Eina_Bool e_pixmap_image_exists(const E_Pixmap *cp);
EAPI Eina_Bool e_pixmap_image_is_argb(const E_Pixmap *cp);