Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Wiggly Mouse Browser Pre-help: Display.readAndDispatch
Wiggly Mouse Browser Pre-help: Display.readAndDispatch [message #533372] Thu, 13 May 2010 15:01 Go to next message
Ryan Levering is currently offline Ryan LeveringFriend
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()) {

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.
Re: Wiggly Mouse Browser Pre-help: Display.readAndDispatch [message #537586 is a reply to message #533372] Thu, 03 June 2010 03:12 Go to previous message
Ryan Levering is currently offline Ryan LeveringFriend
Messages: 3
Registered: May 2010
Junior Member
As follow-up, I logged bug 313956 for this issue. It's reproducible intermittently if you do certain things (I don't know the whole scope) on a web page and causes the screen to freeze during loading. Moving the mouse completes the load. I have temporarily worked around the issue by having a separate thread calling wake on the display every Xms.
Previous Topic:Preventing the user from leaving the tab in a CTabFolder
Next Topic:SWT_AWT compatibility
Goto Forum:

Current Time: Fri Dec 06 15:23:13 GMT 2019

Powered by FUDForum. Page generated in 0.02496 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top