mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
don't leak as many GCs
This commit is contained in:
parent
316109ea09
commit
84841faf7f
@ -1,3 +1,7 @@
|
||||
2003-10-02 Dom Lachowicz <cinamod@hotmail.com>
|
||||
|
||||
* src/wimp_style.c: Deallocate used HDCs
|
||||
|
||||
2003-10-01 Dom Lachowicz <cinamod@hotmail.com>
|
||||
|
||||
* src/wimp_style.c: Only set the delays if the param is installed. Silly gtk -
|
||||
|
@ -151,6 +151,8 @@ get_system_font(SystemFontType type, LOGFONT *out_lf)
|
||||
static char *
|
||||
sys_font_to_pango_font (SystemFontType type, char * buf)
|
||||
{
|
||||
HDC hDC;
|
||||
HWND hwnd;
|
||||
LOGFONT lf;
|
||||
int pt_size;
|
||||
const char * weight;
|
||||
@ -194,13 +196,19 @@ sys_font_to_pango_font (SystemFontType type, char * buf)
|
||||
else
|
||||
style="";
|
||||
|
||||
pt_size = -MulDiv(lf.lfHeight, 72,
|
||||
GetDeviceCaps(GetDC(GetDesktopWindow()),
|
||||
LOGPIXELSY));
|
||||
sprintf(buf, "%s %s %s %d", lf.lfFaceName, style, weight, pt_size);
|
||||
hwnd = GetDesktopWindow();
|
||||
hDC = GetDC(hwnd);
|
||||
if (hDC) {
|
||||
pt_size = -MulDiv(lf.lfHeight, 72,
|
||||
GetDeviceCaps(hDC,LOGPIXELSY));
|
||||
ReleaseDC(hwnd, hDC);
|
||||
} else
|
||||
pt_size = 10;
|
||||
|
||||
return buf;
|
||||
}
|
||||
sprintf(buf, "%s %s %s %d", lf.lfFaceName, style, weight, pt_size);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user