http://bugs.winehq.org/show_bug.cgi?id=15469
--- Comment #2 from Vincent Povirk madewokherd@gmail.com 2008-10-29 16:41:35 --- Right now, virtual desktops ignores WM_TAKE_FOCUS requests, meaning the virtual desktop can be focused but its subwindows cannot. However, if a subwindow of the window that has the focus expresses interest in keyboard events (as these do), and the pointer is on that subwindow, keyboard events will go to that window. As long as X keyboard events go to the right thread, the server processes them as events on that thread, and the messages go to the right place.
I can hack around this by sending all keyboard events that go through the server without a thread id, letting the server sort out which window should ultimately get the message, even though the X event goes to the wrong place.
I'm told the proper solution is to set the X focus so the keyboard events go to the right place, but getting all of this to work properly together is difficult.