From fb326c1b610b7fff242848431ef0027f6eeb1ce4 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 26 Jan 2025 20:13:21 +0100 Subject: [PATCH] Revert "[Window] Allow active window to be sorted on top." This reverts commit 8542b3ee7ee5b49c4be67bf85488938c39621f1c. --- doc/rofi.1.markdown | 13 ------------- source/modes/window.c | 35 ----------------------------------- 2 files changed, 48 deletions(-) diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown index 4ee0fa12..79f342b8 100644 --- a/doc/rofi.1.markdown +++ b/doc/rofi.1.markdown @@ -683,19 +683,6 @@ configuration { or pass `-window-hide-active-window true` on command line. -You can sort the currently active window to the top of the list with the -'sort-active-window-first' setting: - -```css -configuration { - window { - sort-active-window-first: true; - } -} -``` - -or pass `-sort-active-window-first true` on command line. - You can prefer the icon theme above the window set icon with the 'prefer-icon-theme' setting: diff --git a/source/modes/window.c b/source/modes/window.c index 4f0b793c..9aa53c51 100644 --- a/source/modes/window.c +++ b/source/modes/window.c @@ -26,8 +26,6 @@ */ /** The log domain of this dialog. */ -#include -#include #define G_LOG_DOMAIN "Modes.Window" #include "config.h" @@ -698,25 +696,6 @@ static void _window_mode_load_data(Mode *sw, unsigned int cd) { } xcb_ewmh_get_windows_reply_wipe(&clients); } - -static gint _window_mode_sort(gconstpointer a, gconstpointer b, gpointer data) { - WindowModePrivateData *pd = (WindowModePrivateData *)data; - gint wa = *(const int *)a; - gint wb = *(const int *)b; - const client *ca = window_client(pd, wa); - const client *cb = window_client(pd, wb); - if (ca == NULL || cb == NULL) { - return 0; - } - if (ca->active) { - return -1; - } - if (cb->active) { - return 1; - } - - return 0; -} static int window_mode_init(Mode *sw) { if (mode_get_private_data(sw) == NULL) { @@ -738,13 +717,6 @@ static int window_mode_init(Mode *sw) { if (!window_matching_fields_parsed) { window_mode_parse_fields(); } - // Sort active window first. - p = rofi_theme_find_property(wid, P_BOOLEAN, "sort-active-window-first", - FALSE); - if (p && p->type == P_BOOLEAN && p->value.b == TRUE) { - g_qsort_with_data(pd->ids->array, pd->ids->len, sizeof(xcb_window_t), - _window_mode_sort, pd); - } } return TRUE; } @@ -764,13 +736,6 @@ static int window_mode_init_cd(Mode *sw) { if (!window_matching_fields_parsed) { window_mode_parse_fields(); } - // Sort active window first. - p = rofi_theme_find_property(wid, P_BOOLEAN, "sort-active-window-first", - FALSE); - if (p && p->type == P_BOOLEAN && p->value.b == TRUE) { - g_qsort_with_data(pd->ids->array, pd->ids->len, sizeof(xcb_window_t), - _window_mode_sort, pd); - } } return TRUE; }