9front - general discussion about 9front
 help / color / mirror / Atom feed
From: umbraticus@prosimetrum.com
To: 9front@9front.org
Subject: [9front] rio autosize on null sweep
Date: Wed, 01 Jun 2022 22:16:08 +1200	[thread overview]
Message-ID: <1891A6A1667D3B01C161961BB4CC8736@prosimetrum.com> (raw)

I tend to stack my rio windows.  If you do too you may
enjoy the patch below, which takes some inspiration
from sam and interprets a bad sweep (in practice, a
click instead of a sweep) as a request for dimensions
equal to the those of either the window clicked on or
else the whole screen.  You can still cancel a sweep
with b1 or b2.  Perhaps there's a cleverer
pseudo-tiling thing that could be hooked in here but
this was good enough for my use.

umbraticus

diff 9126ee3eea90d639f4e877c01400248581d10f65 uncommitted
--- a//sys/src/cmd/rio/rio.c
+++ b//sys/src/cmd/rio/rio.c
@@ -805,6 +805,7 @@
 sweep(void)
 {
 	Image *i, *oi;
+	Window *w;
 	Rectangle r;
 	Point p0, p;
 
@@ -837,8 +838,13 @@
 	}
 	if(mouse->buttons != 0)
 		goto Rescue;
-	if(i==nil || !goodrect(r))
-		goto Rescue;
+	if(i == nil || !goodrect(r)){
+		w = wpointto(p0);
+		r = w == nil ? screen->r : w->screenr;
+		i = allocwindow(wscreen, r, Refnone, DNofill);
+		if(i == nil)
+			goto Rescue;
+	}
 	oi = i;
 	i = allocwindow(wscreen, oi->r, Refbackup, DNofill);
 	freeimage(oi);

             reply	other threads:[~2022-06-01 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 10:16 umbraticus [this message]
2022-06-01 18:25 ` qwx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1891A6A1667D3B01C161961BB4CC8736@prosimetrum.com \
    --to=umbraticus@prosimetrum.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).