Post ::sendMouseEvent on UI thread

Max Young <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Hi,

I use Mozilla 1.8 in an embedded application. I have ported from 1.9 the 
sendMouseEvent from nsIDOMWindowUtils to my application. Everything 
works fine, but now I face another problem.
I want to send a mouse event to a specific portal which causes a 
hanging/deadlock in my app. Because sendMouseEvent triggers an event to 
a parent node which again starts a javascript which triggers an 
XMLHTTPRequest which wants to update the UI.

so the execution looks like this
::executeonUIThread() {
  ...->sendMouseEvent(...);
//events get-> propagate to parent node -> starts a js script->which 
starts a XMLHTTPRequest -> waits for gui thread (deadlock).
}

During this XMLHTTPRequest I get a mutal exclusion problem because I 
execute the sendMouseEvent method on the UI thread and the 
XMLHTTPRequest request wants to change something on the UI and so waits 
that it can access the UI.
But the embedded App. holds a lock on the gui because it calls 
sendMouseEvent.
I need to call sendMouseEvent on the GUI thread because at latest the js 
script will otherwise crash my application otherwise.

Is it somehow possible to post the sendMouseEvent() on the ui thread and 
return immediately so that the embedded application does not lock the UI 
anymore.

Something like this
::executeAndReturnImmediate() {

	postEventAsyn(->sendMouseEvent(...));
//Does not wait for the event to proceed, just return immediate to the 
embedded app.
}

Would something like this be possible?
Or is there an easier way so that I can send ->sendMouseEvent(...) 
without that the emb. appliation has to lock the UI thread?

Thx for any advice.

Max
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.