Fix evaluating window rules for closed windows
gedit changes its caption from "Untitled document - gedit" to "gedit" when it closes. This schedules Window::evaluateWindowRules() to be called when the window is already marked as deleted. kwin then crashes.
In order to prevent that, a direct connection can be used instead. But then the caption must be initialized extra carefully because if the window rule changes the window type, "" can be lost.
Edited by Vlad Zahorodnii