feat: config/cli option to disable mouse input
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Gingeh · committed by markstos · parent 1f83f32 · Browse files · 10 files·+36 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+36 added−0 removed
- other:+36 added−0 removed
Provenance
- Commit
8c9e76d- Tree
e21b94b- Author
Gingeh <gingeh@noreply.codeberg.org>- Committer
markstos <markstos@noreply.codeberg.org>- Parent
1f83f32
10 files changed+36 added−0 removed
modified:completions/fish/fuzzel.fish+1 added
84 unmodified lines85 complete -c fuzzel -s R -l no-run-if-empty -d "exit immediately without showing the UI if stdin is empty (dmenu mode only)"86 complete -c fuzzel -x -s d -l log-level -a "info warning error none" -d "log-level (warning)"87 complete -c fuzzel -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr"88 complete -c fuzzel -s S -l log-no-syslog -d "disable syslog logging"89+complete -c fuzzel -l no-mouse -d "disable mouse input"90 complete -c fuzzel -s v -l version -d "show the version number and quit"91 complete -c fuzzel -l print-timing-info -d "print timing information, to help debug performance issues"92 complete -c fuzzel -s h -l help -d "show help message and quit"modified:completions/zsh/_fuzzel+1 added
75 unmodified lines76 '(-R --no-run-if-empty)'{-R,--no-run-if-empty}'[exit immediately without showing the UI if stdin is empty (dmenu mode only)]' \77 '--log-level[log level (warning)]:loglevel:(info warning error none)' \78 '--log-colorize[enable or disable colorization of log output on stderr]:logcolor:(never always auto)' \79 '--log-no-syslog[disable syslog logging]' \80+ '--no-mouse[disable mouse input]' \81 '--print-timing-info[print timing information, to help debug performance issues]' \82 '--scaling-filter[filter to use when down scaling PNGs]:scaling-filter:(none nearest bilinear box linear cubic lanczos2 lanczos3 lanczos3-stretched)'83 84 case "${state}" in18 unmodified linesmodified:doc/fuzzel.1.scd+3 added
528 unmodified lines529 530 *--print-timing-info*531 Print timing information to help debug performance issues.532 533+*--no-mouse*534+ Disable mouse input.535+536 *-v*,*--version*537 Show the version number and quit538 539 # SEARCH PATHS71 unmodified linesmodified:doc/fuzzel.ini.5.scd+4 added
419 unmodified lines420 *auto-select*421 Boolean. When one entry is left, automatically select it.422 Default: _no_.423 424+*enable-mouse*425+ Boolean. Enable mouse input.426+ Default: _yes_.427+428 # SECTION: colors429 430 All color values are in RGBA.431 281 unmodified linesmodified:CHANGELOG.md+1 added
57 unmodified lines58 * `--auto-select` option. When one entry is left, automatically select59 it. ([#411][411])60 * `selection-radius` option and `--selection-radius` flag to set the border61 radius of the selected entry62+* `enable-mouse` option and `--no-mouse` flag to disable mouse input63 64 [411]: https://codeberg.org/dnkl/fuzzel/issues/41165 [504]: https://codeberg.org/dnkl/fuzzel/pulls/50466 [512]: https://codeberg.org/dnkl/fuzzel/pulls/512980 unmodified linesmodified:config.c+4 added
1035 unmodified lines1036 1037 else if (strcmp(key, "auto-select") == 0)1038 return value_to_bool(ctx, &conf->auto_select);1039 1040+ else if (strcmp(key, "enable-mouse") == 0)1041+ return value_to_bool(ctx, &conf->enable_mouse);1042+1043 else1044 LOG_CONTEXTUAL_ERR("not a valid option: %s", key);1045 1046 return false;661 unmodified lines1708 .list_executables_in_path = false,1709 .cache_path = NULL,1710 .auto_select = false,1711 .print_timing_info = false,1712+ .enable_mouse = true,1713 };1714 1715 add_default_key_bindings(conf);1716 78 unmodified linesmodified:config.h+2 added
221 unmodified lines222 char *cache_path;223 224 bool auto_select;225 bool print_timing_info;226+227+ bool enable_mouse;228 };229 230 typedef tll(char *) config_override_t;231 6 unmodified linesmodified:fuzzel.ini+2 added
45 unmodified lines46 47 # render-workers=<number of logical CPUs>48 # match-workers=<number of logical CPUs>49 50+# enable-mouse=yes51+52 [colors]53 # background=fdf6e3ff54 # text=657b83ff55 # prompt=586e75ff68 unmodified linesmodified:main.c+11 added
448 unmodified lines449 " stderr\n"450 " --log-no-syslog disable syslog logging\n"451 " --print-timing-info print timing information, to help debug\n"452 " performance issues\n"453+ " --no-mouse disable mouse input\n"454 " -v,--version show the version number and quit\n");455 printf("\n");456 printf("All colors are RGBA - i.e. 8-digit hex values, without prefix.\n");457 }389 unmodified lines847 #define OPT_MINIMAL_LINES 303848 #define OPT_HIDE_PROMPT 304849 #define OPT_AUTO_SELECT 305850 #define OPT_SELECTION_RADIUS 306851+ #define OPT_NO_MOUSE 307852 853 static const struct option longopts[] = {854 {"config", required_argument, 0, OPT_CONFIG},855 {"check-config", no_argument, 0, OPT_CHECK_CONFIG},61 unmodified lines917 {"delayed-filter-ms", required_argument, 0, OPT_DELAYED_FILTER_MS},918 {"delayed-filter-limit", required_argument, 0, OPT_DELAYED_FILTER_LIMIT},919 {"scaling-filter", required_argument, 0, OPT_SCALING_FILTER},920 {"auto-select", no_argument, 0, OPT_AUTO_SELECT},921+ {"no-mouse", no_argument, 0, OPT_NO_MOUSE},922 923 /* dmenu mode */924 {"dmenu", no_argument, 0, 'd'},925 {"dmenu0", no_argument, 0, OPT_DMENU_NULL},79 unmodified lines1005 bool placeholder_color_set:1;1006 bool counter_set:1;1007 bool print_timing_info_set:1;1008 bool scaling_filter_set:1;1009+ bool no_mouse_set:1;1010 } cmdline_overrides = {{0}};1011 1012 setlocale(LC_CTYPE, "");1013 setlocale(LC_MESSAGES, "");837 unmodified lines1851 case OPT_AUTO_SELECT:1852 cmdline_overrides.conf.auto_select = true;1853 break;1854 1855+ case OPT_NO_MOUSE:1856+ cmdline_overrides.conf.enable_mouse = false;1857+ cmdline_overrides.no_mouse_set = true;1858+ break;1859+1860 case 'v':1861 printf("fuzzel %s\n", version_and_features());1862 return EXIT_SUCCESS;1863 208 unmodified lines2072 if (cmdline_overrides.scaling_filter_set)2073 conf.png_scaling_filter = cmdline_overrides.conf.png_scaling_filter;2074 if (cmdline_overrides.conf.auto_select)2075 conf.auto_select = cmdline_overrides.conf.auto_select;2076+ if (cmdline_overrides.no_mouse_set)2077+ conf.enable_mouse = cmdline_overrides.conf.enable_mouse;2078 2079 if (conf.dmenu.enabled) {2080 /* We don't have any meta data in dmenu mode */2081 conf.match_fields = MATCH_NAME;213 unmodified linesmodified:wayland.c+7 added
142 unmodified lines143 float dpi;144 enum fcft_subpixel subpixel;145 bool font_is_sized_by_dpi;146 bool hide_when_prompt_empty;147+ bool enable_mouse;148 149 enum { KEEP_RUNNING, EXIT_UPDATE_CACHE, EXIT} status;150 int exit_code;151 bool force_cache_update;972 unmodified lines1124 uint32_t serial, struct wl_surface *surface,1125 wl_fixed_t surface_x, wl_fixed_t surface_y)1126 {1127 struct seat *seat = data;1128+ if (!seat->wayl->enable_mouse) return;1129 seat->pointer.serial = serial;1130 1131 /*1132 * Note: do *not* set seat->pointer.{x,y} here!21 unmodified lines1154 wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,1155 uint32_t serial, struct wl_surface *surface)1156 {1157 struct seat *seat = data;1158+ if (!seat->wayl->enable_mouse) return;1159 seat->pointer.serial = serial;1160 }1161 1162 static void1163 wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,1164 uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)1165 {1166 struct seat *seat = data;1167+ if (!seat->wayl->enable_mouse) return;1168 1169 const int x = wl_fixed_to_int(surface_x);1170 const int y = wl_fixed_to_int(surface_y);1171 12 unmodified lines1184 uint32_t serial, uint32_t time, uint32_t button, uint32_t state)1185 {1186 struct seat *seat = data;1187 struct wayland *wayl = seat->wayl;1188+ if (!wayl->enable_mouse) return;1189 1190 if (state == WL_POINTER_BUTTON_STATE_RELEASED) {1191 if (button == BTN_LEFT && seat->pointer.hovered_row_idx != -1) {1192 ssize_t clicked_row = render_get_row_num(22 unmodified lines1215 uint32_t time, uint32_t axis, wl_fixed_t value)1216 {1217 struct seat *seat = data;1218 struct wayland *wayl = seat->wayl;1219+ if (!wayl->enable_mouse) return;1220 bool refresh = false;1221 1222 if (value < 0) {1223 refresh = matches_selected_prev(wayl->matches, true);1501 unmodified lines2725 .render = render,2726 .prompt = prompt,2727 .matches = matches,2728 .hide_when_prompt_empty = conf->hide_when_prompt_empty,2729+ .enable_mouse = conf->enable_mouse,2730 .status = KEEP_RUNNING,2731 .exit_code = !conf->dmenu.enabled ? EXIT_SUCCESS : EXIT_FAILURE,2732 .font_reloaded = {2733 .cb = font_reloaded_cb,331 unmodified lines