Check if drain mode has already been enabled/disabled

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Support resolution changes

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>