Tk Source Code

View Ticket
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA
Ticket UUID: a01b6f7227ee2ebf108145c82eecbb6ee799c90a
Title: WidthMMOfScreen returns 0 in VirtualBox VM using XWayland
Type: Bug Version: 8.6.9 8.5.19
Submitter: ralfixx Created on: 2019-09-25 14:29:48
Subsystem: 67. Unix Window Operations Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2019-10-09 13:03:12
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2019-10-09 13:03:12
Description:

In a VirtualBox VM running Debian-10/Buster and the XWayland window server, WidthMMOfScreen and HeightMMOfScreen both return 0, which leads to multiple errors, including:

  $ wish8.6
  % pack [label .foo] -padx 1m
  bad pad value "1m": must be positive screen distance
This is also mentioned in https://www.androwish.org/home/artifact?udc=1&ln=191-207&name=43037cd1b459ee3b and if I apply this patch, the problem is worked-around.

I expect this to still suffer from the resize-problem mentioned in [3141377] and [2524085333f44fbc19d244a2a96d2eeb04cc7e17]

User Comments: jan.nijtmans added on 2019-10-09 13:03:12:
Fixed now in core-8-6-branch and trunk.

Yes, it's a bug in XWayland, but that doesn't mean we cannot work around it ...

Thanks to Christian Werner for providing the patch!

fvogel added on 2019-10-08 06:10:19:

Note: the complete workaround commit in Androwish is https://www.androwish.org/index.html/info/e54a8ad2b7fa9da16a8a38e94c839d93770223a5


fvogel added on 2019-10-07 20:03:09:

The mentioned patch, i.e. https://www.androwish.org/home/artifact?udc=1&ln=191-207&name=43037cd1b459ee3b really is a hack in Tk that works around WidthMMOfScreen() returning zero in some not so well characterized situations, when XWayland is involved. In such cases the patch resorts to a fallback of 75 dpi to compute the requested mm screen size.

While the suggested patch could obviously be implemented in Tk, isn't this an XWayland bug? I man, WidthMMOfScreen() is an X11 macro, shouldn't this just still work with Xwayland?

I'm surprised I couldn't find references to this issue other than tickets that finally point the finger to Tk and the present ticket. Is Tk the only application experiencing this issue? How did other software handle this?


ralfixx added on 2019-09-26 10:16:02:

Work-Around: on the login screen, select the user, then change the session type via the settings-gear-icon to "Gnome und Xorg", then login.

With Xorg instead of XWayland, the screen dimensions are reported properly:

    $ xdpyinfo 
    name of display:    :0
    version number:    11.0
    vendor string:    The X.Org Foundation
    vendor release number:    12004000
    X.Org version: 1.20.4
    --<snip-snip>--
    screen #0:
      dimensions:    1280x800 pixels (339x212 millimeters)
      resolution:    96x96 dots per inch

$ ps -ef | grep X sipp 972 970 0 12:06 tty2 00:00:01 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3 (no XWayland)
Still I think the issue of screen dimensions reported as 0 should be addressed in Tk.


bll added on 2019-09-25 17:10:32:
See also: https://core.tcl-lang.org/tk/tktview/2524085333f44fbc19d2