config: support <mouse><default />

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 <mouse><mousebind> entries
exist, the same default mousebinds will be loaded even if the <default />
element is not provided.

Example usage:

  <mouse>
    <default />
    <context name="Root">
      <mousebind button="Right" action="Press">
        <action name="Execute" command="my-menu-application" />
      </mousebind>
    </context>
  </mouse>
This commit is contained in:
Johan Malm 2022-04-22 17:52:01 +01:00
parent edc5338af4
commit 3d337857b7
3 changed files with 13 additions and 1 deletions

View file

@ -619,7 +619,7 @@ handle_press_mousebinding(struct view *view, struct server *server,
bool activated_any = false;
bool activated_any_frame = false;
wl_list_for_each_reverse(mousebind, &rc.mousebinds, link) {
wl_list_for_each(mousebind, &rc.mousebinds, link) {
if (ssd_part_contains(mousebind->context, view_area)
&& mousebind->button == button
&& modifiers == mousebind->modifiers) {
@ -655,6 +655,7 @@ handle_press_mousebinding(struct view *view, struct server *server,
activated_any = true;
activated_any_frame |= mousebind->context == LAB_SSD_FRAME;
actions_run(view, server, &mousebind->actions, resize_edges);
break;
}
}
return activated_any && activated_any_frame;