Most of the time it's the rubber trim that attaches to the sheet metal that is out of place. It guides the window into the tracks after it leaves the down position. It pushes the window in. If it's loose, the window will go up crooked and stop part way up. Remove the trim, clean up the groove it sets in and see if it will stay still. If not, stick some super glue gel in the slot and try again. Make sure the rubber is clean.