summaryrefslogtreecommitdiff
path: root/sys/src/libdraw
AgeCommit message (Collapse)Author
2022-08-14libdraw: bikeshed formattingOri Bernstein
2021-02-04libdraw: enter/eenter: fix ^W removing the text on the right side of the tickSigrid
2021-02-04libdraw: enter/eenter: fix Kleft for non-ascii textSigrid
2021-01-09libdraw: add bezierptsOri Bernstein
This patch exposes the bezierpts function, providing a way to get the points on a path, similar how bezsplinepts gives them for b splines.
2020-12-09backout OCEXEC changes when potentially opening /srv filescinap_lenrek
Opening a /srv file sets the close-on-exec flag on the shared channel breaking the exportfs openmount() hack. The devsrv tries to prevent posting a channel with the close-on-exec or remove-on-close flags. but nothing currently prevents this poisoning on open. Until this gets fixed in eigther exportfs or devsrv, i'll back out the changes that could have potential side effects like this.
2020-12-07libdraw: open file-descriptor with OCEXEC flag in readcolmap()cinap_lenrek
2020-12-07libdraw: open internal file-descriptors with OCEXEC flagcinap_lenrek
2020-12-07libdraw: remove unused Error label in freescreen()cinap_lenrek
2020-12-02libdraw: do not force flushimage() on freescreen()cinap_lenrek
This causes visual flashes of white in rio. If it is really needed (it is rare) it should be done by the caller.
2020-05-02libdraw: fix mount() error handling in newwindow()cinap_lenrek
2018-11-18libdraw: avoid deadlock for mouse ioproc sending on resizeccinap_lenrek
a deadlock has been observed with samterm (thanks burnzez), that shows the mouse ioproc being stuck in sending on the resize channel, while the mouse consumer is stuck in a readmouse() loop wanting a rectangle to be drawn by the user: recv(v=0x42df50)+0x28 /sys/src/libthread/channel.c:321 readmouse(mc=0x42df50)+0x54 /sys/src/libdraw/mouse.c:34 getrect(.ret=0x41bce0,but=0x4,mc=0x42df50)+0x62 /sys/src/libdraw/getrect.c:49 r=0x41bc70 rc=0x41bc70 getr(rp=0x41bce0)+0x24 /sys/src/cmd/samterm/main.c:244 p=0x6b000004f6 r=0x2 sweeptext(new=0x0,tag=0x2d)+0x12 /sys/src/cmd/samterm/menu.c:208 r=0x2 t=0x42df50 inmesg(type=0x2,count=0x2)+0x1ab /sys/src/cmd/samterm/mesg.c:136 m=0x10000002d l=0x2d00001b00 i=0x43829000000001 t=0x438290 lp=0x42e050 rcv()+0x7a /sys/src/cmd/samterm/mesg.c:77 threadmain(argv=0x7ffffeffef90)+0x173 /sys/src/cmd/samterm/main.c:63 so avoid blocking in the mouse ioproc by using nbsend() instead of send() for writing to the resize channel.
2018-11-08libdraw: cannot happencinap_lenrek
2018-11-07libdraw: fix gengetwindow()cinap_lenrek
- fix fd leak in winname read() <= 0 case - avoid freeing d->image (was by freeimage((*scrp)->image)) - dont leak screen and window in fullscreen mode
2018-07-23libdraw: accept unsigned msec timestamp in /dev/mousecinap_lenrek
2017-04-29libdraw: get rid of _drawdebug variablecinap_lenrek
2016-10-22libdraw: avoid dropping queued button change mouse events in emouse()cinap_lenrek
2016-04-13libdraw: avoid BPSHORT()/BPLONG() expansion, cleanup loadchar(),cachechars()cinap_lenrek
assigning the expression value to a temporary variable in BPSHORT() and BPLONG() saves arround 2K of text in rio on arm and arround 1K on amd64. loadchar(): use the passed in "h" as the char index instead of recomputing it from c-f->cache. dont recompute wid. cachechars(): do cache lookup and find oldest entry in a single loop pass.
2016-04-10libdraw: dont postnote to pid==0 in ekill()cinap_lenrek
2016-04-05libdraw: fix out of bounds memory access after subfont array reallocation ↵cinap_lenrek
(thanks ray) /n/bugs/open/libdrawfont.c_buffer_overflow http://bugs.9front.org/open/libdrawfont.c_buffer_overflow/readme ray@raylai.com Hi all, In plan9port this bug keeps crashing mc when I run lc in a directory with Chinese characters. This is a diff from OpenBSD but it should apply cleanly to the various plan9 sources. The code is basically trying to do a realloc (I guess realloc wasn't available back then?) but it copies too much from the original buffer. Since realloc is available, just use it. If realloc isn't available outside plan9port (I haven't checked) the memmove line should be changed from: memmove(f->subf, of, (f->nsubf+DSUBF)*sizeof *subf); to: memmove(f->subf, of, f->nsubf*sizeof *subf); I hope this is helpful. Ray
2016-03-19libdraw: have openfont() set error stringBurnZeZ
2016-03-13libdraw: don't flush in readmouse() when theres nothing to flushcinap_lenrek
2016-03-12libdraw: remove flushimage calls from fontresize() and loadchar()cinap_lenrek
2016-03-08rio, libdraw: experimental removal of redundant flushimage() calls for ↵cinap_lenrek
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-02-28libdraw: remove unused static log2[] arraycinap_lenrek
2015-09-20libdraw: remove unneeded check (thanks BurnZeZ)cinap_lenrek
2015-09-20libdraw, screenrc: bind devdraw and devmouse in screenrc instead of handling ↵cinap_lenrek
it in libdraw libdraw was attempting to bind '#i' and '#m' to /dev when it could not find /dev/mouse or /dev/draw. a library shouldnt be that clever and do namespace manipulations on behalf of the caller. so instead, we setup the graphics environment in screenrc on boot time.
2015-08-25fix fuckupglenda
2015-08-25import E script from bell labsmischief
2015-06-09libdraw: sync allocimage/allocwindow prototypes with man pagesftrvxmtrx
2015-06-09libdraw: consistent use of nil for pointers, error handlingcinap_lenrek
2015-05-19libdraw: don't loop forever when getting eof on /dev/cons in keyboard ioproccinap_lenrek
2015-03-02libdraw: font->display->defaultsubfont vs. display->defaultsubfont, dead ↵cinap_lenrek
code, malloc erros it is possible to have fonts belong to different or no display, so the check for defaultsubfont has to be against font->display, not the global display variable. remove unused freeup() routine. handle strdup() error in allocsubfont() and realloc() error in buildfont().
2015-03-01libdraw: use multiple read() calls in openfont() to read .font filecinap_lenrek
font files might be bigger than the i/o unit, so do multiple reads until eof to read it.
2015-03-01libdraw: use readn() to read headers and Fontchar arraycinap_lenrek
the Fontchar array might be bigger than the i/o unit, so we have to use readn() to properly read it.
2015-02-24libdraw: check fontchar count in openmemsubfont() and readsubfont()cinap_lenrek
2015-02-24libdraw: cleanup getsubfont()cinap_lenrek
2015-01-18libdraw: fix broken eenter()cinap_lenrek
eenter would go into a endless loop in the redraw avoidance case because the label was misplaced.
2015-01-09libdraw: don't redraw input box in enter/eenter when mouse is moved outside ↵mischief
the rectangle prevents some flickering when devdraw is used over a high latency connection. Fixes issue 236
2014-12-28libdraw: don't deference nil display in freefontmischief
2014-11-06libdraw: fix atomousecinap_lenrek
2014-07-21libdraw: add missing borderop() (thanks aiju)cinap_lenrek
2014-03-10libdraw: fix zero stringwidth() bugcinap_lenrek
stringwidth() and string() sometimes failed spuriously due to the wrong assumption that cachechars() will only fail when a different subfont is needed. in fact, cachechars() can fail for other reasons like when it resizes the fontcache (or fails todo so). theres also the case when loadchar() is unable to translate a character and returns 0. this case needs to be differentiated from such temporary conditions like fontcache resize or subfont load to stop the retry loop in string() and stringwidth(). now cachechars() returns -1 to indicate that it cannot proceed and we test this in string() and stringwidth() to skip over untranslatable characters to make progress instead of retrying.
2014-02-03libdraw: fix typo: 0xfffff -> 0xffffcinap_lenrek
2014-02-03libdraw: work arround devdraw truncating screenid as 16bitcinap_lenrek
2014-02-01libdraw: use pid as initial screenid so one can have more than 25 windows.cinap_lenrek
2014-01-10libdraw: cleanup string() and stringwidth()cinap_lenrek
getting rid of the goto at the end of the while loop by moving the if(subfontnae) case before the cachechars() call.
2014-01-06libdraw: fix stringwidth problemscinap_lenrek
cachechars() used to skip over characters on its own when loadchar() could not find the character or a PJW replacement. this resulted in wrong width calculation. now we just return and handle the case inside _string and _stringwidth. fix subfont leak in stringwidth() remove annoying prints in stringwidth()
2013-10-04libdraw: make newwindow() unmount the old windowcinap_lenrek
newwindow() used to mount the new window directly on /dev, resulting in the old window and the new one being mounted over each other. we now try to unmount the old window from /dev first, mount new window to /mnt/wsys (replacing the old) and then bind /mnt/wsys before /dev. if theres no /mnt/wsys, just mount window directly before /dev.
2013-09-18libevent: drop queued mouse eventscinap_lenrek
the changeset r541ead66e8af: "libdraw: make ebread() return buffer immidiately if available" makes mouse sluggish when the program cant keep up as mouse events queue up. this more or less restores the original behaviour but only for mouse events.
2013-08-13libdraw: fix leftover processes or programs failing to restore window labels ↵cinap_lenrek
when receiving interrupt note fix the default note handler for event programs. only handle non system notes or notes in the slave processes. for interrupt in the main process, just call exits() which will do the cleanup and restore window label properly. this makes completely overriding the note handler in gping and stats uneccesary.