From 689d72f1dc6ccefd5d6d5179b9b72b3844fb2c4f Mon Sep 17 00:00:00 2001 From: Igor <420spn@gmail.com> Date: Mon, 29 Jan 2024 21:29:52 +0600 Subject: [PATCH 1/6] Fix typo in dynamic_themes.md (#1941) Add missing "P" in "PREVIEW=true" --- mkdocs/docs/guides/DynamicThemes/dynamic_themes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs/docs/guides/DynamicThemes/dynamic_themes.md b/mkdocs/docs/guides/DynamicThemes/dynamic_themes.md index ca0999331..ee2822233 100644 --- a/mkdocs/docs/guides/DynamicThemes/dynamic_themes.md +++ b/mkdocs/docs/guides/DynamicThemes/dynamic_themes.md @@ -170,7 +170,7 @@ These will be merged into the theme on load: Now if we run it: ```bash -REVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser +PREVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser ``` It looks like this: From 1c7ff16add6b52de908f00731c0fc07b100ed994 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 10 Feb 2024 21:36:27 +0100 Subject: [PATCH 2/6] Add extra documentation issue template. --- .../ISSUE_TEMPLATE/documentation_report.yml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/documentation_report.yml diff --git a/.github/ISSUE_TEMPLATE/documentation_report.yml b/.github/ISSUE_TEMPLATE/documentation_report.yml new file mode 100644 index 000000000..3ca06d51a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_report.yml @@ -0,0 +1,81 @@ +name: Documentation Bug Report +description: Report a problem in Rofi Documentation +labels: [Documentation] +title: "[Doc] " +body: + + - type: markdown + attributes: + value: | + First read the + [guidelines](https://github.com/DaveDavenport/rofi/blob/next/.github/CONTRIBUTING.md)! + This is not optional for any report. People must be able to understand + the full context of the report when reading it, at any time. + + If you feel like you “it is simple and requires no explanation”, please + consider you’re wrong and still fill the full report. Any report + missing required informations will be labeled as “Incomplete Report - + Please follow the guidelines” and will be closed. If you ask a + question, enter dummy information in required fields to get passed the + checks or in general completely ignore the guidelines, the issue will + be closed and locked as spam. + + If you are unsure, please use the + [discussion](https://github.com/davatorium/rofi/discussions) forum + first. It is easy to upgrade a question to an issue in github. + + **Please do not submit reports related to wayland, see + [here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more + information.** + + - type: input + attributes: + label: "Rofi version (rofi -v)" + placeholder: "Version: 1.7.5" + validations: + required: true + - type: input + attributes: + label: "URL" + description: "Please provide a link to the relevant documentation." + placeholder: "link to page on https://davatorium.github.io/rofi/ or file on https://github.com/davatorium/rofi/" + validations: + required: true + + - type: textarea + attributes: + label: "Explain the issue with the documentation, please be verbose." + placeholder: | + * What am I trying to achieve + .. + * What instructions are unclear, wrong or missing + .. + * Suggestions for improving the current documentation + .. + validations: + required: true + - type: textarea + attributes: + label: "Optional fixed text" + description: "Suggested new and or improved text for documentation." + validations: + required: false + - type: checkboxes + id: wayland + attributes: + label: Using wayland display server protocol + description: I have checked and confirm that my issue is not related to running rofi using wayland as display server protocol. See [here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more information. + options: + - label: "No, my documentation issue is not about running rofi using the wayland display server protocol" + required: true + - type: checkboxes + id: latestversion + attributes: + label: I've checked if the issue exists in the latest stable release + description: I confirm that I verified the issue still exists in the latest stable release. + options: + - label: "Yes, I have checked the problem exists in the latest stable version" + required: false + + + From c3023b399bdd7b5fbba4860743c6ef389be97536 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 10 Feb 2024 21:41:40 +0100 Subject: [PATCH 3/6] [Doc] Clarify in build instructions what release to use. --- INSTALL.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 0a8870d67..1a35bdec2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -70,6 +70,11 @@ On debian based systems, the developer packages are in the form of: ## Install from a release +When downloading from the github release page, make sure to grab the archive +`rofi-{version}.tar.[g|x]z`. The auto-attached files `source code (zip|tar.gz)` +by github do not contain a valid release. It misses a setup build system and +includes irrelevant files. + ### Autotools Create a build directory and enter it: From dc43ee7d5b379363cba2f0377e7119822e8fb866 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 10 Feb 2024 21:52:20 +0100 Subject: [PATCH 4/6] [Doc] Remove reddit link from config.yml. --- .github/ISSUE_TEMPLATE/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index afff87bf9..8d179ff8c 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,9 +3,6 @@ contact_links: - name: discussion forum url: https://github.com/davatorium/rofi/discussions about: Please ask and answer questions here. - - name: Rofi subreddit - url: https://www.reddit.com/r/qtools/ - about: Please ask and answer questions here. - name: Rofi IRC channel url: https://web.libera.chat/?channels=#rofi about: Please ask and answer question in real time here. From 3dc3e2d6164ab4a8720d044575a09d43f06eab0d Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 10 Feb 2024 22:14:08 +0100 Subject: [PATCH 5/6] [Doc] Fix broken ``` guards. --- INSTALL.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1a35bdec2..38da5508b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -257,19 +257,19 @@ For more information see the rofi-debugging(5) manpage. ```bash apt install rofi -```` +``` ### Fedora ```bash dnf install rofi -```` +``` ### ArchLinux ```bash pacman -S rofi -```` +``` ### Gentoo @@ -278,13 +278,13 @@ enable ~arch to get the latest release: ```bash echo 'x11-misc/rofi ~amd64' >> /etc/portage/package.accept_keywords -```` +``` for amd64 or: ```bash echo 'x11-misc/rofi ~x86' >> /etc/portage/package.accept_keywords -```` +``` for i386. @@ -296,13 +296,13 @@ On both openSUSE Leap and openSUSE Tumbleweed rofi can be installed using: ```bash sudo zypper install rofi -```` +``` ### FreeBSD ```bash sudo pkg install rofi -```` +``` ### macOS From 13c2a617666d5ee054fee2bba6abc3ce6a557570 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 11 Feb 2024 13:59:11 +0100 Subject: [PATCH 6/6] [ThreadPool] Sort items in the queue based on priority --- include/rofi-types.h | 1 + source/rofi-icon-fetcher.c | 2 ++ source/view.c | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/include/rofi-types.h b/include/rofi-types.h index 4fc878d4a..4fdb3e37b 100644 --- a/include/rofi-types.h +++ b/include/rofi-types.h @@ -370,6 +370,7 @@ typedef struct rofi_int_matcher_t { */ typedef struct _thread_state { void (*callback)(struct _thread_state *t, gpointer data); + int priority; } thread_state; extern GThreadPool *tpool; diff --git a/source/rofi-icon-fetcher.c b/source/rofi-icon-fetcher.c index c65463aee..c2bb0f1f4 100644 --- a/source/rofi-icon-fetcher.c +++ b/source/rofi-icon-fetcher.c @@ -411,6 +411,7 @@ uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize, // Push into fetching queue. sentry->state.callback = rofi_icon_fetcher_worker; + sentry->state.priority = G_PRIORITY_LOW; g_thread_pool_push(tpool, sentry, NULL); return sentry->uid; @@ -447,6 +448,7 @@ uint32_t rofi_icon_fetcher_query(const char *name, const int size) { // Push into fetching queue. sentry->state.callback = rofi_icon_fetcher_worker; + sentry->state.priority = G_PRIORITY_LOW; g_thread_pool_push(tpool, sentry, NULL); return sentry->uid; diff --git a/source/view.c b/source/view.c index 4b32cb8e9..29ca23073 100644 --- a/source/view.c +++ b/source/view.c @@ -1444,6 +1444,7 @@ static gboolean rofi_view_refilter_real(RofiViewState *state) { states[i].plen = plen; states[i].pattern = pattern; states[i].st.callback = filter_elements; + states[i].st.priority = G_PRIORITY_HIGH; if (i > 0) { g_thread_pool_push(tpool, &states[i], NULL); } @@ -2624,6 +2625,15 @@ void rofi_view_cleanup() { input_history_save(); } + +static int rofi_thread_workers_sort(gconstpointer a,gconstpointer b, gpointer data G_GNUC_UNUSED) +{ + thread_state *tsa = (thread_state *)a; + thread_state *tsb = (thread_state *)b; + // lower number is lower priority.. a is sorted above is a > b. + return tsa->priority-tsb->priority; +} + void rofi_view_workers_initialize(void) { TICK_N("Setup Threadpool, start"); if (config.threads == 0) { @@ -2649,6 +2659,7 @@ void rofi_view_workers_initialize(void) { g_error_free(error); exit(EXIT_FAILURE); } + g_thread_pool_set_sort_function(tpool, rofi_thread_workers_sort, NULL); TICK_N("Setup Threadpool, done"); } void rofi_view_workers_finalize(void) {