Age | Commit message (Collapse) | Author |
|
run the keyboardtap as a thread instead of a proc
so that we can read input window variable.
This gets rid of the wintap channel.
do focus handling by tracking the last window and
only send context switch when we start typing into
a different window.
have fromtap, totap channels created by open and
use the variable also as the in-use flag.
handle use nbsendp() when sending to the tap
program, as it might be blocked or misbehaving.
if the totap channel is full, we bypass the tap
and send to input again.
handle keyup on focus loss in the window thread instead
(just like the artificial mouseup) it is unrelated to
keyboardtap.
|
|
this addresses issues with stuck modifier keys when clicking
off and on from vncv with a modifier held.
|
|
Triggered these from ktrans a couple times when poking at it, the
issue is that we get stuck wanting to emit to the tap without a valid
listener. This ensures we are never stuch sending to a deleted window
or dead tap user.
|
|
This restores the window image when exiting a subrio.
|
|
|
|
Multiple readers eat each other's lunch, and it makes more
sense to limit use to one 'pipeline' then just one reader.
This also brings back the 'focus' message from kbdtap used
by ktrans to reset its line buffers when the user switches
windows. An event file was considered, but deemed harmful
to the artwork. To paraphrase an old excuse found in the code:
"rio just isn't structured for that. Apologies."
|
|
|
|
Before we were just erroring, this provides something useful giving
the total size of the rio to the riostart script.
|
|
Would crash when reading from wctl in riostart.
|
|
This allows users to mount wsys without having
a valid window or creating a new one. In this
mode wsys only servs 'global' files, those that
apply to all windows. Providing this mount to
riostart's namespace gives us two things:
* Allows kbdtap programs(ktrans) to run in riostart
* Obsoletes $wctl and the associated named pipe by providing /dev/wctl in riostart
As such, the wctl pipe and environment variable are removed as well.
|
|
This should make kbdtap related deadlocks
impossible. The tap thread has been rewritten
to use one alt which always allows for the window
handling code to nofiy us regardless if we're send'ing or
recv'ing. We also move the start/stop messages to their
own channel and can the reset code for now.
|
|
It was quite easy for a single threaded
tap program to cause a deadlock. The
following describes the scenario:
prog: read a key from /dev/kbdtap
prog: processing key
rio: read a key from the 'upstream' /dev/kbd
rio: submit key to tap thread
prog: writes translated key back to /dev/kbdtap
Because the tap thread is blocked on waiting for
the program to read the new character, the program's
write never completes and we hit deadlock.
This was "conviently" avoided in testing with ktrans
because the reader and writer are in two different
processes. So in this case ktrans could make forward
progress.
To solve this we first turn the tap channels to have
a small buffer, this grases the wheel and allows the
above case to become tolerant for some amount of
new upstream characters.
Second we move the tap processing thread in to its
own process. This isolates this processing from the
rest of the main rio thread. This ensures that a misbehaving
kbdtap user will never lock you out of being able to 'Delete' it
and restore normal functionality.
|
|
We were erroring if offset != 0. Just ignore
the offset.
|
|
Remove tapmesg, allow the reads to accept
flushes, accept writes of multiple messages,
move open/close to Xfid code.
|
|
Even accidentally killing a subrio can be
annoying. So instead of only showing this
on subrios, show it always but always
require an additional click to actually
exit.
|
|
|
|
|
|
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:
• 614f1d6268fd986fc628eec3754bd4599363ad13
Thanks umbraticus for finding and reporting the issue.
|
|
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'.
|
|
|
|
focus is lost
|
|
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.
|
|
|
|
|
|
|
|
|
|
We color the window border with a dark red in case the
window is too small.
|
|
|
|
|
|
|
|
reasonable value
|
|
|
|
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.
|
|
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.
|
|
Makes the code a bit nicer and allows reusing wsend() in patches.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
same as sam and vt, three clicks selects a
whitespace-delimited line.
|
|
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!
|
|
|
|
|
|
This makes it possible to read the entire initial contents of the wctl
files without blocking.
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
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).
|