]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_mouse.c
ncurses 6.0 - patch 20151219
[ncurses.git] / ncurses / base / lib_mouse.c
index 60bf488c8c6464c619e10ac4244e6a89c1474e20..b6c888c1708ac0ae49fea3d73a1369863cef18d5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2014,2015 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            *
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.165 2014/11/01 12:27:59 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.168 2015/10/31 20:47:41 tom Exp $")
 
 #include <tic.h>
 
@@ -641,13 +641,14 @@ initialize_mousetype(SCREEN *sp)
 
 #if USE_SYSMOUSE
     {
+       static char dev_tty[] = "/dev/tty";
        struct mouse_info the_mouse;
        char *the_device = 0;
 
        if (NC_ISATTY(sp->_ifd))
            the_device = ttyname(sp->_ifd);
        if (the_device == 0)
-           the_device = "/dev/tty";
+           the_device = dev_tty;
 
        sp->_mouse_fd = open(the_device, O_RDWR);
 
@@ -888,7 +889,7 @@ _nc_mouse_event(SCREEN *sp)
     do { \
            eventp->bstate = MASK_PRESS(n); \
            sp->_mouse_bstate |= MASK_PRESS(n); \
-           if (kbuf[0] & 0x40) { \
+           if (button & 0x40) { \
                    eventp->bstate = MASK_RELEASE(n); \
                    sp->_mouse_bstate &= ~MASK_PRESS(n); \
            } \
@@ -1248,7 +1249,6 @@ decode_xterm_SGR1006(SCREEN *sp, MEVENT * eventp)
        int b = data.params[0];
        int b3 = 1 + (b & 3);
 
-       result = TRUE;
        eventp->id = NORMAL_EVENT;
        if (data.final == 'M') {
            (void) handle_wheel(sp, eventp, b, (b & 64) == 64);