aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2009-02-12 14:39:17 +0000
committerJason Rumney2009-02-12 14:39:17 +0000
commitcb4a3e4288f6f1e606fead5542f8be3973d5f0f9 (patch)
treee2e19c1dedc5d54b1f8970db74dccd4c750cf2ae /src
parent7fed8996b49693ff7c4cbc62f554d52d57e8909e (diff)
downloademacs-cb4a3e4288f6f1e606fead5542f8be3973d5f0f9.tar.gz
emacs-cb4a3e4288f6f1e606fead5542f8be3973d5f0f9.zip
(x_display_pixel_height, x_display_pixel_width):
Release DC when finished. Use NULL window to refer to desktop. (w32_term_init): Use NULL window to refer to desktop. (Bug#460)
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/w32term.c14
2 files changed, 14 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bcbf87f1683..5b6f0a6016a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12009-02-12 Jason Rumney <jasonr@gnu.org> 12009-02-12 Jason Rumney <jasonr@gnu.org>
2 2
3 * w32term.c (x_display_pixel_height, x_display_pixel_width):
4 Release DC when finished. Use NULL window to refer to desktop.
5 (w32_term_init): Use NULL window to refer to desktop. (Bug#460)
6
3 * w32font.c (add_font_entity_to_list): Fix check for substituted 7 * w32font.c (add_font_entity_to_list): Fix check for substituted
4 raster fonts. (Bug#2219) 8 raster fonts. (Bug#2219)
5 9
diff --git a/src/w32term.c b/src/w32term.c
index 7ad7778feaa..34fc450217f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -464,14 +464,20 @@ int
464x_display_pixel_height (dpyinfo) 464x_display_pixel_height (dpyinfo)
465 struct w32_display_info *dpyinfo; 465 struct w32_display_info *dpyinfo;
466{ 466{
467 return GetDeviceCaps (GetDC (GetDesktopWindow ()), VERTRES); 467 HDC dc = GetDC (NULL);
468 int pixels = GetDeviceCaps (dc, VERTRES);
469 ReleaseDC (NULL, dc);
470 return pixels;
468} 471}
469 472
470int 473int
471x_display_pixel_width (dpyinfo) 474x_display_pixel_width (dpyinfo)
472 struct w32_display_info *dpyinfo; 475 struct w32_display_info *dpyinfo;
473{ 476{
474 return GetDeviceCaps (GetDC (GetDesktopWindow ()), HORZRES); 477 HDC dc = GetDC (NULL);
478 int pixels = GetDeviceCaps (dc, HORZRES);
479 ReleaseDC (NULL, dc);
480 return pixels;
475} 481}
476 482
477 483
@@ -6216,7 +6222,7 @@ w32_term_init (display_name, xrm_option, resource_name)
6216 dpyinfo->next = x_display_list; 6222 dpyinfo->next = x_display_list;
6217 x_display_list = dpyinfo; 6223 x_display_list = dpyinfo;
6218 6224
6219 hdc = GetDC (GetDesktopWindow ()); 6225 hdc = GetDC (NULL);
6220 6226
6221 dpyinfo->root_window = GetDesktopWindow (); 6227 dpyinfo->root_window = GetDesktopWindow ();
6222 dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES); 6228 dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES);
@@ -6224,7 +6230,7 @@ w32_term_init (display_name, xrm_option, resource_name)
6224 dpyinfo->resx = GetDeviceCaps (hdc, LOGPIXELSX); 6230 dpyinfo->resx = GetDeviceCaps (hdc, LOGPIXELSX);
6225 dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY); 6231 dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY);
6226 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE; 6232 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
6227 ReleaseDC (GetDesktopWindow (), hdc); 6233 ReleaseDC (NULL, hdc);
6228 6234
6229 /* initialise palette with white and black */ 6235 /* initialise palette with white and black */
6230 { 6236 {