How to use the pywayland.client.Display function in pywayland

To help you get started, we’ve selected a few pywayland 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 realitix / vulkan / example / contribs / example_wayland.py View on Github external
window['shm'] = registry.bind(id_, Shm, version)
        window['shm'].dispatcher['format'] = shm_format_handler

def registry_global_remover(registry, id_):
    print("got a registry losing event for {}".format(id))

def shell_surface_ping_handler(shell_surface, serial):
    shell_surface.pong(serial)

window = {
    'compositor': None,
    'shell': None,
    'shm': None
}

display = Display()
display.connect()

registry = display.get_registry()
registry.dispatcher['global'] = registry_global_handler
registry.dispatcher['global_remove'] = registry_global_remover
registry.user_data = window

display.dispatch()
display.roundtrip()

assert window['compositor']
assert window['shell']
assert window['shm']

surface = window['compositor'].create_surface()
shell_surface = window['shell'].get_shell_surface(surface)

pywayland

Python bindings for the libwayland library written in pure Python

Apache-2.0
Latest version published 5 months ago

Package Health Score

67 / 100
Full package analysis

Similar packages