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

get_tree, leaves, floating problem? #75

Closed
cyrinux opened this issue Feb 6, 2018 · 9 comments
Closed

get_tree, leaves, floating problem? #75

cyrinux opened this issue Feb 6, 2018 · 9 comments

Comments

@cyrinux
Copy link

cyrinux commented Feb 6, 2018

Hi!
Please could you please look this issue maximbaz/dotfiles#4
It is related a python scripts which use our lib, and a behaviour change between 2 versions.
Do you have an idea about the problem?
Regards,

@acrisci
Copy link
Member

acrisci commented Feb 7, 2018

Yeah looks like a library issue. I will look into it tomorrow.

@cyrinux
Copy link
Author

cyrinux commented Feb 8, 2018

Ok thanks @acrisci !
ping @maximbaz

@acrisci
Copy link
Member

acrisci commented Feb 11, 2018

I think this is fixed in #70 which was fairly recent.

@acrisci
Copy link
Member

acrisci commented Feb 11, 2018

I just released 1.4.0 which I think should fix it.

@cyrinux
Copy link
Author

cyrinux commented Feb 11, 2018

Hi @acrisci , sorry the issue seems to be still here.
What can I do for help?

@maximbaz
Copy link

The problem is that .leaves() of i3.get_tree().workspaces() doesn't include floating windows, but .leaves() of .i3.get_tree() does. This example shows the difference, iterate_tree correctly discovers floating windows, but iterate_workspaces does not.

#!/usr/bin/env python3

import i3ipc


def iterate_workspaces(i3):
    print('iterating workspaces')
    for _, workspace in enumerate(i3.get_tree().workspaces()):
        print('workspace name: ' + workspace.name)
        for leaf in workspace.leaves():
            print(leaf.name)
        print('------')
    print('iterating workspaces: DONE')


def iterate_tree(i3):
    print('iterating tree')
    root = i3.get_tree()
    print('root name: ' + root.name)
    for leaf in root.leaves():
        print(leaf.name)
    print('iterating tree: DONE')


def main():
    i3 = i3ipc.Connection()

    iterate_workspaces(i3)
    print('\n============\n')
    iterate_tree(i3)


if __name__ == '__main__':
    main()

@acrisci
Copy link
Member

acrisci commented Feb 14, 2018

Can you try again with 54c9218? I think that fixes it. I added a test you can look at so we won't have regressions.

@maximbaz
Copy link

I confirm that the fix is working, thanks! 👍

@cyrinux
Copy link
Author

cyrinux commented Feb 14, 2018

Cool! Thanks it works!

@cyrinux cyrinux closed this as completed Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants