]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_mouse.c
ncurses 5.9 - patch 20110910
[ncurses.git] / ncurses / base / lib_mouse.c
index 0ab894af2ac6fe30428c48816045cccfa719a88d..4316957918015f336833303a8440f5563a793e30 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.119 2010/05/22 20:00:55 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.122 2011/09/10 22:23:38 tom Exp $")
 
 #include <tic.h>
 
 
 #include <tic.h>
 
@@ -1359,6 +1359,17 @@ NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
        /* compute the current-event pointer */
        MEVENT *prev = PREV(eventp);
 
        /* 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;
        if (prev->id != INVALID_EVENT) {
            /* copy the event we find there */
            *aevent = *prev;
@@ -1371,6 +1382,7 @@ NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
            SP_PARM->_mouse_eventp = PREV(prev);
            result = OK;
        }
            SP_PARM->_mouse_eventp = PREV(prev);
            result = OK;
        }
+#endif
     }
     returnCode(result);
 }
     }
     returnCode(result);
 }
@@ -1450,7 +1462,7 @@ NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask)
            }
        }
     }
            }
        }
     }
-    returnBits(result);
+    returnMMask(result);
 }
 
 #if NCURSES_SP_FUNCS
 }
 
 #if NCURSES_SP_FUNCS