mirror of https://github.com/0intro/wmii
Fix printing of client ids.
This commit is contained in:
parent
183db1ad92
commit
e8951a9d7d
|
@ -439,10 +439,17 @@ kill_client(Client * c) {
|
|||
}
|
||||
|
||||
void
|
||||
fullscreen(Client *c, Bool fullscreen) {
|
||||
fullscreen(Client *c, int fullscreen) {
|
||||
Frame *f;
|
||||
|
||||
if(fullscreen == Toggle)
|
||||
fullscreen = c->fullscreen ^ On;
|
||||
if(fullscreen == c->fullscreen)
|
||||
return;
|
||||
|
||||
write_event("Fullscreen %C %s\n", c, (fullscreen ? "on" : "off"));
|
||||
c->fullscreen = fullscreen;
|
||||
|
||||
if((f = c->sel)) {
|
||||
if(fullscreen) {
|
||||
if(!f->area->floating)
|
||||
|
@ -455,12 +462,15 @@ fullscreen(Client *c, Bool fullscreen) {
|
|||
}
|
||||
|
||||
void
|
||||
set_urgent(Client *c, Bool urgent, Bool write) {
|
||||
set_urgent(Client *c, int urgent, Bool write) {
|
||||
XWMHints *wmh;
|
||||
char *cwrite, *cnot;
|
||||
Frame *f, *ff;
|
||||
Area *a;
|
||||
|
||||
if(urgent == Toggle)
|
||||
urgent = c->urgent ^ On;
|
||||
|
||||
cwrite = (write ? "Manager" : "Client");
|
||||
cnot = (urgent ? "" : "Not");
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
# pragma varargck type "r" void
|
||||
#endif
|
||||
|
||||
typedef struct CTuple CTuple;
|
||||
|
||||
enum Align {
|
||||
NORTH = 0x01,
|
||||
EAST = 0x02,
|
||||
|
@ -33,9 +31,10 @@ enum Align {
|
|||
NWEST = NORTH | WEST,
|
||||
SEAST = SOUTH | EAST,
|
||||
SWEST = SOUTH | WEST,
|
||||
CENTER = NEAST | SWEST
|
||||
CENTER = NEAST | SWEST,
|
||||
};
|
||||
|
||||
typedef struct CTuple CTuple;
|
||||
typedef enum Align Align;
|
||||
|
||||
struct CTuple {
|
||||
|
@ -46,7 +45,13 @@ struct CTuple {
|
|||
};
|
||||
|
||||
enum {
|
||||
Coldefault, Colstack, Colmax
|
||||
Coldefault, Colstack, Colmax,
|
||||
};
|
||||
|
||||
enum {
|
||||
Off,
|
||||
On,
|
||||
Toggle,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -54,12 +59,12 @@ enum {
|
|||
CurNECorner, CurNWCorner, CurSECorner, CurSWCorner,
|
||||
CurDHArrow, CurMove, CurInput, CurSizing, CurIcon,
|
||||
CurNone,
|
||||
CurLast
|
||||
CurLast,
|
||||
};
|
||||
|
||||
enum {
|
||||
enum {
|
||||
NCOL = 16,
|
||||
WM_PROTOCOL_DELWIN = 1
|
||||
WM_PROTOCOL_DELWIN = 1,
|
||||
};
|
||||
|
||||
/* Data Structures */
|
||||
|
|
|
@ -127,13 +127,13 @@ void* maprm(Map*, ulong);
|
|||
void* hashrm(Map*, char*);
|
||||
|
||||
/* message.c */
|
||||
char * getword(IxpMsg*);
|
||||
Area * strarea(View*, char*);
|
||||
char * message_view(View*, IxpMsg*);
|
||||
char * parse_colors(IxpMsg*, CTuple*);
|
||||
char * message_root(void*, IxpMsg*);
|
||||
char * read_root_ctl(void);
|
||||
char * message_client(Client*, IxpMsg*);
|
||||
char *getword(IxpMsg*);
|
||||
Area *strarea(View*, char*);
|
||||
char *message_view(View*, IxpMsg*);
|
||||
char *parse_colors(IxpMsg*, CTuple*);
|
||||
char *message_root(void*, IxpMsg*);
|
||||
char *read_root_ctl(void);
|
||||
char *message_client(Client*, IxpMsg*);
|
||||
char *select_area(Area*, IxpMsg*);
|
||||
char *send_client(View*, IxpMsg*, Bool swap);
|
||||
|
||||
|
|
|
@ -699,7 +699,6 @@ fs_read(Ixp9Req *r) {
|
|||
assert(!"Read called on an unreadable file");
|
||||
}
|
||||
|
||||
/* This function needs to be seriously cleaned up */
|
||||
void
|
||||
fs_write(Ixp9Req *r) {
|
||||
FileId *f;
|
||||
|
|
|
@ -12,13 +12,12 @@
|
|||
|
||||
static char
|
||||
Ebadcmd[] = "bad command",
|
||||
Ebadvalue[] = "bad value";
|
||||
Ebadvalue[] = "bad value",
|
||||
Ebadusage[] = "bad usage";
|
||||
|
||||
/* Edit |sort Edit s/"([^"]+)"/L\1/g Edit |tr 'a-z' 'A-Z' */
|
||||
enum {
|
||||
LFULLSCREEN,
|
||||
LNOTFULLSCREEN,
|
||||
LNOTURGENT,
|
||||
LURGENT,
|
||||
LBORDER,
|
||||
LCLIENT,
|
||||
|
@ -31,6 +30,8 @@ enum {
|
|||
LKILL,
|
||||
LLEFT,
|
||||
LNORMCOLORS,
|
||||
LOFF,
|
||||
LON,
|
||||
LQUIT,
|
||||
LRIGHT,
|
||||
LSELCOLORS,
|
||||
|
@ -44,8 +45,6 @@ enum {
|
|||
};
|
||||
char *symtab[] = {
|
||||
"Fullscreen",
|
||||
"NotFullscreen",
|
||||
"NotUrgent",
|
||||
"Urgent",
|
||||
"border",
|
||||
"client",
|
||||
|
@ -58,6 +57,8 @@ char *symtab[] = {
|
|||
"kill",
|
||||
"left",
|
||||
"normcolors",
|
||||
"off",
|
||||
"on",
|
||||
"quit",
|
||||
"right",
|
||||
"selcolors",
|
||||
|
@ -79,6 +80,9 @@ static int
|
|||
getsym(char *s) {
|
||||
int i, n, m, cmp;
|
||||
|
||||
if(s == nil)
|
||||
return -1;
|
||||
|
||||
n = nelem(symtab);
|
||||
i = 0;
|
||||
while(n) {
|
||||
|
@ -96,6 +100,20 @@ getsym(char *s) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
gettoggle(IxpMsg *m) {
|
||||
switch(getsym(getword(m))) {
|
||||
case LON:
|
||||
return On;
|
||||
case LOFF:
|
||||
return Off;
|
||||
case LTOGGLE:
|
||||
return Toggle;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
eatrunes(IxpMsg *m, int (*p)(Rune), int val) {
|
||||
Rune r;
|
||||
|
@ -130,7 +148,6 @@ getword(IxpMsg *m) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#define strbcmp(str, const) (strncmp((str), (const), sizeof(const)-1))
|
||||
static int
|
||||
getbase(char **s) {
|
||||
|
@ -369,6 +386,7 @@ read_root_ctl(void) {
|
|||
char *
|
||||
message_client(Client *c, IxpMsg *m) {
|
||||
char *s;
|
||||
int i;
|
||||
|
||||
s = getword(m);
|
||||
|
||||
|
@ -377,16 +395,16 @@ message_client(Client *c, IxpMsg *m) {
|
|||
kill_client(c);
|
||||
break;
|
||||
case LURGENT:
|
||||
set_urgent(c, True, True);
|
||||
break;
|
||||
case LNOTURGENT:
|
||||
set_urgent(c, False, True);
|
||||
i = gettoggle(m);
|
||||
if(i == -1)
|
||||
return Ebadusage;
|
||||
set_urgent(c, i, True);
|
||||
break;
|
||||
case LFULLSCREEN:
|
||||
fullscreen(c, True);
|
||||
break;
|
||||
case LNOTFULLSCREEN:
|
||||
fullscreen(c, False);
|
||||
i = gettoggle(m);
|
||||
if(i == -1)
|
||||
return Ebadusage;
|
||||
fullscreen(c, i);
|
||||
break;
|
||||
default:
|
||||
return Ebadcmd;
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
Point ZP = {0, 0};
|
||||
Rectangle ZR = {{0, 0}, {0, 0}};
|
||||
|
||||
Map wmap, amap;
|
||||
MapEnt *wbucket[137];
|
||||
MapEnt *abucket[137];
|
||||
static Map wmap, amap;
|
||||
static MapEnt *wbucket[137];
|
||||
static MapEnt *abucket[137];
|
||||
|
||||
XRectangle
|
||||
XRect(Rectangle r) {
|
||||
|
@ -117,7 +117,7 @@ Wfmt(Fmt *f) {
|
|||
Window *w;
|
||||
|
||||
w = va_arg(f->args, Window*);
|
||||
return fmtprint(f, "0x%ux", w);
|
||||
return fmtprint(f, "0x%ux", w->w);
|
||||
}
|
||||
|
||||
/* Init */
|
||||
|
|
|
@ -215,7 +215,7 @@ fn Key-$MODKEY-p { ifs=() { run_command `{wmiimenu <$progs_file} & } }
|
|||
fn Key-$MODKEY-Return { run_command $WMII_TERM & }
|
||||
fn Key-$MODKEY-t { wmiir xwrite /ctl view `{read_tags | wmiimenu} & }
|
||||
fn Key-$MODKEY-Shift-t {
|
||||
wmiir xwrite /client/`{wmiir read /client/sel/ctl}^/tags `{read_tags | wmiimenu} &
|
||||
wmiir xwrite /client/`{wmiir read /client/sel/ctl|sed 1q}^/tags `{read_tags | wmiimenu} &
|
||||
}
|
||||
|
||||
fn Key-$MODKEY-^`{seq 0 9} { wmiir xwrite /ctl view `{echo $1 | sed 's/.*-//'} }
|
||||
|
|
Loading…
Reference in New Issue