If you have a gvim window open under KDE, KDE will hang when
shutting down. I am using gvim 5.3 and KDE 1.1.2.
The screen goes grey and the "Preparing Session..." message comes up
and then nothing else happens after that. You can still exit X by
using the Ctrl-Alt-Backspace combination.
unfortunately, the way that session management is implemented in KDE 1.1.x,
there is no way around this. Session handling has been completely reimplemented
for KDE 2.x, and this problem is gone.
For now, the workaround will be to close gvim before logging out of KDE.