9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Easily create/move window on left/right half of the screen
@ 2013-05-13 17:33 Costin Chirvasuta
  0 siblings, 0 replies; only message in thread
From: Costin Chirvasuta @ 2013-05-13 17:33 UTC (permalink / raw)
  To: 9fans

Hello,

I made this quick little hack to do what the subject says.
Sharing for anyone who might find it useful.

diff /n/sources/plan9/sys/src/cmd/rio/rio.c /sys/src/cmd/rio/rio.c
779a780,802
>         if(mouse->buttons == 0 && eqpt(mouse->xy, p)){
>             p = onscreen(mouse->xy);
>             if(p.x < screen->clipr.min.x + 10){
>                 p0.x = screen->clipr.min.x;
>                 p0.y = screen->clipr.min.y;
>                 p.x = (screen->clipr.max.x + screen->clipr.min.x) / 2;
>                 p.y = screen->clipr.max.y;
>             }else if(p.x > screen->clipr.max.x - 10){
>                 p0.x = (screen->clipr.max.x + screen->clipr.min.x) / 2;
>                 p0.y = screen->clipr.min.y;
>                 p.x = screen->clipr.max.x;
>                 p.y = screen->clipr.max.y;
>             }else
>                 break;
>             r = Rect(p0.x, p0.y, p.x, p.y);
>             i = allocwindow(wscreen, r, Refnone, 0xEEEEEEFF);
>             freeimage(oi);
>             if(i == nil)
>                 goto Rescue;
>             border(i, r, Selborder, red, ZP);
>             flushimage(display, 1);
>             break;
>         }



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-13 17:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 17:33 [9fans] Easily create/move window on left/right half of the screen Costin Chirvasuta

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