Am Sonntag, den 01.07.2012, 15:24 +0200 schrieb Felix Bier: > Hello list, > this patch makes tag.viewidx take a screen index rather than a screen > object, complying with its doc string. This seems to be more consistent > with other parts of the API to me, and also fixes #963. Config breakage > should be minimal, since this function is usually called without the > screen parameter. > Felix
Unfortunately I noticed a problem with my patch when attempting to
switch tags via mouse wheel. When tag.viewprev or tag.viewnext is set as
a callback to a mouse button event for a tag, the screen parameter
passed to viewidx will in fact be the originating tag. This is the right
behaviour for i. e. viewonly, but causes an error with my patch. I
guess this did not matter previously, because screen.index would
evaluate to nil.
I am not sure how this should be handled. The attached patch checks
whether type(screen)=="number", which is the most simple fix, but not
exactly beautiful. Alternatively, the previous patch could be reverted
and this side effect be documented. The "right thing" would probably be
to wrap viewnext/viewprev like awful.button({}, 4, function()
awful.tag.viewnext() end), though that would be my least favourite
option, because it would break a lot of configs. Other opinions?
Felix
From f542a68519a5c0c416eebef2b0434a7f3dc18e34 Mon Sep 17 00:00:00 2001 From: Felix Bier <[email protected]> Date: Sun, 1 Jul 2012 19:52:57 +0200 Subject: [PATCH] Follow-up fix for tag.viewidx When viewprev or viewnext are set as mouse button callbacks, the screen number parameter passed to viewidx will in fact be the originating tag. Signed-off-by: Felix Bier <[email protected]> --- lib/awful/tag.lua.in | 2 +- 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index 0d75366..dc32fde 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -345,7 +345,7 @@ end -- @param i The relative index to see. -- @param screen Optional screen number. function tag.viewidx(i, screen) - local screen = screen or capi.mouse.screen + local screen = (type(screen) == "number" and screen) or capi.mouse.screen local tags = capi.screen[screen]:tags() local showntags = {} for k, t in ipairs(tags) do -- 1.7.11.1
signature.asc
Description: This is a digitally signed message part
