summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-04-25 11:45:53 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-04-25 11:45:53 +0100
commitdb72a84e5822d27717975f992801d81a89d929f5 (patch)
tree01c4eb58d02e9d1dd0e8c115166039188fae8ac7
parent47283e55188a7470138b3a96eb640bea5571b5e2 (diff)
improve efm mouse move detection (no more tooltips when cursor is in separate window)
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_fm.c56
3 files changed, 38 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index bc6af85b0..1b54642d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
12013-04-25 Mike Blumenkrantz 12013-04-25 Mike Blumenkrantz
2 2
3 * added deskmirror 3 * added deskmirror
4 * improve efm mouse movement detection for icons
4 5
52013-04-19 Mike Blumenkrantz 62013-04-19 Mike Blumenkrantz
6 7
diff --git a/NEWS b/NEWS
index fa5104040..69c0f722d 100644
--- a/NEWS
+++ b/NEWS
@@ -134,6 +134,7 @@ Improvements:
134 * desk flip animations moved to edje 134 * desk flip animations moved to edje
135 * startup splash screen moved to compositor canvas 135 * startup splash screen moved to compositor canvas
136 * added new modes for notification display on multiple monitors 136 * added new modes for notification display on multiple monitors
137 * improve efm mouse movement detection for icons
137 138
138Fixes: 139Fixes:
139 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. 140 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index cd339e164..16a643dba 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -183,7 +183,7 @@ struct _E_Fm2_Icon
183 E_Fm2_Smart_Data *sd; 183 E_Fm2_Smart_Data *sd;
184 E_Fm2_Region *region; 184 E_Fm2_Region *region;
185 Evas_Coord x, y, w, h, min_w, min_h; 185 Evas_Coord x, y, w, h, min_w, min_h;
186 Evas_Object *obj, *obj_icon; 186 Evas_Object *obj, *obj_icon, *rect;
187 E_Menu *menu; 187 E_Menu *menu;
188 E_Entry_Dialog *entry_dialog; 188 E_Entry_Dialog *entry_dialog;
189 Evas_Object *entry_widget; 189 Evas_Object *entry_widget;
@@ -4783,13 +4783,20 @@ _e_fm2_icon_label_click(void *data, Evas_Object *obj __UNUSED__, const char *emi
4783static void 4783static void
4784_e_fm2_icon_realize(E_Fm2_Icon *ic) 4784_e_fm2_icon_realize(E_Fm2_Icon *ic)
4785{ 4785{
4786 Evas *e;
4787
4786 if (ic->realized) return; 4788 if (ic->realized) return;
4789 e = evas_object_evas_get(ic->sd->obj);
4787 /* actually create evas objects etc. */ 4790 /* actually create evas objects etc. */
4788 ic->realized = EINA_TRUE; 4791 ic->realized = EINA_TRUE;
4789 evas_event_freeze(evas_object_evas_get(ic->sd->obj)); 4792 evas_event_freeze(e);
4790 ic->obj = edje_object_add(evas_object_evas_get(ic->sd->obj)); 4793 ic->obj = edje_object_add(e);
4791 edje_object_freeze(ic->obj); 4794 edje_object_freeze(ic->obj);
4792 evas_object_smart_member_add(ic->obj, ic->sd->obj); 4795 evas_object_smart_member_add(ic->obj, ic->sd->obj);
4796 ic->rect = evas_object_rectangle_add(e);
4797 evas_object_color_set(ic->rect, 0, 0, 0, 0);
4798 evas_object_smart_member_add(ic->rect, ic->sd->obj);
4799 evas_object_repeat_events_set(ic->rect, 1);
4793 evas_object_stack_below(ic->obj, ic->sd->drop); 4800 evas_object_stack_below(ic->obj, ic->sd->drop);
4794 if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST) 4801 if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST)
4795 { 4802 {
@@ -4836,25 +4843,31 @@ _e_fm2_icon_realize(E_Fm2_Icon *ic)
4836 "base/theme/fileman", 4843 "base/theme/fileman",
4837 "icon/variable"); 4844 "icon/variable");
4838 } 4845 }
4846 evas_object_stack_above(ic->rect, ic->obj);
4839 _e_fm2_icon_label_set(ic, ic->obj); 4847 _e_fm2_icon_label_set(ic, ic->obj);
4840 evas_object_clip_set(ic->obj, ic->sd->clip); 4848 evas_object_clip_set(ic->obj, ic->sd->clip);
4841 evas_object_move(ic->obj, 4849 evas_object_move(ic->obj,
4842 ic->sd->x + ic->x - ic->sd->pos.x, 4850 ic->sd->x + ic->x - ic->sd->pos.x,
4843 ic->sd->y + ic->y - ic->sd->pos.y); 4851 ic->sd->y + ic->y - ic->sd->pos.y);
4852 evas_object_move(ic->rect,
4853 ic->sd->x + ic->x - ic->sd->pos.x,
4854 ic->sd->y + ic->y - ic->sd->pos.y);
4844 evas_object_resize(ic->obj, ic->w, ic->h); 4855 evas_object_resize(ic->obj, ic->w, ic->h);
4856 evas_object_resize(ic->rect, ic->w, ic->h);
4845 4857
4846 evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_DOWN, _e_fm2_cb_icon_mouse_down, ic); 4858 evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_DOWN, _e_fm2_cb_icon_mouse_down, ic);
4847 evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_UP, _e_fm2_cb_icon_mouse_up, ic); 4859 evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_UP, _e_fm2_cb_icon_mouse_up, ic);
4848 evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_MOVE, _e_fm2_cb_icon_mouse_move, ic); 4860 evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_MOVE, _e_fm2_cb_icon_mouse_move, ic);
4849 evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_IN, _e_fm2_cb_icon_mouse_in, ic); 4861 evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_IN, _e_fm2_cb_icon_mouse_in, ic);
4850 evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_OUT, _e_fm2_cb_icon_mouse_out, ic); 4862 evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_OUT, _e_fm2_cb_icon_mouse_out, ic);
4851 edje_object_signal_callback_add(ic->obj, "e,action,label,click", "e", _e_fm2_icon_label_click, ic); 4863 edje_object_signal_callback_add(ic->obj, "e,action,label,click", "e", _e_fm2_icon_label_click, ic);
4852 4864
4853 _e_fm2_icon_icon_set(ic); 4865 _e_fm2_icon_icon_set(ic);
4854 4866
4855 edje_object_thaw(ic->obj); 4867 edje_object_thaw(ic->obj);
4856 evas_event_thaw(evas_object_evas_get(ic->sd->obj)); 4868 evas_event_thaw(e);
4857 evas_object_show(ic->obj); 4869 evas_object_show(ic->obj);
4870 evas_object_show(ic->rect);
4858 4871
4859 if (ic->selected) 4872 if (ic->selected)
4860 { 4873 {
@@ -4890,6 +4903,8 @@ _e_fm2_icon_unrealize(E_Fm2_Icon *ic)
4890 ic->realized = EINA_FALSE; 4903 ic->realized = EINA_FALSE;
4891 evas_object_del(ic->obj); 4904 evas_object_del(ic->obj);
4892 ic->obj = NULL; 4905 ic->obj = NULL;
4906 evas_object_del(ic->rect);
4907 ic->rect = NULL;
4893 evas_object_del(ic->obj_icon); 4908 evas_object_del(ic->obj_icon);
4894 ic->obj_icon = NULL; 4909 ic->obj_icon = NULL;
4895} 4910}
@@ -5215,7 +5230,10 @@ _e_fm2_region_realize(E_Fm2_Region *rg)
5215 EINA_LIST_FOREACH(rg->list, l, ic) 5230 EINA_LIST_FOREACH(rg->list, l, ic)
5216 { 5231 {
5217 if (ic->selected) 5232 if (ic->selected)
5218 evas_object_stack_below(ic->obj, ic->sd->drop); 5233 {
5234 evas_object_stack_below(ic->obj, ic->sd->drop);
5235 evas_object_stack_above(ic->rect, ic->obj);
5236 }
5219 } 5237 }
5220 edje_thaw(); 5238 edje_thaw();
5221} 5239}
@@ -6216,6 +6234,7 @@ _e_fm2_dnd_finish(Evas_Object *obj, int refresh)
6216 ic->drag.src = EINA_FALSE; 6234 ic->drag.src = EINA_FALSE;
6217 if (ic->drag.hidden) continue; 6235 if (ic->drag.hidden) continue;
6218 if (ic->obj) evas_object_show(ic->obj); 6236 if (ic->obj) evas_object_show(ic->obj);
6237 if (ic->rect) evas_object_show(ic->rect);
6219 if (ic->obj_icon) evas_object_show(ic->obj_icon); 6238 if (ic->obj_icon) evas_object_show(ic->obj_icon);
6220 } 6239 }
6221 if (refresh) e_fm2_refresh(obj); 6240 if (refresh) e_fm2_refresh(obj);
@@ -7274,7 +7293,6 @@ _e_fm2_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
7274 ev = event_info; 7293 ev = event_info;
7275 7294
7276 edje_object_message_signal_process(ic->obj); 7295 edje_object_message_signal_process(ic->obj);
7277 edje_object_message_signal_process(ic->obj);
7278 7296
7279 _e_fm2_typebuf_hide(ic->sd->obj); 7297 _e_fm2_typebuf_hide(ic->sd->obj);
7280 if ((ev->button == 1) && (!ic->drag.dnd)) 7298 if ((ev->button == 1) && (!ic->drag.dnd))
@@ -7295,6 +7313,7 @@ _e_fm2_cb_drag_finished_show(E_Fm2_Icon *ic)
7295{ 7313{
7296 ic->drag.dnd = ic->drag.src = EINA_FALSE; 7314 ic->drag.dnd = ic->drag.src = EINA_FALSE;
7297 if (ic->obj) evas_object_show(ic->obj); 7315 if (ic->obj) evas_object_show(ic->obj);
7316 if (ic->rect) evas_object_show(ic->rect);
7298 if (ic->obj_icon) evas_object_show(ic->obj_icon); 7317 if (ic->obj_icon) evas_object_show(ic->obj_icon);
7299 ic->drag.dnd_end_timer = NULL; 7318 ic->drag.dnd_end_timer = NULL;
7300 return EINA_FALSE; 7319 return EINA_FALSE;
@@ -7439,15 +7458,6 @@ _e_fm2_cb_icon_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
7439 ev = event_info; 7458 ev = event_info;
7440 7459
7441 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 7460 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
7442 /* here we have some stupid checks to see if we're REALLY getting a mouse out or
7443 * if some jackass is sending us bad events
7444 * ticket #1324
7445 */
7446 if (E_INSIDE(ev->output.x, ev->output.y - 10, ic->sd->x + ic->x - ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
7447 E_INSIDE(ev->output.x - 10, ev->output.y, ic->sd->x + ic->x - ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
7448 E_INSIDE(ev->output.x + 10, ev->output.y, ic->sd->x + ic->x - ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
7449 E_INSIDE(ev->output.x, ev->output.y + 10, ic->sd->x + ic->x - ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
7450 evas_pointer_inside_get(evas_object_evas_get(ic->sd->obj))) return;
7451 evas_object_smart_callback_call(ic->sd->obj, "icon_mouse_out", &ic->info); 7461 evas_object_smart_callback_call(ic->sd->obj, "icon_mouse_out", &ic->info);
7452} 7462}
7453 7463
@@ -7512,6 +7522,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
7512 ic->sd->drag = EINA_TRUE; 7522 ic->sd->drag = EINA_TRUE;
7513 ic->drag.dnd = EINA_TRUE; 7523 ic->drag.dnd = EINA_TRUE;
7514 if (ic->obj) evas_object_hide(ic->obj); 7524 if (ic->obj) evas_object_hide(ic->obj);
7525 if (ic->rect) evas_object_hide(ic->rect);
7515 if (ic->obj_icon) evas_object_hide(ic->obj_icon); 7526 if (ic->obj_icon) evas_object_hide(ic->obj_icon);
7516 ic->drag.start = EINA_FALSE; 7527 ic->drag.start = EINA_FALSE;
7517 evas_object_geometry_get(ic->obj, &x, &y, &w, &h); 7528 evas_object_geometry_get(ic->obj, &x, &y, &w, &h);
@@ -7553,6 +7564,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
7553 7564
7554 ici->ic->drag.dnd = EINA_TRUE; 7565 ici->ic->drag.dnd = EINA_TRUE;
7555 if (ici->ic->obj) evas_object_hide(ici->ic->obj); 7566 if (ici->ic->obj) evas_object_hide(ici->ic->obj);
7567 if (ici->ic->rect) evas_object_hide(ici->ic->rect);
7556 if (ici->ic->obj_icon) evas_object_hide(ici->ic->obj_icon); 7568 if (ici->ic->obj_icon) evas_object_hide(ici->ic->obj_icon);
7557 } 7569 }
7558 if (!sel) return; 7570 if (!sel) return;
@@ -8333,7 +8345,11 @@ _e_fm2_obj_icons_place(E_Fm2_Smart_Data *sd)
8333 evas_object_move(ic->obj, 8345 evas_object_move(ic->obj,
8334 sd->x + ic->x - sd->pos.x, 8346 sd->x + ic->x - sd->pos.x,
8335 sd->y + ic->y - sd->pos.y); 8347 sd->y + ic->y - sd->pos.y);
8348 evas_object_move(ic->rect,
8349 sd->x + ic->x - sd->pos.x,
8350 sd->y + ic->y - sd->pos.y);
8336 evas_object_resize(ic->obj, ic->w, ic->h); 8351 evas_object_resize(ic->obj, ic->w, ic->h);
8352 evas_object_resize(ic->rect, ic->w, ic->h);
8337 _e_fm2_icon_thumb(ic, ic->obj_icon, 0); 8353 _e_fm2_icon_thumb(ic, ic->obj_icon, 0);
8338 if (_e_fm2_view_mode_get(ic->sd) != E_FM2_VIEW_MODE_LIST) continue; 8354 if (_e_fm2_view_mode_get(ic->sd) != E_FM2_VIEW_MODE_LIST) continue;
8339 /* FIXME: this is probably something that should be unnecessary, 8355 /* FIXME: this is probably something that should be unnecessary,