Re: [Sawfish] Activate workspace if 'focus-windows-when-mapped set patch |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [Sawfish] Activate workspace if 'focus-windows-when-mapped set patch
- From: Teika Kazura <teika@xxxxxxxxxxx>
- Date: Tue, 03 Apr 2012 15:54:40 +0900 (JST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=st+ICrMNY9I8P23Scv2qGKu4wESPiiEZiZjOR40bGazshwtSLvJw5Sb28VhZnS9/Izf1UZpmhtcZ0KbdDg/oyq+E8ADg7LXxcstEO1FAJ+QBsae8PaitLo6X5r+QlTJ9UxhB7mdMAuHhPC6cbtR7cx+R0Q/H28sQxxsdHHZIDsQ=; h=Date:Message-Id:To:Subject:From:In-Reply-To:References:Mime-Version:Content-Type:Content-Transfer-Encoding;
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