http://bugs.winehq.org/show_bug.cgi?id=8683
--- Comment #8 from Fábio Capela fabio.capela@yahoo.com 2008-01-19 09:25:31 --- (In reply to comment #7)
Isn't that exactly the same behaviour as you would get using native X11 applications, or just xev for testing?
No. Native application will receive KeyPress events for deadkeys and can opt to process them - if they are just interested in keypresses, instead of text input, they might even never call XFilterEvent. But applications running under Wine right now will never receive the WM_KEYDOWN message for the deadkeys - even if they want to process keypresses for deadkeys they can't right now.
This can be seen by doing a +key trace in wine and pressing any deadkey; you will just get the KeyRelease event. At the same time, executing xev and pressing a deadkey will register both KeyPress and KeyRelease events, with "XFilterEvent returns: True" for the KeyPress event.
What is happening under Wine right now is also different from what happens under Windows - there application will receive WM_KEYDOWN events for deadkeys, and the problem with binding actions to deadkeys don't happen.
Wine relies on native dead keys support on the X11 side, so your patch would simply break it.
I don't care about my patch, I just want a bug fixed. My patch is just a first attempt to show what is wrong and a quick (and somewhat buggy) fix for it. Besides, I'm not discarding X11 deadkey processing, I just moved it to inside X11DRV_KeyEvent in dlls/winex11.drv/keyboard.c, where I store the deadkey information to be used by ToUnicodeEx. To properly handle deadkeys (i.e., send WM_KEYDOWN events for them and either WM_DEADCHAR with the deadkey or WM_CHAR with the composed character when they are processed by TranslateMessage), as far as I can tell, would require either a change in how keyboard events are handled (to let TranslateMessage itself call XFilterEvent on the original keypress event) or storing the result from XFilterEvent somewhere to be used by TranslateMessage. My main difficulty to handle this is that I don't know a reliable way to associate information with a WM_KEYDOWN message inside Wine - that is why I created a keypress buffer indexed by virtual key, which I believe is not the best solution to this problem.