Commit graph

129 commits

Author SHA1 Message Date
xfnw 5e89dcb387 Merge branch 'newpatch' into front 2022-04-16 21:50:35 -04:00
xfnw be4132b248 add patches to git 2022-04-16 21:49:41 -04:00
Igor Böhm 876907a530 rio: fix parsing of directory path (-cd) when creating a new window via wctl
Before applying this patch the following will fail to open ed
in the '/tmp/s p a c e' folder:

<snip>
% mkdir '/tmp/s p a c e'
% window -cd '/tmp/s p a c e' ed
!pwd
/tmp/s p a c e
!
q
<snap>

After applying the patch the above sequence works as expected,
opening ed in the '/tmp/s p a c e' folder, printing the present
working directory, and quitting ed.

The root cause was a faulty computation of the pointer `s`,
being off by one, leading to any arguments after the
directory path to be skipped.

This regression was introduced in revision:
• 614f1d6268

Thanks umbraticus for finding and reporting the issue.
2022-02-09 00:11:44 +00:00
Igor Böhm 614f1d6268 rio: allow spaces in working directory path (-cd) when creating a new window via wctl
The initial working directory of a new window may be set by a
`-cd directory` option. However, the `-cd directory` option is
not capable of handling paths with spaces when used via wctl.

To enable paths with spaces the function
/sys/src/cmd/rio/wctl.c:/^parsewctl is extended to handle quoted
directory paths.

Before applying the patch the following will fail to open a new
window by writing to /dev/wctl:

<snip>
 % rio -i window
 % mkdir '/tmp/path with space'
 % echo new -cd '''/tmp/path with space''' window -x rc >> /dev/wctl
 % pwd
 /tmp/path with space
<snap>

The following invocation fails as well:

<snip>
 % window -cd '/tmp/path with space'
 % pwd
 /tmp/path with space
<snap>

After applying the patch the above sequences work as expected,
opening a window running rc with the working directory set to
'/tmp/path with space'.
2021-11-29 00:06:45 +00:00
Ori Bernstein 8d578014cf rio: match background screen color format (thanks noam) 2021-06-06 22:44:36 +00:00
cinap_lenrek 6b4b8e405a rio: avoid re-triggering clicks on resize/hide/unhide and send wctl when focus is lost 2021-04-25 12:41:20 +02:00
cinap_lenrek b5783b1e39 rio: make window focus changes deterministic, cleanup wind.c
Switching window focus used to be non deterministic
as the current window in focus (Window *input) was set
concurrently while processing window messages such as
Resized and Topped.

This implements a new approach where wcurrent() and
wuncurrent() are responsible for the synchronization
and switch of the input.

It is implemented by sending a Repaint message to the
old input window first, neccesarily waiting until that
window releases the focus and then input is updated
and then a Topped or Reshaped message is send to the
new input window.

Note, that when the whole screen is resized that no
input changes need to happening anymore.
2021-03-07 20:26:30 +01:00
cinap_lenrek 544bca0290 rio: format pid's as ulongs 2020-12-07 14:23:41 +01:00
cinap_lenrek ed3ae3faa3 rio: open /dev/snarf with OCEXEC flag when writing 2020-12-07 14:23:23 +01:00
cinap_lenrek c86a960880 rio: simplify filsysinit() by using getuser(), format pid's as ulongs 2020-12-07 14:22:30 +01:00
cinap_lenrek 753a35b52a rio: undo previous commit, was a stupid idea 2020-12-06 15:08:23 +01:00
cinap_lenrek a0d12784bd rio: give visual clue during sweep and bandsizing when window is too small
We color the window border with a dark red in case the
window is too small.
2020-12-06 14:50:50 +01:00
cinap_lenrek bf2a6f7865 rio: use libdraw's badrect() to exclude some extreme cases in goodrect() 2020-12-06 14:44:23 +01:00
cinap_lenrek 082560fd5b rio: rewrite better portion() function 2020-12-06 13:20:29 +01:00
Sigrid f5d9b2222b rio: handle corner selection for resizing better (thanks cinap) 2020-12-06 13:04:36 +01:00
Sigrid a696951c6c rio: goodrect: clarify minimal height and actually use the smallest reasonable value 2020-12-06 13:02:33 +01:00
Sigrid 7f7c151687 rio: allow windows as small as one line of text, still scrollable 2020-12-06 12:17:05 +01:00
cinap_lenrek 7d55aa8a32 rio: properly restore the windows contents on /dev/mouse close
The previous resize optimization now means that the wfill()
is skipped on resize for libdraw programs.

So do it once /dev/mouse is closed and the window processes
the Refresh message.
2020-12-02 00:53:58 +01:00
cinap_lenrek c931e96364 rio: avoid redrawing window text on resize for programs using libdraw
As long as the client as the mouse file open
and maintains reading the winname file of the window
after a resize we will avoid drawing the text frame
on a resize as it will be overdrawn by the client.

This reduces flicker on resize somewhat for slow systems.
2020-11-29 17:51:57 +01:00
kvik 6f76d00300 rio: move the code for 'send' into a function
Makes the code a bit nicer and allows reusing wsend() in patches.
2020-10-04 22:45:22 +02:00
kvik e5894dccea pre-lib9p servers: fix incorrect Tversion handling
version(5) says:

	If the server does not understand the client's version
	string, it should respond with an Rversion message (not
	Rerror) with the version string the 7 characters
	``unknown''.

Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror.

lib9p(2) follows the above spec, although ignoring the next part
concerning comparison after period-stripping.  It assumes an
Fcall.version starting with "9P" is correctly formed and returns
the only supported version of the protocol, which seems alright.

This patch brings pre-lib9p servers in accordance with the spec.
2020-08-01 15:27:28 +02:00
Ori Bernstein 0dc9c8d019 Reset click count on mouse motion. 2020-05-06 13:38:39 -07:00
cinap_lenrek ac88ce4f7f make bind(2) error handling consistent
The mount() and bind() syscalls return -1 on error,
and the mountid sequence number on success.

The manpage states that the mountid sequence number
is a positive integer, but the kernels implementation
currently uses a unsigned 32-bit integer and does not
guarantee that the mountid will not become negative.

Most code just cares about the error, so test for
the -1 error value only.
2020-05-02 17:32:01 +02:00
Ori Bernstein 60c34ebb2d tweak selection criteria
grow selection from point of click, not start of selection region.
starting at the beginning of the selection region causes the match
logic to kick in, which is confusing.
2020-04-25 15:18:04 -07:00
Ori Bernstein 6f44393958 triple click selection in rio
same as sam and vt, three clicks selects a
whitespace-delimited line.
2020-04-25 08:58:24 -07:00
cinap_lenrek 1a1b4b54b3 rio: fix goodrect() bug (thanks mike)
mike from eff0ff.net reported the following:

> I was running a second instance of rio inside a rio window and
> suddenly weird things started happening. The second instance started
> imposing arbitrary limits on the size of its windows and refused to
> resize some of its windows when its own window was resized.
> Turns out this happens if rio's screen is 3 times as high as wide
> because of a tiny mistake in its goodrect function.

... and kindly provided a patch. thanks!
2020-03-07 20:41:46 +01:00
23hiro 4eee8f13cf rio, kbdfs: increase read buffer for high latency kbdfs support 2019-12-23 01:31:30 +01:00
cinap_lenrek 2c9e3861a5 rio: fix cons read breakage from previous commit 2019-11-19 09:03:45 +01:00
Alex Musolino 59115ba407 rio: pad window status strings in wctl files
This makes it possible to read the entire initial contents of the wctl
files without blocking.
2019-11-19 12:40:53 +10:30
Alex Musolino 4d4107b385 rio: fix bug causing short reads of wctl files
Previously, reads of wctl files would return one byte less than
requested as the returned string must be null terminated.  Now we pass
the actual size of the allocated buffer to the handler, which is large
enough to accommodate a trailing partial rune and terminating null
byte.
2019-11-19 12:38:13 +10:30
cinap_lenrek 03e60450c2 rio: get rid of window delete thread, fix mysterious disappearing windows
because a client might not handle resize, rio would try to move ther
window offsceen after 750 ms. however, it does this by window name,
which could have been reassigned by another concurrent rio, causing the
wrong window to disappear.

now we always move the window offscreen before freeimage(). this way we
are sure to still have the right reference to the original window.
2018-12-07 16:32:04 +01:00
cinap_lenrek bff4fad52a rio: implement writable and truncatable /dev/text 2017-05-07 19:05:12 +02:00
ftrvxmtrx 0930f44feb cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
cinap_lenrek c7bad8f0e5 rio: fix onscreen() 2016-09-20 09:15:53 +02:00
cinap_lenrek 1447b95555 rio: improved bandsize()
when dragging a window edge, allow one to slide to a corner
or slide from corner to corner (usefull when inverting).

also make sure the right or bottom of the rectangle returned
by whichrect() is not outside of the screen (which makes
drawing slow).
2016-09-18 21:16:45 +02:00
cinap_lenrek a0d4c5e208 make error handling in 9p service loops consistent
when we get eof, stop the loop immidiately and do not
rely on the read to eventually return an error.

when convM2S() fails to decode the message, error out
and stop the loop. there is no point in continuing.
2016-07-24 02:21:32 +02:00
cinap_lenrek baf20a548b rio: move the test if w is allowed to change cursor into wsetcursor()
the onscreen cursor shows the cursor of the current
focused window or the window it points at. if there
is no window, then we set the default cursor (nil).
2016-06-26 18:14:34 +02:00
cinap_lenrek 81f867f4fb rio: only the current window may change the cursor, fix typo screen->r vs w->screenr in drag() 2016-05-14 18:14:08 +02:00
cinap_lenrek 06a0dc5319 rio: second attempt... 2016-05-14 00:58:11 +02:00
cinap_lenrek 20fe277f38 revert previous commit, not ready yet 2016-05-14 00:17:07 +02:00
cinap_lenrek 24e7384007 rio: get rid of all mouse moves, fix cursor handling 2016-05-13 23:46:45 +02:00
cinap_lenrek a74542613d rio: /dev/kbd cleanup
- use free running unsigned indeces for window kbdq
- emalloc() vs malloc() in xfid
2016-04-04 06:47:26 +02:00
cinap_lenrek ce84082205 change /dev/kbd to return multiple messages per read 2016-04-03 22:54:22 +02:00
cinap_lenrek 5c95c50c6c rio: flushimage() before wscrsleep() 2016-03-23 20:17:58 +01:00
cinap_lenrek 7ff779ff52 rio: add flushimage() after mb2 menu action 2016-03-22 17:48:08 +01:00
BurnZeZ 9b874fb5cb rio botch 2016-03-19 20:27:09 -04:00
BurnZeZ 18046fd815 rio: fix some spacing, slightly cleaner arg handling 2016-03-19 17:50:33 -04:00
cinap_lenrek 8b9f36dbe2 rio: flushimage() improves your ability to see, i repeat twice. 2016-03-15 22:06:11 +01:00
cinap_lenrek 02f37359b0 rio: remove more unneccesary flushimage() calls 2016-03-15 18:32:05 +01:00
cinap_lenrek 9dc9c6c5ef rio, libdraw: experimental removal of redundant flushimage() calls for roundtrip latency reduction
- remove redundant flushimage() calls before readmouse()
- remove flushimage() calls for allocimage(),freeimage() and originwindow()

this is experimental. it will break allocimage() error handling unless the
caller does explicit flushimage() calls, tho the gains
in usability over high latency connections is huge. in most cases, programs
will just terminate when encountering these errors.
2016-03-08 16:45:29 +01:00