Home » Eclipse Projects » SWTBot » UI deadlock when typing character with SWTKeyboardStrategy
UI deadlock when typing character with SWTKeyboardStrategy [message #40829] |
Fri, 26 June 2009 17:23 |
Pascal G Messages: 157 Registered: July 2009 |
Senior Member |
|
|
Hi again,
As you know, I'm using the typeText methods to simulate real user input
and with the AltGr problem we are having, I started using the EN_US
keyboard layout for the tests. I found out that the layout couldn't
write the ' character with AWTKeyboardStrategy, so I started using
SWTKeyboardStrategy; problem is, I'm getting UI deadlock.
First, Display.post synchronize on the Device class (Display, line 2900)
then obtains the display pointer with OS.GDK_DISPLAY() (Display, line
2904). This method then lock on a field of the OS class and that's where
the WorkbenchTestable thread (SWTBot's thread) holds.
Meanwhile, in the UI thread, a paint event has been dispatched by SWT
using OS.gtk_main_do_event (OS, line 5783) which holds the lock on the
OS field. During the paint event handling, the widget being painted
tries to access something (could be the GC, system color, anything, I
got the deadlocks at different places) in the Display class: the class
check for validity and tries to synchronize on the Device class before
doing so, but this lock is hold by Display.post, on another thread. DEADLOCK
I tried wrapping up the calls to my calls to typeText into syncExec and
the text that was typed only appeared at the end of the exec. If a
problem happens (and it did) then the UI is frozen.
For now, I have fallen back to a custom AWTStrategy which map ' to
KeyEvent.VK_QUOTE, but if anyone has any ideas about this issue, I would
appreciate it.
Regards,
P
|
|
|
Re: UI deadlock when typing character with SWTKeyboardStrategy [message #40860 is a reply to message #40829] |
Fri, 26 June 2009 17:45 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
I'd recommend opening a bug against SWT if you're sure that's the case.
I'm not on GTK and can't reproduce this.
--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
On 26/6/09 22:53, Pascal Gelinas wrote:
> Hi again,
>
> As you know, I'm using the typeText methods to simulate real user input
> and with the AltGr problem we are having, I started using the EN_US
> keyboard layout for the tests. I found out that the layout couldn't
> write the ' character with AWTKeyboardStrategy, so I started using
> SWTKeyboardStrategy; problem is, I'm getting UI deadlock.
>
> First, Display.post synchronize on the Device class (Display, line 2900)
> then obtains the display pointer with OS.GDK_DISPLAY() (Display, line
> 2904). This method then lock on a field of the OS class and that's where
> the WorkbenchTestable thread (SWTBot's thread) holds.
>
> Meanwhile, in the UI thread, a paint event has been dispatched by SWT
> using OS.gtk_main_do_event (OS, line 5783) which holds the lock on the
> OS field. During the paint event handling, the widget being painted
> tries to access something (could be the GC, system color, anything, I
> got the deadlocks at different places) in the Display class: the class
> check for validity and tries to synchronize on the Device class before
> doing so, but this lock is hold by Display.post, on another thread.
> DEADLOCK
>
> I tried wrapping up the calls to my calls to typeText into syncExec and
> the text that was typed only appeared at the end of the exec. If a
> problem happens (and it did) then the UI is frozen.
>
> For now, I have fallen back to a custom AWTStrategy which map ' to
> KeyEvent.VK_QUOTE, but if anyone has any ideas about this issue, I would
> appreciate it.
>
> Regards,
> P
|
|
| | | | | | |
Goto Forum:
Current Time: Thu Mar 28 19:24:07 GMT 2024
Powered by FUDForum. Page generated in 0.02480 seconds
|