config: support scroll-factor

Fixes: issue #846
This commit is contained in:
Johan Malm 2023-03-25 15:57:47 +00:00 committed by Johan Malm
parent 753aef9d78
commit a8e0248f47
5 changed files with 10 additions and 1 deletions

View file

@ -210,6 +210,9 @@ The rest of this man page describes configuration options.
*<mouse><doubleClickTime>*
Set double click time in milliseconds. Default is 500.
*<mouse><scrollFactor>*
Set scroll factor. Default is 1.0.
*<mouse><context name=""><mousebind button="" direction=""><action>*
Multiple *<mousebind>* can exist within one *<context>*; and multiple
*<action>* can exist within one *<mousebind>*

View file

@ -199,6 +199,7 @@
<!-- time is in ms -->
<doubleClickTime>500</doubleClickTime>
<scrollFactor>1.0</scrollFactor>
<context name="Frame">
<mousebind button="A-Left" action="Press">

View file

@ -41,6 +41,7 @@ struct rcxml {
/* mouse */
long doubleclick_time; /* in ms */
struct wl_list mousebinds; /* struct mousebind.link */
double scroll_factor;
/* libinput */
struct wl_list libinput_categories;

View file

@ -420,6 +420,8 @@ entry(xmlNode *node, char *nodename, char *content)
} else {
wlr_log(WLR_ERROR, "invalid doubleClickTime");
}
} else if (!strcasecmp(nodename, "scrollFactor.mouse")) {
rc.scroll_factor = atof(content);
} else if (!strcasecmp(nodename, "name.context.mouse")) {
current_mouse_context = content;
current_mousebind = NULL;
@ -573,6 +575,7 @@ rcxml_init(void)
init_font_defaults(&rc.font_osd);
rc.doubleclick_time = 500;
rc.scroll_factor = 1.0;
rc.repeat_rate = 25;
rc.repeat_delay = 600;
rc.screen_edge_strength = 20;

View file

@ -1054,7 +1054,8 @@ cursor_axis(struct wl_listener *listener, void *data)
/* Notify the client with pointer focus of the axis event. */
wlr_seat_pointer_notify_axis(seat->seat, event->time_msec,
event->orientation, event->delta, event->delta_discrete,
event->orientation, rc.scroll_factor * event->delta,
round(rc.scroll_factor * event->delta_discrete),
event->source);
}
}