diff options
author | Yongsu Park <pcpenpal@gmail.com> | 2020-05-19 09:35:43 +0000 |
---|---|---|
committer | Chun-wei Fan <fanc999@yahoo.com.tw> | 2020-05-19 09:35:43 +0000 |
commit | f59acff3b08d60f1d3d3469efd6d603f707bc07f (patch) | |
tree | 9e2e6f2b7af5536c63e4af0d119a8f262f6aeb53 /pango/pangocairo-win32fontmap.c | |
parent | 2a773323f1f7b5510ee0de7a1ea0ac8bec0e05d4 (diff) | |
download | pango-f59acff3b08d60f1d3d3469efd6d603f707bc07f.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/pangocairo-win32fontmap.c')
-rw-r--r-- | pango/pangocairo-win32fontmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pangocairo-win32fontmap.c b/pango/pangocairo-win32fontmap.c index b58d16f6..94500fd6 100644 --- a/pango/pangocairo-win32fontmap.c +++ b/pango/pangocairo-win32fontmap.c @@ -121,5 +121,5 @@ static void pango_cairo_win32_font_map_init (PangoCairoWin32FontMap *cwfontmap) { cwfontmap->serial = 1; - cwfontmap->dpi = GetDeviceCaps (pango_win32_get_dc (), LOGPIXELSY); + cwfontmap->dpi = GetDeviceCaps (_pango_win32_get_display_dc (), LOGPIXELSY); } |