diff options
author | rsc <devnull@localhost> | 2004-03-29 12:00:15 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-29 12:00:15 +0000 |
commit | 1cb3fa80938299775382766b4b754e6220bf9831 (patch) | |
tree | bb33cdf36f2b18c2708286938a56f61569b5e1a6 /src/cmd/rio/main.c | |
parent | d99b2f34e69bc363c2973a2473e75654196ab40e (diff) | |
download | plan9port-1cb3fa80938299775382766b4b754e6220bf9831.tar.gz plan9port-1cb3fa80938299775382766b4b754e6220bf9831.tar.bz2 plan9port-1cb3fa80938299775382766b4b754e6220bf9831.zip |
Border resizing by dragging.
Thanks to Axel Belinfante.
Diffstat (limited to 'src/cmd/rio/main.c')
-rw-r--r-- | src/cmd/rio/main.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/cmd/rio/main.c b/src/cmd/rio/main.c index 02929773..2eb63867 100644 --- a/src/cmd/rio/main.c +++ b/src/cmd/rio/main.c @@ -31,6 +31,7 @@ char *termprog; char *shell; Bool shape; int _border = 4; +int _corner = 25; int _inset = 1; int curtime; int debug; @@ -236,13 +237,13 @@ initscreen(ScreenInfo *s, int i, int background) else s->display[0] = '\0'; - s->activeholdborder = colorpixel(dpy, s->depth, 0x000099); - s->inactiveholdborder = colorpixel(dpy, s->depth, 0x005DBB); - s->activeborder = colorpixel(dpy, s->depth ,0x55AAAA); - s->inactiveborder = colorpixel(dpy, s->depth, 0x9EEEEE); - s->red = colorpixel(dpy, s->depth, 0xDD0000); s->black = BlackPixel(dpy, i); s->white = WhitePixel(dpy, i); + s->activeholdborder = colorpixel(dpy, s->depth, 0x000099, s->white); + s->inactiveholdborder = colorpixel(dpy, s->depth, 0x005DBB, s->black); + s->activeborder = colorpixel(dpy, s->depth ,0x55AAAA, s->black); + s->inactiveborder = colorpixel(dpy, s->depth, 0x9EEEEE, s->white); + s->red = colorpixel(dpy, s->depth, 0xDD0000, s->white); s->width = WidthOfScreen(ScreenOfDisplay(dpy, i)); s->height = HeightOfScreen(ScreenOfDisplay(dpy, i)); s->bkup[0] = XCreatePixmap(dpy, s->root, 2*s->width, BORDER, DefaultDepth(dpy, i)); @@ -267,21 +268,21 @@ initscreen(ScreenInfo *s, int i, int background) gv.foreground = s->red; s->gcred = XCreateGC(dpy, s->root, mask, &gv); - gv.foreground = colorpixel(dpy, s->depth, 0xEEEEEE); + gv.foreground = colorpixel(dpy, s->depth, 0xEEEEEE, s->black); s->gcsweep = XCreateGC(dpy, s->root, mask, &gv); - gv.foreground = colorpixel(dpy, s->depth, 0xE9FFE9); + gv.foreground = colorpixel(dpy, s->depth, 0xE9FFE9, s->white); s->gcmenubg = XCreateGC(dpy, s->root, mask, &gv); - gv.foreground = colorpixel(dpy, s->depth, 0x448844); + gv.foreground = colorpixel(dpy, s->depth, 0x448844, s->black); s->gcmenubgs = XCreateGC(dpy, s->root, mask, &gv); gv.foreground = s->black; - gv.background = colorpixel(dpy, s->depth, 0xE9FFE9); + gv.background = colorpixel(dpy, s->depth, 0xE9FFE9, s->white); s->gcmenufg = XCreateGC(dpy, s->root, mask, &gv); - gv.foreground = colorpixel(dpy, s->depth, 0xE9FFE9); - gv.background = colorpixel(dpy, s->depth, 0x448844); + gv.foreground = colorpixel(dpy, s->depth, 0xE9FFE9, s->white); + gv.background = colorpixel(dpy, s->depth, 0x448844, s->black); s->gcmenufgs = XCreateGC(dpy, s->root, mask, &gv); initcurs(s); @@ -299,9 +300,21 @@ initscreen(ScreenInfo *s, int i, int background) XClearWindow(dpy, s->root); } else system("xsetroot -solid grey30"); - - s->menuwin = XCreateSimpleWindow(dpy, s->root, 0, 0, 1, 1, 2, colorpixel(dpy, s->depth, 0x88CC88), colorpixel(dpy, s->depth, 0xE9FFE9)); - s->sweepwin = XCreateSimpleWindow(dpy, s->root, 0, 0, 1, 1, 4, s->red, colorpixel(dpy, s->depth, 0xEEEEEE)); + s->menuwin = XCreateSimpleWindow(dpy, s->root, 0, 0, 1, 1, 2, colorpixel(dpy, s->depth, 0x88CC88, s->black), colorpixel(dpy, s->depth, 0xE9FFE9, s->white)); + // s->sweepwin = XCreateWindow(dpy, s->root, 0, 0, 1, 1, 4, s->red, colorpixel(dpy, s->depth, 0xEEEEEE, s->black)); + { + XSetWindowAttributes attrs; + attrs.background_pixel = colorpixel(dpy, s->depth, 0xEEEEEE, s->black); + attrs.border_pixel = s->red; + attrs.save_under = True; + s->sweepwin = XCreateWindow(dpy, s->root, 0, 0, 1, 1, 4, + CopyFromParent, + CopyFromParent, + CopyFromParent, + CWBackPixel | CWBorderPixel | CWSaveUnder, + &attrs + ); + } } ScreenInfo* |