]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: support scroll-factor
authorJohan Malm <jgm323@gmail.com>
Sat, 25 Mar 2023 15:57:47 +0000 (15:57 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 27 Mar 2023 19:30:00 +0000 (20:30 +0100)
Fixes: issue #846
docs/labwc-config.5.scd
docs/rc.xml.all
include/config/rcxml.h
src/config/rcxml.c
src/cursor.c

index 1b61d385d202d237bd24a4fd475da160892a68de..63bd9cc8f21104398231d6778d45c002e0e30561 100644 (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>*
index f1558d4b2772ade45acd9f7efbfe89aad6dac51b..0ff8a88e6a38d1102d11c7e0f59a3aa03e280488 100644 (file)
 
     <!-- time is in ms -->
     <doubleClickTime>500</doubleClickTime>
+    <scrollFactor>1.0</scrollFactor>
 
     <context name="Frame">
       <mousebind button="A-Left" action="Press">
index c9ddbcbe564bd48a1a2207d1c36783b5bb7cd2c0..18f79ea247c5377dde4d660c7aab86c8e22fedf9 100644 (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;
index 78515e6928ac91194e543969fef7cf62be56052d..176b573795b814b497d9be52d35f33e553a11b7a 100644 (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;
index 016b47a1e1764ec26fdcb5fa4149a4322f991299..2255a5ec3760f2de7f7c3c97ba2bab6312d7863b 100644 (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);
        }
 }