Wiggly Mouse Browser Pre-help: Display.readAndDispatch [message #533372] |
Thu, 13 May 2010 15:01 |
Ryan Levering Messages: 3 Registered: May 2010 |
Junior Member |
|
|
I'm having a wiggly mouse problem while loading pages in the Browser, but it's not the standard SWT one. My problem is not that I'm locked on Display.sleep(), it's that I'm locked on the native call in Display.readAndDispatch.
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02358 seconds