usually 6" (2way or 3 way) door speakers have a shallow mounting depth for this very reason. with my window rolled fully down, i have maybe half an inch from the speaker magnet to the glass.
as with some component speakers, as in splits, the actual speeker is a woofer and has a larger magnet and requires a deeper mounting depth, such speakers are the Alpine Type S and Type R. to deal with these problems, door pods are used, these are usually where your feet are, at the front of the door, and where your side pockets are, and are angled towards your head. they also have plain spacers, in half inch, or 1 inch, but be careful, as sometimes there may not be enough room between the door and the seats when doors are closed, and also, you need a bit of space for the sounds/music to circulate and sound descent.
if you need your side pockets, save up for some top end 4" speakers, and place them in the factory positions, and get some 6" SPLITS or some 6"x9"s.