For some reason, QTextEdit can be put into states where it no longer emits paint events, which is what we relied on. Now we force repaints for events we expect to change the visuals, e.g. keyboard/mouse events.