Commits


INSTALL: set CC9 on macOS to use xcrun clang Using plain 'clang' does not work well for the new devdraw on macOS 10.14. But 'xcrun --sdk macosx clang' does work, for reasons no one understands. Hopefully this will be OK on all macOS systems.


devdraw: add Cursor2 support on macOS 10.14 Mojave This replaces the pixel-art scaling algorithm used for upscaling before. The results were not crisp enough to serve as everyday cursors.


tweak: add support for Cursor2


libdraw: add Cursor2, a 32x32 high-res cursor Also add setcursor2, esetcursor2, and draw protocol encoding. Calls to the old setcursor, esetcursor create a 32x32 by pixel doubling when needed.


devdraw: rewrite the Cocoa screen using Metal Add a new macOS cocoa screen, cocoa-screen-metal.m. Rewrite the macOS cocoa drawing code to use the builtin runloop, and use Metal to push pixels with CAMetalLayer. Remove all of the deprecated code, and simplify some of the logic. Modify mkwsysrules.sh such that the new code is used only when the system version is equal or higher than 10.14. Allow touch events to simulate mouse clicks: three finger tap for the middle mouse button; four finger tap for the 2-1 chord. Support Tresize. Scale 16x16 Cursor up to 32x32 with an EPX algorithm. Support macOS input sources including the basic dead keys and the advanced CJK input methods. Increase the communication buffers in cocoa-srv.c to allow more input, especially for long sentences prepared by the macOS input souces.


upas/smtp: fix TLS connections (#163) Both `upas/nfs` and `upas/smtp` call the currently broken `tlsClient()` from libsec. This commit copies a fix from upas/nfs into upas/smtp. In `imapdial()`, upas/nfs replaces a process call for tlsClient with `stunnel3` when not on Plan 9. upas/smtp calls tlsClient directly as a function, so imapdial was copied into mxdial.c as `smtpdial()`, and tlsClient+dial replaced with a call to smtpdial.


INSTALL: fix compiler detection on FreeBSD+clang (#177)


devdraw: set displaydpi on devdraw x11 attach (#178) See https://plan9port-review.googlesource.com/c/plan9/+/1470 for discussion of the approach, especially Michael Stapleberg's comment: Note that chromium, firefox and others have tried this and then switched to using the Xft.dpi X resource, see e.g. https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/libgtk2ui/gtk2_ui.cc and especially http://sources.debian.net/src/gnome-settings-daemon/3.18.2-1/plugins/xsettings/gsd-xsettings-manager.c/?hl=824#L80 for some anecdata about why this approach doesn’t work out. The Xft.dpi resource is being set accurately by desktop environments (GNOME, KDE, …) and can easily be changed by users of niche window managers by editing ~/.Xresources. I suggest we check only Xft.dpi, without considering the DPI environment variable or the monitor width/height.


mac/9term.app: invoke 9term with -l This seems to match Terminal. Fixes #145.


9term: make 9term -l invoke $SHELL with -l


web: allow any $BROWSER Fixes #118.


fontsrv: increase x11 font height scale (#111)


9term.app: add $PLAN9/bin to $PATH if not already in $PATH (#144) 9term set $PLAN9 if PLAN9 is not set. But $PATH is not set. As a result, 9term exits with "exec devdraw: No such file or directory"


plumb/basic: avoid wrap around in file:1:2 (#158) Fixes #122, #140. As reported in #122, `file:1:1` moves to the end of the file, and `file:1:2` fails with “address out of range”. I’ll use file:2:3 as an example so we can tell the line and column number apart. What’s happening is this: plumb/basic matches `2:3` using twocolonaddr (from plumb/fileaddr), then sets addr to `2-#1+#3` (the 1 is constant and was introduced because column numbers are 1-based). Acme interprets this in three steps: 1. find the range (q0, q1) that contains line 2 2. create the range (q2, q2) where q2 = q0 - 1 3. create the range (q3, q3) where q3 = q2 + 3 The second step has a branch where if q0 == 0 and 1 > 0 (remember that 1 is constant and comes form plumb/basic), q0 is set to the end of the file. This makes addressing things at the end of the file easier. The problem then is that if we select line 1, which starts at the beginning of the file, q0 is always 0 and the branch in step 2) will always be used. `1:1` is interpreted as `1-#1+#1` which starts at 0, wraps around to the end of the file, then moves 1 character backwards and then forwards again, ending at the end of the file. `1:2` is interpretes as `1-#1+#2` which starts at 0, wraps around to the end od the file, then moves 1 character backwards and tries moving 2 characters forwards beyond the end of the file, resulting in the out of range error. In #140 @rsc proposed transforming `:X:Y` into `:X-#0+#Y-#1` instead since that avoids wrapping around by not moving backwards at first. This change modifies `plumb/basic` to do that.


devdraw: make ctrl generate 1-click while mouse down (#119) This makes 2-1 chords possible with touchpad on a mac laptop.