
Comment #80 on issue 177 by gere...@gmail.com: xmonad does not follow ICCCM and ignores WM_TAKE_FOCUS protocol http://code.google.com/p/xmonad/issues/detail?id=177 I took a look at if this could be done through extensible state and a modification of the logHook in Hooks.ICCCMFocus and my opinion is that it cannot. There are a few problems with the logHook as is: - It uses currentTime as the event time, violating the ICCCM - It sends a WM_TAKE_FOCUS client message every time the logHook is run Problems with the out-of-core approach in general are: - No way to connect a focus change to the event that caused it. The closest possibility is to have an eventHook that stores the event in some extensible state or in an IORef cell. The problem is there is no way to clear it once event processing has finished. - The logHook is the only reasonable place to put the sending of the WM_TAKE_FOCUS client message, but the logHook is called many more times than the focus is changed. It might be sufficient to remember the focused window from the last invocation and send when it's different, but it's still quite hackish. The in-core solution as-is is found wanting as well: - When a window refuses to take focus (like many on-screen keyboards) it's not possible to manage the window. XMonad's management focus is tied directly to input focus. I agree with #79 that xmonad should take care to implement the ICCCM properly without needing any contrib modules.