mirror of
https://github.com/0intro/wmii
synced 2024-12-24 04:16:50 +03:00
changed colors to be like in wmii-2, enabled increment handling, fixed Button2+ isues on focus
This commit is contained in:
parent
9f232d69b5
commit
eab6580a89
@ -109,7 +109,7 @@ focus_client(Client *c)
|
||||
}
|
||||
|
||||
if(old && (old != c)) {
|
||||
grab_window(old->win, AnyModifier, AnyButton);
|
||||
grab_window(old->win, AnyModifier, Button1);
|
||||
draw_client(old);
|
||||
}
|
||||
ungrab_window(c->win, AnyModifier, AnyButton);
|
||||
@ -481,7 +481,7 @@ resize_client(Client *c, XRectangle *r, XPoint *pt)
|
||||
/* resize if client requests special size */
|
||||
check_dimensions(c, bh, bw);
|
||||
|
||||
if(c->inc)
|
||||
if(def.inc)
|
||||
resize_incremental(c, bh, bw);
|
||||
|
||||
XMoveResizeWindow(dpy, c->frame.win, c->frame.rect.x, c->frame.rect.y,
|
||||
|
@ -61,8 +61,8 @@ handle_buttonpress(XEvent * e)
|
||||
Align align;
|
||||
static char buf[32];
|
||||
if((c = win_to_frame(ev->window))) {
|
||||
focus_client(c);
|
||||
if(ev->button == Button1) {
|
||||
focus_client(c);
|
||||
align = cursor_to_align(c->frame.cursor);
|
||||
if(align == CENTER)
|
||||
mouse_move(c);
|
||||
@ -71,15 +71,16 @@ handle_buttonpress(XEvent * e)
|
||||
}
|
||||
}
|
||||
else if((c = win_to_client(ev->window))) {
|
||||
focus_client(c);
|
||||
ev->state &= valid_mask;
|
||||
if(ev->state & Mod1Mask) {
|
||||
XRaiseWindow(dpy, c->frame.win);
|
||||
switch (ev->button) {
|
||||
case Button1:
|
||||
focus_client(c);
|
||||
mouse_move(c);
|
||||
break;
|
||||
case Button3:
|
||||
focus_client(c);
|
||||
align = xy_to_align(&c->rect, ev->x, ev->y);
|
||||
if(align == CENTER)
|
||||
mouse_move(c);
|
||||
@ -88,6 +89,8 @@ handle_buttonpress(XEvent * e)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(ev->button == Button1)
|
||||
focus_client(c);
|
||||
}
|
||||
if(c) {
|
||||
snprintf(buf, sizeof(buf), "Button%dPress\n", ev->button);
|
||||
|
@ -102,6 +102,7 @@ focus_page(Page *p)
|
||||
do_pend_fcall("SelPage\n");
|
||||
XChangeProperty(dpy, root, net_atoms[NET_CURRENT_DESKTOP], XA_CARDINAL,
|
||||
32, PropModeReplace, (unsigned char *) &sel, 1);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
|
||||
XRectangle *
|
||||
|
@ -714,7 +714,7 @@ main(int argc, char *argv[])
|
||||
def.font = strdup(BLITZ_FONT);
|
||||
def.border = DEF_BORDER;
|
||||
def.snap = DEF_SNAP;
|
||||
def.bar = True;
|
||||
def.inc = def.bar = True;
|
||||
cext_strlcpy(def.selcolor, BLITZ_SEL_COLOR, sizeof(def.selcolor));
|
||||
blitz_loadcolor(dpy, screen, def.selcolor, &def.sel);
|
||||
cext_strlcpy(def.normcolor, BLITZ_NORM_COLOR, sizeof(def.normcolor));
|
||||
|
@ -76,7 +76,6 @@ struct Client {
|
||||
int proto;
|
||||
unsigned int border;
|
||||
unsigned int ignore_unmap;
|
||||
Bool inc;
|
||||
Bool destroyed;
|
||||
Bool maximized;
|
||||
Page *page;
|
||||
|
@ -265,10 +265,11 @@ static char *
|
||||
qid_to_name(Qid *qid)
|
||||
{
|
||||
unsigned char type = qpath_type(qid->path);
|
||||
int i = index_of_id(qpath_id(qid->path));
|
||||
unsigned short id = qpath_id(qid->path);
|
||||
int i;
|
||||
static char buf[32];
|
||||
|
||||
if(i == -1)
|
||||
if(id && ((i = index_of_id(id)) == -1))
|
||||
return nil;
|
||||
switch(type) {
|
||||
case Droot: return "/"; break;
|
||||
@ -320,10 +321,12 @@ mkqid(Qid *dir, char *wname, Qid *new)
|
||||
{
|
||||
const char *err;
|
||||
unsigned short id = qpath_id(dir->path);
|
||||
int type = name_to_type(wname);
|
||||
int i = index_of_id(id);
|
||||
int i, type = name_to_type(wname);
|
||||
|
||||
if(id && ((i = index_of_id(id)) == -1))
|
||||
return -1;
|
||||
|
||||
if((i == -1) || (dir->type != IXP_QTDIR) || (type == -1))
|
||||
if((dir->type != IXP_QTDIR) || (type == -1))
|
||||
return -1;
|
||||
|
||||
new->dtype = qpath_type(dir->path);
|
||||
@ -453,11 +456,11 @@ mkstat(Stat *stat, Qid *dir, char *name, unsigned long long length, unsigned int
|
||||
static unsigned int
|
||||
type_to_stat(Stat *stat, char *name, Qid *dir)
|
||||
{
|
||||
int type = name_to_type(name);
|
||||
int i = index_of_id(qpath_id(dir->path));
|
||||
int i, type = name_to_type(name);
|
||||
unsigned short id = qpath_id(dir->path);
|
||||
char buf[16];
|
||||
|
||||
if(i == -1)
|
||||
if(id && ((i = index_of_id(id)) == -1))
|
||||
return 0;
|
||||
switch (type) {
|
||||
case Droot:
|
||||
@ -497,12 +500,12 @@ static char *
|
||||
xremove(IXPConn *c, Fcall *fcall)
|
||||
{
|
||||
IXPMap *m = ixp_server_fid2map(c, fcall->fid);
|
||||
unsigned short id = qpath_id(m->qid.path);
|
||||
int i;
|
||||
|
||||
if(!m)
|
||||
return Enofid;
|
||||
i = index_of_id(qpath_id(m->qid.path));
|
||||
if(i == -1)
|
||||
if(id && ((i = qpath_id(id)) == -1))
|
||||
return Enofile;
|
||||
if((qpath_type(m->qid.path) == Ditem) && i && (i < nitem)) {
|
||||
Item *it = item[i];
|
||||
@ -527,6 +530,7 @@ xread(IXPConn *c, Fcall *fcall)
|
||||
{
|
||||
Stat stat;
|
||||
IXPMap *m = ixp_server_fid2map(c, fcall->fid);
|
||||
unsigned short id;
|
||||
unsigned char *p = fcall->data;
|
||||
unsigned int len;
|
||||
int i;
|
||||
@ -534,8 +538,8 @@ xread(IXPConn *c, Fcall *fcall)
|
||||
|
||||
if(!m)
|
||||
return Enofid;
|
||||
i = index_of_id(qpath_id(m->qid.path));
|
||||
if(i == -1)
|
||||
id = qpath_id(m->qid.path);
|
||||
if(id && ((i = index_of_id(id)) == -1))
|
||||
return Enofile;
|
||||
|
||||
fcall->count = 0;
|
||||
@ -668,13 +672,13 @@ xwrite(IXPConn *c, Fcall *fcall)
|
||||
{
|
||||
char buf[256];
|
||||
IXPMap *m = ixp_server_fid2map(c, fcall->fid);
|
||||
unsigned short id;
|
||||
int i;
|
||||
|
||||
if(!m)
|
||||
return Enofid;
|
||||
|
||||
i = index_of_id(qpath_id(m->qid.path));
|
||||
if(i == -1)
|
||||
id = qpath_id(m->qid.path);
|
||||
if(id && ((i = index_of_id(id)) == -1))
|
||||
return Enofile;
|
||||
switch (qpath_type(m->qid.path)) {
|
||||
case Fctl:
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include <cext.h>
|
||||
|
||||
#define BLITZ_FONT "fixed"
|
||||
#define BLITZ_SEL_COLOR "#eeeeee #005577 #006699"
|
||||
#define BLITZ_NORM_COLOR "#bbbbbb #222222 #000000"
|
||||
#define BLITZ_SEL_COLOR "#ffffff #666699 #9999cc"
|
||||
#define BLITZ_NORM_COLOR "#ffffff #888888 #bbbbbb"
|
||||
|
||||
typedef enum {
|
||||
CENTER, WEST, NWEST, NORTH, NEAST, EAST,
|
||||
|
13
rc/wmiirc
13
rc/wmiirc
@ -1,16 +1,11 @@
|
||||
#!9PREFIX/bin/rc
|
||||
# configure wmii
|
||||
|
||||
TAB=0
|
||||
CLIENT_BAR=0
|
||||
HANDLEINC=1
|
||||
BAR_ALIGN=south
|
||||
|
||||
SEL_BG_COLOR='#204060'
|
||||
SEL_FG_COLOR='#eeeeee'
|
||||
SEL_BORDER_COLOR='#406080'
|
||||
NORM_BG_COLOR='#000000'
|
||||
NORM_FG_COLOR='#eeeeee'
|
||||
NORM_BORDER_COLOR='#111111'
|
||||
SEL_COLOR="#ffffff #666699 #9999cc"
|
||||
NORM_COLOR="#ffffff #888888 #bbbbbb"
|
||||
FONT='-artwiz-snap-normal-*-*-*-*-*-*-*-*-*-*-*'
|
||||
|
||||
MODKEY=M
|
||||
@ -148,5 +143,5 @@ normstyle /menu/nstyle >[2]/dev/null
|
||||
selstyle /menu/sstyle >[2]/dev/null
|
||||
|
||||
# MISC
|
||||
xsetroot -solid black
|
||||
xsetroot -mod 2 2 -bg \#666699 -fg \#888888
|
||||
status&
|
||||
|
Loading…
Reference in New Issue
Block a user