Ticket #74 (closed defect: wontfix)
Wrong mouse position when col > 255
|Reported by:||Christian||Owned by:||ian|
When the gnome-terminal (xterm, rxvt,..) has more than 255 columns and I click in a column on the right side of the 255th column the value of col in mouse_event is wrong. 256th column -> col=-33 257th column -> col=-32 and so on. I have looked a bit in the code and found this piece: (raw_display.py:427ff)
def _getch(self, timeout): ready = self._wait_for_input_ready(timeout) if self.gpm_mev is not None: if self.gpm_mev.stdout.fileno() in ready: self.gpm_event_pending = True if self._term_input_file.fileno() in ready: return ord(os.read(self._term_input_file.fileno(), 1)) return -1
Values greater then 255 can't be read correct from stdin. So if gpm isn't available there should be some code that prevents this error. I don't know if there is another way to get the mouse position except from stdin, or if you have to ensure that the terminal isn't bigger then 255x255.