GNOME Bugzilla – Bug 754890
Fix Mesa warning when unrealizing/rerealizing foreign stage windows
Last modified: 2015-09-11 22:42:45 UTC
We get a "failed to create drawable" warning for Mesa when rerealizing a stage with the same foreign window. It turns out that Cogl keeps a reference on the current frame buffer set using cogl_set_framebuffer().
Created attachment 311161 [details] [review] gdk: stage window: reset framebuffer on foreign window unrealize
Review of attachment 311161 [details] [review]: ::: clutter/gdk/clutter-stage-gdk.c @@ +194,3 @@ + * rendered to. In the case of foreign window, we want to + * avoid this, as we don't know what's going to happen to + This comment should be the Git commit message. :-)
Created attachment 311187 [details] [review] gdk: stage window: reset framebuffer on foreign window unrealize Clutter still uses part of the deprecated stateful API of Cogl (in particulart cogl_set_framebuffer). It means Cogl can keep an internal reference to the onscreen object we rendered to. In the case of foreign window, we want to avoid this, as we don't know what's going to happen to that window. This change sets the current Cogl framebuffer to a dummy 1x1 framebuffer if the current Cogl framebuffer is the one we're unrealizing.
Review of attachment 311161 [details] [review]: ::: clutter/gdk/clutter-stage-gdk.c @@ +194,3 @@ + * rendered to. In the case of foreign window, we want to + * avoid this, as we don't know what's going to happen to + Done. @@ +200,3 @@ + * foreign window. + */ + * can keep an internal reference to the onscreen object we Actually missed a small condition here.
Review of attachment 311187 [details] [review]: Pushed to master.