|
From: Raphaël D. <rap...@gm...> - 2012-04-29 17:43:05
|
On Sun, Apr 29, 2012 at 03:52:07PM +0200, Thorsten Wißmann wrote: > I also fixed the annoying lag between a click and the reaction by abook. > Now the mouse should just work as expected™. Can someone test it and > give feedback? (Then we could enable it by default) One visual problem I found is that editing a field immediately makes some garbage appear in the bottom editing bar ( #X* ). I also found some problem with wheel-down handling. It appears that ncurses before 2005 didn't support it (at least it didn't #define corresponding events). Then it comes for --with-ext-mouse ncurses build (which is still not the default for gentoo in 5.9), see: $ grep -m1 NCURSES_MOUSE_VERSION /usr/include/ncursesw/curses.h AFAICT button2 represents the middle click rather than the wheel but the patch appeared to work for me because I'm using a newer version of rxvt-unicode which embed built-in support for mouse wheel. The attached patch should apply on top of yours. * It does not attach to BUTTON1_PRESS event anymore as it's not needed, unless I missed something. * Conditionally set mousemask() according to ncurses headers and removed the use of BUTTON2_PRESS which AFAICT is not involved in mouse-wheel-down, whatever NCURSES_MOUSE_VERSION is. There may be more elegant function to do this in the ncurses API but I didn't take the time to look at them. * detach from mouse signal before we start editing a field (in edit_field()) and restore before we return. * removed some debug statements So it's a bit crappy (4x #if NCURSES_MOUSE_VERSION) but tries to play nice with ncurses headers. Let me know if you have any idea in order to make the whole better. Finally, I've a bad feeling about was_double_click() / custom handling of mouse interval ? do we really need this ? isn't what mouseinterval(200) would do ? It may also be a bug in ncurses, or a bad use of the mouse handling API ? Could you ensure that this is the right way to fix the lag (I didn't find myself the UI laggy) ? or that it still happens when we stop listening to BUTTON1_PRESSED ? ... thank you! best regards PS: I also attached the colors-related patches rebased/merged, as they will appear in the upstream/master repository once pushed; unless you have some additional remarks. (I would personally have preferred to see 2/2 Fabio's patch merged into Thorsten's one but either way wouldn't hurt). |