Gnats

Gnats

Does anyone else have a gnat problem? There's a swarm that likes to hang out by my kitchen window, and anytime I open that window for some circulation, I get tons of gnats in my apartment! Needless to say, a problem I could do without, and I don't like spraying bug killer everytime (the sprays give me headaches). Has anyone else had any success getting rid of these little buggers? What did you do? Sorry if this might not be directly related to gardening! This seemed like the best place to ask. :) ~~Edit~ Now that I think about it, they might not be gnats. I guess they could be fruit flies? They like to hang out on my dirty dishes or in my trash can, or else just fly around in circles. They're definitely not house flies though -- they're much smaller. Any ideas on how to prevent them from getting inside, other than keeping that window closed, or how to get rid of them once they're in? They're driving me bonkers.
Garden pics

Garden pics

Deer and the Garden

Deer and the Garden

Plant ID, Fellow Plant Nerdies

Plant ID, Fellow Plant Nerdies

my hot household & our apartment

my hot household & our apartment

tulips

tulips

Eggplant Harvest

Eggplant Harvest