[hackers] [st] set selection to IDLE on clear || v4hn

From: <git_AT_suckless.org>
Date: Fri, 15 May 2015 07:53:11 +0200 (CEST)

commit 8e15887de95a7076b9515dcbb428b364f6dc3849
Author: v4hn <me_AT_v4hn.de>
Date: Thu May 14 15:46:07 2015 +0200

    set selection to IDLE on clear
    
    Otherwise a tangling bmotion event will consider
    the selection still valid and selnormalize segfaults
    because of an invalid sel.ob.y index.

diff --git a/st.c b/st.c
index 73fe291..c0a9bf3 100644
--- a/st.c
+++ b/st.c
_AT_@ -1069,6 +1069,7 @@ void
 selclear(XEvent *e) {
         if(sel.ob.x == -1)
                 return;
+ sel.mode = SEL_IDLE;
         sel.ob.x = -1;
         tsetdirt(sel.nb.y, sel.ne.y);
 }
Received on Fri May 15 2015 - 07:53:11 CEST

This archive was generated by hypermail 2.3.0 : Fri May 15 2015 - 08:00:14 CEST