Colomban Wendling
2014-06-21 13:35:32 UTC
Hi,
GTK 3.14 (current development version) will (likely) make Scintilla emit
https://mail.gnome.org/archives/gtk-devel-list/2014-June/msg00010.html
The good news is, it may not be so hard to fix actually.
The reason we see these warning is because GTK implementation of
SurfaceImpl::Init(WindowID) creates a drawing context (hence calling
gdk_cairo_create()) unconditionally, even for surfaces only used for
measurements (like the one used in Editor::LocationFromPosition() --
method indirectly called on mouse movements).
So, what I suggest would be to delay the creation of the actual drawing
context (and the call to gdk_cairo_create()) until we actually want to
draw something on the surface.
Attached is a (somewhat ugly) patch doing this, which seems to get rid
of all these new warnings we had (or at least, that I could trigger).
It should be completely safe in any situations anyway, as it only delays
the creation of this internal context, it doesn't remove it.
If the concept is acceptable but patch is too ugly, I'm willing to
improve the actual implementation if you want, just tell me.
Regards,
Colomban
GTK 3.14 (current development version) will (likely) make Scintilla emit
Gdk-WARNING **: gdk_cairo_create called from outside a paint. Make sure to call gdk_window_begin_paint_region before calling gdk_cairo_create!
Yaykes. Seehttps://mail.gnome.org/archives/gtk-devel-list/2014-June/msg00010.html
The good news is, it may not be so hard to fix actually.
The reason we see these warning is because GTK implementation of
SurfaceImpl::Init(WindowID) creates a drawing context (hence calling
gdk_cairo_create()) unconditionally, even for surfaces only used for
measurements (like the one used in Editor::LocationFromPosition() --
method indirectly called on mouse movements).
So, what I suggest would be to delay the creation of the actual drawing
context (and the call to gdk_cairo_create()) until we actually want to
draw something on the surface.
Attached is a (somewhat ugly) patch doing this, which seems to get rid
of all these new warnings we had (or at least, that I could trigger).
It should be completely safe in any situations anyway, as it only delays
the creation of this internal context, it doesn't remove it.
If the concept is acceptable but patch is too ugly, I'm willing to
improve the actual implementation if you want, just tell me.
Regards,
Colomban
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.