summaryrefslogtreecommitdiff
path: root/sys/src/libdraw
AgeCommit message (Collapse)Author
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.
2013-08-11libdraw: make ebread() return buffer immidiately if available, cleanupcinap_lenrek
this reduces number of syscalls and improves performance for vt
2013-08-11libdraw: fix ekbd() memory leakcinap_lenrek
2013-06-19libdraw: fix allocscreen() memory leak with too many retries (from 9atom)cinap_lenrek
2013-06-18libdraw: avoid moving cursor if we dont have to for menuhitcinap_lenrek
depending on the font, poping the menu would move your cursor one pixel down each time (due to division). this is annoying when using a trackpoint and trying to repeat some operation over 9000 times. the cursor should only be moved when the menu is repositioned to contain it on the screen.
2013-06-16draw: add badrect() function to reject zero, negative size or orverly huge ↵cinap_lenrek
rectangles not checking the rectangle dimensions causes integer overflows and memory corruption. adding a new badrect() function that checks for these cases.
2013-05-25libdraw: fix agefont crash when display == nil (from sources / ↵cinap_lenrek
agefont-nodisplay patch) If you run this: {for (i in `{seq 1 70000}) echo '½•α·'} | mc | wc mc will eventually suicide. The error comes from /sys/src/libdraw/font.c:/^agefont which assumes it has a display. Normally, this is set up by geninitdraw (usually via initdraw), but mc.c avoids that to avoid the screen redraws (flicker, at a minimum, but worse in long-running cases). graphics(2) does not prohibit this use, so I made the least intrusive change to make it work.
2013-05-04libdraw: fix font f->cacheimage nil dereferencecinap_lenrek
the initial fontresize() might fail but its error code is ignored potentially leaving f->cacheimage == nil. make sure we call fontresize() in loadchar() when theres no cacheimage and check the return value to avoid nil pointer dereference.
2013-04-27libdraw: avoid printing error on closemouse()cinap_lenrek
2013-04-27libdraw: exit mouseproc() on read error instead of spinningcinap_lenrek
2013-01-25libdraw: fix memory corruption bug in initdisplay()cinap_lenrek
2013-01-11libdraw: gengetwindow() fix mistakecinap_lenrek
dont zero *winp so the "screen" pointer is preserved.
2013-01-10libdraw: gengetwindow() resize racecinap_lenrek
instead of trying to make rio not change the window image too fast and give the client some time to attach it (which turns out to be impossible), we acknowledge that there is a race and just retry the window reattach as long as the winname keeps changing in gengetwindow().
2013-01-08libdraw: fix wrong menusel() calculation for menuhit() (noticable with small ↵cinap_lenrek
fonts) the text for a menu entry is drawn from: y = textr.min.y + i*(font->height+Vspacing); but we calculated the item from: r = insetrect(textr); i = (p.y - r.min.y) / (font->height+Vspacing); the insetrect is wrong.
2012-12-31fix utf and rune handling in preparation for 32bit runescinap_lenrek
2012-09-26libdraw: enter()/eenter() ^W support - we are getting therecinap_lenrek
2012-09-26need more coffeecinap_lenrek
2012-09-26libdraw: fix ^W corner case tick == 0 for enter()/eenter()cinap_lenrek
2012-09-26libdraw: implement ^W word delete for enter() and eenter()cinap_lenrek
2012-08-09libdraw: improve handling of screen cliprcinap_lenrek
2012-07-22libdraw: enter/eenter, set and restore clip rectcinap_lenrek
2011-12-09libdraw: change built in lucm.9 default font to vga fontglenda
2011-11-10libdraw: dont abort() on failed allocimage in fontresize()cinap_lenrek
2011-10-31libdraw: added enter() and eenter() functionscinap_lenrek
2011-10-02libdraw: shutdown keyboard and mouseprocs with threadint, libthread: avoid ↵glenda
delayed note leak (this fixes the "too many delayed notes" error with auth/fgui)
2011-09-05libdraw: fix old subfont leakcinap_lenrek
2011-09-04libdraw: reduce memory for writeimage/writememimagecinap_lenrek
2011-09-04libdraw: fix libdraws copy of writeimage() toocinap_lenrek
2011-09-04libdraw: fix unloadimage() for wide images, libmemdraw: work arround width ↵cinap_lenrek
limit by outputting uncompressed image in writememimage() if compressed blocksize exceeds chunk limit
2011-09-03libdraw: make loadimage and readimage handle wide imagesglenda
2011-08-14libdraw: fix more leakscinap_lenrek
2011-08-14libdraw: fixed memory leakaiju
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen