/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_mouse.c,v 1.116 2010/05/01 19:29:31 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.122 2011/09/10 22:23:38 tom Exp $")
#include <tic.h>
* Wheel mice may return buttons 4 and 5 when the wheel is turned.
* We encode those as button presses.
*/
+# if USE_PTHREADS_EINTR
+# if USE_WEAK_SYMBOLS
+ if ((pthread_self) && (pthread_kill) && (pthread_equal))
+# endif
+ _nc_globals.read_thread = pthread_self();
+# endif
for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) {
/* For VIO mouse we add extra bit 64 to disambiguate button-up. */
if (res == -1)
break;
}
+#if USE_PTHREADS_EINTR
+ _nc_globals.read_thread = 0;
+#endif
kbuf[3] = '\0';
TR(TRACE_IEVENT,
/* compute the current-event pointer */
MEVENT *prev = PREV(eventp);
+#if 1
+ /* copy the event we find there */
+ *aevent = *prev;
+
+ TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
+ _nc_tracemouse(SP_PARM, prev),
+ (long) IndexEV(SP_PARM, prev)));
+
+ prev->id = INVALID_EVENT; /* so the queue slot becomes free */
+ result = OK;
+#else /* 20100102 change prevented "release" events from returning to caller */
if (prev->id != INVALID_EVENT) {
/* copy the event we find there */
*aevent = *prev;
SP_PARM->_mouse_eventp = PREV(prev);
result = OK;
}
+#endif
}
returnCode(result);
}
}
}
}
- returnBits(result);
+ returnMMask(result);
}
#if NCURSES_SP_FUNCS