They aren't strong flyers. If you put a fan blowing over your indoor plants, gnats will be blown away from the plants and not have a chance to lay eggs in the soil.
Also, soaking the plants under water will kill the eggs. Of course, bark floats.
__________________ May the bridges I've burned light my way.