pop-os / cosmic-protocols

Addtional wayland-protocols used by the COSMIC desktop environment
30 stars 7 forks source link

Example capturing output to `gtk4::Picture` #6

Closed ids1024 closed 2 years ago

ids1024 commented 2 years ago

Captures all outputs using export_dmabuf.

Using dispatch_pending in a busy loop here isn't ideal, but poll_dispatch_pending doesn't seem to work?

If GDK tries tries to destroy a surface, an EGL_BAD_DISPLAY error is produced, which causes a segfault. With https://github.com/Smithay/smithay/pull/771 it logs instead of segfaulting. This seems to happen as long as GpuManager::new() is called, even if it isn't used.

Copying the dmabuf into a Vec is not ideal, but GDK doesn't seem to provide a way to get the EGLContext behind a Gdk::GLContext.

This should be updated to have an optional crate feature that provides abstractions based on smithay-client-toolkit to simplify the code needed here. We can also use that for an Iced example then.