/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_mouse.c,v 1.85 2006/11/25 22:30:28 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.88 2007/09/29 21:50:04 tom Exp $")
#include <term.h>
#include <tic.h>
}
#endif /* USE_GPM_SUPPORT */
+#define xterm_kmous "\033[M"
+
static void
initialize_mousetype(void)
{
- static const char *xterm_kmous = "\033[M";
-
T((T_CALLED("initialize_mousetype()")));
/* Try gpm first, because gpm may be configured to run in xterm */
init_xterm_mouse();
}
} else if (strstr(cur_term->type.term_names, "xterm") != 0) {
- (void) _nc_add_to_try(&(SP->_keytry), xterm_kmous, KEY_MOUSE);
- init_xterm_mouse();
+ if (_nc_add_to_try(&(SP->_keytry), xterm_kmous, KEY_MOUSE) == OK)
+ init_xterm_mouse();
}
returnVoid;
}
}
#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
+ if (USE_TRACEF(TRACE_IEVENT)) {
_trace_slot("before mouse press/release merge:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
(long) (runp - SP->_mouse_events),
(long) ((eventp - SP->_mouse_events) + (EV_MAX - 1)) % EV_MAX,
runcount);
+ _nc_unlock_global(tracef);
}
#endif /* TRACE */
(merge);
#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
+ if (USE_TRACEF(TRACE_IEVENT)) {
_trace_slot("before mouse click merge:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
(long) (runp - SP->_mouse_events),
(long) ((eventp - SP->_mouse_events) + (EV_MAX - 1)) % EV_MAX,
runcount);
+ _nc_unlock_global(tracef);
}
#endif /* TRACE */
(merge);
#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
+ if (USE_TRACEF(TRACE_IEVENT)) {
_trace_slot("before mouse event queue compaction:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
(long) (runp - SP->_mouse_events),
(long) ((eventp - SP->_mouse_events) + (EV_MAX - 1)) % EV_MAX,
runcount);
+ _nc_unlock_global(tracef);
}
#endif /* TRACE */
SP->_mouse_eventp = eventp = prev;
}
#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
+ if (USE_TRACEF(TRACE_IEVENT)) {
_trace_slot("after mouse event queue compaction:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
(long) (runp - SP->_mouse_events),
(long) ((eventp - SP->_mouse_events) + (EV_MAX - 1)) % EV_MAX,
runcount);
+ _nc_unlock_global(tracef);
}
for (ep = runp; ep != eventp; ep = NEXT(ep))
if (ep->id != INVALID_EVENT)