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

* Re: tiny rio hack: Delete
  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
  0 siblings, 1 reply; 6+ messages in thread
From: michael block @ 2010-02-09  0:58 UTC (permalink / raw)
  To: plan9port-dev, 9fans

> [...] it has happened to me too often to select [delete] by mistake
> and to delete a window afterwards before I realized my mistake.

there is a patch on sources that allows you to change rio's linear menus
into pie menus. this allows you to associate the desired action with a
mouse gesture rather than requiring you to either remember the menu state
or to always look carefully at what you're doing. since i began using pie
menus with rio, my rate of absent-minded window loss has sharply dropped


satisfaction guaranteed. and thank you to whoever wrote the patch


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

* Re: tiny rio hack: Delete
  2010-02-09  0:58 ` michael block
@ 2010-02-09  9:09   ` Mathieu Lonjaret
  2010-02-09  9:36     ` [9fans] " cinap_lenrek
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Lonjaret @ 2010-02-09  9:09 UTC (permalink / raw)
  To: michaelmuffin; +Cc: plan9port-dev, 9fans

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

I knew about that patch but I wanted to change the least possible to
the original code.

I think cinap is the one who did the pie menus btw.

[-- Attachment #2: Type: message/rfc822, Size: 6755 bytes --]

From: michael block <michaelmuffin@gmail.com>
To: plan9port-dev@googlegroups.com, 9fans@9fans.net
Subject: Re: tiny rio hack: Delete
Date: Mon, 8 Feb 2010 18:58:25 -0600
Message-ID: <3df301651002081658j32d4f3e9xb9f9be198153fea8@mail.gmail.com>

> [...] it has happened to me too often to select [delete] by mistake
> and to delete a window afterwards before I realized my mistake.

there is a patch on sources that allows you to change rio's linear menus
into pie menus. this allows you to associate the desired action with a
mouse gesture rather than requiring you to either remember the menu state
or to always look carefully at what you're doing. since i began using pie
menus with rio, my rate of absent-minded window loss has sharply dropped


satisfaction guaranteed. and thank you to whoever wrote the patch

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

* Re: [9fans] tiny rio hack: Delete
  2010-02-09  9:09   ` Mathieu Lonjaret
@ 2010-02-09  9:36     ` cinap_lenrek
  2010-02-09 21:59       ` Michaelian Ennis
  0 siblings, 1 reply; 6+ messages in thread
From: cinap_lenrek @ 2010-02-09  9:36 UTC (permalink / raw)
  To: mathieu.lonjaret; +Cc: 9fans, plan9port-dev

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

20h did the first pie menu patch that is available on sources as a
real patch so the credit goes to him:

/n/sources/patch/sorry/piemenus-rio

used this for a long time but hidden window items cause the position
of the static items to change destroying the benefit of pie menus
where you can remember the direction of the action and then use it
blindly without scanning the pie.

what i did was write my own piemenu implementation using another
packing algo and adding sub menus to separate the dynamic
items.

/n/sources/contrib/cinap_lenrek/pierio

didnt release it as a patch because i did some other modifications
to rio like focus follows mouse and window cycling by keyboard
so that dir above contains all of this.

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 9749 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 145 bytes --]

I knew about that patch but I wanted to change the least possible to
the original code.

I think cinap is the one who did the pie menus btw.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 6755 bytes --]

From: michael block <michaelmuffin@gmail.com>
To: plan9port-dev@googlegroups.com, 9fans@9fans.net
Subject: Re: tiny rio hack: Delete
Date: Mon, 8 Feb 2010 18:58:25 -0600
Message-ID: <3df301651002081658j32d4f3e9xb9f9be198153fea8@mail.gmail.com>

> [...] it has happened to me too often to select [delete] by mistake
> and to delete a window afterwards before I realized my mistake.

there is a patch on sources that allows you to change rio's linear menus
into pie menus. this allows you to associate the desired action with a
mouse gesture rather than requiring you to either remember the menu state
or to always look carefully at what you're doing. since i began using pie
menus with rio, my rate of absent-minded window loss has sharply dropped


satisfaction guaranteed. and thank you to whoever wrote the patch

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

* Re: [9fans] tiny rio hack: Delete
  2010-02-09  9:36     ` [9fans] " cinap_lenrek
@ 2010-02-09 21:59       ` Michaelian Ennis
  2010-02-09 22:26         ` Federico G. Benavento
  0 siblings, 1 reply; 6+ messages in thread
From: Michaelian Ennis @ 2010-02-09 21:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Feb 9, 2010 at 4:36 AM,  <cinap_lenrek@gmx.de> wrote:

> /n/sources/contrib/cinap_lenrek/pierio

Even after rebuilding libdraw with piemenuhit I get an error.

pie: incompatible type signatures 951b2e20(rio.8) and
cbecf6bf(/386/lib/libdraw.a(piemenuhit)) for piemenuhit

Ian



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

* Re: [9fans] tiny rio hack: Delete
  2010-02-09 21:59       ` Michaelian Ennis
@ 2010-02-09 22:26         ` Federico G. Benavento
  0 siblings, 0 replies; 6+ messages in thread
From: Federico G. Benavento @ 2010-02-09 22:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

piemenuhit's prototype has to be visible when it's called

On Tue, Feb 9, 2010 at 7:59 PM, Michaelian Ennis
<michaelian.ennis@gmail.com> wrote:
> On Tue, Feb 9, 2010 at 4:36 AM,  <cinap_lenrek@gmx.de> wrote:
>
>> /n/sources/contrib/cinap_lenrek/pierio
>
> Even after rebuilding libdraw with piemenuhit I get an error.
>
> pie: incompatible type signatures 951b2e20(rio.8) and
> cbecf6bf(/386/lib/libdraw.a(piemenuhit)) for piemenuhit
>
> Ian
>
>



-- 
Federico G. Benavento



^ 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).