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
Provenance
- Commit
db12816- Tree
88b6ae8- Author
Christian Fillion <contact@cfillion.ca>- Committer
Christian Fillion <contact@cfillion.ca>- Parent
fe2a08d
7 files changed+10 added−6 removed
modified:application.h+1 added
98 unmodified lines99 100 struct application_list {101 struct application **v;102 size_t count;103+ size_t visible_count;104 mtx_t lock;105 };106 107 struct application_list *applications_init(void);2 unmodified linesmodified:dmenu.c+2 added-2 removed
199 unmodified lines200 tll_remove(entries, it);201 }202 203 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 lines225 applications->v[i++] = it->item;226 tll_remove(entries, it);227 }228 229- applications->count = new_count;229+ applications->count = applications->visible_count = new_count;230 mtx_unlock(&applications->lock);231 232 tll_free(entries);233 }21 unmodified linesmodified:match.c+2 added-2 removed
636 unmodified lines637 : NULL;638 }639 640 size_t641-matches_get_application_count(const struct matches *matches)641+matches_get_application_visible_count(const struct matches *matches)642 {643- return matches->applications->count;643+ return matches->applications->visible_count;644 }645 646 size_t647 matches_get_count(const struct matches *matches)1029 unmodified linesmodified:match.h+1 added-1 removed
58 unmodified lines59 size_t matches_get_page(const struct matches *matches);60 61 const struct match *matches_get(const struct matches *matches, size_t idx);62 const struct match *matches_get_match(const struct matches *matches);63-size_t matches_get_application_count(const struct matches *matches);63+size_t matches_get_application_visible_count(const struct matches *matches);64 size_t matches_get_count(const struct matches *matches); /* Matches on current page */65 size_t matches_get_total_count(const struct matches *matches);66 size_t matches_get_match_index(const struct matches *matches);67 11 unmodified linesmodified:path.c+1 added
96 unmodified lines97 applications->v, applications->count + tll_length(entries), sizeof(applications->v[0]));98 99 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 lines277 conf->colors.background.a == 1. && conf->colors.selection.a == 1.278 ? render->subpixel279 : FCFT_SUBPIXEL_NONE;280 281- 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);284 285 char *text = NULL;1183 unmodified linesmodified:xdg.c+2 added
687 unmodified lines688 689 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