Alt-tab-macos: Focused window resets to second item after some milliseconds

Created on 4 Apr 2020  路  7Comments  路  Source: lwouis/alt-tab-macos

I this issue on my alt-tab-macos instance:

https://youtu.be/nbDWCy8g2R8

When I move to the right windows, selector return always after some milliseconds to second item.

It is very boring, alt-tab-macos is unusable for me 馃様

  • alt-tab-macos version: 3.4.0
  • macos version: 10.15.4

Best regards,
St茅phane

bug unreproducible

Most helpful comment

I can't reproduce the issue on my machine unfortunately, so it's hard to guess what's happening here.

It seems the focused window is reset to index 1, multiple times. In the code there are 4 places where there the index is set.

  1. This is on mouse click so unlikely to be the one at play here
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/ui/main-window/ThumbnailsView.swift#L33

  2. This one happens when you invoke the UI initially, so again I don't think it's this
    https://github.com/lwouis/alt-tab-macos/blob/48d5d6305ee370ee70079e008f34e27331dea1a8/src/ui/App.swift#L150

  3. This one can be triggered by many things, but it is a variable step from the current selected window. In your video, which ever is the current selection is clearly resets to exactly index1, so I would say unlikely:
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/logic/Windows.swift#L30

This leaves us with our candidate:

  1. This one sets the index to 1, which seems exactly like what we see on screen. However, it is triggered when an app quits in the background. This means that it could be possible that on system, some background process is starting/quitting in a loop, thus affecting the focused window continuously
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/logic/Applications.swift#L64

All 7 comments

I can't reproduce the issue on my machine unfortunately, so it's hard to guess what's happening here.

It seems the focused window is reset to index 1, multiple times. In the code there are 4 places where there the index is set.

  1. This is on mouse click so unlikely to be the one at play here
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/ui/main-window/ThumbnailsView.swift#L33

  2. This one happens when you invoke the UI initially, so again I don't think it's this
    https://github.com/lwouis/alt-tab-macos/blob/48d5d6305ee370ee70079e008f34e27331dea1a8/src/ui/App.swift#L150

  3. This one can be triggered by many things, but it is a variable step from the current selected window. In your video, which ever is the current selection is clearly resets to exactly index1, so I would say unlikely:
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/logic/Windows.swift#L30

This leaves us with our candidate:

  1. This one sets the index to 1, which seems exactly like what we see on screen. However, it is triggered when an app quits in the background. This means that it could be possible that on system, some background process is starting/quitting in a loop, thus affecting the focused window continuously
    https://github.com/lwouis/alt-tab-macos/blob/5c51decf6949aba0d26969c46474934145df3109/src/logic/Applications.swift#L64

If my assumption is right and you have some process being restarted continuously, this is not a normal situation on your machine. Still, there is also a bug in AltTab to reset focus like this.

I pushed a potential fix on the more-l10n branch, which i aim to merge in a PR sometime this week, together with a bunch of other improvements. This will auto-trigger a new AltTab release that hopefully fixes the issue for you!

if my assumption is right and you have some process being restarted continuously, this is not a normal situation on your machine

Thanks, @lwouis how can I see it?

I'm not sure. You could open Activity Monitor and see if you can visually find something moving in and out of the list, maybe by playing with the table sorting

You could open Activity Monitor and see if you can visually find something moving in and out of the list

@lwouis I see nothing.

For information, on my laptop, I use 馃憤

  • node for web development
  • docker
  • ...

@stephane-klein is the problem still happening btw? What if you reboot, still happening?

If yes, could you please try this build? AltTab.app.zip Update: a new version has been release. You can simply click the update button:

image

It's a build of the branch where I made a tentative fix for the issue. I would like to know from you if it fixes it 馃憤

@lwouis issue fixed after upgrade to last version 3.7.3 馃憣

Thanks you !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rway7 picture rway7  路  5Comments

mrc247-DE picture mrc247-DE  路  3Comments

gingerr picture gingerr  路  4Comments

boldandbusted picture boldandbusted  路  3Comments

gingerr picture gingerr  路  6Comments