The same thing happens to me on occasion in gedit with DWM. I run gedit 3.4.2 on Debian 7.0 x64. I believe the common trait amongst the three window managers mentioned in this thread are that they are tiling, and I have seen other threads also talk about gedit acting oddly in this manner with tiling window managers.