question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Layout Spiral has inverted next_window and prev_window logic

See original GitHub issue

The issue:

Your Qtile version (qtile --version): 0.21.1.dev9+g634a470a

  • When I use key or mouse binding to change to next or prev window on layout Spiral, it seems to be the only one with inverted logic. lazy.group.prev_window() does not go to prev window.
  • Also I am not sure if rearranging the windows by minimizing and unminimizing a window that brings it to front does interfere with the window list too. I wish the next_window and prev_window would always follow what the current window order on screen is and not when it was created. Maybe this is another topic.

This behavior is not documented and there seem to be no option to change it, so I believe it is a bug. If not, then this is a request to change the behavior or give me option to invert that logic right in the layout settings, so I don’t need to make exceptions everywhere else with .when(layout='spiral'). Which does not work with mouse_callbacks anyway I think. I switch between different layouts and this one sticks out with this logic to me, as it is not consistent to all other layouts I tried for longer period of time (5 or so).

Just tried this right now. Created a new terminal window to get qtile version and using next_window() will go back in history to this Firefox window. So clearly it is inverted. Here first my layout settings:

layout.Spiral(
    border_focus = layout_default['border_focus'],
    border_normal = layout_default['border_normal'],
    border_width = layout_default['border_width'],
    margin = layout_default['margin'],
    clockwise = False,
    # 'after_current', 'before_current', 'top', 'bottom'
    new_client_position = 'top',
    # main_pane_ratio = None,
    main_pane_ratio = 0.47,
    main_pane = 'left',
    # ratio = 0.6180469715698392,
    ratio = 0.42,
    ratio_increment = 0.08,
),

Required:

  • I have searched past issues to see if this bug has already been reported.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
SweepingBishopscommented, Apr 8, 2022

@thingsiplay , you could try writing a function for it. Something like {'Button5': lazy.function(my_function_for_button5)}

def my_function_for_button5(qtile):
     if qtile.current_group.layout.name == 'spiral':
        qtile.current_group.cmd_prev_window()
     else:
        qtile.current_group.cmd_next_window()

It depends what you want prev_window to do. If you mean it to open the previous window referring to the order you opened the window then, yes, but only when new_client_position is top.

How would propose handling the situation when a client could be added in the middle (e.g. before_current or after_current)?

This is not unique to spiral. For example in columns next is considered to be down the column and columns are ordered left to right, regardless of the whether the new window is above or below.

0reactions
thingsiplaycommented, Apr 8, 2022

Good idea! I was so focused on solving this problem itself, that I forgot to write a function as I usually do. This simple solution just works. Hopefully this issue did not take too much of your time. Next time I discuss it before doing issues. Thank you. And not sure if this should be closed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found