mousebind: support Border context

This new context includes `Top`...`BRCorner` and makes it easier to modify
the mousebinds bound to them.
This commit is contained in:
tokyo4j 2025-09-02 08:32:23 +09:00 committed by Johan Malm
parent b5b257092d
commit 02be24bf59
6 changed files with 10 additions and 72 deletions

View file

@ -132,6 +132,8 @@ context_from_str(const char *str)
return LAB_SSD_PART_CORNER_BOTTOM_RIGHT;
} else if (!strcasecmp(str, "BLCorner")) {
return LAB_SSD_PART_CORNER_BOTTOM_LEFT;
} else if (!strcasecmp(str, "Border")) {
return LAB_SSD_PART_BORDER;
} else if (!strcasecmp(str, "Top")) {
return LAB_SSD_PART_TOP;
} else if (!strcasecmp(str, "Right")) {

View file

@ -328,6 +328,10 @@ ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate)
return candidate >= LAB_SSD_BUTTON_CLOSE
&& candidate <= LAB_SSD_CLIENT;
}
if (whole == LAB_SSD_PART_BORDER) {
return candidate >= LAB_SSD_PART_CORNER_TOP_LEFT
&& candidate <= LAB_SSD_PART_LEFT;
}
if (whole == LAB_SSD_PART_TOP) {
return candidate == LAB_SSD_PART_CORNER_TOP_LEFT
|| candidate == LAB_SSD_PART_CORNER_TOP_RIGHT;