tag.screen doesn't exist anymore

awful.tag.getscreen(tag) returns now the tag's screen index

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
dodo 2012-10-25 18:39:19 +02:00 committed by Uli Schlachter
parent d729b71b17
commit 1e4c14d306
3 changed files with 10 additions and 9 deletions

View File

@ -122,8 +122,8 @@ mytaglist.buttons = awful.util.table.join(
awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ modkey }, 1, awful.client.movetotag),
awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ modkey }, 3, awful.client.toggletag),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
) )
mytasklist = {} mytasklist = {}
mytasklist.buttons = awful.util.table.join( mytasklist.buttons = awful.util.table.join(

View File

@ -234,8 +234,9 @@ function mouse.client.dragtotag.widget(c)
local w = mouse.widget_under_pointer() local w = mouse.widget_under_pointer()
if w and widget.taglist.gettag(w) then if w and widget.taglist.gettag(w) then
local t = widget.taglist.gettag(w) local t = widget.taglist.gettag(w)
if t.screen ~= c.screen then local s = tag.getscreen(t)
aclient.movetoscreen(c, t.screen) if s ~= c.screen then
aclient.movetoscreen(c, s)
end end
aclient.movetotag(t, c) aclient.movetotag(t, c)
end end

View File

@ -37,7 +37,7 @@ tag.history.limit = 20
-- @param new_index Integer absolute position in the table to insert. -- @param new_index Integer absolute position in the table to insert.
function tag.move(new_index, target_tag) function tag.move(new_index, target_tag)
local target_tag = target_tag or tag.selected() local target_tag = target_tag or tag.selected()
local scr = target_tag.screen local scr = tag.getscreen(target_tag)
local tmp_tags = capi.screen[scr]:tags() local tmp_tags = capi.screen[scr]:tags()
if (not new_index) or (new_index < 1) or (new_index > #tmp_tags) then if (not new_index) or (new_index < 1) or (new_index > #tmp_tags) then
@ -117,8 +117,8 @@ function tag.delete(target_tag, fallback_tag)
local target_tag = target_tag or tag.selected() local target_tag = target_tag or tag.selected()
if target_tag == nil then return end if target_tag == nil then return end
local ntags = #capi.screen[target_tag.screen]:tags() local target_scr = tag.getscreen(target_tag)
local target_scr = target_tag.screen local ntags = #capi.screen[target_scr]:tags()
-- We can't use the target tag as a fallback. -- We can't use the target tag as a fallback.
local fallback_tag = fallback_tag local fallback_tag = fallback_tag
@ -147,7 +147,7 @@ function tag.delete(target_tag, fallback_tag)
end end
-- delete the tag -- delete the tag
target_tag.screen = nil data.tags[target_tag].screen = nil
-- If no tags are visible, try and view one. -- If no tags are visible, try and view one.
if tag.selected(target_scr) == nil and ntags > 0 then if tag.selected(target_scr) == nil and ntags > 0 then
@ -398,7 +398,7 @@ function tag.getidx(query_tag)
local query_tag = query_tag or tag.selected() local query_tag = query_tag or tag.selected()
if query_tag == nil then return end if query_tag == nil then return end
for i, t in ipairs(tag.gettags(query_tag.screen)) do for i, t in ipairs(tag.gettags(tag.getscreen(query_tag))) do
if t == query_tag then if t == query_tag then
return i return i
end end