Skip to content
Myr

xdg: don't count NoDisplay=true apps towards the match counter's total

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Fillion · committed by Christian Fillion · parent fe2a08d · Browse files · 7 files+10 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+10 added−6 removed

  • other:+10 added−6 removed

7 files+10 added−6 removed

modified:application.h+1 added
98 unmodified lines
99100struct application_list {101 struct application **v;102 size_t count;103 size_t visible_count;104 mtx_t lock;105};106107struct application_list *applications_init(void);
2 unmodified lines
modified:dmenu.c+2 added-2 removed
199 unmodified lines
200 tll_remove(entries, it);201 }202203 assert(i == new_count);204 applications->count = new_count;204 applications->count = applications->visible_count = new_count;205 send_event(event_fd, EVENT_APPS_SOME_LOADED);206 mtx_unlock(&applications->lock);207 }208 }
16 unmodified lines
225 applications->v[i++] = it->item;226 tll_remove(entries, it);227 }228229 applications->count = new_count;229 applications->count = applications->visible_count = new_count;230 mtx_unlock(&applications->lock);231232 tll_free(entries);233}
21 unmodified lines
modified:match.c+2 added-2 removed
636 unmodified lines
637 : NULL;638}639640size_t641matches_get_application_count(const struct matches *matches)641matches_get_application_visible_count(const struct matches *matches)642{643 return matches->applications->count;643 return matches->applications->visible_count;644}645646size_t647matches_get_count(const struct matches *matches)
1029 unmodified lines
modified:match.h+1 added-1 removed
58 unmodified lines
59size_t matches_get_page(const struct matches *matches);6061const struct match *matches_get(const struct matches *matches, size_t idx);62const struct match *matches_get_match(const struct matches *matches);63size_t matches_get_application_count(const struct matches *matches);63size_t matches_get_application_visible_count(const struct matches *matches);64size_t matches_get_count(const struct matches *matches); /* Matches on current page */65size_t matches_get_total_count(const struct matches *matches);66size_t matches_get_match_index(const struct matches *matches);67
11 unmodified lines
modified:path.c+1 added
96 unmodified lines
97 applications->v, applications->count + tll_length(entries), sizeof(applications->v[0]));9899 tll_foreach(entries, it) {100 applications->v[applications->count++] = it->item;101 applications->visible_count++;102 tll_remove(entries, it);103 }104}
modified:render.c+1 added-1 removed
276 unmodified lines
277 conf->colors.background.a == 1. && conf->colors.selection.a == 1.278 ? render->subpixel279 : FCFT_SUBPIXEL_NONE;280281 size_t total_count = matches_get_application_count(matches);281 size_t total_count = matches_get_application_visible_count(matches);282 size_t match_count = matches_get_total_count(matches);283 const char32_t *ptext = prompt_text(prompt);284285 char *text = NULL;
1183 unmodified lines
modified:xdg.c+2 added
687 unmodified lines
688689 size_t i = 0;690 tll_foreach(apps, it) {691 applications->v[i++] = it->item;692 if (it->item->visible)693 applications->visible_count++;694 tll_remove(apps, it);695 }696 tll_free(apps);697
150 unmodified lines