From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23666 invoked from network); 1 Jun 2022 10:18:41 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 1 Jun 2022 10:18:41 -0000 Received: from asquith.prosimetrum.com ([125.236.209.157]) by 9front; Wed Jun 1 06:16:00 -0400 2022 Message-ID: <1891A6A1667D3B01C161961BB4CC8736@prosimetrum.com> Date: Wed, 01 Jun 2022 22:16:08 +1200 From: umbraticus@prosimetrum.com To: 9front@9front.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: browser-scale reduce/map full-stack full-stack interface Subject: [9front] rio autosize on null sweep Reply-To: 9front@9front.org Precedence: bulk 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);