How to use the xcffib.xproto.EventMask function in xcffib

To help you get started, we’ve selected a few xcffib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qtile / qtile / libqtile / group.py View on Github external
def hide(self):
        self.screen = None
        with self.disable_mask(xcffib.xproto.EventMask.EnterWindow |
                               xcffib.xproto.EventMask.FocusChange |
                               xcffib.xproto.EventMask.LeaveWindow):
            for i in self.windows:
                i.hide()
            self.layout.hide()
github qtile / qtile / libqtile / backend / x11 / xcbq.py View on Github external
    def send_event(self, synthevent, mask=EventMask.NoEvent):
        self.conn.conn.core.SendEvent(False, self.wid, mask, synthevent.pack())
github qtile / qtile / libqtile / window.py View on Github external
wm_client_machine=self.window.get_wm_client_machine(),
            normalhints=normalhints,
            hints=hints,
            state=state,
            float_info=self._float_info
        )


class Internal(_Window):
    """An internal window, that should not be managed by qtile"""
    _window_mask = EventMask.StructureNotify | \
        EventMask.PropertyChange | \
        EventMask.EnterWindow | \
        EventMask.FocusChange | \
        EventMask.Exposure | \
        EventMask.ButtonPress | \
        EventMask.ButtonRelease | \
        EventMask.KeyPress

    @classmethod
    def create(cls, qtile, x, y, width, height, opacity=1.0):
        win = qtile.conn.create_window(x, y, width, height)
        win.set_property("QTILE_INTERNAL", 1)
        i = Internal(win, qtile)
        i.place(x, y, width, height, 0, None)
        i.opacity = opacity
        return i

    def __repr__(self):
        return "Internal(%r, %s)" % (self.name, self.window.wid)

    def kill(self):
github qtile / qtile / libqtile / window.py View on Github external
normalhints=normalhints,
            hints=hints,
            state=state,
            float_info=self._float_info
        )


class Internal(_Window):
    """An internal window, that should not be managed by qtile"""
    _window_mask = EventMask.StructureNotify | \
        EventMask.PropertyChange | \
        EventMask.EnterWindow | \
        EventMask.FocusChange | \
        EventMask.Exposure | \
        EventMask.ButtonPress | \
        EventMask.ButtonRelease | \
        EventMask.KeyPress

    @classmethod
    def create(cls, qtile, x, y, width, height, opacity=1.0):
        win = qtile.conn.create_window(x, y, width, height)
        win.set_property("QTILE_INTERNAL", 1)
        i = Internal(win, qtile)
        i.place(x, y, width, height, 0, None)
        i.opacity = opacity
        return i

    def __repr__(self):
        return "Internal(%r, %s)" % (self.name, self.window.wid)

    def kill(self):
        self.qtile.conn.conn.core.DestroyWindow(self.window.wid)
github asrp / guitktk / wrap_event.py View on Github external
event.mods = []
            for attrib in dir(KeyButMask):
                if not attrib.startswith("__"):
                    if event.state & getattr(KeyButMask, attrib):
                        event.mods.append(attrib.lower())
            if event.type == Event.mouse_press and event.button == 1:
                startdrag = event.xy
            logger.info("Wrapped: %s", (event.__class__.__name__, event.button, event.xy, event.mods))
        elif event.type == Event.motion:
            event.xy = numpy.array([event.event_x, event.event_y])
            event.txy = numpy.linalg.solve(doc["drawing"].transform, numpy.append(event.xy, [1]))[:2]
            if event.state & EventMask.Button1Motion:
                event.drag_button = 1
            elif event.state & EventMask.Button2Motion:
                event.drag_button = 2
            elif event.state & EventMask.Button1Motion:
                event.drag_button = 3
            else:
                event.drag_button = None
            if event.drag_button:
                event.diff = event.xy - startdrag
            if event.drag_button:
                logger.info("Wrapped: %s", (event.__class__.__name__, event.drag_button, event.xy, event.diff))
            logger.info("Wrapped: %s", (event.type, event.__class__.__name__, event.xy))
github qtile / qtile / libqtile / window.py View on Github external
return i

    def __repr__(self):
        return "Internal(%r, %s)" % (self.name, self.window.wid)

    def kill(self):
        self.qtile.conn.conn.core.DestroyWindow(self.window.wid)

    def cmd_kill(self):
        self.kill()


class Static(_Window):
    """An internal window, that should not be managed by qtile"""
    _window_mask = EventMask.StructureNotify | \
        EventMask.PropertyChange | \
        EventMask.EnterWindow | \
        EventMask.FocusChange | \
        EventMask.Exposure

    def __init__(self, win, qtile, screen,
                 x=None, y=None, width=None, height=None):
        _Window.__init__(self, win, qtile)
        self.update_name()
        self.conf_x = x
        self.conf_y = y
        self.conf_width = width
        self.conf_height = height
        self.x = x or 0
        self.y = y or 0
        self.width = width or 0
        self.height = height or 0
github qtile / qtile / libqtile / backend / x11 / xcore.py View on Github external
raise QtileError("No DISPLAY set")

        self.conn = xcbq.Connection(display_name)
        self._display_name = display_name

        # Because we only do Xinerama multi-screening,
        # we can assume that the first
        # screen's root is _the_ root.
        self._root = self.conn.default_screen.root
        self._root.set_attribute(
            eventmask=(
                xcffib.xproto.EventMask.StructureNotify
                | xcffib.xproto.EventMask.SubstructureNotify
                | xcffib.xproto.EventMask.SubstructureRedirect
                | xcffib.xproto.EventMask.EnterWindow
                | xcffib.xproto.EventMask.LeaveWindow
            )
        )

        self._root.set_property(
            "_NET_SUPPORTED", [self.conn.atoms[x] for x in xcbq.SUPPORTED_ATOMS]
        )

        wmname = "qtile"
        self._supporting_wm_check_window = self.conn.create_window(-1, -1, 1, 1)
        self._supporting_wm_check_window.set_property("_NET_WM_NAME", wmname)
        self._supporting_wm_check_window.set_property(
            "_NET_SUPPORTING_WM_CHECK", self._supporting_wm_check_window.wid
        )
        self._root.set_property(
            "_NET_SUPPORTING_WM_CHECK", self._supporting_wm_check_window.wid
        )