9front - general discussion about 9front
 help / color / mirror / Atom feed
* rio exit menu
@ 2018-12-09 20:26 qwx
  2018-12-09 20:38 ` [9front] " Julius Schmidt
  2018-12-13 10:44 ` Ethan Gardener
  0 siblings, 2 replies; 8+ messages in thread
From: qwx @ 2018-12-09 20:26 UTC (permalink / raw)
  To: 9front

Hello,

Currently, rio hides an 'Exit' entry in mouse menu 3 unless argv[0] contains
the string ".out".

The inlined patch below removes the check and exposes the entry.

While potentially dangerous, it is more convenient than manually killing a
given rio, and several people including me have been using this or similar
patches for a while.

What do you think?  Would anyone else like to see this merged?

Thanks,

qwx


diff -r 49bd5e4c9bde sys/src/cmd/rio/rio.c
--- a/sys/src/cmd/rio/rio.c	Wed Feb 07 18:53:08 2018 +0000
+++ b/sys/src/cmd/rio/rio.c	Thu Feb 15 23:00:00 2018 +0100
@@ -125,10 +125,6 @@
 	Image *i;
 	Rectangle r;
 
-	if(strstr(argv[0], ".out") == nil){
-		menu3str[Exit] = nil;
-		Hidden--;
-	}
 	initstr = nil;
 	kbdin = nil;
 	maxtab = 0;


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

* Re: [9front] rio exit menu
  2018-12-09 20:26 rio exit menu qwx
@ 2018-12-09 20:38 ` Julius Schmidt
  2018-12-09 20:53   ` Steve Simon
  2018-12-09 21:01   ` Stanley Lieber
  2018-12-13 10:44 ` Ethan Gardener
  1 sibling, 2 replies; 8+ messages in thread
From: Julius Schmidt @ 2018-12-09 20:38 UTC (permalink / raw)
  To: 9front

I'm opposed to this change.
I would kill too many rios by accident :)

On Sun, 9 Dec 2018, qwx wrote:

> Hello,
>
> Currently, rio hides an 'Exit' entry in mouse menu 3 unless argv[0] contains
> the string ".out".
>
> The inlined patch below removes the check and exposes the entry.
>
> While potentially dangerous, it is more convenient than manually killing a
> given rio, and several people including me have been using this or similar
> patches for a while.
>
> What do you think?  Would anyone else like to see this merged?
>
> Thanks,
>
> qwx
>
>
> diff -r 49bd5e4c9bde sys/src/cmd/rio/rio.c
> --- a/sys/src/cmd/rio/rio.c	Wed Feb 07 18:53:08 2018 +0000
> +++ b/sys/src/cmd/rio/rio.c	Thu Feb 15 23:00:00 2018 +0100
> @@ -125,10 +125,6 @@
> 	Image *i;
> 	Rectangle r;
>
> -	if(strstr(argv[0], ".out") == nil){
> -		menu3str[Exit] = nil;
> -		Hidden--;
> -	}
> 	initstr = nil;
> 	kbdin = nil;
> 	maxtab = 0;
>


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

* Re: [9front] rio exit menu
  2018-12-09 20:38 ` [9front] " Julius Schmidt
@ 2018-12-09 20:53   ` Steve Simon
  2018-12-09 21:01   ` Stanley Lieber
  1 sibling, 0 replies; 8+ messages in thread
From: Steve Simon @ 2018-12-09 20:53 UTC (permalink / raw)
  To: 9front

I agree with aiju, don't do it.

-Steve


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

* Re: [9front] rio exit menu
  2018-12-09 20:38 ` [9front] " Julius Schmidt
  2018-12-09 20:53   ` Steve Simon
@ 2018-12-09 21:01   ` Stanley Lieber
  2018-12-09 21:03     ` hiro
  1 sibling, 1 reply; 8+ messages in thread
From: Stanley Lieber @ 2018-12-09 21:01 UTC (permalink / raw)
  To: 9front

I agree with Julius.

Serious question: When and why do you need to kill rio cleanly?

sl



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

* Re: [9front] rio exit menu
  2018-12-09 21:01   ` Stanley Lieber
@ 2018-12-09 21:03     ` hiro
  2018-12-09 21:29       ` qwx
  2018-12-13  8:56       ` Ethan Gardener
  0 siblings, 2 replies; 8+ messages in thread
From: hiro @ 2018-12-09 21:03 UTC (permalink / raw)
  To: 9front

when you want to reuse the window.


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

* Re: [9front] rio exit menu
  2018-12-09 21:03     ` hiro
@ 2018-12-09 21:29       ` qwx
  2018-12-13  8:56       ` Ethan Gardener
  1 sibling, 0 replies; 8+ messages in thread
From: qwx @ 2018-12-09 21:29 UTC (permalink / raw)
  To: 9front

Fair enough.  Calling off the paratroops.

Fwiw, I use subrios a lot, and it comes handy.

Thanks!

qwx


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

* Re: [9front] rio exit menu
  2018-12-09 21:03     ` hiro
  2018-12-09 21:29       ` qwx
@ 2018-12-13  8:56       ` Ethan Gardener
  1 sibling, 0 replies; 8+ messages in thread
From: Ethan Gardener @ 2018-12-13  8:56 UTC (permalink / raw)
  To: 9front

On Sun, Dec 9, 2018, at 9:03 PM, hiro wrote:
> when you want to reuse the window.

I used it to close the window, being tidier and sometimes more accessible than selecting Delete in the parent.  Come to think of it, I didn't close subrios very often.  It only got used when I was shutting down to get the window out of the way so I didn't think its contents (extra editors) still needed to be closed properly.

I'm starting to think that old patch of mine shouldn't have worked when it did, calling emouse from a program which doesn't normally include event.h.  Yay for blundering into functionality.  I remember doing that & then fixing it at a later date, but can't remember how (or how well) I fixed it.


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

* Re: [9front] rio exit menu
  2018-12-09 20:26 rio exit menu qwx
  2018-12-09 20:38 ` [9front] " Julius Schmidt
@ 2018-12-13 10:44 ` Ethan Gardener
  1 sibling, 0 replies; 8+ messages in thread
From: Ethan Gardener @ 2018-12-13 10:44 UTC (permalink / raw)
  To: 9front

More complete patch, only because it turned up as a preliminary to what I intended to do.  I can't post it on my contrib now although I do think that's the best place for such patches.  I'm too stressed to look up how.

diff -c /sys/src/cmd/rio/rio.c rio_exit_conf/rio.c
/sys/src/cmd/rio/rio.c:52,57 - rio_exit_conf/rio.c:52,58
  	Delete,
  	Hide,
  	Exit,
+ 	Hidden,
  };
  
  enum
/sys/src/cmd/rio/rio.c:81,88 - rio_exit_conf/rio.c:82,87
  	menu2str
  };
  
- int	Hidden = Exit+1;
- 
  char		*menu3str[100] = {
   [New]		"New",
   [Reshape]	"Resize",
/sys/src/cmd/rio/rio.c:124,133 - rio_exit_conf/rio.c:123,128
  	Image *i;
  	Rectangle r;
  
- 	if(strstr(argv[0], ".out") == nil){
- 		menu3str[Exit] = nil;
- 		Hidden--;
- 	}
  	initstr = nil;
  	kbdin = nil;
  	maxtab = 0;
/sys/src/cmd/rio/rio.c:730,740 - rio_exit_conf/rio.c:725,732
  		hide();
  		break;
  	case Exit:
- 		if(Hidden > Exit){
- 			send(exitchan, nil);
- 			break;
- 		}
- 		/* else fall through */
+ 		send(exitchan, nil);
+ 		break;
  	default:
  		unhide(i);
  		break;


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

end of thread, other threads:[~2018-12-13 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 20:26 rio exit menu qwx
2018-12-09 20:38 ` [9front] " Julius Schmidt
2018-12-09 20:53   ` Steve Simon
2018-12-09 21:01   ` Stanley Lieber
2018-12-09 21:03     ` hiro
2018-12-09 21:29       ` qwx
2018-12-13  8:56       ` Ethan Gardener
2018-12-13 10:44 ` Ethan Gardener

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