* [9front] rio autosize on null sweep
@ 2022-06-01 10:16 umbraticus
2022-06-01 18:25 ` qwx
0 siblings, 1 reply; 2+ messages in thread
From: umbraticus @ 2022-06-01 10:16 UTC (permalink / raw)
To: 9front
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [9front] rio autosize on null sweep
2022-06-01 10:16 [9front] rio autosize on null sweep umbraticus
@ 2022-06-01 18:25 ` qwx
0 siblings, 0 replies; 2+ messages in thread
From: qwx @ 2022-06-01 18:25 UTC (permalink / raw)
To: 9front
On Wed Jun 1 12:17:35 +0200 2022, umbraticus@prosimetrum.com wrote:
> 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
Nice, thanks :)
Cheers,
qwx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-01 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01 10:16 [9front] rio autosize on null sweep umbraticus
2022-06-01 18:25 ` qwx
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).