diff --git a/src/config/mousebind.c b/src/config/mousebind.c index c8e31c44..903be153 100644 --- a/src/config/mousebind.c +++ b/src/config/mousebind.c @@ -57,14 +57,32 @@ mousebind_event_from_str(const char *str) static enum ssd_part_type context_from_str(const char *str) { - if (!strcasecmp(str, "Titlebar")) { - return LAB_SSD_PART_TITLEBAR; - } else if (!strcasecmp(str, "Close")) { + if (!strcasecmp(str, "Close")) { return LAB_SSD_BUTTON_CLOSE; } else if (!strcasecmp(str, "Maximize")) { return LAB_SSD_BUTTON_MAXIMIZE; } else if (!strcasecmp(str, "Iconify")) { return LAB_SSD_BUTTON_ICONIFY; + } else if (!strcasecmp(str, "Titlebar")) { + return LAB_SSD_PART_TITLEBAR; + } else if (!strcasecmp(str, "Title")) { + return LAB_SSD_PART_TITLE; + } else if (!strcasecmp(str, "TLCorner")) { + return LAB_SSD_PART_CORNER_TOP_LEFT; + } else if (!strcasecmp(str, "TRCorner")) { + return LAB_SSD_PART_CORNER_TOP_RIGHT; + } else if (!strcasecmp(str, "BRCorner")) { + return LAB_SSD_PART_CORNER_BOTTOM_RIGHT; + } else if (!strcasecmp(str, "BLCorner")) { + return LAB_SSD_PART_CORNER_BOTTOM_LEFT; + } else if (!strcasecmp(str, "Top")) { + return LAB_SSD_PART_TOP; + } else if (!strcasecmp(str, "Right")) { + return LAB_SSD_PART_RIGHT; + } else if (!strcasecmp(str, "Bottom")) { + return LAB_SSD_PART_BOTTOM; + } else if (!strcasecmp(str, "Left")) { + return LAB_SSD_PART_LEFT; } else if (!strcasecmp(str, "Frame")) { return LAB_SSD_FRAME; } else if (!strcasecmp(str, "Client")) { diff --git a/src/ssd.c b/src/ssd.c index ffa0b728..789f5e38 100644 --- a/src/ssd.c +++ b/src/ssd.c @@ -423,10 +423,22 @@ ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate) return true; } if (whole == LAB_SSD_PART_TITLEBAR) { - return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_CORNER_TOP_RIGHT; + return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_TITLE; } if (whole == LAB_SSD_FRAME) { return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_CLIENT; } + if (whole == LAB_SSD_PART_TOP) { + return candidate == LAB_SSD_PART_CORNER_TOP_LEFT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT; + } + if (whole == LAB_SSD_PART_RIGHT) { + return candidate == LAB_SSD_PART_CORNER_TOP_RIGHT || candidate == LAB_SSD_PART_CORNER_BOTTOM_RIGHT; + } + if (whole == LAB_SSD_PART_BOTTOM) { + return candidate == LAB_SSD_PART_CORNER_BOTTOM_RIGHT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT; + } + if (whole == LAB_SSD_PART_LEFT) { + return candidate == LAB_SSD_PART_CORNER_TOP_LEFT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT; + } return false; }