Hello,

I had a two problems with the shelf:
1. If I used "auto-hide" and "show on mouse in" the shelf don't became 
visible.
2. If the hiding timer was running and I pushed the mouse back over the shelf, 
it got still hidden.

I wrote a patch so that these things work for me.

I think he also simplify the file a little bit.

http://phpfi.com/321706

I use Enlightenment since a few weeks and this is my first patch for an 
OpenSource project, so if the patch is bad, please have comprehension.

David
--- ../../../../../e17/apps/e/src/bin/e_shelf.c	2008-05-19 06:37:34.000000000 +0200
+++ e_shelf.c	2008-06-03 18:02:13.000000000 +0200
@@ -129,12 +129,6 @@ e_shelf_zone_new(E_Zone *zone, const cha
    evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_DOWN, _e_shelf_cb_mouse_down, es);
 
    /* FIXME: Need an EDGE_MOVE handler */
-   es->handlers = evas_list_append(es->handlers,
-	 ecore_event_handler_add(E_EVENT_ZONE_EDGE_IN, _e_shelf_cb_mouse_in, es));
-   es->handlers = evas_list_append(es->handlers,
-	 ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_shelf_cb_mouse_in, es));
-   es->handlers = evas_list_append(es->handlers,
-	 ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_shelf_cb_mouse_out, es));
  
    es->o_base = edje_object_add(es->evas);
    es->name = evas_stringshare_add(name);
@@ -160,6 +154,11 @@ e_shelf_zone_new(E_Zone *zone, const cha
 	es->win = zone->container->event_win;
      }
 
+	evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_IN, _e_shelf_cb_mouse_in, es);
+	evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_OUT, _e_shelf_cb_mouse_out, es);
+	evas_object_event_callback_add(es->o_base, EVAS_CALLBACK_MOUSE_IN, _e_shelf_cb_mouse_in, es);
+	evas_object_event_callback_add(es->o_base, EVAS_CALLBACK_MOUSE_OUT, _e_shelf_cb_mouse_out, es);
+
    es->gadcon = e_gadcon_swallowed_new(es->name, es->id, es->o_base, "e.swallow.content");
    e_gadcon_min_size_request_callback_set(es->gadcon,
 					  _e_shelf_gadcon_min_size_request, es);
@@ -1232,98 +1231,21 @@ _e_shelf_cb_mouse_in(void *data, int typ
    E_Shelf              *es;
 
    es = data;
-   if (es->cfg->autohide_show_action) return 1;
-
-   if (type == E_EVENT_ZONE_EDGE_IN)
-     {
-	E_Event_Zone_Edge_In *ev;
-	int                   show = 0;
-
-	ev = event;
-	if (es->zone != ev->zone) return 1;
-	switch (es->gadcon->orient)
-	  {
-	   case E_GADCON_ORIENT_LEFT:
-	      if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_RIGHT:
-	      if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_TOP:
-	      if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_BOTTOM:
-	      if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_CORNER_TL:
-	   case E_GADCON_ORIENT_CORNER_LT:
-	      if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_CORNER_TR:
-	   case E_GADCON_ORIENT_CORNER_RT:
-	      if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_CORNER_BL:
-	   case E_GADCON_ORIENT_CORNER_LB:
-	      if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   case E_GADCON_ORIENT_CORNER_BR:
-	   case E_GADCON_ORIENT_CORNER_RB:
-	      if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
-		show = 1;
-	      else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
-		show = 1;
-	      break;
-	   default:
-	      break;
-	  }
-
-	if (show)
+	if ((es->hide_animator) || (es->hide_timer))
 	  {
-	     edje_object_signal_emit(es->o_base, "e,state,focused", "e");
 	     e_shelf_toggle(es, 1);
 	  }
-	else
-	  e_shelf_toggle(es, 0);
-     }
-   else if (type == ECORE_X_EVENT_MOUSE_IN)
-     {
-	Ecore_X_Event_Mouse_In *ev;
-
-	ev = event;
-	/* If we are about to hide the shelf, interrupt on mouse in */
-	if (ev->win == es->win)
-	  {
-	     edje_object_signal_emit(es->o_base, "e,state,focused", "e");
-	     if ((es->hide_animator) || (es->instant_timer))
+	if (es->cfg->autohide_show_action) return 1;
 	       e_shelf_toggle(es, 1);
-	  }
-     }
    return 1;
 }
 
 static int
 _e_shelf_cb_mouse_out(void *data, int type, void *event)
 {
-   Ecore_X_Event_Mouse_Out *ev;
    E_Shelf                 *es;
 
-   ev = event;
    es = data;
-   if (ev->win != es->win) return 1;
    e_shelf_toggle(es, 0);
    return 1;
 }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to