http://bugs.winehq.org/show_bug.cgi?id=29254
Bug #: 29254 Summary: Alt key gets stuck when launching an X11 application Product: Wine Version: 1.3.34 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: winehq@tibit.com Classification: Unclassified
When launching an X11 app from a Windows app using Alt + another key, and the launched X11 app takes keyboard focus before the Alt key is released, the Windows app is left thinking the Alt key is still pressed. Returning to the Windows app using the mouse (or using the other Alt key + Tab) finds it in a state where many keystrokes don't work properly.
Workaround: Once you figure out that the app is misbehaving because Wine thinks a key is still down, this state can be cleared by tapping the originally-pressed Alt key a couple of times. (But having to do this is maddening.)
This is a regression. The problem doesn't exist in wine-stable (1.2.3).
This probably affects multiple applications, but I discovered it using the Forte Agent mail reader. To reproduce: 1. Download Forte Agent free trial: http://www.forteinc.com/agent/download.php 2. Configure it for receiving email. 3. Send yourself a few email messages with attachments that can be handled by an X11 program launched from Wine. The easiest way to test is to just send a html (mime multipart) message. 4. Open the email in Agent. 5. Control+I (or click Message -> Index) to show the message's mime parts. 6. Highlight the text/html item or attachment. 7. Alt+L to launch the attachment. Do not release the Alt until the X11 helper application (e.g. Firefox) appears and takes focus. If Agent prompts you to confirm before it launches the helper app, tell it not to confirm next time, and do it again. The goal here is to see what happens when the helper app opens before you let go of the Alt key. 8. Return to Agent's message list using the mouse (or using the other Alt key + Tab.) 9. Try to navigate the message list with the Up & Down arrows. Notice that it don't work, because Wine thinks Alt is still depressed. 10. Tap Alt twice to clear the stuck key.
The same problem shows up in other scenarios and with other keys. I chose to demonstrate with this approach because it's the most familiar to me and because a stuck Alt key has more obvious side-effects than some other keys.
To see the Control key get stuck, email yourself a message with a URL in it, receive the message, highlight the URL, and Control + U to launch it in your X11 browser. Return to Agent and notice that the Control key is now stuck until you tap it again.
A git bisect reveals the offending commit:
bc4afb078677095468d4ee8f9a15c18cbb47bbbf is the first bad commit commit bc4afb078677095468d4ee8f9a15c18cbb47bbbf Author: Alexandre Julliard julliard@winehq.org Date: Tue Mar 1 11:54:55 2011 +0100
server: Don't pass a thread id to send_hardware_message, determine it from the window.
:040000 040000 4e7ac89f77a4ddc31fd947151c34d0acadc5dcc0 a3d857abf43a1eed9fcb6837ea006ac00d80a1a7 M dlls :040000 040000 7247b4b93aca9c98394638ccd0c48a788133a8cd 45aed0fb1bc86b403af16666b3fa5963c2abaf7d M include :040000 040000 469f40ddbdca23554a397c5122a78e09a13e2c75 f118b4fd2fb23ecbde100798c68b3221fe5ec2fc M server