Skip to content

Commit

Permalink
[mice] if pixelmice is set, use 1016 #2326
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Jan 8, 2022
1 parent 2cca9c6 commit ea7e740
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/mice.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ int mouse_setup(tinfo* ti, unsigned eventmask){
// Sets the shift-escape option, allowing shift+mouse to override the standard
// mouse protocol (mainly so copy-and-paste can still be performed).
#define XTSHIFTESCAPE "\x1b[>1s"
char mousecmd[] = XTSHIFTESCAPE "\x1b[?100x;" SET_SGR_MOUSE_PROT "x";
char* mousecmd;
if(ti->pixelmice){
static char m[] = XTSHIFTESCAPE "\x1b[?100x;" SET_PIXEL_MOUSE_PROT "x";
mousecmd = m;
}else{
static char m[] = XTSHIFTESCAPE "\x1b[?100x;" SET_SGR_MOUSE_PROT "x";
mousecmd = m;
}
mousecmd[11] = ti->mouseproto;
mousecmd[17] = command;
if(command == 'l'){
Expand Down
1 change: 1 addition & 0 deletions src/lib/termdesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ typedef struct tinfo {
pthread_t gpmthread; // thread handle for GPM watcher
int gpmfd; // connection to GPM daemon
char mouseproto; // DECSET level (100x, '0', '2', '3')
bool pixelmice; // do we support pixel-precision mice?
#ifdef __linux__
int linux_fb_fd; // linux framebuffer device fd
char* linux_fb_dev; // device corresponding to linux_fb_dev
Expand Down

0 comments on commit ea7e740

Please sign in to comment.