From a4bc0fb8f7c595ef322afa510145ca98793482f4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 11 Oct 2012 08:03:19 +0000 Subject: [PATCH] refresh desktop icons only when they actually need to be refreshed so we don't refresh every time someone adds a gadget to a shelf SVN revision: 77849 --- src/modules/fileman/e_fwin.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index 8c15a9188..2b8d5a8db 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -1955,17 +1955,21 @@ _e_fwin_zone_focus_in(void *data, static Eina_Bool _e_fwin_zone_move_resize(void *data, int type __UNUSED__, void *event) { - E_Event_Zone_Move_Resize *ev; - E_Fwin *fwin; + E_Event_Zone_Move_Resize *ev = event; + E_Fwin *fwin = data; + int x, y, w, h, sx, sy, sw, sh; - fwin = data; - ev = event; if (!fwin) return ECORE_CALLBACK_PASS_ON; if (fwin->zone != ev->zone) return ECORE_CALLBACK_PASS_ON; - /* prevent scrollbars from showing up on the desktop! */ - e_fwin_zone_shutdown(ev->zone); - e_fwin_zone_new(ev->zone, e_mod_fileman_path_find(ev->zone)); - return ECORE_CALLBACK_PASS_ON; + if (!fwin->cur_page->scrollframe_obj) return ECORE_CALLBACK_RENEW; + e_zone_useful_geometry_get(ev->zone, &x, &y, &w, &h); + evas_object_geometry_get(fwin->cur_page->scrollframe_obj, &sx, &sy, &sw, &sh); + /* if same, do nothing */ + if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) return ECORE_CALLBACK_RENEW; + evas_object_move(fwin->cur_page->scrollframe_obj, x, y); + evas_object_resize(fwin->cur_page->scrollframe_obj, w, h); + e_fm2_refresh(fwin->cur_page->fm_obj); + return ECORE_CALLBACK_RENEW; } static Eina_Bool