focus-when-mapped extension

there's a quite easy way to disable focus-when-mapped for selected windows.

In other words:
you can have (setq focus-windows-when-mapped #t) and have some
(matched) windows not focused. For now only the opposite is possible
(having focus-windows-when-mapped #f) and have some matched windows focused.

It has 2 parts:

make the condition in transient-map-window  more complex:

  (define (transient-map-window w)
    (cond ((and (window-transient-p w)
		(window-really-wants-input-p w)
		(window-visible-p w)
		(transient-of-p w (input-focus) #:allow-root t))
	   (set-input-focus w))
>	   ((and (not (eq (window-get w 'focus-when-mapped) 'never))
		(or (and focus-windows-when-mapped
                         (not (window-get w 'never-focus)))
>                   (eq (window-get w 'focus-when-mapped) 'always))
                (or (not (window-transient-p w))
                    (eql (window-transient-p w) (root-window-id)))
                (window-really-wants-input-p w)
                (window-visible-p w))
	   (set-input-focus w))))

and update the configuration type in sawfish.wm.ext.match-window:

      (focus ,(_ "Focus")
       (raise-on-focus boolean)
|       (focus-when-mapped (choice never always))

hm, the symbols could be named differently.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]