示例#1
0
def is_x11_compositing_enabled():
    """Is X11 compositing manager running.
    """
    try:
        from PyQt4.QtGui import QX11Info
    except ImportError:
        return False

    return QX11Info.isCompositingManagerRunning()
示例#2
0
文件: utils.py 项目: rbax/orange3
def is_x11_compositing_enabled():
    """Is X11 compositing manager running.
    """
    try:
        from PyQt4.QtGui import QX11Info
    except ImportError:
        return False

    return QX11Info.isCompositingManagerRunning()
示例#3
0
    def __init__(self, keyPressHandler, parent=None):
        QDialog.__init__(self, parent)

        self.keyPressHandler = keyPressHandler

        self.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setFocusPolicy(Qt.NoFocus)
        # Causes issues in some non-compositing WM's (notably Fluxbox)
        if QX11Info.isCompositingManagerRunning():
            self.setAttribute(Qt.WA_TranslucentBackground)

        self.timer = QTimer()
        self.timer.setSingleShot(True)
        self.timer.timeout.connect(self.hide)
示例#4
0
    def from_qt(cls):
        """
        Create and return a :class:`Display` object from the Qt display
        connection, as available in :meth:`PyQt4.QtGui.QX11Info.display()`.

        Raise :exc:`~exceptions.DisplayError`, if no Qt display connection
        is available.  Raise :exc:`~exceptions.ImportError`, if either
        :mod:`sip` or :mod:`PyQt4.QtGui` are not available.
        """
        import sip
        from PyQt4.QtGui import QX11Info

        display = QX11Info.display()
        if not display:
            raise DisplayError()
        display_address = sip.unwrapinstance(display)
        return cls(cast(display_address, xlib.Display_p))
示例#5
0
    def from_qt(cls):
        """
        Create and return a :class:`Display` object from the Qt display
        connection, as available in :meth:`PyQt4.QtGui.QX11Info.display()`.

        Raise :exc:`~exceptions.DisplayError`, if no Qt display connection
        is available.  Raise :exc:`~exceptions.ImportError`, if either
        :mod:`sip` or :mod:`PyQt4.QtGui` are not available.
        """
        import sip
        from PyQt4.QtGui import QX11Info

        display = QX11Info.display()
        if not display:
            raise DisplayError()
        display_address = sip.unwrapinstance(display)
        return cls(cast(display_address, xlib.Display_p))