aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 3aec7a6ab..beef9749d 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -553,6 +553,8 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID wid) {
PLATFORM_ASSERT(wid);
context = cairo_reference(reinterpret_cast<cairo_t *>(sid));
pcontext = gtk_widget_create_pango_context(PWidget(wid));
+ // update the Pango context in case sid isn't the widget's surface
+ pango_cairo_update_context(context, pcontext);
layout = pango_layout_new(pcontext);
cairo_set_line_width(context, 1);
createdGC = true;
@@ -566,6 +568,8 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID
PLATFORM_ASSERT(wid);
context = cairo_reference(surfImpl->context);
pcontext = gtk_widget_create_pango_context(PWidget(wid));
+ // update the Pango context in case surface_ isn't the widget's surface
+ pango_cairo_update_context(context, pcontext);
PLATFORM_ASSERT(pcontext);
layout = pango_layout_new(pcontext);
PLATFORM_ASSERT(layout);