Vte.Terminal.do_draw() not updating the entire window in some cases.
I'm working on a Terminator enhancement https://github.com/gnome-terminator/terminator/issues/74 and I think I've found a case where Vte.terminal.do_draw() is only updating the row that the command prompt is on, and not the entire terminal window.
Here's what I'm referring to.
When a terminal goes out of focus, I expect it to get overpainted with the background color by setting the alpha transparency to 0.5 to indicate that it's out of focus, and when focus is returned, the alpha transparency goes back to 0.0. This is to fix up the unfocussed dim that Terminator uses,
to do this I've basically overriden the Vte.Terminal.do_draw() method and added a dim method This is as close a translation of the code in the vte test app as I could do in python.
class Overpaint(Vte.Terminal):
def dim(self,b):
self.overpaint = b
def do_draw(self,cr):
Vte.Terminal.do_draw(self,cr)
bgc = Vte.Terminal.get_color_background_for_draw(self)
if self.overpaint:
bgc.alpha = 0.5
cr.set_operator(cairo.Operator.OVER)
Gdk.cairo_set_source_rgba(cr,bgc)
cr.rectangle(0.0,0.0,self.get_allocated_width(),self.get_allocated_height())
cr.paint()
With this code, instead of painting the entire terminal window, it only paints the row that the command prompt is currently on. After 5 or 10 seconds, it does paint the entire terminal window, but there is a very disconcerting pause there between the focus leaving, and the full paint.