summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio/dat.h
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.
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: 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-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
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-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-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.
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-05-14rio: second attempt...cinap_lenrek
2016-05-14revert previous commit, not ready yetcinap_lenrek
2016-05-13rio: get rid of all mouse moves, fix cursor handlingcinap_lenrek
2016-04-03change /dev/kbd to return multiple messages per readcinap_lenrek
2016-02-13rio: fix wrong frame colors when moving non-current windowcinap_lenrek
When a window is moved or reshaped, that implicitely tops the window and makes it current. The conseqence of this is that we always have to redraw the window as if it where a current window in any case. This was handled for Reshaped windows, but not when the window was just moved. We now handle both cases the exact same way, getting rid of the Moved wctl message.
2015-11-23rio: stop serving kbdin file (thanks eekee)cinap_lenrek
kbdfs already provides a /dev/kbdin file for the system, rio does not need to provide one for the onscreen keyboard anymore.
2014-10-25rio: dont serve a kbd file per window when we didnt got one from the environmentcinap_lenrek
9vx doesnt provide a /dev/kbd file and rio faking one up causes problems with vncv. (issue #223)
2014-01-11rio: implement "look" (thanks lf94)cinap_lenrek
2013-11-03rio: cleanup and error handlingcinap_lenrek
2013-11-02rio: huge simplification of flush handlingcinap_lenrek
xfidflush() now uses a simpler way to flush another xfid. when we can send to Xfid.c channel, we know that the xfid is completed. so all xfidflush() needs todo is to do an alt sending to both Xfid.c and Xfid.flushc. once the send to Xfid.c succeeds, we know the xfid is gone and we can respond to the flush request. theres no need to keep track of flush state anymore. so Xfid.active and Xfid.flushing can be removed. note, that it is ok to respond normally to a currently flushed request.
2013-11-01rio: properly handle follow up flushes (fixes unexpected reply tag)cinap_lenrek
when multiple flushes are send, they need to be replied in order. we ensure this by having the flush xfid taking over the flushtag (synchronized with a new fs->csyncflush channel) so the next flush will flush the previous flush.
2013-10-04rio: gone windows, window resize, rectonscreen, goodrectcinap_lenrek
dont rely on postnote to shutdown client. instead, make reads on cons, kbd and mouse error. when we mount a window system over exportfs, the pid useless and even dangerous! pid should be only used by clients forked by rio itself. fix bug in resized(), goodrect() takes rect in screen coordinates! make rectonscreen() fix window size if the window doesnt fit on the screen. improve goodrect() to check for windows outside of the screen or bigger than screen without borders visible.
2013-06-29rio: run filename completion in background processcinap_lenrek
this avoids locking up rio when doing filename completion on a unresponsive directory.
2013-01-10still races, reverting... need a better approach.cinap_lenrek
2013-01-09rio: fix window resize and attach racecinap_lenrek
if a window gets hidden/unhidden/resized too fast, the client might have no chance attaching to that image using winname. so we move the window offscreen instead and delay the freeimage() by doing it in the deletethread().
2012-10-30rio: fix topping a hidden window does not activate the foreground font colorcinap_lenrek
2012-10-22rio: fix deadlockcinap_lenrek
we can't really change the Window *input from outside the winctl() thread. the problem is that the window might end up reading the mouse (scroll, select) which makes the w->cctl channel block once you try to talk to the window again (from the mousethread). this also means we have to coordinate window switchin from the winctl proc waiting for the current window to release the input and then take over. thers a new Winctl message Topped that basically does that now using Wakeup and a chan to synchronize.
2012-10-21rio: various fixescinap_lenrek
use notefd in killprocs() insead of postnote() as the process might'v exited. the notefd stays valid even if the particular process it was originaly opend on exited. remove the Window.pid field as its not needed. dup() the notefd for interruptproc as the window might'v gone away and closed the notefd file descriptor, resulting in us writing to the wrong thing. use snprint() instead of sprint() for safety. fix bogus debug fprint(). add missing "visible" flushimage() after Reshaped winctl message got handled. i assumed wsetname()/nameimage() would be enough, it but does a invisible flush so softscreen doesnt get updated immidiately. do not make allocimage() failure in scrtemps() fatal. it wont draw the window properly, but it gives the user a chance to delete some windows to recover.
2012-10-20rio: colors, flicker reduction, refresh after mouse closecinap_lenrek
allocate all the colors in iconinit(), remove unused ones like grey. rename darkgrey to paletextcol because thats what it is used for. new approach to window image allocation. we allocate the window with DNofill and let the window fill itself. this reduces flickering especially with (-b) option and makes rio resize feel a lot faster. wrefresh() didnt work. now fixed.
2012-10-20rio: preserve window z-order on resize, fix race conditionscinap_lenrek
sort the window array by w->topped before reshaping all windows. this preserves the window z-order. remove implicit focus change on reshape/move. it called wcurrent() in wtcl thread which might send a wctl message to itself, bad... also we might not want to change focus on reshape, like for the rio resize. so we set the input window explicitely in all call sites. window deletion was racy. wclosewin() destroys w->i, but it is called outside the wctl thread so it might just free the image under libframe doing some text selection. this is fixed the following: add wclunk() function, which basically just marks the window as deleted and removes the reference from the window[] and hidden[] arrays. (called on wclose() when refcount drops to zero). wclosewin() now just frees the image and is only called from the wctl thread on exit or when handing the Deleted message. get a reference to the window when doing sweeping or moving as the filesystem might just clunk it under us and we might end up sending wctl messages to a Exited window. wctl resize message has to fail if the window is not current as it might be hidden... would also be annoying.
2012-09-16rio: single line scroll up/down with holding shift keycinap_lenrek
2012-05-08rio: dont list files we dont serve when reading directorycinap_lenrek
2011-05-11add /dev/kbd support to riocinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen