9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* tiny rio hack: Delete
@ 2010-02-08 23:33 Mathieu Lonjaret
  2010-02-09  0:58 ` michael block
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Lonjaret @ 2010-02-08 23:33 UTC (permalink / raw)
  To: plan9port-dev; +Cc: 9fans

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-09 22:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-08 23:33 tiny rio hack: Delete Mathieu Lonjaret
2010-02-09  0:58 ` michael block
2010-02-09  9:09   ` Mathieu Lonjaret
2010-02-09  9:36     ` [9fans] " cinap_lenrek
2010-02-09 21:59       ` Michaelian Ennis
2010-02-09 22:26         ` Federico G. Benavento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).