If I open e.g. Kate as a non maximized window and I maximize it, I can always restore its previous window size. But when I close the maximized window it will open correctly maximized, but it looses the possibility to restore the not maximized window size. You need to drag the size manually again from maximized down to a smaller window.
Not much the compositor can do. The application seem to store their last size and open at the maximized size instead of a proper size. This needs to be fixed in the toolkits (I assume that's just a Qt issue).