Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)