
compare_window_position calls into meta_window_stack_position_compare with inverted inputs instead of duplicating the logic. This comes at the cost of an extra meta_stack_ensure_sorted which should be culled out. To ensure this, need_resort is reset before the sorting process starts. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4183>