@@ -174,11 +174,10 @@ class DashApps(GenericScopeView):
174174 category_element = self._get_category_element(category)
175175 application_cards = category_element.select_many('Card')
176176
177− def visible_order(card):
178− """Enable sorting of cards by vertical, horizontal."""
179− # NOTE that we limit testable resolution to 10K
180− return card.globalRect[1] * 10000 + card.globalRect[0]
181− application_cards = sorted(application_cards, key=visible_order)
177+ # sort by y, x
178+ application_cards = sorted(
179+ application_cards,
180+ key=lambda card: (card.globalRect.y, card.globalRect.x))
182181
183182 result = []
184183 for card in application_cards: