diff options
author | dgp <dgp@users.sourceforge.net> | 2019-10-21 13:03:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-10-21 13:03:42 (GMT) |
commit | ef56eb393679cb51381bdd31558dabc011328e76 (patch) | |
tree | 6a11e245995e4c7e30a418e369108f841e394aac /unix | |
parent | 4b84553a843a8019f456d5d8e7f5e1130576df68 (diff) | |
parent | e5ec9901434a09547d80a2fa1f351dedcf9e7f1b (diff) | |
download | tk-ef56eb393679cb51381bdd31558dabc011328e76.zip tk-ef56eb393679cb51381bdd31558dabc011328e76.tar.gz tk-ef56eb393679cb51381bdd31558dabc011328e76.tar.bz2 |
merge 8.6
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixEvent.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index a92b868..43f695c 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -166,7 +166,7 @@ TkpOpenDisplay( if (display == NULL) { /*fprintf(stderr,"event=%d error=%d major=%d minor=%d reason=%d\nDisabling xkb\n", event, error, major, minor, reason);*/ - display = XOpenDisplay(displayNameStr); + display = XOpenDisplay(displayNameStr); } else { use_xkb = TK_DISPLAY_USE_XKB; /*fprintf(stderr, "Using xkb %d.%d\n", major, minor);*/ @@ -188,6 +188,25 @@ TkpOpenDisplay( DisplayFileProc, dispPtr); /* + * Observed weird WidthMMOfScreen() in X on Wayland on a + * Fedora 30/i386 running in a VM. Fallback to 75 dpi, + * otherwise many other strange things may happen later. + * See: [https://core.tcl-lang.org/tk/tktview?name=a01b6f7227] + */ + if (WidthMMOfScreen(DefaultScreenOfDisplay(display)) <= 0) { + int mm; + + mm = WidthOfScreen(DefaultScreenOfDisplay(display)) * (25.4 / 75.0); + WidthMMOfScreen(DefaultScreenOfDisplay(display)) = mm; + } + if (HeightMMOfScreen(DefaultScreenOfDisplay(display)) <= 0) { + int mm; + + mm = HeightOfScreen(DefaultScreenOfDisplay(display)) * (25.4 / 75.0); + HeightMMOfScreen(DefaultScreenOfDisplay(display)) = mm; + } + + /* * Key map info must be available immediately, because of "send event". */ TkpInitKeymapInfo(dispPtr); |