define ssd_part_contains to define the mouse context subset relation

This commit is contained in:
bi4k8 2021-12-01 22:10:33 +00:00 committed by Johan Malm
parent b008917895
commit d84103d669
2 changed files with 16 additions and 0 deletions

View file

@ -415,3 +415,18 @@ ssd_update_geometry(struct view *view, bool force)
view->ssd.box.height = view->h;
damage_all_outputs(view->server);
}
bool
ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate)
{
if (whole == candidate) {
return true;
}
if (whole == LAB_SSD_PART_TITLEBAR) {
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_CORNER_TOP_RIGHT;
}
if (whole == LAB_SSD_FRAME) {
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_CLIENT;
}
return false;
}