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.