Section 4 of the following paper considers in some detail the 2D wave equation ($\partial_x\partial_y f = 0$ in your coordinates; not exactly the same but closely related) on compact domains with smooth boundary (with unpleasant cases where the boundary is too closely tangent to null/characteristic directions is also excluded):
Cattaneo, Alberto S.; Mnev, Pavel, Wave relations, Commun. Math. Phys. 332, No. 3, 1083-1111 (2014). arXiv:1308.5592 ZBL1300.53069.
A quick summary that doesn't do justice to all the details: The wave equation has a variational formulation, which indirectly means that the boundary data (value and normal derivative of $f$ on the boundary) gets an induced symplectic structure. The authors show that the restriction of solutions $f$ to the boundary gives a Lagragian subspace $L$ of this space of boundary data. Thinking abstractly, any set of boundary conditions identifies another (affine) subspace $C$ of the boundary data. The boundary conditions specify a unique solution when the two subspaces are complementary, the intersection $L\cap C$ is zero dimensional (just one point, the unique solution). The authors then consider some examples of such subspaces $C$. Heuristically (ignoring the infinite dimensional context), a generic second Lagrangian subspace would give a good $C$.