emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src w32term.c


From: Jason Rumney
Subject: [Emacs-diffs] emacs/src w32term.c
Date: Thu, 12 Feb 2009 14:36:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jason Rumney <jasonr>   09/02/12 14:36:33

Modified files:
        src            : w32term.c 

Log message:
        (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)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/w32term.c?cvsroot=emacs&r1=1.320&r2=1.321

Patches:
Index: w32term.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32term.c,v
retrieving revision 1.320
retrieving revision 1.321
diff -u -b -r1.320 -r1.321
--- w32term.c   30 Jan 2009 18:01:42 -0000      1.320
+++ w32term.c   12 Feb 2009 14:36:33 -0000      1.321
@@ -464,14 +464,20 @@
 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 @@
   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 @@
   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 */
   {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]