Fix lots of warnings.
Incorporate changes from Andrey Mirtchovski.
This commit is contained in:
parent
64044a070a
commit
e62ba5ec0b
9 changed files with 58 additions and 25 deletions
|
|
@ -1,5 +1,8 @@
|
|||
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
|
@ -124,7 +127,7 @@ top(Client *c)
|
|||
}
|
||||
l = &cc->next;
|
||||
}
|
||||
fprintf(stderr, "9wm: %x not on client list in top()\n", c);
|
||||
fprintf(stderr, "9wm: %p not on client list in top()\n", c);
|
||||
}
|
||||
|
||||
Client *
|
||||
|
|
|
|||
|
|
@ -144,5 +144,8 @@ extern int numhidden;
|
|||
extern char *b3items[];
|
||||
extern Menu b3menu;
|
||||
|
||||
/* manage.c */
|
||||
extern int isNew;
|
||||
|
||||
/* error.c */
|
||||
extern int ignore_badwindow;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
|
@ -35,9 +36,9 @@ handler(Display *d, XErrorEvent *e)
|
|||
sprintf(number, "%d", e->request_code);
|
||||
XGetErrorDatabaseText(d, "XRequest", number, "", req, sizeof(req));
|
||||
if (req[0] == '\0')
|
||||
sprintf(req, "<request-code-%d>", e->request_code);
|
||||
sprintf(req, "<request-code-%d>", (int)e->request_code);
|
||||
|
||||
fprintf(stderr, "9wm: %s(0x%x): %s\n", req, e->resourceid, msg);
|
||||
fprintf(stderr, "9wm: %s(0x%x): %s\n", req, (int)e->resourceid, msg);
|
||||
|
||||
if (initting) {
|
||||
fprintf(stderr, "9wm: failure during initialisation; aborting\n");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
|
@ -90,6 +91,7 @@ mainloop(int shape_event)
|
|||
case ConfigureNotify:
|
||||
case MapNotify:
|
||||
case MappingNotify:
|
||||
case GraphicsExpose:
|
||||
/* not interested */
|
||||
trace("ignore", 0, &ev);
|
||||
break;
|
||||
|
|
@ -173,8 +175,8 @@ mapreq(XMapRequestEvent *e)
|
|||
|
||||
if (c == 0 || c->window != e->window) {
|
||||
/* workaround for stupid NCDware */
|
||||
fprintf(stderr, "9wm: bad mapreq c %x w %x, rescanning\n",
|
||||
c, e->window);
|
||||
fprintf(stderr, "9wm: 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);
|
||||
|
|
@ -305,11 +307,11 @@ clientmesg(XClientMessageEvent *e)
|
|||
}
|
||||
else
|
||||
fprintf(stderr, "9wm: WM_CHANGE_STATE: format %d data %d w 0x%x\n",
|
||||
e->format, e->data.l[0], e->window);
|
||||
(int)e->format, (int)e->data.l[0], (int)e->window);
|
||||
return;
|
||||
}
|
||||
fprintf(stderr, "9wm: strange ClientMessage, type 0x%x window 0x%x\n",
|
||||
e->message_type, e->window);
|
||||
(int)e->message_type, (int)e->window);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
#define trace(s, c, e)
|
||||
#endif
|
||||
|
||||
#define setstate setstate9wm
|
||||
|
||||
|
||||
/* color.c */
|
||||
unsigned long colorpixel(Display*, int, unsigned long);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ menuhit(XButtonEvent *e, Menu *m)
|
|||
XEvent ev;
|
||||
int i, n, cur, old, wide, high, status, drawn, warp;
|
||||
int x, y, dx, dy, xmax, ymax;
|
||||
int tx, ty;
|
||||
ScreenInfo *s;
|
||||
|
||||
if (font == 0)
|
||||
|
|
@ -231,10 +230,12 @@ sweepcalc(Client *c, int x, int y)
|
|||
dx = x - c->x;
|
||||
dy = y - c->y;
|
||||
sx = sy = 1;
|
||||
x += dx;
|
||||
if (dx < 0) {
|
||||
dx = -dx;
|
||||
sx = -1;
|
||||
}
|
||||
y += dy;
|
||||
if (dy < 0) {
|
||||
dy = -dy;
|
||||
sy = -1;
|
||||
|
|
@ -268,8 +269,8 @@ sweepcalc(Client *c, int x, int y)
|
|||
void
|
||||
dragcalc(Client *c, int x, int y)
|
||||
{
|
||||
c->x = x;
|
||||
c->y = y;
|
||||
c->x += x;
|
||||
c->y += y;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -366,9 +367,12 @@ sweepdrag(Client *c, XButtonEvent *e0, void (*recalc)(Client*, int, int))
|
|||
c->dx += 2*BORDER;
|
||||
c->dy += 2*BORDER;
|
||||
if (e0) {
|
||||
getmouse(&c->x, &c->y, c->screen);
|
||||
/*
|
||||
c->x = cx = e0->x;
|
||||
c->y = cy = e0->y;
|
||||
recalc(c, e0->x, e0->y);
|
||||
*/
|
||||
}
|
||||
else
|
||||
getmouse(&cx, &cy, c->screen);
|
||||
|
|
@ -387,7 +391,10 @@ sweepdrag(Client *c, XButtonEvent *e0, void (*recalc)(Client*, int, int))
|
|||
XGrabServer(dpy);
|
||||
idle = 0;
|
||||
}
|
||||
recalc(c, rx, ry);
|
||||
if(e0)
|
||||
recalc(c, rx, ry);
|
||||
else
|
||||
recalc(c, rx-cx, ry-cy);
|
||||
cx = rx;
|
||||
cy = ry;
|
||||
drawbound(c, 1);
|
||||
|
|
@ -405,7 +412,6 @@ sweepdrag(Client *c, XButtonEvent *e0, void (*recalc)(Client*, int, int))
|
|||
XUngrabServer(dpy);
|
||||
if (e->button != Button3 && c->init)
|
||||
goto bad;
|
||||
recalc(c, ev.xbutton.x, ev.xbutton.y);
|
||||
if (c->dx < 0) {
|
||||
c->x += c->dx;
|
||||
c->dx = -c->dx;
|
||||
|
|
@ -466,13 +472,6 @@ drag(Client *c)
|
|||
ScreenInfo *s;
|
||||
|
||||
s = c->screen;
|
||||
if (c->init)
|
||||
setmouse(c->x-BORDER, c->y-BORDER, s);
|
||||
else {
|
||||
getmouse(&c->x, &c->y, s); /* start at current mouse pos */
|
||||
c->x += BORDER;
|
||||
c->y += BORDER;
|
||||
}
|
||||
status = grab(s->root, s->root, ButtonMask, s->boxcurs, 0);
|
||||
if (status != GrabSuccess) {
|
||||
graberror("drag", status); /* */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
|
@ -47,7 +49,8 @@ Atom _9wm_hold_mode;
|
|||
char *fontlist[] = {
|
||||
"lucm.latin1.9",
|
||||
"blit",
|
||||
"lucidasanstypewriter-bold-10",
|
||||
"*-lucidatypewriter-bold-*-14-*-75-*",
|
||||
"*-lucidatypewriter-medium-*-12-*-75-*",
|
||||
"9x15bold",
|
||||
"fixed",
|
||||
"*",
|
||||
|
|
@ -66,8 +69,9 @@ main(int argc, char *argv[])
|
|||
{
|
||||
int i, background, do_exit, do_restart;
|
||||
char *fname;
|
||||
int shape_event, dummy;
|
||||
int shape_event;
|
||||
|
||||
shape_event = 0;
|
||||
myargv = argv; /* for restart */
|
||||
|
||||
do_exit = do_restart = 0;
|
||||
|
|
@ -195,6 +199,7 @@ main(int argc, char *argv[])
|
|||
scanwins(&screens[i]);
|
||||
|
||||
mainloop(shape_event);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
|
@ -9,6 +10,8 @@
|
|||
#include "dat.h"
|
||||
#include "fns.h"
|
||||
|
||||
int isNew;
|
||||
|
||||
int
|
||||
manage(Client *c, int mapped)
|
||||
{
|
||||
|
|
@ -25,7 +28,11 @@ manage(Client *c, int mapped)
|
|||
if (XGetClassHint(dpy, c->window, &class) != 0) { /* ``Success'' */
|
||||
c->instance = class.res_name;
|
||||
c->class = class.res_class;
|
||||
c->is9term = (strcmp(c->class, "9term") == 0);
|
||||
c->is9term = 0;
|
||||
if(isNew){
|
||||
c->is9term = strstr(c->class, "term") || strstr(c->class, "Term");
|
||||
isNew = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->instance = 0;
|
||||
|
|
@ -257,7 +264,7 @@ gravitate(Client *c, int invert)
|
|||
dy = 2*delta;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "9wm: bad window gravity %d for 0x%x\n", gravity, c->window);
|
||||
fprintf(stderr, "9wm: bad window gravity %d for 0x%x\n", gravity, (int)c->window);
|
||||
return;
|
||||
}
|
||||
dx += BORDER;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
|
@ -102,6 +105,13 @@ button(XButtonEvent *e)
|
|||
void
|
||||
spawn(ScreenInfo *s)
|
||||
{
|
||||
/*
|
||||
* ugly dance to cause sweeping for terminals.
|
||||
* the very next window created will require sweeping.
|
||||
* hope it's created by the program we're about to
|
||||
* exec!
|
||||
*/
|
||||
isNew = 1;
|
||||
/*
|
||||
* ugly dance to avoid leaving zombies. Could use SIGCHLD,
|
||||
* but it's not very portable.
|
||||
|
|
@ -206,7 +216,7 @@ unhide(int n, int map)
|
|||
c = hiddenc[n];
|
||||
if (!hidden(c)) {
|
||||
fprintf(stderr, "9wm: unhide: not hidden: %s(0x%x)\n",
|
||||
c->label, c->window);
|
||||
c->label, (int)c->window);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -237,7 +247,7 @@ unhidec(Client *c, int map)
|
|||
return;
|
||||
}
|
||||
fprintf(stderr, "9wm: unhidec: not hidden: %s(0x%x)\n",
|
||||
c->label, c->window);
|
||||
c->label, (int)c->window);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue