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

Fix icon order in Systray #3198

Merged
merged 1 commit into from
Jan 16, 2022
Merged

Conversation

elParaguayo
Copy link
Member

To prevent icon order changing after restart/reloading config, icons are now ordered by application name.

@m-col
Copy link
Member

m-col commented Jan 15, 2022

It might be a bit nicer to order them at the type level so that the sorting doesn't need to happen upon every draw. I see the wids used for keys in self.icons aren't all that useful; they can be accessed at icon.wid (or icon.window.wid) during finalize(). Then the keys can be the window names, which would be used for ordering in an OrderedDict IIRC.

@elParaguayo
Copy link
Member Author

OrderedDicts remember the order items were added to the dict, rather than sorting them. You'd still need to sort each time you add an item to the dictionary (but that's probably still better than sorting on each draw).

@elParaguayo
Copy link
Member Author

Also looks like one of my new tests is playing up...

@m-col
Copy link
Member

m-col commented Jan 15, 2022

OrderedDicts remember the order items were added to the dict, rather than sorting them.

Oh indeed, TIL, OrderedDicts are mostly redundant.

You'd still need to sort each time you add an item to the dictionary (but that's probably still better than sorting on each draw).

Yeah this seems like the way to go, just running sorted on the dict when it an item is added.

To prevent icon order changing after restart/reloading config,
icons are now ordered by application name.
@m-col
Copy link
Member

m-col commented Jan 16, 2022

LGTM, thanks! Auto merge enabled :)

@m-col m-col enabled auto-merge (rebase) January 16, 2022 13:06
@m-col m-col merged commit ec8270e into qtile:master Jan 16, 2022
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

Successfully merging this pull request may close these issues.

2 participants