Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows tile over other tiled windows sometimes #183

Closed
dominiklohmann opened this issue Aug 1, 2019 · 3 comments
Closed

Windows tile over other tiled windows sometimes #183

dominiklohmann opened this issue Aug 1, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@dominiklohmann
Copy link
Collaborator

dominiklohmann commented Aug 1, 2019

Bug report

I've reported this issue in #159 (comment) previously.

I've been having a very similar issue lately which I can't reliably reproduce, where yabai loses some of its managed windows so new windows tile over them. Here's a screencast: https://streamable.com/h6fau

Your idea of resetting the space by destroying the current one works quite smoothly, so I wrote a small script that creates a new space, moves it so it's right next to the current one and then destroys the current one, thus moving all windows over to the newly created space and keeping the order of spaces as if nothing ever happened.

# reset current (non-fullscreen) space
yabai -m query --spaces --space | jq -er '."native-fullscreen" == 0' > /dev/null && \
    yabai -m space --create && \
    seq "$(yabai -m query --spaces --display | jq -r 'map(select(."native-fullscreen" == 0).index)[-1]')" \
        "$(yabai -m query --spaces --space | jq -r '.index + 1')" \
        | sed '$d' \
        | xargs -I{} yabai -m space {} --move prev && \
    yabai -m space --destroy

I have this set to a keyboard shortcut in skhd so I can easily reset the current space.

It's not a fix, but it's at least a working bandaid.

Now I've gotten this issue again and tried to query whether any state was messed up.

Nothing wrong with the windows: It shows 3 tiled windows, however 2 have the same frame.

yabai -m query --windows --space | jq 'map({app: .app, floating: .floating, frame: .frame})'
[
  {
    "app": "iTerm2",
    "floating": 0,
    "frame": {
      "x": 850,
      "y": 42,
      "w": 810,
      "h": 988
    }
  },
  {
    "app": "Google Chrome",
    "floating": 0,
    "frame": {
      "x": 850,
      "y": 42,
      "w": 810,
      "h": 988
    }
  },
  {
    "app": "Google Chrome",
    "floating": 0,
    "frame": {
      "x": 20,
      "y": 42,
      "w": 810,
      "h": 988
    }
  }
]

Now here's what's weird: The first-window attribute of the space is 0.

yabai -m query --spaces --space | jq
{
	"id": 58,
	"index": 1,
	"display": 1,
	"windows": [
		1992,
		1626,
		109
	],
	"type": "bsp",
	"visible": 1,
	"focused": 1,
	"native-fullscreen": 0,
	"first-window": 0,
	"last-window": 1992
}

I do not know what triggers this behaviour and cannot reproduce it reliably. I've had this multiple times on both 10.14.6 and 10.15 over the last two weeks or so.

It seems like something gets messed up with how yabai manages the space as the only way to properly fix the issue without restarting yabai or moving all windows to other spaces is to destroy the space.

@ghost
Copy link

ghost commented Aug 1, 2019

Just wanted to chime in that I've noticed the same issue, happens intermittently and I haven't been able to figure out a cause yet...

@koekeishiya
Copy link
Owner

This issue is only present on master, and not in the latest stable release.

@koekeishiya
Copy link
Owner

koekeishiya commented Aug 1, 2019

The underlaying problem of this issue is present in earlier versions, but did not manifest for some reason. Fixed on master.

@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released bug Something isn't working labels Aug 1, 2019
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants