Skip to content
Myr

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

10 files+36 added−0 removed

modified:completions/fish/fuzzel.fish+1 added
84 unmodified lines
85complete -c fuzzel -s R -l no-run-if-empty -d "exit immediately without showing the UI if stdin is empty (dmenu mode only)"86complete -c fuzzel -x -s d -l log-level -a "info warning error none" -d "log-level (warning)"87complete -c fuzzel -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr"88complete -c fuzzel -s S -l log-no-syslog -d "disable syslog logging"89complete -c fuzzel -l no-mouse -d "disable mouse input"90complete -c fuzzel -s v -l version -d "show the version number and quit"91complete -c fuzzel -l print-timing-info -d "print timing information, to help debug performance issues"92complete -c fuzzel -s h -l help -d "show help message and quit"
modified:completions/zsh/_fuzzel+1 added
75 unmodified lines
76 '(-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)'8384case "${state}" in
18 unmodified lines
modified:doc/fuzzel.1.scd+3 added
528 unmodified lines
529530*--print-timing-info*531 Print timing information to help debug performance issues.532533*--no-mouse*534 Disable mouse input.535536*-v*,*--version*537 Show the version number and quit538539# SEARCH PATHS
71 unmodified lines
modified:doc/fuzzel.ini.5.scd+4 added
419 unmodified lines
420*auto-select*421 Boolean. When one entry is left, automatically select it.422 Default: _no_.423424*enable-mouse*425 Boolean. Enable mouse input.426 Default: _yes_.427428# SECTION: colors429430All color values are in RGBA.431
281 unmodified lines
modified:CHANGELOG.md+1 added
57 unmodified lines
58* `--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 input6364[411]: https://codeberg.org/dnkl/fuzzel/issues/41165[504]: https://codeberg.org/dnkl/fuzzel/pulls/50466[512]: https://codeberg.org/dnkl/fuzzel/pulls/512
980 unmodified lines
modified:config.c+4 added
1035 unmodified lines
10361037 else if (strcmp(key, "auto-select") == 0)1038 return value_to_bool(ctx, &conf->auto_select);10391040 else if (strcmp(key, "enable-mouse") == 0)1041 return value_to_bool(ctx, &conf->enable_mouse);10421043 else1044 LOG_CONTEXTUAL_ERR("not a valid option: %s", key);10451046 return false;
661 unmodified lines
1708 .list_executables_in_path = false,1709 .cache_path = NULL,1710 .auto_select = false,1711 .print_timing_info = false,1712 .enable_mouse = true,1713 };17141715 add_default_key_bindings(conf);1716
78 unmodified lines
modified:config.h+2 added
221 unmodified lines
222 char *cache_path;223224 bool auto_select;225 bool print_timing_info;226227 bool enable_mouse;228};229230typedef tll(char *) config_override_t;231
6 unmodified lines
modified:fuzzel.ini+2 added
45 unmodified lines
4647# render-workers=<number of logical CPUs>48# match-workers=<number of logical CPUs>4950# enable-mouse=yes5152[colors]53# background=fdf6e3ff54# text=657b83ff55# prompt=586e75ff
68 unmodified lines
modified:main.c+11 added
448 unmodified lines
449 " 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 lines
847 #define OPT_MINIMAL_LINES 303848 #define OPT_HIDE_PROMPT 304849 #define OPT_AUTO_SELECT 305850 #define OPT_SELECTION_RADIUS 306851 #define OPT_NO_MOUSE 307852853 static const struct option longopts[] = {854 {"config", required_argument, 0, OPT_CONFIG},855 {"check-config", no_argument, 0, OPT_CHECK_CONFIG},
61 unmodified lines
917 {"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},922923 /* dmenu mode */924 {"dmenu", no_argument, 0, 'd'},925 {"dmenu0", no_argument, 0, OPT_DMENU_NULL},
79 unmodified lines
1005 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}};10111012 setlocale(LC_CTYPE, "");1013 setlocale(LC_MESSAGES, "");
837 unmodified lines
1851 case OPT_AUTO_SELECT:1852 cmdline_overrides.conf.auto_select = true;1853 break;18541855 case OPT_NO_MOUSE:1856 cmdline_overrides.conf.enable_mouse = false;1857 cmdline_overrides.no_mouse_set = true;1858 break;18591860 case 'v':1861 printf("fuzzel %s\n", version_and_features());1862 return EXIT_SUCCESS;1863
208 unmodified lines
2072 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;20782079 if (conf.dmenu.enabled) {2080 /* We don't have any meta data in dmenu mode */2081 conf.match_fields = MATCH_NAME;
213 unmodified lines
modified:wayland.c+7 added
142 unmodified lines
143 float dpi;144 enum fcft_subpixel subpixel;145 bool font_is_sized_by_dpi;146 bool hide_when_prompt_empty;147 bool enable_mouse;148149 enum { KEEP_RUNNING, EXIT_UPDATE_CACHE, EXIT} status;150 int exit_code;151 bool force_cache_update;
972 unmodified lines
1124 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;11301131 /*1132 * Note: do *not* set seat->pointer.{x,y} here!
21 unmodified lines
1154wl_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}11611162static void1163wl_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;11681169 const int x = wl_fixed_to_int(surface_x);1170 const int y = wl_fixed_to_int(surface_y);1171
12 unmodified lines
1184 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;11891190 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 lines
1215 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;12211222 if (value < 0) {1223 refresh = matches_selected_prev(wayl->matches, true);
1501 unmodified lines
2725 .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