From fad79035e756aba6b79562fe7297c25eadfcde3e Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 26 Aug 2021 18:31:08 -0400 Subject: [PATCH] gpm: stash connect fd --- src/lib/internal.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/internal.h b/src/lib/internal.h index 013d30964..79f45eee8 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -1145,12 +1145,12 @@ coerce_styles(fbuf* f, const tinfo* ti, uint16_t* curstyle, static inline int mouse_enable(tinfo* ti, FILE* out){ if(ti->qterm == TERMINAL_LINUX){ - if(ti->gpmfd >= 0){ - return 0; - } - if((ti->gpmfd = gpm_connect(ti)) >= 0){ - return 0; + if(ti->gpmfd < 0){ + if((ti->gpmfd = gpm_connect(ti)) < 0){ + return -1; + } } + return 0; } // Sets the shift-escape option, allowing shift+mouse to override the standard // mouse protocol (mainly so copy-and-paste can still be performed).