aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-09-19upas/nfs: fix null date when message is sent to plumber (#263)telephil1-1/+1
When fetching, messages are sent to plumber as soon as the ENVELOPE part is read. The date field of the message is sent when the INTERNALDATE part is read and there is no guarantee that this will be read before the ENVELOPE. This bug can be observed when using faces(1) which will retrieve messages with a null date and then always display a 'Jan 1' date instead of the correct one. The fix is to simply send the message to plumber after having read all parts, thus ensuring the message is complete.
2019-09-19plumber: fix EOF detection on writes to rules file (#257)Fazlul Shahriar1-3/+3
Instead of checking Fcall.data==nil, check Fcall.count==0. The former check always fails after `gcc -O2` optimizations (gcc version 8.3.0). Also fix an out-of-bound read detected by valgrind: ``` ==31162== Invalid read of size 1 ==31162== at 0x11005E: morerules (rules.c:739) ==31162== by 0x110254: writerules (rules.c:775) ==31162== by 0x10D2FE: fsyswrite (fsys.c:848) ==31162== by 0x10C304: fsysproc (fsys.c:248) ==31162== by 0x112E8C: threadstart (thread.c:96) ==31162== by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so) ==31162== Address 0x4ea984a is 0 bytes after a block of size 250 alloc'd ==31162== at 0x483AD7B: realloc (vg_replace_malloc.c:826) ==31162== by 0x1196F3: p9realloc (malloc.c:53) ==31162== by 0x10BDFD: erealloc (plumber.c:124) ==31162== by 0x10FCD9: concat (rules.c:642) ==31162== by 0x10FCD9: concat (rules.c:635) ==31162== by 0x110230: writerules (rules.c:773) ==31162== by 0x10D2FE: fsyswrite (fsys.c:848) ==31162== by 0x10C304: fsysproc (fsys.c:248) ==31162== by 0x112E8C: threadstart (thread.c:96) ==31162== by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so) ``` Fixes #256
2019-09-19auxstats: replace /proc ACPI calls with /sys ones (#245)Zach Scott1-22/+8
According to <https://askubuntu.com/a/309146>, use of `/proc/acpi` to get battery usage is deprecated. This commit replaces the two files from this API with the single file `/sys/class/power_supply/BAT0/capacity`, simultaneously removing the need to calculate battery percentage.
2019-06-19devdraw: cocoa metal screen adds a delayed update (#270)Xiao-Yong1-0/+7
The immediate display of the screen sometimes miss the update from the CPU side memory. No obvious synchronization mechanism is available. In order to make sure the screen updates properly, we set needsDisplay again after 16ms delay to ensure a second screen update.
2019-06-11devdraw: handle windowDidResize on macOS (#212)Pocket78781-1/+7
This supports non-live window resize.
2019-06-10acme: accept expanded URLs in lookRuss Cox1-9/+39
Just as look expands a click in /etc/passwd to the full name (provided that file exists), it now expands a click in https://9fans.net/ to the full URL (provided the prefix is http:// or https://). Probably more adjustment is needed.
2019-05-17acme: delete trailing spaces during Put in autoindent modeRuss Cox1-41/+64
Autoident mode is the leading cause of trailing spaces on lines. Remove them during Put to make various picky tools happier. The changes during Put are added as a separate entry to the file history, so that the first Undo after Put restores the spaces.
2019-05-17devdraw: cocoa metal screen updates (#215)Xiao-Yong2-63/+31
* devdraw: cocoa metal screen uses a dirty hack to make everything smooth * devdraw: cocoa metal screen uses a layer to make fullscreen applications behave * devdraw: macOS cocoa metal fix resizeimg without img * devdraw: macOS cocoa metal uses blit instead of render We directly use the blit command encoder to copy texture to the framebuffer. We no longer need to compile the metal shader every time the application starts just for rendering a flat 2D surface. * travis: add osx images covering 10.13 and 10.14
2019-04-19acme: do not trim spaces during PutRuss Cox1-4/+8
The commit that introduced this was pushed accidentally. It is not a good idea to do this. (It breaks programs that think that a clean window means the body matches the on-disk file.)
2019-04-05samterm: stop ignoring all keys >= KcmdPocket78781-2/+3
2019-04-05devdraw: stop redirecting ^H in cocoa-metal (#209)Xiao-Yong1-1/+0
2019-04-05man/memdraw.3: fix typoNoah Evans1-1/+1
2019-04-05libdraw,devdraw: fix compatibility with old 16x16 cursor protocol (#217)Fazlul Shahriar4-1/+33
Some libraries that depend on devdraw don't know about 32x32 cursor -- mainly 9fans.net/go/draw.
2019-04-05devdraw: prefer low-power GPU for macOS metal rendering (#231)Chris Schultz1-2/+13
2019-04-05devdraw: avoid deadlock on pre-Mojave macOSRuss Cox1-0/+6
2019-04-05fortunes: correct a mispelling (#234)Travis snɯǝᗡɔW1-1/+1
2019-04-05acme: Update tag after receiving menu/nomenu control event (#251)Martin Kühl1-0/+2
2019-04-05devdraw: fix cocoa metal _flushmemscreen for invalid rectangles (#240)Xiao-Yong1-0/+4
It is possible to receive multiple screen resize events, and resizeimg would be called for different sizes, before _flushmemscreen actually gets called with rectangle sizes different from the most recent resizeimg call. The size mismatch would trigger illegal memory access inside _flushmemscreen. This commit protects _flushmemscreen by returning early if the requested rectangle is outside of the current texture rectangle.
2019-04-05devdraw: respond to windowDidBecomeKey on darwin (#239)Jacob Vosmaer1-0/+5
Fixes bug where devdraw does not "notice" mouse position after task switch. Fixes https://github.com/9fans/plan9port/issues/232.
2019-02-25page: handle EPS without showpageRuss Cox2-1/+6
2019-02-01rio: delete ancient Imakefile (use mk instead)Russ Cox1-27/+0
Fixes #235.
2019-02-01acme: drop trailing spaces during Put of auto-indent windowRuss Cox1-3/+38
Auto-indent mode leaves trailing spaces on blank lines as you type past them, so silently elide them from the window content as it gets written back to disk. Another option would be to remove them from the window entirely during Put, but they're actually nice to have while editing, and to date Put has never modified the window content.
2018-11-16INSTALL: use cc to check for fontsrv on non-Darwin (#203)Xiao-Yong1-1/+1
FreeBSD 11.2 by default does not have gcc.
2018-11-16unix: fix for tar on FreeBSD (#202)Xiao-Yong1-4/+4
Use the widely accepted /dev/stdout.
2018-11-16INSTALL: set $NPROC on macOSRuss Cox2-1/+2
My MacBook Pro has hw.ncpu=12, so set NPROC=12. Speeds up INSTALL dramatically. Should probably add similar code to other OSes. Also silence rio warning from earlier commit.
2018-11-16libdraw: redo default font construction to be hidpi-safeRuss Cox20-587/+374
If $font is not set, the default font is constructed from font data linked into every libdraw binary. That process was different from the usual openfont code, and so it was not hidpi-aware, resulting in very tiny fonts out of the box on hidpi systems, until users set $font. Fix this by using openfont to construct the default font, by recognizing the name *default* when looking for font and subfont file contents. Then all the hidpi scaling applies automatically. As a side effect, the concept of a 'default subfont' is gone, as are display->defaultsubfont, getdefont, and memgetdefont.
2018-11-15file: recognize Mach-O binaries and Java class filesMartin Kühl1-0/+3
2018-11-15file: add missing newlines to file typesMartin Kühl1-3/+3
2018-11-15paint: add drawing program from 9front (#112)Tobias Heinicke4-0/+1213
Paint first appeared in 9front. The 9front license is reproduced in the related source files - the original repository is located at https://code.9front.org/hg/plan9front.
2018-11-15rio: make 'mk all' explain why it does nothing on non-x11 systemsRuss Cox1-2/+4
Fixes #98.
2018-11-15devdraw: remove os x 10.5 compatibility codeJacob Vosmaer4-1790/+2
2018-11-15unix: fix tar use in mkfile to allow Plan 9 tarMat Kovach1-4/+4
2018-11-15acme: add 32x32 boxcursorRuss Cox4-2/+71
The only difference from the upscaled 16x16 is a one-pixel adjustment in the offset position, but this at least exercises setcursor2.
2018-11-15INSTALL: set CC9 on macOS to use xcrun clangRuss Cox1-0/+1
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.
2018-11-15devdraw: add Cursor2 support on macOS 10.14 MojaveRuss Cox8-45/+113
This replaces the pixel-art scaling algorithm used for upscaling before. The results were not crisp enough to serve as everyday cursors.
2018-11-15tweak: add support for Cursor2Russ Cox1-30/+78
2018-11-15libdraw: add Cursor2, a 32x32 high-res cursorRuss Cox11-7/+86
Also add setcursor2, esetcursor2, and draw protocol encoding. Calls to the old setcursor, esetcursor create a 32x32 by pixel doubling when needed.
2018-11-15devdraw: rewrite the Cocoa screen using MetalXiao-Yong Jin8-21/+1307
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.
2018-11-14upas/smtp: fix TLS connections (#163)Zach Scott2-0/+49
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.
2018-11-14INSTALL: fix compiler detection on FreeBSD+clang (#177)Francis Conti1-17/+24
2018-11-14devdraw: set displaydpi on devdraw x11 attach (#178)Gabriel Díaz1-2/+7
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.
2018-11-14mac/9term.app: invoke 9term with -lRuss Cox1-1/+1
This seems to match Terminal. Fixes #145.
2018-11-149term: make 9term -l invoke $SHELL with -lRuss Cox1-1/+6
2018-11-14web: allow any $BROWSERRuss Cox1-1/+1
Fixes #118.
2018-11-14fontsrv: increase x11 font height scale (#111)iru-1-1/+1
2018-11-139term.app: add $PLAN9/bin to $PATH if not already in $PATH (#144)KADOTA, Kyohei1-0/+4
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"
2018-11-13plumb/basic: avoid wrap around in file:1:2 (#158)Martin Kühl1-2/+2
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.
2018-11-13devdraw: make ctrl generate 1-click while mouse down (#119)Xiao-Yong1-0/+2
This makes 2-1 chords possible with touchpad on a mac laptop.
2018-11-13keyboard: add compose sequences lc and rc for ceiling brackets (#126)thisrod1-0/+2
Change-Id: Ice1c8c9d15cc6febf32dc2b7c449d457acc319b6
2018-11-13keyboard: add tab/untab symbols (#160)Martin Kühl1-0/+2