]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Restore SnapToEdge and MoveToEdge default keybinds
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 6 Aug 2023 08:26:04 +0000 (10:26 +0200)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 6 Aug 2023 08:37:36 +0000 (10:37 +0200)
When adding the fallback keybinds we add them as string but expect them being an int.
This commit fixes that by using the same parsing routines that are used when parsing
user supplied configuration.

Fixes 1ee8715d57ddb6b444e0b089879db6f837400539
actions: use enum for _ToEdge action

include/action.h
src/action.c
src/config/rcxml.c

index f11e4c116b31ec20eb17c294d014e8b048e630b7..a76aecf50c88ac9f870e7779d7bf1c4f6fb90236 100644 (file)
@@ -24,7 +24,7 @@ bool action_is_valid(struct action *action);
 
 void action_arg_add_str(struct action *action, const char *key, const char *value);
 
-void action_arg_from_xml_node(struct action *action, char *nodename, char *content);
+void action_arg_from_xml_node(struct action *action, const char *nodename, const char *content);
 
 bool actions_contain_toggle_keybinds(struct wl_list *action_list);
 
index 35a29e7f15158e5f0269cf98d75d1730cdbf27f3..c04e1c54eb45817baa44c5528d169b65bdc2788f 100644 (file)
@@ -159,7 +159,7 @@ action_arg_add_int(struct action *action, const char *key, int value)
 }
 
 void
-action_arg_from_xml_node(struct action *action, char *nodename, char *content)
+action_arg_from_xml_node(struct action *action, const char *nodename, const char *content)
 {
        assert(action);
 
index f0af0b515e60a9609ad29f609110da1731491589..42f89442ab7412c9555737fdbb692a8dd641e69e 100644 (file)
@@ -847,7 +847,8 @@ load_default_key_bindings(void)
                wl_list_append(&k->actions, &action->link);
 
                if (key_combos[i].attribute && key_combos[i].value) {
-                       action_arg_add_str(action, key_combos[i].attribute, key_combos[i].value);
+                       action_arg_from_xml_node(action,
+                               key_combos[i].attribute, key_combos[i].value);
                }
        }
 }
@@ -956,7 +957,8 @@ load_default_mouse_bindings(void)
                 * slightly more sophisticated approach will be needed.
                 */
                if (current->attribute && current->value) {
-                       action_arg_add_str(action, current->attribute, current->value);
+                       action_arg_from_xml_node(action,
+                               current->attribute, current->value);
                }
        }
        wlr_log(WLR_DEBUG, "Loaded %u merged mousebinds", count);