From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: plan9port-dev@googlegroups.com CC: 9fans@9fans.net Subject: tiny rio hack: Delete From: "Mathieu Lonjaret" Date: Tue, 9 Feb 2010 00:33:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: d09274ae-ead5-11e9-9d60-3106f5b1d025 Hello, if you have been bitten one too many times by Delete on rio, here's one quick fix: diff -r 7aac02e8704e src/cmd/rio/grab.c --- a/src/cmd/rio/grab.c Sat Feb 06 22:16:46 2010 -0800 +++ b/src/cmd/rio/grab.c Tue Feb 09 00:11:33 2010 +0100 @@ -142,7 +142,8 @@ else if(i < 0 || i >= n) i = -1; else - m->lasthit = i; + if(i != 3) + m->lasthit = i; if(!nobuttons(&ev.xbutton)) i = -1; ungrab(&ev.xbutton); The way the button 3 menu works is the following: the entry selected by default when you call the menu is the one that was used for the last time. This change simply disables that behavior when the last operation was Delete. I did this because it has happened to me too often to select it by mistake and to delete a window afterwards before I realized my mistake. I realize this breaks the generic behavior, but on the other hand Delete is the only operation that is not always easily reversible, so it didn't bother me that much to make an exception for this one in the end. Cheers, Mathieu P.S: tested only on p9p, I haven't checked on plan 9. I can do it if anyone's interested.