Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
      Tag: SPLIT
        Ecore_X.h ecore_x_events.c 


Log Message:


"safe" interface. a rogue/bad app will find it REALLY hard to bring ecore
down now. ecore does pointer AND magic number checks so it can safely abort
using stale pointers (already freed, but ram is still valid in memory space)
and getting NULL pointers from apps etc. since handles for timers, idlers
etc. etc. are all pointers, this keeps stability up, at least on the ecore
side of things. technically the app is STILL bad and has a fatal bug, but
it wont necessarily crash strangely inside ecore (easily) due to the badness.

this is also what evas does and seems to work wonders in preventing
acciental segv's or wierd bugs during development. i need to make ecore
"complain" bitterly next if the pointers are NULL or the types wrong.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -3 -r1.1.2.7 -r1.1.2.8
--- Ecore_X.h   23 Jan 2003 23:03:24 -0000      1.1.2.7
+++ Ecore_X.h   23 Jan 2003 23:51:41 -0000      1.1.2.8
@@ -138,7 +138,19 @@
 struct _Ecore_X_Event_Window_Focus_In
 {
    Window  win;
-   
+   struct {
+      int while_grabbed : 1;
+      int grab : 1;
+      int ungrab : 1;
+   } mode;
+   struct {
+      int  parent : 1;
+      int  child : 1;
+      int  virt : 1;
+      int  non_linear : 1;
+      int  pointer : 1;
+      int  root : 1;
+   } notify;
    Time time;
 };
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_events.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- ecore_x_events.c    23 Jan 2003 23:03:24 -0000      1.1.2.4
+++ ecore_x_events.c    23 Jan 2003 23:51:41 -0000      1.1.2.5
@@ -107,6 +107,10 @@
 void
 _ecore_x_event_handle_button_press(XEvent *xevent)
 {
+   static Window last_win = 0;
+   static Window last_last_win = 0;
+   static Window last_subwin = 0;
+   static Window last_last_subwin = 0;
    static Time last_time = 0;
    static Time last_last_time = 0;
    int did_triple = 0;
@@ -142,11 +146,15 @@
             e->win = xevent->xbutton.window;
             e->subwin = xevent->xbutton.subwindow;
             e->time = xevent->xbutton.time;
-            if ((e->time - last_time) <= 
-                (int)(1000 * _ecore_x_double_click_time))
+            if (((e->time - last_time) <= 
+                 (int)(1000 * _ecore_x_double_click_time)) &&
+                (e->win == last_win) &&
+                (e->subwin == last_subwin))
               e->double_click = 1;
-            if ((e->time - last_last_time) <= 
-                (int)(2 * 1000 * _ecore_x_double_click_time))
+            if (((e->time - last_last_time) <= 
+                 (int)(2 * 1000 * _ecore_x_double_click_time)) &&
+                (e->win == last_win) && (e->win == last_last_win) &&
+                (e->subwin == last_subwin) && (e->subwin == last_last_subwin))
               {
                  did_triple = 1;
                  e->triple_click = 1;
@@ -155,11 +163,19 @@
          }
        if (did_triple)
          {
+            last_win = 0;
+            last_last_win = 0;
+            last_subwin = 0;
+            last_last_subwin = 0;
             last_time = 0;
             last_last_time = 0;
          }
        else
          {
+            last_last_win = last_win;
+            last_win = xevent->xbutton.window;
+            last_last_subwin = last_subwin;
+            last_subwin = xevent->xbutton.subwindow;
             last_last_time = last_time;
             last_time = xevent->xbutton.time;
          }




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to