You can't reparent a GtkGLArea
If you change the parent of a GtkGLArea using the recommended approach:
g_object_ref (widget);
gtk_container_remove (GTK_CONTAINER (priv->parent), widget);
gtk_container_add (GTK_CONTAINER (new_parent), widget);
g_object_unref (widget);
then the widget becomes unrealized and the context is destroyed and then recreated. But this can break the control because even though the resources are shared, not all OpenGL resources are shareable (e.g. VAOs, FBOs). Those resources therefore become invalid after reparenting.
I tried using gtk_widget_reparent to avoid the unrealizing piece but:
- This function is deprecated so not a great solution going forward
- It prevents the control from being unrealized, but it still doesn't work...I get a black window. I didn't dig into this too deeply.
I didn't use the bug template, because this is not so much a bug as a design flaw or oversight.