'Transparent PyQT5 window does not show over fullscreened application

I am currently trying to make an overlay for games using a transparent PyQT5 window. My current code:

class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint | QtCore.Qt.X11BypassWindowManagerHint)
        self.setGeometry(QtWidgets.QStyle.alignedRect(QtCore.Qt.LeftToRight, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop, QtCore.QSize(round(screeninfo.get_monitors()[0].width/3), round(screeninfo.get_monitors()[0].height/5)), QtWidgets.qApp.desktop().availableGeometry()))
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground, True)
        self.show()
        

Except it doesn't show over fullscreened applications (like games). Is there an attribute I can set that can enable it to show on top of fullscreened applications as well?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source