Commit graph

1874 commits

Author SHA1 Message Date
Russ Cox
4650064aa7 acme: scale window bodies on resize, not including tag space
This avoids reopening collapsed windows after a large vertical resize.
2020-03-30 09:56:50 -04:00
Martin Palma
f66f0a587b
devdraw: fix cmd-r to toggle retina vs. non-retina mode on macOS (#361)
and not unexpectedly quitting an application.

Fixes #360
2020-02-03 14:59:58 -05:00
Russ Cox
93e2e820a5 acme: report close failure in Put, this time for sure
Missed in 0b349f6f that Bterm is not closing fd.
2020-01-24 13:09:11 -05:00
Russ Cox
1d0d432ccb devdraw: abort alt sequence on window change on macOS
Fixes #3.
2020-01-16 12:07:47 -05:00
Dan Cross
7bf2db4c2a malloc: remove locking
The issue manifests in fork: POSIX fork mandates that a
fork'd process is created with a single thread.  If a
multithreaded program forks, and some thread was in
malloc() when the fork() happened, then in the child
the lock will be held but there will be no thread to
release it.

We assume the system malloc() must already know how to
deal with this and is thread-safe, but it won't know about
our custom spinlock.  Judging that this is no longer
necessary (the lock code was added 15 years ago) we remove
it.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-16 16:54:19 +00:00
Russ Cox
0be57355f9 devdraw: avoid deadlock in x11 resize
Fixes #347.
2020-01-15 12:01:12 -05:00
Nicola Girardi
4241cae2a1 cmd/rio: xshove: set geometry by window id 2020-01-15 11:55:37 -05:00
Russ Cox
fe2b2de984 devdraw: set windowrect correctly on x11 if window gets unexpected size
Fixes #54.
2020-01-15 11:26:01 -05:00
Russ Cox
ba60bab3cd devdraw: actually send resize event on resize
Fixes #340.
Fixes #343.
2020-01-15 11:09:16 -05:00
Russ Cox
e75dbb6af8 factotum: update for new nbrecvul return value
Unclear whether the old semantics were the right ones,
but at least this preserves what they've been for the past
however many years.
2020-01-15 10:49:28 -05:00
sean
cb58f3291c compress: import Plan9 compress
Add #define USED(x)... boilerplate

compress: import Plan9 manpage.
2020-01-15 10:00:14 -05:00
Dan Cross
6510a2d353 winwatch: Plan 9-ify.
This is new code, and custom to plan9port.  Make it
conform more closely to plan9 style.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-15 09:58:24 -05:00
Dan Cross
0ac4bfee32 clock: Remove unused static variable in clock.c
`struct Tm tms` was set but never referenced; noticed
in a compiler warning.  Remove it.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-15 09:20:41 -05:00
markvanatten
a9b462061c winwatch: port based Plan 9 winwatch
Port of Plan 9's winwatch(1).
2020-01-15 08:43:01 -05:00
Oleg Nemanov
dc24d309d5 9pfuse: update errortab 2020-01-15 08:32:00 -05:00
Russ Cox
5c06214952 venti/buildindex: fix hang on large indexes
Fixes #93.
2020-01-14 19:46:47 -05:00
Russ Cox
1f799495e4 devdraw: notify window resize promptly on x11
Fixes #339.
2020-01-14 19:43:32 -05:00
Russ Cox
d28913a9e6 acme: save/restore multiline tags in Dump/Load
The dump substitutes each \n in a multiline tag with a 0xff byte.
Since it is not valid UTF it cannot occur in an ordinary dump file.
Old acmes will just read it in as an error rune.

Fixes #135.
Fixes #153.
2020-01-14 16:49:43 -05:00
phonologus
a0691bc460 tar: remove /bin/ when invoking compressors 2020-01-14 14:52:18 -05:00
Russ Cox
4c54893156 devdraw: do not force-hide menu and dock during full screen on mac
This hides the menu on dock on all screens which is more than we want.
The code was added to fix a problem with Catalina that I can no longer
reproduce, so I guess it works now.

Fixes #336.
2020-01-14 12:06:34 -05:00
Russ Cox
3d1382b98a devdraw: hide dock in full screen mode
Unfortunately this hides the dock even if it is on a
different screen. We need to figure out how to tell.
But this is more usable than not.
Probably.
2020-01-13 23:56:29 -05:00
Xiao-Yong
b741db607a devdraw: correctly hide Mac menu bar (#335)
`window:willUseFullScreenPresentationOptions:` is an instance method
of the protocol `NSWindowDelegate`.
2020-01-13 23:33:59 -05:00
Russ Cox
573169dd88 acme: fix buffer overflow introduced in parsetag refactor 2020-01-13 23:17:39 -05:00
Russ Cox
86bfd6075d acme: fix movetodel for spaces in file names 2020-01-13 23:17:39 -05:00
Russ Cox
7b1c85f6e8 acme: allow spaces in window names
There are many things we could do to make this work.
an environment variable to control the character.
Another option would be to use U+00A0 (non-breaking space),
which renders the same as space.

This change avoids changing the separator character and instead
assumes that if the left side of the tag already ends in " Del Snarf |"
then what comes before that is the file name.
Acme already aggressively preserves the "Del Snarf |",
so this should work decently well as a stop-gap.
We can always try something else later.

Fixes #26.
Fixes #104.
Fixes #329.
2020-01-13 23:17:39 -05:00
Neven Sajko
26cae02da7 mk: fix hash function (#315)
Avoid signed integer overflow using ulong instead of long h.
2020-01-13 22:05:03 -05:00
Russ Cox
6bddb06b71 acme: one more place to use parsetag 2020-01-13 21:58:40 -05:00
Russ Cox
81d992e35f acme: factor out tag parsing code 2020-01-13 21:43:54 -05:00
Russ Cox
6c17f63090 mk: treat X= as empty list in rc shell
This brings mk's behavior when using rc in line with Plan 9's.
The existing code is for Unix environment data structures but
also was assuming Unix shell semantics where empty and missing
variables are mostly equivalent.

The Plan 9 code (/sys/src/cmd/mk/plan9.c in the distribution)
explicitly removes /env/name (creating an empty list) when the
value is missing or an empty string.

Fixes #255.
2020-01-13 19:20:34 -05:00
Russ Cox
d2df5d6cbd acme: fix crash in X |cat with multiple windows
Fixes #9.
Fixes #219.
Fixes #222.
Fixes #330.
2020-01-13 18:15:57 -05:00
Russ Cox
59b460f845 vac, unvac: allow 128MB cache size, up from 4MB
When a directory has lots of children, vac crashes because it runs out of cache.

Fixes #266.
2020-01-13 17:09:39 -05:00
Russ Cox
fa588406f0 9pfuse: do not fswalk("..")
f is open, so walk will fail.
The comments say we only need one directory anyway.

Fixes #277.
2020-01-13 17:07:44 -05:00
Nicola Girardi
93f9789c04 cmd/9pfuse: ignore FMODE_EXEC open flag
Improved error message in case of unexpected open flags. The message

    unexpected open flags requested=0100040 unhandled=040

prompted me to clear the FMODE_EXEC flag, although I wonder if I
shouldn't have set OEXEC (0x3) instead.
2020-01-13 16:56:57 -05:00
Russ Cox
ac6456a0cc clock: import from plan 9
Fixes #250.
2020-01-13 16:53:30 -05:00
Russ Cox
04da015976 devdraw: AUTOFRAMEWORK CoreFoundation on macOS
Fixes #273.
2020-01-13 16:47:16 -05:00
Russ Cox
50923426bf devdraw: x11 working again
Need to think a bit more about locking,
but overall it's a working devdraw.

Multiclient mode may not be working
but nothing is using it yet.
2020-01-13 16:46:14 -05:00
Russ Cox
892b3c4687 devdraw: multiclient mode 2020-01-13 16:46:14 -05:00
Russ Cox
2cb85891ba cmapcube: don't crash on initdraw failure 2020-01-13 16:46:14 -05:00
Russ Cox
41547af3f6 devdraw: more cleanup, clearer locking 2020-01-13 16:46:14 -05:00
Russ Cox
b1a086dee9 devdraw: refactor, clean up mac screen
Also turn mac-srv.c into a generic srv.c,
so we can remove the duplication with x11-srv.c.
2020-01-13 16:46:14 -05:00
Russ Cox
843e5af198 devdraw: move per-window globals in mac-screen.m into Client 2020-01-13 16:46:14 -05:00
Russ Cox
88ed92aa40 devdraw: move Client into devdraw.h and move global state in 2020-01-13 16:46:14 -05:00
Russ Cox
933b98054f devdraw: use consistent mac-* prefix on macOS files
We were using osx- and cocoa- but it's not even OS X anymore.
2020-01-13 16:46:14 -05:00
Russ Cox
ce27d7babd devdraw: can use libthread directly now on macOS 2020-01-13 16:46:14 -05:00
Russ Cox
db20f89c32 devdraw: simplify mac file names
Now that we only have Metal, we can drop the -metal.
Also now that Carbon is gone we can drop the macargv.c,
and then the -objc from object file names.
2020-01-13 16:46:14 -05:00
Russ Cox
f177c0ba18 devdraw: drop pre-metal macOS support
We didn't start using Metal until macOS 10.14,
but it was available on 10.13, which is currently
the oldest Apple-supported version of macOS.
Simplify by deleting the old code.
2020-01-13 16:46:14 -05:00
Russ Cox
cc3d97d52a devdraw: update drawclient test program to run again 2020-01-13 16:46:14 -05:00
Neven Sajko
bf59f0ed28 cmd/yacc: correctly detect end of file in gettok
This prevents an infinite loop.

Change-Id: I7eda6b9d032ca0daeb24b555954330d07f35c78b
2020-01-13 14:41:28 -05:00
Neven Sajko
eb4aea5072 cmd/yacc: check that arg is safe to pass to <ctype.h> isX functions
The functions from <ctype.h> require that their argument be
representable as an unsigned char, anything else is an error.

Change-Id: I9dafc49c431b7a2550b041603f27bac3c0010eea
2020-01-13 14:41:28 -05:00
Neven Sajko
d2fae53d17 cmd/yacc: check for EOF in string constant in cpyact
Change-Id: I3b41ab3f181080bcff89201d30f0bdf8aa20d55c
2020-01-13 14:41:28 -05:00