On 05/31/2018 09:40 AM, Dmitry Timoshkov wrote:
Zebediah Figura zfigura@codeweavers.com wrote:
Changes from Staging patch: send message inside of SetFocus() handler instead of adding a new driver message.
These changes broke the patch, test program attached to the bug 2155 enters an infinite loop (flickering windows constantly changing the focus) here with Mate as a WM.
Thanks, I've sent an updated version. Please let me know if the patch still breaks; it works here with Xfce4 and passes all of the user32 tests (or at least doesn't introduce any new failures).
New version of the patch still doesn't work here, same flickering in an infinite loop until I move mouse over the test's window.
Thanks. It looks like Marco sends a WM_TAKE_FOCUS message when honouring a request to become the active window. Since we call SetForegroundWindow() inside of our WM_TAKE_FOCUS handler, we generate a loop. This wouldn't be a problem, except that the application creates two windows in quick succession before processing events, and Marco generates one WM_TAKE_FOCUS message for each, so we essentially start out one WM_TAKE_FOCUS message behind the most recent one.
It's not clear to me what we should do about this; the spec doesn't seem to explicitly forbid any of this behaviour, but neither does it say we can depend on receiving WM_TAKE_FOCUS in response to a _NET_ACTIVE_WINDOW request. Could someone more knowledgeable about X11 provide input?