# How to force draw() update on viewport for “fade out” effect?

I couldn't find anything that answered my question, so here it goes:

I'm doing a basic draw method that writes something on the viewport, but I want it to fade out. This much I got working. The problem is, unless I'm actually moving the viewport, the text won't update (video).

https://youtu.be/VWcwE7n0yOs

Is there a way to force the viewport to update every time I fade out the text or is this a blender limitation?

Here's my code (just paste it on Blender's text editor and press play)

import blf
import bpy
import time

class DrawMessage:
def __init__(self, context, text) -> None:
self.text = text
self.draw_text_callback, (context,), 'WINDOW', 'POST_PIXEL'
)

def draw_text_callback(self, context):
font_id = 0

# Draw some text:
blf.position(font_id, 2, 80, 0)
blf.size(font_id, 50, 72)
blf.draw(font_id, "{} and {}".format(context.scene.name, self.text))

bpy.types.SpaceView3D.draw_handler_remove(self.handle, 'WINDOW')
return None
return 0.1

def remove_handle(self):
bpy.types.SpaceView3D.draw_handler_remove(self.handle, 'WINDOW')
print("REMOVIDO!")

context = bpy.context
dc = DrawMessage(context, "DRAW THIS ON SCREEN")