By using the Onsager variational principle as an approximation tool, we develop a new diffusion generated motion method for wetting problems. The method uses a signed distance function to represent the interface between the liquid and vapor surface. In each iteration, a linear diffusion equation with a linear boundary condition is solved for one time step in addition to a simple re-distance step and a volume correction step. The method has a first-order convergence rate with respect to the time step size even in the vicinity threephase contact points. Its energy stability property is analysed by careful studies for some geometric flows on substrates. Numerical examples show that the method can be used to simulate complicated wetting problems on inhomogeneous surfaces.