summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio
AgeCommit message (Collapse)Author
2023-02-06rio: refactor the keyboardtap code a bitcinap_lenrek
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.
2023-01-28rio: sync keyboard state with active window on switchJacob Moody
this addresses issues with stuck modifier keys when clicking off and on from vncv with a modifier held.
2022-10-19rio: prevent some more keyboard lockupsJacob Moody
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.
2022-10-11rio: close the display on the way outJacob Moody
This restores the window image when exiting a subrio.
2022-09-29rio: kbdtap style tweakJacob Moody
2022-09-28rio: ensure single reader and single writer for kbdtapJacob Moody
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."
2022-09-11rio: correct error messageJacob Moody
2022-09-11rio: return 'global' size for none /dev/wctl read (thanks umbraticus)Jacob Moody
Before we were just erroring, this provides something useful giving the total size of the rio to the riostart script.
2022-09-11rio: more pointy edges with none attachJacob Moody
Would crash when reading from wctl in riostart.
2022-09-11rio: add 'none' attach option to wsysJacob Moody
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.
2022-08-21rio: kbdtap deadlocks are verbodenJacob Moody
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.
2022-08-20rio: make it harder to deadlock from kbdtapJacob Moody
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.
2022-08-20rio: /dev/label should just ignore offsetJacob Moody
We were erroring if offset != 0. Just ignore the offset.
2022-08-19rio: correct tap codeJacob Moody
Remove tapmesg, allow the reads to accept flushes, accept writes of multiple messages, move open/close to Xfid code.
2022-08-18rio: require a confirmation for ExitJacob Moody
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.
2022-08-15rio: add /dev/kbdtapJacob Moody
2022-08-04rio: show Exit in subriosJacob Moody
2022-02-09rio: fix parsing of directory path (-cd) when creating a new window via wctlIgor Böhm
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.
2021-11-29rio: allow spaces in working directory path (-cd) when creating a new window ↵Igor Böhm
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-06-06rio: match background screen color format (thanks noam)Ori Bernstein
2021-04-25rio: avoid re-triggering clicks on resize/hide/unhide and send wctl when ↵cinap_lenrek
focus is lost
2021-03-07rio: make window focus changes deterministic, cleanup wind.ccinap_lenrek
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.
2020-12-07rio: format pid's as ulongscinap_lenrek
2020-12-07rio: open /dev/snarf with OCEXEC flag when writingcinap_lenrek
2020-12-07rio: simplify filsysinit() by using getuser(), format pid's as ulongscinap_lenrek
2020-12-06rio: undo previous commit, was a stupid ideacinap_lenrek
2020-12-06rio: give visual clue during sweep and bandsizing when window is too smallcinap_lenrek
We color the window border with a dark red in case the window is too small.
2020-12-06rio: use libdraw's badrect() to exclude some extreme cases in goodrect()cinap_lenrek
2020-12-06rio: rewrite better portion() functioncinap_lenrek
2020-12-06rio: handle corner selection for resizing better (thanks cinap)Sigrid
2020-12-06rio: goodrect: clarify minimal height and actually use the smallest ↵Sigrid
reasonable value
2020-12-06rio: allow windows as small as one line of text, still scrollableSigrid
2020-12-02rio: properly restore the windows contents on /dev/mouse closecinap_lenrek
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-11-29rio: avoid redrawing window text on resize for programs using libdrawcinap_lenrek
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-10-04rio: move the code for 'send' into a functionkvik
Makes the code a bit nicer and allows reusing wsend() in patches.
2020-08-01pre-lib9p servers: fix incorrect Tversion handlingkvik
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-05-06Reset click count on mouse motion.Ori Bernstein
2020-05-02make bind(2) error handling consistentcinap_lenrek
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-04-25tweak selection criteriaOri Bernstein
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-25triple click selection in rioOri Bernstein
same as sam and vt, three clicks selects a whitespace-delimited line.
2020-03-07rio: fix goodrect() bug (thanks mike)cinap_lenrek
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!
2019-12-23rio, kbdfs: increase read buffer for high latency kbdfs support23hiro
2019-11-19rio: fix cons read breakage from previous commitcinap_lenrek
2019-11-19rio: pad window status strings in wctl filesAlex Musolino
This makes it possible to read the entire initial contents of the wctl files without blocking.
2019-11-19rio: fix bug causing short reads of wctl filesAlex Musolino
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.
2018-12-07rio: get rid of window delete thread, fix mysterious disappearing windowscinap_lenrek
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.
2017-05-07rio: implement writable and truncatable /dev/textcinap_lenrek
2016-11-17cmd: remove a bit of unused stuffftrvxmtrx
2016-09-20rio: fix onscreen()cinap_lenrek
2016-09-18rio: improved bandsize()cinap_lenrek
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).