[xmonad] Emacs frame with STRUT+DOCK doesn't get keyboard focus

Ted Zlatanov tzz at lifelogs.com
Wed Jun 8 21:44:58 CEST 2011

On Wed, 8 Jun 2011 11:40:29 -0400 Brandon Allbery <allbery.b at gmail.com> wrote: 

BA> 2011/6/8 Ted Zlatanov <tzz at lifelogs.com>:
>> On Tue, 7 Jun 2011 18:18:34 -0400 Brandon Allbery <allbery.b at gmail.com> wrote:
BA> Dig back a few messages and you'll find the source code for a function
BA> manageUtility.  Copy it into your xmonad.hs and invoke it instead of
BA> manageDocks in your manageHook.
>> Can it be applied only to Emacs frames at the manageHook level?

BA> Yes, although you'll have to work out what to use to select it
BA> yourself.  (This may be tricky as I've found emacs can set or change
BA> titles in odd ways.

>> title =? "my emacs frame" --> manageUtility

BA> just like any other managehook.

Hmm yeah, that's a tough one.  There's nothing in xwininfo that could
identify Emacs directly, and the frame title and class are not reliable.
So we'll have to force the Emacs docked frames to have a specific title.
It's not ideal but should work.  To summarize, we'll tell the users to
add your manageUtility (renamed to manageEmacsDockHook, if that's OK
with you):

manageEmacsDockHook :: ManageHook
manageEmacsDockHook =  ask >>=
                       \win -> liftX (withDisplay $ \dpy -> io $ raiseWindow dpy win) >>

and then modify their manageHook:

title =? "special emacs dock frame title" --> manageEmacsDockHook


More information about the xmonad mailing list