view.c: simplify view_at()

This commit is contained in:
Johan Malm 2020-09-02 20:26:18 +01:00
parent c56fe23b2e
commit b99977368d

View file

@ -250,26 +250,9 @@ struct view *view_at(struct server *server, double lx, double ly,
return view; return view;
if (!view->show_server_side_deco) if (!view->show_server_side_deco)
continue; continue;
if (deco_at(view, lx, ly) == LAB_DECO_PART_TITLE) { *view_area = deco_at(view, lx, ly);
*view_area = LAB_DECO_PART_TITLE; if (*view_area != LAB_DECO_NONE)
return view; return view;
}
if (deco_at(view, lx, ly) == LAB_DECO_PART_TOP) {
*view_area = LAB_DECO_PART_TOP;
return view;
}
if (deco_at(view, lx, ly) == LAB_DECO_PART_RIGHT) {
*view_area = LAB_DECO_PART_RIGHT;
return view;
}
if (deco_at(view, lx, ly) == LAB_DECO_PART_BOTTOM) {
*view_area = LAB_DECO_PART_BOTTOM;
return view;
}
if (deco_at(view, lx, ly) == LAB_DECO_PART_LEFT) {
*view_area = LAB_DECO_PART_LEFT;
return view;
}
} }
return NULL; return NULL;
} }