Tk Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
2016-08-22
08:36 Ticket [985607f2] Tk reports wrong physical screen size status still Open with 3 other changes artifact: 507f8c70 user: dkf
2016-01-17
10:14 Ticket [985607f2]: 3 changes artifact: 9b88a6d0 user: anonymous
2016-01-16
13:41 New ticket [985607f2]. artifact: cbc5e5a5 user: anonymous

Ticket UUID: 985607f2406d737a124f6a5b68a8139262c17003
Title: Tk reports wrong physical screen size
Type: Bug Version: 8.6
Submitter: anonymous Created on: 2016-01-16 13:41:53
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-08-22 08:36:54
Resolution: None Closed By: nobody
    Closed on:
Description:

Test code:

% winfo screenwidth .
3840
% winfo screenheight .
1080
% winfo screenmmwidth .
1013
# ^ reports total dual monitor width. Monitors are identical, so for each, screenmmwidth = 506.5mm 
% winfo screenmmheight .
284
However, xrandr gives different values which, after measuring the actual screens, prove to be the correct ones:
$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
VGA-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+
   1680x1050      60.0  
   1400x1050      60.0  
   1600x900       60.0  
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x800       59.8  
   1152x864       75.0  
   1280x720       60.0  
   1024x768       75.1     60.0  
   832x624        74.6  
   800x600        75.0     60.3     56.2  
   640x480        75.0     60.0  
   720x400        70.1  
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+
   1680x1050      59.9  
   1280x1024      75.0     60.0  
   1152x864       75.0  
   1024x768       75.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0  
   720x400        70.1  
Screen geometry reported by xrandr: 3840 x 1080 px (correct).
Physical size reported by xrandr: 477mm x 268mm (per screen, correct)

Horizontal and vertical screen sizes reported by Tk are wrong. Tests have been done with 2x LG FLATRON E2251 and verified on a single LG-22EA53.

The problem is amplified when simulating AndroWish apps on desktop PCs, because it becomes difficult to match font sizes due to the wrong resulting dpi.

dzach

User Comments: anonymous added on 2016-01-17 10:14:49:

Missing OS info:

Kubuntu 14.04, Linux 3.13.0-39-generic #66-Ubuntu SMP i686 GNU/Linux
dzach