Ambiguous focus after some commands...

I've recently encountered an odd focus behavior, and I'm not certain whether I'm thinking about it incorrectly, or if it's a bug. I do a lot of document editing in Emacs' org-mode. (and I highly recommend it: anyone who groks xmonad will probably find Emacs a pleasant environment). In that universe, you compose in a plain-text format, and then direct an 'export' process. On export, Emacs translates your 'org-mode' document into a LaTeX one, then makes PDF out of it, and optionally displays it. If you're doing this with evince as the display engine, you get the result of the document view updating, but no new window. I frequently have my Evince on a screen adjacent to the Emacs, so each has plenty of space. So: with my focus on the Emacs, I [C-c C-e d] (control-c, control-e, d) and watch the export process go. Evince updates with the view of the new document. ... And my focus is now oddly inconsistent. The Emacs window still has the red border by which xmonad attempts to communicate focus, and if I do things like 'onNextNeighbour W.view' it becomes clear that xmonad thinks my focus is there. But my keystrokes are going to evince. If I had started a new client, which appeared on a currently displayed desktop, I would expect that client to grab focus. But I'm not starting a new client, here; I'm sending a message to an existing one. Or at least I think that's what I'm doing, it's possible I guess that Evince is slaying the old process and starting anew, but I'd then expect it to appear on the same workspace as the Emacs. Does this ring any bells? -Allen S Rout

On Thu, Jan 5, 2012 at 15:39, Allen S. Rout
So: with my focus on the Emacs, I [C-c C-e d] (control-c, control-e, d) and watch the export process go. Evince updates with the view of the new document.
... And my focus is now oddly inconsistent. The Emacs window still has the red border by which xmonad attempts to communicate focus, and if I do things like 'onNextNeighbour W.view' it becomes clear that xmonad thinks my focus is there. But my keystrokes are going to evince.
evince is probably raising / focusing itself. It should ask the WM to do so instead of doing so itself, but doesn't; and there have been other reports that xmonad doesn't notice when programs do that. I suspect an addition to the handleEventHook is needed that watches for FocusIn events and updates the internal state if necessary. ...except I just noticed that Graphics.X11.Xlib.Extras.Event doesn't *have* FocusIn. Errrr??? -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

Quoting "Allen S. Rout"
... And my focus is now oddly inconsistent. The Emacs window still has the red border by which xmonad attempts to communicate focus, and if I do things like 'onNextNeighbour W.view' it becomes clear that xmonad thinks my focus is there. But my keystrokes are going to evince.
FWIW, I've also seen this kind of behavior clicking links (and having them open in an already-existing chromium window). ~d
participants (3)
-
Allen S. Rout
-
Brandon Allbery
-
wagnerdm@seas.upenn.edu