changeset 98227:166909ca8be2

(x_display_pixel_height, x_display_pixel_width): New functions. (w32_read_socket, x_calc_absolute_position): Use them. (w32_initialize_display_info, w32_term_init): Omit removed members of w32_display_info.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 18 Sep 2008 18:18:12 +0000
parents 81594681a4bd
children 8adf9be2900c
files src/w32term.c
diffstat 1 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Thu Sep 18 18:16:04 2008 +0000
+++ b/src/w32term.c	Thu Sep 18 18:18:12 2008 +0000
@@ -459,6 +459,20 @@
     pfnSetLayeredWindowAttributes (window, 0, opac, LWA_ALPHA);
 }
 
+int
+x_display_pixel_height (dpyinfo)
+     struct w32_display_info *dpyinfo;
+{
+  return GetDeviceCaps (GetDC (GetDesktopWindow ()), VERTRES);
+}
+
+int
+x_display_pixel_width (dpyinfo)
+     struct w32_display_info *dpyinfo;
+{
+  return GetDeviceCaps (GetDC (GetDesktopWindow ()), HORZRES);
+}
+
 
 /***********************************************************************
 		    Starting and ending an update
@@ -4686,11 +4700,10 @@
 
 	  if (f)
 	    {
-	      dpyinfo->width = (short) LOWORD (msg.msg.lParam);
-	      dpyinfo->height = (short) HIWORD (msg.msg.lParam);
 	      dpyinfo->n_cbits = msg.msg.wParam;
-	      DebPrint (("display change: %d %d\n", dpyinfo->width,
-			 dpyinfo->height));
+	      DebPrint (("display change: %d %d\n",
+			 (short) LOWORD (msg.msg.lParam),
+			 (short) HIWORD (msg.msg.lParam)));
 	    }
 
 	  check_visibility = 1;
@@ -5313,13 +5326,13 @@
   /* Treat negative positions as relative to the rightmost bottommost
      position that fits on the screen.  */
   if (flags & XNegative)
-    f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
+    f->left_pos = (x_display_pixel_width (FRAME_W32_DISPLAY_INFO (f))
 		   - FRAME_PIXEL_WIDTH (f)
 		   + f->left_pos
 		   - (left_right_borders_width - 1));
 
   if (flags & YNegative)
-    f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
+    f->top_pos = (x_display_pixel_height (FRAME_W32_DISPLAY_INFO (f))
 		  - FRAME_PIXEL_HEIGHT (f)
 		  + f->top_pos
 		  - (top_bottom_borders_height - 1));
@@ -5952,8 +5965,6 @@
      with values obtained from system metrics.  */
   dpyinfo->resx = 1;
   dpyinfo->resy = 1;
-  dpyinfo->height_in = 1;
-  dpyinfo->width_in = 1;
   dpyinfo->n_planes = 1;
   dpyinfo->n_cbits = 4;
   dpyinfo->n_fonts = 0;
@@ -6180,8 +6191,6 @@
 
   hdc = GetDC (GetDesktopWindow ());
 
-  dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
-  dpyinfo->width = GetDeviceCaps (hdc, HORZRES);
   dpyinfo->root_window = GetDesktopWindow ();
   dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES);
   dpyinfo->n_cbits = GetDeviceCaps (hdc, BITSPIXEL);
@@ -6189,8 +6198,6 @@
   dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY);
   dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
   dpyinfo->terminal->image_cache = make_image_cache ();
-  dpyinfo->height_in = dpyinfo->height / dpyinfo->resx;
-  dpyinfo->width_in = dpyinfo->width / dpyinfo->resy;
   ReleaseDC (GetDesktopWindow (), hdc);
 
   /* initialise palette with white and black */