deco.c: add enum end-marker

This commit is contained in:
Johan Malm 2020-09-02 21:04:31 +01:00
parent 625722cb66
commit 97c29987e2
2 changed files with 4 additions and 4 deletions

View file

@ -92,7 +92,8 @@ struct output {
enum view_type { LAB_XDG_SHELL_VIEW, LAB_XWAYLAND_VIEW };
enum deco_part {
LAB_DECO_BUTTON_CLOSE = 0,
LAB_DECO_NONE = 0,
LAB_DECO_BUTTON_CLOSE,
LAB_DECO_BUTTON_MAXIMIZE,
LAB_DECO_BUTTON_ICONIFY,
LAB_DECO_PART_TITLE,
@ -100,8 +101,7 @@ enum deco_part {
LAB_DECO_PART_RIGHT,
LAB_DECO_PART_BOTTOM,
LAB_DECO_PART_LEFT,
LAB_DECO_NONE
/* Keep LAB_DECO_NONE last as iteration end-marker */
LAB_DECO_END_MARKER
};
struct view_impl {

View file

@ -94,7 +94,7 @@ struct wlr_box deco_box(struct view *view, enum deco_part deco_part)
enum deco_part deco_at(struct view *view, double lx, double ly)
{
enum deco_part deco_part;
for (deco_part = 0; deco_part < LAB_DECO_NONE; ++deco_part) {
for (deco_part = 0; deco_part < LAB_DECO_END_MARKER; ++deco_part) {
struct wlr_box box = deco_box(view, deco_part);
if (wlr_box_contains_point(&box, lx, ly))
return deco_part;