Context mismatch in svga_surface_destroy messages from gtkmm 4 application

I’m working on a charting application using gtkmm 4, cairo and an Ubuntu 24.10 VM on Intel. I derive a class ChartDrawingArea from Gtk::DrawingArea to draw the chart. ChartWindow (derived from Gtk::Window) has member

Glib::RefPtr chart_drawing_area;

initialized in the constructor with

chart_drawing_area = Glib::make_refptr_for_instance(new ChartDrawingArea());

When the application is idle, context mismatch in svga_surface_destroy messages are shown in the terminal. How can I determine where this happens and fix the issue?

Hello @jlouw,

First we should identify which library is emitting the error. Quick Google search suggest it might be related to VM graphics drivers:

Thank you for the advice. This error disappears if I disable 3D graphics acceleration in Vmware Workstation. I assumed I was not using gtkmm and cairomm correctly.

I assumed I was not using gtkmm and cairomm correctly.

Your assumption is correct, although your error message is not related to your
mistake with gtkmm. Gtk::Drawing Area is a widget. Don’t use Glib::RefPtr and
Glib::make_refptr_for_instance() with widgets. See for instance the example program at

The description of Glib::RefPtr at Appendix A. The RefPtr smartpointer
has been updated lately.