Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsWiggly Mouse Browser Pre-help: Display.readAndDispatch
https://www.eclipse.org/forums/index.php/mv/msg/168131/533372/#msg_533372
I'm going to commit the cardinal sin of not including a real code sample, because it has some fairly complex XPCOM callback code and I haven't figured out which piece is the offending one. For some basic info, there is an authentication listener registered, a global XPCOM channel listener registered, and some standard browser/progress listeners registered. I am also using Browser.execute(String) to execute page-level script.
while (true) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
Then I have another thread which for simplicity we can say is waiting for the callback from BrowserListener.completed. I load an HTML page using Browser.setUrl, I get a the main request and maybe a script request or two from the request listener and then it suddenly stops mid-load and doesn't finish the page.
I'm running my SWT on Linux/gtk_x64, so readAndDispatch calls the native g_main_context_iteration and stalls (I can see it in the debugger or in a kill -3). Any mouse movement over the browser window OR a call to Display.wake() will unlock the dispatch loop and finish loading the HTML. There are no Java locking/thread problems that I can see, so something strange is happening in the native level.
I'm not expecting a real answer for such an ambiguous problem description; I was just wondering if anyone had seen a similar problem with readAndDispatch hanging and what it turned out to be. I can work around the problem by putting a poke (Display.wake()) in my page loading loop, but that doesn't seem right.]]>Ryan Levering2010-05-13T15:01:28-00:00Re: Wiggly Mouse Browser Pre-help: Display.readAndDispatch
https://www.eclipse.org/forums/index.php/mv/msg/168131/537586/#msg_537586
Ryan Levering2010-06-03T03:12:11-00:00