yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Microsoft Teams meeting window switches active space back to Teams window

Open rxbn opened this issue 1 year ago • 2 comments

When I join a meeting in Teams and the meeting window is not minimized, and I switch the active space, it brings me back to the Teams space.

I believe that this has something to do with yabai not noticing that the floating window has changed the space (since it follows you to every space):

},{
        "id":8947,
        "pid":52272,
        "app":"Microsoft Teams (work or school)",
        "title":"XXX (External) | Microsoft Teams",
        "frame":{
                "x":1605.0000,
                "y":46.0000,
                "w":1587.0000,
                "h":1746.0000
        },
        "role":"AXWindow",
        "subrole":"AXStandardWindow",
        "display":1,
        "space":7, <- yabai thinks the floating window is still at space 7, even though I am at another space
        "level":-20,
        "layer":"below",
        "opacity":1.0000,
        "split-type":"vertical",
        "split-child":"second_child",
        "stack-index":0,
        "can-move":true,
        "can-resize":true,
        "has-focus":false,
        "has-shadow":false,
        "has-parent-zoom":false,
        "has-fullscreen-zoom":false,
        "is-native-fullscreen":false,
        "is-visible":false,
        "is-minimized":false,
        "is-hidden":false,
        "is-floating":false,
        "is-sticky":false,
        "is-grabbed":false
},{

I have tried excluding Teams with manage=off but with no success. Please let me know if you need additional information.

Thanks!

rxbn avatar Jan 05 '24 17:01 rxbn

Update: I think I am mistaken, yabai doesn't register the floating window at all.

rxbn avatar Jan 05 '24 18:01 rxbn

Update: With 6.0.7 this issue is partially resolved. When changing the active space to one that has at least one window, it no longer puts me back to the space where Teams is running. However, if I change the active space to an empty one, it still throws me back to the Teams space.

rxbn avatar Jan 25 '24 20:01 rxbn

This seems to be related to https://github.com/koekeishiya/yabai/issues/1957 . Can confirm it seems partially resolved by 6.0.7

oddnugget avatar Feb 19 '24 09:02 oddnugget

How does this behave in v6.0.15 / current master branch?

Edit: Note that yabai doesn't actually focus any window when you move to a different space unless you have added a space_changed signal or something like that. Window focus is solely controlled by macOS until the user issues a yabai -m window --focus command or uses autoraise/autofocus and moves the mouse.

koekeishiya avatar Mar 12 '24 22:03 koekeishiya

Thanks for looking into my issue :)

Unfortunately, I have the same issue on both stable and master. For reference, my yabai config looks like this: https://github.com/rxbn/dotfiles/blob/master/config/yabai/yabairc

rxbn avatar Mar 13 '24 07:03 rxbn

Do any of the solutions in #74 still apply, or do none of them work? (They might need some syntax adaptation for the latest yabai version). I do not really understand why this is happening. Could you attempt the following:

  1. stop yabai and pkill Dock to unload scripting-addition.
  2. use mission control shortcuts to switch to the space -- does this work correctly?
  3. use touchpad gestures (if available) to switch to the space -- does this work correctly?
  4. start yabai with an empty config file, only setting yabai -m config layout float. repeat steps 2 and 3
  5. start yabai with a real config, repeat steps 2 and 3.
  6. load yabai scripting addition and use yabai -m space --focus command to activate space -- this does not work correctly?

koekeishiya avatar Mar 13 '24 10:03 koekeishiya

You are right! The issue also exists when I use the Trackpad gesture... When I select an empty space using Mission Control, it works. But swiping with 4 fingers between spaces also causes the issue, even with yabai stopped. So I think it is an issue with Microsoft Teams or macOS, right?

rxbn avatar Mar 15 '24 10:03 rxbn

That does sound like a Teams/macOS issue. I don't think there is much to do here, as we cannot prevent other applications from changing/stealing focus.

koekeishiya avatar Mar 15 '24 11:03 koekeishiya