[4735] in testers
Alex Coventry: Sawfish focus issues.
daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Jun 8 10:48:17 2001
Message-Id: <200106081448.KAA04107@egyptian-gods.MIT.EDU>
To: testers@MIT.EDU
Date: Fri, 08 Jun 2001 10:48:06 -0400
From: Greg Hudson <ghudson@MIT.EDU>
I don't know if we really have time to be tweaking this, but I'm
sending this here so it doesn't get lost.
------- Forwarded Message
Return-Path: <alex_c@MIT.EDU>
Received: from central-city-carrier-station.mit.edu by po12.mit.edu (8.9.2/4.7) id GAA22019; Fri, 8 Jun 2001 06:39:53 -0400 (EDT)
Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86])
by central-city-carrier-station.mit.edu (8.9.2/8.9.2) with ESMTP id GAA23288
for <ghudson@mit.edu>; Fri, 8 Jun 2001 06:39:53 -0400 (EDT)
Received: from pickled-herring.mit.edu (PICKLED-HERRING.MIT.EDU [18.187.1.250])
by melbourne-city-street.mit.edu (8.9.2/8.9.2) with ESMTP id GAA21742
for <ghudson@MIT.EDU>; Fri, 8 Jun 2001 06:39:53 -0400 (EDT)
Received: (from alex_c@localhost) by pickled-herring.mit.edu (8.9.3)
id GAA11324; Fri, 8 Jun 2001 06:39:53 -0400
Date: Fri, 8 Jun 2001 06:39:53 -0400
Message-Id: <200106081039.GAA11324@pickled-herring.mit.edu>
From: Alex Coventry <alex_c@MIT.EDU>
To: Greg Hudson <ghudson@mit.edu>
Subject: Sawfish focus issues.
Hi, Greg. I noticed the mail to testers about the default focus
settings in sawfish. I've had similar problems, but have solved them,
at least to my own satisfaction. Feel free to use/post these ideas, if
they're helpful. You can control focus with the variable focus-mode.
(setq focus-mode 'enter-exit) or (setq focus-mode 'enter-only) are
sensible values for the problem raised in testers. Life also gets a
little easier if you also (setq transients-get-focus t), meaning that
dialogue windows automatically get focus when they appear, which is
usually where you want to be next. The only problem with that is that
then zephyrs and console messages can randomly shift the focus when they
appear, which is quite disruptive. Modifying the transient-map-window
hook (defined in transients.jl) like this solves that:
(defvar transients-that-do-not-get-focus (list "zwgc" "Console")
"List of names of windows that are not to be given focus on mapping,
even though they're transient.")
(define (transient-map-window w)
(let ((set-focus nil))
(when (window-transient-p w)
(let ((parent (get-window-by-id (window-transient-p w))))
(when parent
(when (and transients-get-focus
;; Must not be in the list of windows that the
;; user does not want to automatically get focus
(not (member (window-name w)
transients-that-do-not-get-focus))
(eq (input-focus) parent)
(window-really-wants-input-p w)
(window-visible-p w))
(set-input-focus w)
(setq set-focus t)))))
(when (and (not set-focus)
(or (and focus-windows-when-mapped
(not (window-get w 'never-focus)))
(window-get w 'focus-when-mapped))
(window-really-wants-input-p w)
(window-visible-p w))
(set-input-focus w))))
HTH
Alex.
------- End of Forwarded Message