I adopted the code from this answer in order to draw an overlay window, which stays on top of all windows, always. But I find that this window keeps flickering whenever there is a keypress or a button click. I wanted to know if this can be stopped somehow. Increasing the time did not help me, as my terminal was frozen for few seconds when I increased time to 5000000000
The code was tested on Ubuntu 16.04 LTS.