Re: [Sawfish] Activate workspace if 'focus-windows-when-mapped set patch

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


On Tue, 3 Apr 2012 04:04:33 +0200, fuchur wrote:
>      (when (and (window-really-wants-input-p w)
> -               (window-visible-p w)
> +               (or (window-visible-p w)
> +                   (window-workspaces w))
>                 (or (let ((focus (input-focus)))

The logic is correct, but please delete this part.  window-workspaces
returns nil if it's WS sticky. (It should be documented.) But the
original goal of this function is to *focus* the mapped window. With
this hunk, a sticky window won't get the focus, I'm afraid.

Ah yes, "require" is necessary, and you can't replace it with
"open wm.workspace"; it'll crash Sawfish. (See eg the open clause
in windows.jl for the reason.)

> @@ -177,6 +179,10 @@
>                                 (not (window-get w 'never-focus))
>                                 (not (window-get w 'inhibit-focus-when-mapped)))
>                                (window-get w 'focus-when-mapped))))))
> +      (unless (window-get w 'sticky)
> +        (when (not (eq (car (window-in-workspace-p w current-workspace))
> +                       (car (window-workspaces w))))
> +          (select-workspace (car (window-workspaces w)))))
>        (set-input-focus w)))
>  

Thanks. You can combine 'unless' with 'when', but it's a trivial
matter.

I'm sorry for crash. (I know, you should send a patch after testing,
but I'm half dead.)

Teika (Teika kazura)


-- 
Sawfish ML


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/