The existence of multiple gateways, as is a common case in Wireless Mesh Networks (WMNs), brings the possibility to improve network performance. However, previous studies, including both heuristic-based gradual-optimization work and theory-driven cross-layer design work, cannot guarantee an optimal exploitation of multiple gateways. In this paper, we first extend the current framework of cross-layer design to incorporate a dynamic gateway selection strategy, and propose a novel joint traffic splitting, rate control, routing and scheduling algorithm called CLC-DGS, which distributes traffic of a flow into multiple gateways in an optimal way so as to guarantee maximum network utility. Secondly, based on CLC-DGS, we propose an enhanced CLC-DGS-DD algorithm which in addition takes into account the delay requirements for network flows. CLC-DGS-DD provides a flexible framework for adjusting delays among different flows, and thereby achieves as low as order-optimal delays for preferential flows while simultaneously guaranteeing maximum network utility. Through theoretical analysis and simulation experiments, we demonstrate that compared with previous studies, CLC-DGS and CLC-DGS-DD significantly improve performance of WMNs.