This commit is contained in:
rsc 2004-04-19 19:35:17 +00:00
parent c2a9c3bb4e
commit aa8086853b
13 changed files with 98 additions and 63 deletions

31
CHANGES
View file

@ -1,3 +1,34 @@
April 19, 2004
lots of man page updates.
fix bug in comm, reported by Taj Khattra.
add libmach, db, acid
April 18, 2004
add utf-8 input support from david tolpin.
pick up rog's acme fixes w.r.t. cut and paste
small fixes to ps, B, web
more types in u.h
man page nits
make gzip, bzip2 work with gnu tar
add fmt, tweak
change misc/ding checkboxes to be smaller
April 17, 2004
make 9term work a bit better w.r.t. terminal modes
April 14, 2004
add look. thanks to Taj Khattra.

View file

@ -191,9 +191,10 @@ usage(void)
void
threadmain(int argc, char *argv[])
{
char *p;
char *p, *font;
rfork(RFNOTEG);
font = nil;
_wantfocuschanges = 1;
mainpid = getpid();
ARGBEGIN{
@ -202,6 +203,9 @@ threadmain(int argc, char *argv[])
case 'a': /* acme mode */
button2exec++;
break;
case 'f':
font = EARGF(usage());
break;
case 's':
scrolling++;
break;
@ -210,6 +214,9 @@ threadmain(int argc, char *argv[])
break;
}ARGEND
if(font)
putenv("font", font);
p = getenv("tabstop");
if(p == 0)
p = getenv("TABSTOP");
@ -607,9 +614,9 @@ domenu2(int but)
else
menu2str[Scroll] = "☐ scroll";
if(cooked)
menu2str[Cooked] = "cooked";
menu2str[Cooked] = "mustecho";
else
menu2str[Cooked] = "cooked";
menu2str[Cooked] = "mustecho";
switch(menuhit(but, mc, &menu2, nil)){
case -1:

View file

@ -7,7 +7,7 @@ int one;
int two;
int three;
char *ldr[3];
char ldr[3][4] = { "", "\t", "\t\t" };
Biobuf *ib1;
Biobuf *ib2;
@ -23,9 +23,6 @@ main(int argc, char *argv[])
int l;
char lb1[LB],lb2[LB];
ldr[0] = "";
ldr[1] = "\t";
ldr[2] = "\t\t";
l = 2;
ARGBEGIN{
case '1':

View file

@ -16,7 +16,7 @@ void
setactive(Client *c, int on)
{
if (c->parent == c->screen->root) {
fprintf(stderr, "9wm: bad parent in setactive; dumping core\n");
fprintf(stderr, "rio: bad parent in setactive; dumping core\n");
abort();
}
if (on) {
@ -62,7 +62,7 @@ active(Client *c)
Client *cc;
if (c == 0) {
fprintf(stderr, "9wm: active(c==0)\n");
fprintf(stderr, "rio: active(c==0)\n");
return;
}
if (c == current)
@ -131,7 +131,7 @@ top(Client *c)
}
l = &cc->next;
}
fprintf(stderr, "9wm: %p not on client list in top()\n", c);
fprintf(stderr, "rio: %p not on client list in top()\n", c);
}
Client *

View file

@ -3,7 +3,7 @@
#define BORDER _border
#define CORNER _corner
#define INSET _inset
#define MAXHIDDEN 32
#define MAXHIDDEN 128
#define B3FIXED 5
#define AllButtonMask (Button1Mask|Button2Mask|Button3Mask \
@ -147,11 +147,11 @@ extern int curtime;
extern int debug;
extern int solidsweep;
extern Atom exit_9wm;
extern Atom restart_9wm;
extern Atom exit_rio;
extern Atom restart_rio;
extern Atom wm_state;
extern Atom wm_change_state;
extern Atom _9wm_hold_mode;
extern Atom _rio_hold_mode;
extern Atom wm_protocols;
extern Atom wm_delete;
extern Atom wm_take_focus;

View file

@ -13,7 +13,7 @@ int ignore_badwindow;
void
fatal(char *s)
{
fprintf(stderr, "9wm: ");
fprintf(stderr, "rio: ");
perror(s);
fprintf(stderr, "\n");
exit(1);
@ -25,7 +25,7 @@ handler(Display *d, XErrorEvent *e)
char msg[80], req[80], number[80];
if (initting && (e->request_code == X_ChangeWindowAttributes) && (e->error_code == BadAccess)) {
fprintf(stderr, "9wm: it looks like there's already a window manager running; 9wm not started\n");
fprintf(stderr, "rio: it looks like there's already a window manager running; rio not started\n");
exit(1);
}
@ -38,10 +38,10 @@ handler(Display *d, XErrorEvent *e)
if (req[0] == '\0')
sprintf(req, "<request-code-%d>", (int)e->request_code);
fprintf(stderr, "9wm: %s(0x%x): %s\n", req, (int)e->resourceid, msg);
fprintf(stderr, "rio: %s(0x%x): %s\n", req, (int)e->resourceid, msg);
if (initting) {
fprintf(stderr, "9wm: failure during initialisation; aborting\n");
fprintf(stderr, "rio: failure during initialisation; aborting\n");
exit(1);
}
return 0;
@ -69,10 +69,10 @@ graberror(char *f, int err)
case GrabSuccess:
return;
default:
fprintf(stderr, "9wm: %s: grab error: %d\n", f, err);
fprintf(stderr, "rio: %s: grab error: %d\n", f, err);
return;
}
fprintf(stderr, "9wm: %s: grab error: %s\n", f, s);
fprintf(stderr, "rio: %s: grab error: %s\n", f, s);
#endif
}
@ -85,7 +85,7 @@ graberror(char *f, int err)
void
dotrace(char *s, Client *c, XEvent *e)
{
fprintf(stderr, "9wm: %s: c=0x%x", s, c);
fprintf(stderr, "rio: %s: c=0x%x", s, c);
if (c)
fprintf(stderr, " x %d y %d dx %d dy %d w 0x%x parent 0x%x", c->x, c->y, c->dx, c->dy, c->window, c->parent);
#ifdef DEBUG_EV

View file

@ -32,7 +32,7 @@ mainloop(int shape_event)
shapenotify((XShapeEvent *)&ev);
else
#endif
fprintf(stderr, "9wm: unknown ev.type %d\n", ev.type);
fprintf(stderr, "rio: unknown ev.type %d\n", ev.type);
break;
case ButtonPress:
button(&ev.xbutton);
@ -67,13 +67,13 @@ mainloop(int shape_event)
property(&ev.xproperty);
break;
case SelectionClear:
fprintf(stderr, "9wm: SelectionClear (this should not happen)\n");
fprintf(stderr, "rio: SelectionClear (this should not happen)\n");
break;
case SelectionNotify:
fprintf(stderr, "9wm: SelectionNotify (this should not happen)\n");
fprintf(stderr, "rio: SelectionNotify (this should not happen)\n");
break;
case SelectionRequest:
fprintf(stderr, "9wm: SelectionRequest (this should not happen)\n");
fprintf(stderr, "rio: SelectionRequest (this should not happen)\n");
break;
case EnterNotify:
enter(&ev.xcrossing);
@ -180,13 +180,13 @@ mapreq(XMapRequestEvent *e)
if (c == 0 || c->window != e->window) {
/* workaround for stupid NCDware */
fprintf(stderr, "9wm: bad mapreq c %p w %x, rescanning\n",
fprintf(stderr, "rio: bad mapreq c %p w %x, rescanning\n",
c, (int)e->window);
for (i = 0; i < num_screens; i++)
scanwins(&screens[i]);
c = getclient(e->window, 0);
if (c == 0 || c->window != e->window) {
fprintf(stderr, "9wm: window not found after rescan\n");
fprintf(stderr, "rio: window not found after rescan\n");
return;
}
}
@ -293,15 +293,15 @@ clientmesg(XClientMessageEvent *e)
Client *c;
curtime = CurrentTime;
if (e->message_type == exit_9wm) {
if (e->message_type == exit_rio) {
cleanup();
exit(0);
}
if (e->message_type == restart_9wm) {
fprintf(stderr, "*** 9wm restarting ***\n");
if (e->message_type == restart_rio) {
fprintf(stderr, "*** rio restarting ***\n");
cleanup();
execvp(myargv[0], myargv);
perror("9wm: exec failed");
perror("rio: exec failed");
exit(1);
}
if (e->message_type == wm_change_state) {
@ -311,11 +311,11 @@ clientmesg(XClientMessageEvent *e)
hide(c);
}
else
fprintf(stderr, "9wm: WM_CHANGE_STATE: format %d data %d w 0x%x\n",
fprintf(stderr, "rio: WM_CHANGE_STATE: format %d data %d w 0x%x\n",
(int)e->format, (int)e->data.l[0], (int)e->window);
return;
}
fprintf(stderr, "9wm: strange ClientMessage, type 0x%x window 0x%x\n",
fprintf(stderr, "rio: strange ClientMessage, type 0x%x window 0x%x\n",
(int)e->message_type, (int)e->window);
}
@ -379,8 +379,8 @@ property(XPropertyEvent *e)
gettrans(c);
return;
}
if (a == _9wm_hold_mode) {
c->hold = getiprop(c->window, _9wm_hold_mode);
if (a == _rio_hold_mode) {
c->hold = getiprop(c->window, _rio_hold_mode);
if (c == current)
draw_border(c, 1);
}

View file

@ -6,7 +6,7 @@
#define trace(s, c, e)
#endif
#define setstate setstate9wm
#define setstate setstaterio
/* color.c */

View file

@ -125,7 +125,7 @@ menuhit(XButtonEvent *e, Menu *m)
XMaskEvent(dpy, MenuMask, &ev);
switch (ev.type) {
default:
fprintf(stderr, "9wm: menuhit: unknown ev.type %d\n", ev.type);
fprintf(stderr, "rio: menuhit: unknown ev.type %d\n", ev.type);
break;
case ButtonPress:
break;

View file

@ -39,8 +39,8 @@ int signalled;
int num_screens;
int solidsweep = 0;
Atom exit_9wm;
Atom restart_9wm;
Atom exit_rio;
Atom restart_rio;
Atom wm_state;
Atom wm_change_state;
Atom wm_protocols;
@ -48,8 +48,8 @@ Atom wm_delete;
Atom wm_take_focus;
Atom wm_lose_focus;
Atom wm_colormaps;
Atom _9wm_running;
Atom _9wm_hold_mode;
Atom _rio_running;
Atom _rio_hold_mode;
char *fontlist[] = {
"lucm.latin1.9",
@ -138,17 +138,17 @@ main(int argc, char *argv[])
if (signal(SIGHUP, sighandler) == SIG_IGN)
signal(SIGHUP, SIG_IGN);
exit_9wm = XInternAtom(dpy, "9WM_EXIT", False);
restart_9wm = XInternAtom(dpy, "9WM_RESTART", False);
exit_rio = XInternAtom(dpy, "9WM_EXIT", False);
restart_rio = XInternAtom(dpy, "9WM_RESTART", False);
curtime = -1; /* don't care */
if (do_exit) {
sendcmessage(DefaultRootWindow(dpy), exit_9wm, 0L, 1);
sendcmessage(DefaultRootWindow(dpy), exit_rio, 0L, 1);
XSync(dpy, False);
exit(0);
}
if (do_restart) {
sendcmessage(DefaultRootWindow(dpy), restart_9wm, 0L, 1);
sendcmessage(DefaultRootWindow(dpy), restart_rio, 0L, 1);
XSync(dpy, False);
exit(0);
}
@ -162,19 +162,19 @@ main(int argc, char *argv[])
wm_take_focus = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
wm_lose_focus = XInternAtom(dpy, "_9WM_LOSE_FOCUS", False);
wm_colormaps = XInternAtom(dpy, "WM_COLORMAP_WINDOWS", False);
_9wm_running = XInternAtom(dpy, "_9WM_RUNNING", False);
_9wm_hold_mode = XInternAtom(dpy, "_9WM_HOLD_MODE", False);
_rio_running = XInternAtom(dpy, "_9WM_RUNNING", False);
_rio_hold_mode = XInternAtom(dpy, "_9WM_HOLD_MODE", False);
if (fname != 0)
if ((font = XLoadQueryFont(dpy, fname)) == 0)
fprintf(stderr, "9wm: warning: can't load font %s\n", fname);
fprintf(stderr, "rio: warning: can't load font %s\n", fname);
if (font == 0) {
i = 0;
for (;;) {
fname = fontlist[i++];
if (fname == 0) {
fprintf(stderr, "9wm: warning: can't find a font\n");
fprintf(stderr, "rio: warning: can't find a font\n");
break;
}
font = XLoadQueryFont(dpy, fname);
@ -199,7 +199,7 @@ main(int argc, char *argv[])
/* set selection so that 9term knows we're running */
curtime = CurrentTime;
XSetSelectionOwner(dpy, _9wm_running, screens[0].menuwin, timestamp());
XSetSelectionOwner(dpy, _rio_running, screens[0].menuwin, timestamp());
XSync(dpy, False);
initting = 0;
@ -389,7 +389,7 @@ timestamp(void)
XEvent ev;
if (curtime == CurrentTime) {
XChangeProperty(dpy, screens[0].root, _9wm_running, _9wm_running, 8,
XChangeProperty(dpy, screens[0].root, _rio_running, _rio_running, 8,
PropModeAppend, (unsigned char *)"", 0);
XMaskEvent(dpy, PropertyChangeMask, &ev);
curtime = ev.xproperty.time;
@ -418,7 +418,7 @@ sendcmessage(Window w, Atom a, long x, int isroot)
mask = ExposureMask; /* not really correct but so be it */
status = XSendEvent(dpy, w, False, mask, &ev);
if (status == 0)
fprintf(stderr, "9wm: sendcmessage failed\n");
fprintf(stderr, "rio: sendcmessage failed\n");
}
void
@ -472,11 +472,11 @@ getevent(XEvent *e)
return;
}
if (errno != EINTR || !signalled) {
perror("9wm: select failed");
perror("rio: select failed");
exit(1);
}
}
fprintf(stderr, "9wm: exiting on signal\n");
fprintf(stderr, "rio: exiting on signal\n");
cleanup();
exit(1);
}

View file

@ -52,7 +52,7 @@ manage(Client *c, int mapped)
getproto(c);
gettrans(c);
if (c->is9term)
c->hold = getiprop(c->window, _9wm_hold_mode);
c->hold = getiprop(c->window, _rio_hold_mode);
/* Figure out what to do with the window from hints */
@ -299,7 +299,7 @@ gravitate(Client *c, int invert)
dy = 2*delta;
break;
default:
fprintf(stderr, "9wm: bad window gravity %d for 0x%x\n", gravity, (int)c->window);
fprintf(stderr, "rio: bad window gravity %d for 0x%x\n", gravity, (int)c->window);
return;
}
dx += BORDER;

View file

@ -140,12 +140,12 @@ spawn(ScreenInfo *s)
putenv(s->display);
if (termprog != NULL) {
execl(shell, shell, "-c", termprog, 0);
fprintf(stderr, "9wm: exec %s", shell);
fprintf(stderr, "rio: exec %s", shell);
perror(" failed");
}
execlp("9term", "9term", "-w", 0);
execlp("xterm", "xterm", "-ut", 0);
perror("9wm: exec 9term/xterm failed");
perror("rio: exec 9term/xterm failed");
exit(1);
}
exit(0);
@ -206,7 +206,7 @@ hide(Client *c)
if (c == 0 || numhidden == MAXHIDDEN)
return;
if (hidden(c)) {
fprintf(stderr, "9wm: already hidden: %s\n", c->label);
fprintf(stderr, "rio: already hidden: %s\n", c->label);
return;
}
XUnmapWindow(dpy, c->parent);
@ -227,12 +227,12 @@ unhide(int n, int map)
int i;
if (n >= numhidden) {
fprintf(stderr, "9wm: unhide: n %d numhidden %d\n", n, numhidden);
fprintf(stderr, "rio: unhide: n %d numhidden %d\n", n, numhidden);
return;
}
c = hiddenc[n];
if (!hidden(c)) {
fprintf(stderr, "9wm: unhide: not hidden: %s(0x%x)\n",
fprintf(stderr, "rio: unhide: not hidden: %s(0x%x)\n",
c->label, (int)c->window);
return;
}
@ -263,7 +263,7 @@ unhidec(Client *c, int map)
unhide(i, map);
return;
}
fprintf(stderr, "9wm: unhidec: not hidden: %s(0x%x)\n",
fprintf(stderr, "rio: unhidec: not hidden: %s(0x%x)\n",
c->label, (int)c->window);
}

View file

@ -8,6 +8,6 @@ $LIB: $OFILES
all install:V: $LIB
NUKEFILES=$NUKEFILES $LIB
CLEANFILES=$CLEANFILES $LIB
<$PLAN9/src/mkcommon