summaryrefslogtreecommitdiff
path: root/pango/pangowin32-private.h
diff options
context:
space:
mode:
authorYongsu Park <pcpenpal@gmail.com>2020-05-19 09:35:43 +0000
committerAaron Boxer <boxerab@gmail.com>2020-06-08 08:31:54 -0400
commita47f958ce1b7e1fedb58ae270ad8244a6623ece1 (patch)
tree6ac40972fe7f33172da45f52d6229bffdf62722c /pango/pangowin32-private.h
parentbe05ecd2360a7dc75dde2a0a153466141cea0935 (diff)
downloadpango-a47f958ce1b7e1fedb58ae270ad8244a6623ece1.tar.gz
win32: Use GPrivate-managed display device context
The document of [CreateDCA][1] says: > If lpszDriver or lpszDevice is DISPLAY, the thread that calls > CreateDC owns the HDC that is created. When this thread is > destroyed, the HDC is no longer valid. Thus, if you create the HDC > and pass it to another thread, then exit the first thread, > the second thread will not be able to use the HDC. So this change introduces GPrivate to fix potential problem. This also fixes the problem caused by accessing the global variable DC directly, which makes some early call to Pango functions fail. (e.g., failure of calling pango_win32_font_description_from_logfontw from _get_system_font_name in GTK.) [1]: https://docs.microsoft.com/windows/win32/api/wingdi/nf-wingdi-createdca
Diffstat (limited to 'pango/pangowin32-private.h')
-rw-r--r--pango/pangowin32-private.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h
index 082470e7..f5620b87 100644
--- a/pango/pangowin32-private.h
+++ b/pango/pangowin32-private.h
@@ -272,7 +272,9 @@ void _pango_win32_fontmap_cache_remove (PangoFontMap *fontmap,
_PANGO_EXTERN
HFONT _pango_win32_font_get_hfont (PangoFont *font);
-extern HDC _pango_win32_hdc;
+_PANGO_EXTERN
+HDC _pango_win32_get_display_dc (void);
+
extern gboolean _pango_win32_debug;
#endif /* __PANGOWIN32_PRIVATE_H__ */