Skip to content

Tag selection is not restored properly #43

Open
@trinistr

Description

When finishing the cycling, tags on the final client's screen are unselected, leaving only the client's first tag.

Relevant sections are in the exit_grabber() function (inside cyclefocus.cycle()).
Following part is supposed to restore the tags, but it does not actually handle the client's screen. A separate loop is needed to preserve the behaviour mentioned in the comment.

            -- Restore previously selected tags for screen(s).
            -- With a given client, handle other screens first, otherwise
            -- the focus might be on the wrong screen.
           if restore_tag_selected then
                for s in capi.screen do
                    if not c or s ~= c.screen then
                        for _,t in pairs(s.tags) do
                            t.selected = restore_tag_selected[s][t]
                        end
                    end
                end
+                if c then
+                    for _,t in pairs(c.screen.tags) do
+                         t.selected = restore_tag_selected[c.screen][t]
+                    end
+                end
            end

Tag selection is actually changed by raise_client_fn(), because the default implementation (cyclefocus.raise_client_without_focus()) actively selects client's first tag. This requires moving the block where it is called before the tag restoration logic. There don't seem to be any issues with doing that, but this probably needs further testing.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions