Skip to content
  • Vlad Zahorodnii's avatar
    Introduce persistent global share context · 445d1496
    Vlad Zahorodnii authored
    On Wayland, internal windows that use OpenGL are rendered into fbos,
    which are later handed over to kwin. In order to achieve that, our QPA
    creates OpenGL contexts that share resources with the scene's context.
    
    The problems start when compositing has been restarted. If user changes
    any compositing settings, the underlying render backend will be
    reinitialized and with it, the scene's context will be destroyed. Thus,
    we no longer can accept framebuffer objects from internal windows.
    
    This change addresses the framebuffer object sharing problem by adding
    a so called global share context. It persists throughout the lifetime of
    kwin. It can never be made current. The scene context and all contexts
    created in our QPA share resources with it.
    
    Therefore we can destroy the scene OpenGL context without affecting
    OpenGL contexts owned by internal windows, e.g. the outline visual or
    tabbox.
    
    It's worth noting that Qt provides a way to create a global share
    context. But for ...
    445d1496