diff options
author | Jason Rumney <jasonr@gnu.org> | 2009-02-12 14:39:17 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2009-02-12 14:39:17 +0000 |
commit | cb4a3e4288f6f1e606fead5542f8be3973d5f0f9 (patch) | |
tree | e2e19c1dedc5d54b1f8970db74dccd4c750cf2ae /src/w32term.c | |
parent | 7fed8996b49693ff7c4cbc62f554d52d57e8909e (diff) | |
download | emacs-cb4a3e4288f6f1e606fead5542f8be3973d5f0f9.tar.gz |
(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/w32term.c')
-rw-r--r-- | src/w32term.c | 14 |
1 files changed, 10 insertions, 4 deletions
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 x_display_pixel_height (dpyinfo) struct w32_display_info *dpyinfo; { - return GetDeviceCaps (GetDC (GetDesktopWindow ()), VERTRES); + HDC dc = GetDC (NULL); + int pixels = GetDeviceCaps (dc, VERTRES); + ReleaseDC (NULL, dc); + return pixels; } int x_display_pixel_width (dpyinfo) struct w32_display_info *dpyinfo; { - return GetDeviceCaps (GetDC (GetDesktopWindow ()), HORZRES); + HDC dc = GetDC (NULL); + int pixels = GetDeviceCaps (dc, HORZRES); + ReleaseDC (NULL, dc); + return pixels; } @@ -6216,7 +6222,7 @@ w32_term_init (display_name, xrm_option, resource_name) dpyinfo->next = x_display_list; x_display_list = dpyinfo; - hdc = GetDC (GetDesktopWindow ()); + hdc = GetDC (NULL); dpyinfo->root_window = GetDesktopWindow (); dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES); @@ -6224,7 +6230,7 @@ w32_term_init (display_name, xrm_option, resource_name) dpyinfo->resx = GetDeviceCaps (hdc, LOGPIXELSX); dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY); dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE; - ReleaseDC (GetDesktopWindow (), hdc); + ReleaseDC (NULL, hdc); /* initialise palette with white and black */ { |