[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ncurses-5.9-20111022.patch.gz
From: |
Damien Guibouret |
Subject: |
Re: ncurses-5.9-20111022.patch.gz |
Date: |
Sun, 23 Oct 2011 17:04:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050416 |
Hello,
I take a look at this last patch and I have a strange feeling on _mouse_mask2
use: in get_mouse and _nc_mouse_parse functions, everywhere you used
_mouse_mask2 I would had kept _mouse_mask and everywhere you kept _mouse_mask, I
would had used _mouse_mask2 (the temporary set mask shall be used for the
click/doubleclick/tripleclick merge but not to return event to user) or I
misunderstand something.
And the
} else if (!ValidEvent(next)) {
continue;
you add at line 1254 is theorically not needed (the first invalid event that is
encountered in loop is eventp and it is treated by previous condition that will
end loop at end of this iteration) (or if you encounter a case where next is
invalid, it is the previous loop that needs to be fixed).
That gives something as attached file.
Regards,
Damien
--- lib_mouse.orig.c 2011-10-23 16:57:44.179549880 +0200
+++ lib_mouse.c 2011-10-23 16:59:50.290378120 +0200
@@ -1178,7 +1178,7 @@
if (changed) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_CLICK(b))
&& (ep->bstate & MASK_PRESS(b))) {
next->bstate &= ~MASK_RELEASE(b);
next->bstate |= MASK_CLICK(b);
@@ -1251,15 +1251,13 @@
if (next == eventp) {
/* Will end the loop, but check event type and compact before */
endLoop = TRUE;
- } else if (!ValidEvent(next)) {
- continue;
} else {
/* merge click events forward */
if ((ep->bstate & BUTTON_CLICKED)
&& (next->bstate & BUTTON_CLICKED)) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_DOUBLE_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_DOUBLE_CLICK(b))
&& (ep->bstate & MASK_CLICK(b))
&& (next->bstate & MASK_CLICK(b))) {
next->bstate &= ~MASK_CLICK(b);
@@ -1277,7 +1275,7 @@
&& (next->bstate & BUTTON_CLICKED)) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_TRIPLE_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_TRIPLE_CLICK(b))
&& (ep->bstate & MASK_DOUBLE_CLICK(b))
&& (next->bstate & MASK_CLICK(b))) {
next->bstate &= ~MASK_CLICK(b);
@@ -1292,7 +1290,7 @@
}
/* Discard event if it does not match event mask */
- if (!(ep->bstate & sp->_mouse_mask2)) {
+ if (!(ep->bstate & sp->_mouse_mask)) {
Invalidate(ep);
}
@@ -1434,7 +1432,7 @@
* _nc_mouse_parse was not called, e.g., when _nc_mouse_inline returns
* false).
*/
- while (ValidEvent(prev) && (!(prev->bstate & SP_PARM->_mouse_mask2))) {
+ while (ValidEvent(prev) && (!(prev->bstate & SP_PARM->_mouse_mask))) {
Invalidate(prev);
prev = PREV(prev);
}