Index: gnopernicus/srlow/libsrlow/SRLow.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/srlow/libsrlow/SRLow.c,v
retrieving revision 1.92
diff -u -r1.92 SRLow.c
--- gnopernicus/srlow/libsrlow/SRLow.c	12 Jul 2004 14:02:23 -0000	1.92
+++ gnopernicus/srlow/libsrlow/SRLow.c	15 Jul 2004 09:59:33 -0000
@@ -93,7 +93,7 @@
     SRL_EVENT_TEXT_SELECTION_CHANGED,
     SRL_EVENT_VALUE_CHANGED,
     SRL_EVENT_STATE_CHECKED,
-    SRL_EVENT_STATE_SELECTED, /*FIXME: really needed???? */
+    SRL_EVENT_STATE_SELECTED, 
     SRL_EVENT_STATE_EXPANDED,
     SRL_EVENT_STATE_SHOWING,
     SRL_EVENT_SELECTION_CHANGED,
@@ -1278,6 +1278,16 @@
 	event->type = SRL_EVENT_TAB_ADDED;
     else if (srle_has_type (event, SRL_EVENT_CHILDREN_REMOVED))
 	event->type = SRL_EVENT_TAB_REMOVED;
+	
+    /* Convert the "state-changed:selected" event for a _selected_ page-tab
+       into a "focus:" event */
+    if (srle_has_type (event, SRL_EVENT_STATE_SELECTED) &&
+        srle_acc_has_role (event, SPI_ROLE_PAGE_TAB)    &&
+	srl_acc_has_state (event->acc_ev->source, SPI_STATE_SELECTED))
+    {
+	event->type = SRL_EVENT_FOCUS;
+    }	       	
+    
     return TRUE;
 }
 
@@ -1612,6 +1622,18 @@
          srle_has_type (event, SRL_EVENT_TAB_REMOVED))) 
 	rv = srle_acc_has_role (event, SPI_ROLE_PAGE_TAB);
 	
+    /*In some situations we have tho 'focus:' events for a page-tab 
+     (an "object:state-changed:selectes" event which was converted into
+      a focus event _and_ a "focus:" event) => report a single "focus:" event*/	
+    if (srle_has_type (event, SRL_EVENT_FOCUS) &&
+        srle_acc_has_role (event, SPI_ROLE_PAGE_TAB))
+    {
+	if (srl_last_focus == event->acc_ev->source)
+	    rv = FALSE;
+	else
+	    rv = TRUE;    
+    }	      
+	
     return rv;
 }
 
@@ -1636,6 +1658,7 @@
     srl_timing_process_start ((gpointer) event->acc_ev);
     srle_set_acc (event);
     srle_change_type (event);
+    process = srl_event_is_reported (event);
 
     if (srle_has_type (event, SRL_EVENT_FOCUS) ||
 	srle_has_type (event, SRL_EVENT_FOCUS2))
@@ -1646,7 +1669,6 @@
 /* FIXME: 
     if (srle_has_type (event, SRL_EVENT_WINDOW_DEACTIVATE))
 	report no focus if no other event */
-    process = srl_event_is_reported (event);
     if (process)
 	srl_report_event (event);
 
