Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/itray


Modified Files:
        e_mod_main.c 


Log Message:


pass on mouse events if we didnt trap them first. :) (we fake them)

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/itray/e_mod_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_main.c        1 Feb 2006 10:25:17 -0000       1.4
+++ e_mod_main.c        1 Feb 2006 11:25:07 -0000       1.5
@@ -628,7 +628,32 @@
      }
    else
      {
-       /* FIXME: fake mouse events onto tray windows */
+       Ecore_X_Window win;
+       int x, y, w, h, xx, yy;
+       Evas_List *l;
+
+       printf("fakie!\n");
+       for (l = itb->tray->wins; l; l = l->next)
+         {
+            win = (Ecore_X_Window)l->data;
+            
+            printf("check..\n");
+            ecore_x_window_geometry_get(win, &x, &y, &w, &h);
+            evas_pointer_output_xy_get(itb->evas, &xx, &yy);
+            xx -= itb->x;
+            yy -= itb->y;
+            printf("%i %i %i %i | %i %i %i %i\n",
+                   x, y, w, h, xx, yy, 1, 1);
+            if (E_CONTAINS(x, y, w, h, xx, yy, 1, 1))
+              {
+                 x = xx - x;
+                 y = yy - y;
+                 win = ecore_x_window_at_xy_begin_get(win, x, y);
+                 printf("send %x! %i %i\n", win, x, y);
+                 ecore_x_mouse_down_send(win, x, y, ev->button);
+                 break;
+              }
+         }
      }
 }
 
@@ -645,7 +670,27 @@
      }
    else
      {
-       /* FIXME: fake mouse events onto tray windows */
+       Ecore_X_Window win;
+       int x, y, w, h, xx, yy;
+       Evas_List *l;
+       
+       for (l = itb->tray->wins; l; l = l->next)
+         {
+            win = (Ecore_X_Window)l->data;
+            
+            ecore_x_window_geometry_get(win, &x, &y, &w, &h);
+            evas_pointer_output_xy_get(itb->evas, &xx, &yy);
+            xx -= itb->x;
+            yy -= itb->y;
+            if (E_CONTAINS(x, y, w, h, xx, yy, 1, 1))
+              {
+                 x = xx - x;
+                 y = yy - y;
+                 win = ecore_x_window_at_xy_begin_get(win, x, y);
+                 ecore_x_mouse_up_send(win, x, y, ev->button);
+                 break;
+              }
+         }
      }
 }
 
@@ -654,10 +699,29 @@
 {
    Evas_Event_Mouse_Move *ev;
    ITray_Box *itb;
-
+   
    ev = event_info;
    itb = data;
-   /* FIXME: fake mouse events onto tray windows */
+     {
+       Ecore_X_Window win;
+       int x, y, w, h;
+       Evas_List *l;
+       
+       for (l = itb->tray->wins; l; l = l->next)
+         {
+            win = (Ecore_X_Window)l->data;
+            
+            ecore_x_window_geometry_get(win, &x, &y, &w, &h);
+            if (E_CONTAINS(x, y, w, h, ev->cur.canvas.x, ev->cur.canvas.y, 1, 
1))
+              {
+                 x = ev->cur.canvas.x - x;
+                 y = ev->cur.canvas.y - y;
+                 win = ecore_x_window_at_xy_begin_get(win, x, y);
+                 ecore_x_mouse_move_send(win, x, y);
+                 break;
+              }
+         }
+     }
 }
 
 static void




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to