From ea6007d34c1cea2924c003e21db2a7ab1d7fd614 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Mon, 29 Aug 2022 23:43:13 +0200 Subject: [PATCH] src/config/rcxml.c: Add support for mousebinds This loads default mousebinds and provides a way to keep config files simpler whilst allowing user specific binds. Note that if no rc.xml is found, or if no entries exist, the same default mousebinds will be loaded even if the element is not provided. Example usage (with a slight spelling error): Co-Authored-By: @johanmalm Fixes #416 --- docs/labwc-config.5.scd | 7 +++++++ src/config/rcxml.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 845da4a9..920455b9 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -219,6 +219,13 @@ The rest of this man page describes configuration options. - DoubleClick: Two presses within the doubleClickTime. - Drag: Pressing the button within the context, then moving the cursor +** + Load default mousebinds. This is an addition to the openbox + specification and provides a way to keep config files simpler whilst + allowing user specific binds. Note that if no rc.xml is found, or if no + entries exist, the same default mousebinds will be + loaded even if the element is not provided. + ## LIBINPUT ** diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 3b04cd55..c0a92991 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -42,6 +42,7 @@ enum font_place { }; static void load_default_key_bindings(void); +static void load_default_mouse_bindings(void); static void fill_keybind(char *nodename, char *content) @@ -335,6 +336,11 @@ entry(xmlNode *node, char *nodename, char *content) load_default_key_bindings(); return; } + if (!strcmp(nodename, "devault.mouse") + || !strcmp(nodename, "default.mouse")) { + load_default_mouse_bindings(); + return; + } /* handle the rest */ if (!content) {