emacs-devel
[Top][All Lists]
Advanced

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

Re: x-display-pixel-width/height inconsistency


From: YAMAMOTO Mitsuharu
Subject: Re: x-display-pixel-width/height inconsistency
Date: Wed, 20 Mar 2013 08:52:49 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Wed, 20 Mar 2013 03:15:06 +0400, Dmitry Gutov <address@hidden> said:

>>> But the actual return value is different among the platforms:
>> 
>>> * W32 port: Dimension of the primary monitor. (Not actually
>>> tested, but guessed from the code and API documentations.)
>> 
>> Could someone using multi-monitor setups on W32 check if this guess
>> is correct?  I'm confused because an API reference in English (*1)
>> says

> It is correct.

Thanks for checking.  Does the following patch give dimensions of all
physical monitors as in X11?  Do display-mm-height/width return
meaningful values?

                                     YAMAMOTO Mitsuharu
                                address@hidden

=== modified file 'src/w32fns.c'
*** src/w32fns.c        2013-03-10 22:55:25 +0000
--- src/w32fns.c        2013-03-19 23:47:14 +0000
***************
*** 4732,4746 ****
  If omitted or nil, that stands for the selected frame's display.  */)
    (Lisp_Object display)
  {
!   struct w32_display_info *dpyinfo = check_x_display_info (display);
!   HDC hdc;
!   int cap;
! 
!   hdc = GetDC (dpyinfo->root_window);
  
!   cap = GetDeviceCaps (hdc, VERTSIZE);
! 
!   ReleaseDC (dpyinfo->root_window, hdc);
  
    return make_number (cap);
  }
--- 4732,4741 ----
  If omitted or nil, that stands for the selected frame's display.  */)
    (Lisp_Object display)
  {
!   HDC hdc = CreateDC ("DISPLAY", NULL, NULL, NULL);
!   int cap = GetDeviceCaps (hdc, VERTSIZE);
  
!   DeleteDC (hdc);
  
    return make_number (cap);
  }
***************
*** 4752,4767 ****
  If omitted or nil, that stands for the selected frame's display.  */)
    (Lisp_Object display)
  {
!   struct w32_display_info *dpyinfo = check_x_display_info (display);
! 
!   HDC hdc;
!   int cap;
! 
!   hdc = GetDC (dpyinfo->root_window);
! 
!   cap = GetDeviceCaps (hdc, HORZSIZE);
  
!   ReleaseDC (dpyinfo->root_window, hdc);
  
    return make_number (cap);
  }
--- 4747,4756 ----
  If omitted or nil, that stands for the selected frame's display.  */)
    (Lisp_Object display)
  {
!   HDC hdc = CreateDC ("DISPLAY", NULL, NULL, NULL);
!   int cap = GetDeviceCaps (hdc, HORZSIZE);
  
!   DeleteDC (hdc);
  
    return make_number (cap);
  }

=== modified file 'src/w32term.c'
*** src/w32term.c       2013-03-15 10:07:29 +0000
--- src/w32term.c       2013-03-19 23:47:25 +0000
***************
*** 515,532 ****
  int
  x_display_pixel_height (struct w32_display_info *dpyinfo)
  {
!   HDC dc = GetDC (NULL);
    int pixels = GetDeviceCaps (dc, VERTRES);
!   ReleaseDC (NULL, dc);
    return pixels;
  }
  
  int
  x_display_pixel_width (struct w32_display_info *dpyinfo)
  {
!   HDC dc = GetDC (NULL);
    int pixels = GetDeviceCaps (dc, HORZRES);
!   ReleaseDC (NULL, dc);
    return pixels;
  }
  
--- 515,532 ----
  int
  x_display_pixel_height (struct w32_display_info *dpyinfo)
  {
!   HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL);
    int pixels = GetDeviceCaps (dc, VERTRES);
!   DeleteDC (dc);
    return pixels;
  }
  
  int
  x_display_pixel_width (struct w32_display_info *dpyinfo)
  {
!   HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL);
    int pixels = GetDeviceCaps (dc, HORZRES);
!   DeleteDC (dc);
    return pixels;
  }
  




reply via email to

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