"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "button.c" between
xterm-355.tgz and xterm-356.tgz

About: xterm is a terminal emulator for X with ISO/ANSI color and vt220 enhancements.

button.c  (xterm-355.tgz):button.c  (xterm-356.tgz)
/* $XTermId: button.c,v 1.579 2020/04/30 23:16:03 tom Exp $ */ /* $XTermId: button.c,v 1.580 2020/05/02 16:49:20 tom Exp $ */
/* /*
* Copyright 1999-2019,2020 by Thomas E. Dickey * Copyright 1999-2019,2020 by Thomas E. Dickey
* *
* All Rights Reserved * All Rights Reserved
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
skipping to change at line 4833 skipping to change at line 4833
TScreen *screen = TScreenOf(xw); TScreen *screen = TScreenOf(xw);
int pty = screen->respond; int pty = screen->respond;
int mouse_limit = MouseLimit(screen); int mouse_limit = MouseLimit(screen);
Char line[32]; Char line[32];
Char final = 'M'; Char final = 'M';
int row, col; int row, col;
int button; int button;
unsigned count = 0; unsigned count = 0;
Boolean changed = True; Boolean changed = True;
/*
* Avoid making multiple replies due to multiple actions per event.
*/
if (screen->last_mouse == event->serial)
return;
screen->last_mouse = event->serial;
/* If button event, get button # adjusted for DEC compatibility */ /* If button event, get button # adjusted for DEC compatibility */
button = (int) (event->button - 1); button = (int) (event->button - 1);
if (button >= 3) if (button >= 3)
button++; button++;
/* Ignore buttons that cannot be encoded */ /* Ignore buttons that cannot be encoded */
if (screen->send_mouse_pos == X10_MOUSE) { if (screen->send_mouse_pos == X10_MOUSE) {
if (button > 3) if (button > 3)
return; return;
} else if (screen->extend_coords == SET_SGR_EXT_MODE_MOUSE } else if (screen->extend_coords == SET_SGR_EXT_MODE_MOUSE
skipping to change at line 4922 skipping to change at line 4915
} else { } else {
/* Button-Motion events */ /* Button-Motion events */
switch (event->type) { switch (event->type) {
case ButtonPress: case ButtonPress:
screen->mouse_button |= ButtonBit(button); screen->mouse_button |= ButtonBit(button);
count = EMIT_BUTTON(button); count = EMIT_BUTTON(button);
break; break;
case ButtonRelease: case ButtonRelease:
/* /*
* The (vertical) wheel mouse interface generates release-events * The (vertical) wheel mouse interface generates release-events
* for buttons 4 and 5, coded here as 3 and 4 respectively. * for buttons 4 and 5.
* *
* The X10/X11 xterm protocol maps the release for buttons 1..3 to * The X10/X11 xterm protocol maps the release for buttons 1..3 to
* a -1, which will be later mapped into a "0" (some button was * a -1, which will be later mapped into a "0" (some button was
* released), * released), At this point, buttons 1..3 are encoded 0..2 (the
* code 3 is unused).
* *
* The SGR (extended) xterm mouse protocol keeps the button number * The SGR (extended) xterm mouse protocol keeps the button number
* and uses a "m" to indicate button release. * and uses a "m" to indicate button release.
* *
* The behavior for mice with more buttons is unclear, and may be * The behavior for mice with more buttons is unclear, and may be
* revised -TD * revised -TD
*/ */
screen->mouse_button &= ~ButtonBit(button); screen->mouse_button &= ~ButtonBit(button);
if (button < 3 || button >= 8) { if (button < 3 || button > 5) {
switch (screen->extend_coords) { switch (screen->extend_coords) {
case SET_SGR_EXT_MODE_MOUSE: case SET_SGR_EXT_MODE_MOUSE:
final = 'm'; final = 'm';
break; break;
default: default:
button = -1; button = -1;
break; break;
} }
} }
count = EMIT_BUTTON(button); count = EMIT_BUTTON(button);
 End of changes. 5 change blocks. 
11 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)