Skip to content

Regression: Can't switch between windows of same app after some time #16

Open

Description

@stianhoiland

Eventually Alt-Tilde/Backquote seems to stop working. "Eventually" as in after cmdtab has run for some time. Probably something goes wrong after cmdtab has observed more than 128 window changes, which is max history entries. The code that handles the overflow is here. Admittedly I wrote this while rather exhausted, so I won't be surprised if it's wonky.

Activity

  1. changed the title [-]Can't switch between windows of same app after some time[/-] [+]Regression: Can't switch between windows of same app after some time[/+] on Apr 22, 2025
  2. german-one commented on May 7, 2025

    @german-one
    Contributor

    I can't repro. However, you generate an off-by-one in the linked code.

    In the if branch, postfix incrementation should be used
    sizeof History[0] * HistoryCount++

    and in the else branch take either
    sizeof History[0] * (HistoryCount - 1)
    or, preferably something like
    sizeof History[0] * (countof(History) - 1) or sizeof History - sizeof History[0]
    to tell the compiler it's a constant expression which doesn't need to be calculated at runtime.

    I'll refrain from further PRs for now as it doesn't seem you have time to review them at the moment.

  3. stianhoiland commented on Aug 19, 2026

    @stianhoiland
    OwnerAuthor

    This issue might have been fixed by #33/#36. I haven't kept track, so it might have disappeared (or not!) from other changes. I'll close if I eventually feel confident that I'm not having this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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