Merge branch 'master' of ssh://git.naquadah.org/var/cache/git/awesome
This commit is contained in:
commit
8ba08c31ab
2
Makefile
2
Makefile
|
@ -34,7 +34,7 @@ dist: clean
|
|||
@echo creating dist tarball
|
||||
@mkdir awesome-${VERSION}
|
||||
@mkdir awesome-${VERSION}/layouts
|
||||
@cp -R LICENSE AUTHORS Makefile README config.mk \
|
||||
@cp -R LICENSE AUTHORS Makefile README awesomerc config.mk \
|
||||
awesome.1 ${SRC} ${SRC:.c=.h} awesome-${VERSION}
|
||||
@cp -R ${LAYOUTS} ${LAYOUTS:.c=.h} awesome-${VERSION}/layouts
|
||||
@tar -cf awesome-${VERSION}.tar awesome-${VERSION}
|
||||
|
|
|
@ -71,8 +71,8 @@ awesome:
|
|||
(("Mod4"), "k", "focusprev"),
|
||||
(("Mod4"), "h", "setmwfact", "-0.05"),
|
||||
(("Mod4"), "l", "setmwfact", "+0.05"),
|
||||
(("Mod4"), "p", "setborder", "+1),
|
||||
(("Mod4", "Shift"), "p", "setborder", "+2),
|
||||
(("Mod4"), "p", "setborder", "+1"),
|
||||
(("Mod4", "Shift"), "p", "setborder", "-1"),
|
||||
(("Mod4", "Shift"), "h", "setnmaster", "+1"),
|
||||
(("Mod4", "Shift"), "l", "setnmaster", "-1"),
|
||||
(("Mod4", "Control"), "h", "setncols", "+1"),
|
||||
|
|
2
config.c
2
config.c
|
@ -456,7 +456,7 @@ initfont(const char *fontstr, Display * disp, DC * drawcontext)
|
|||
XFreeFont(disp, drawcontext->font.xfont);
|
||||
drawcontext->font.xfont = NULL;
|
||||
if(!(drawcontext->font.xfont = XLoadQueryFont(disp, fontstr))
|
||||
|| !(drawcontext->font.xfont = XLoadQueryFont(disp, "fixed")))
|
||||
&& !(drawcontext->font.xfont = XLoadQueryFont(disp, "fixed")))
|
||||
die("awesome: error, cannot load font: '%s'\n", fontstr);
|
||||
drawcontext->font.ascent = drawcontext->font.xfont->ascent;
|
||||
drawcontext->font.descent = drawcontext->font.xfont->descent;
|
||||
|
|
4
draw.c
4
draw.c
|
@ -70,13 +70,13 @@ drawtext(Display *disp, DC drawcontext, Drawable drawable, const char *text, uns
|
|||
}
|
||||
|
||||
void
|
||||
drawsquare(Display *disp, DC drawcontext, Bool filled, Bool empty, unsigned long col[ColLast], Statusbar *statusbar)
|
||||
drawsquare(Display *disp, DC drawcontext, Bool filled, Bool empty, unsigned long col, Statusbar *statusbar)
|
||||
{
|
||||
int x;
|
||||
XGCValues gcv;
|
||||
XRectangle r = { drawcontext.x, drawcontext.y, drawcontext.w, drawcontext.h };
|
||||
|
||||
gcv.foreground = col[ColFG];
|
||||
gcv.foreground = col;
|
||||
XChangeGC(disp, drawcontext.gc, GCForeground, &gcv);
|
||||
x = (drawcontext.font.ascent + drawcontext.font.descent + 2) / 4;
|
||||
r.x = drawcontext.x + 1;
|
||||
|
|
2
draw.h
2
draw.h
|
@ -26,7 +26,7 @@
|
|||
|
||||
#define textw(set, xfont, text, height) (textnw(set, xfont, text, a_strlen(text)) + height)
|
||||
|
||||
void drawsquare(Display *, DC, Bool, Bool, unsigned long *, Statusbar *);
|
||||
void drawsquare(Display *, DC, Bool, Bool, unsigned long, Statusbar *);
|
||||
void drawtext(Display *, DC, Drawable, const char *, unsigned long *);
|
||||
unsigned int textnw(XFontSet, XFontStruct *, const char *, unsigned int);
|
||||
|
||||
|
|
14
event.c
14
event.c
|
@ -52,7 +52,7 @@ getclient(Window w)
|
|||
}
|
||||
|
||||
static void
|
||||
movemouse(Client * c, int screen, awesome_config *awesomeconf)
|
||||
movemouse(Client * c, awesome_config *awesomeconf)
|
||||
{
|
||||
int x1, y1, ocx, ocy, di, nx, ny;
|
||||
unsigned int dui;
|
||||
|
@ -60,7 +60,7 @@ movemouse(Client * c, int screen, awesome_config *awesomeconf)
|
|||
XEvent ev;
|
||||
ScreenInfo *si;
|
||||
|
||||
si = get_screen_info(c->display, c->screen, awesomeconf[screen].statusbar, &x1);
|
||||
si = get_screen_info(c->display, c->screen, awesomeconf->statusbar, &x1);
|
||||
|
||||
ocx = nx = c->x;
|
||||
ocy = ny = c->y;
|
||||
|
@ -85,13 +85,13 @@ movemouse(Client * c, int screen, awesome_config *awesomeconf)
|
|||
XSync(c->display, False);
|
||||
nx = ocx + (ev.xmotion.x - x1);
|
||||
ny = ocy + (ev.xmotion.y - y1);
|
||||
if(abs(si[c->screen].x_org + nx) < awesomeconf[screen].snap)
|
||||
if(abs(si[c->screen].x_org + nx) < awesomeconf->snap)
|
||||
nx = si[c->screen].x_org;
|
||||
else if(abs((si[c->screen].x_org + si[c->screen].width) - (nx + c->w + 2 * c->border)) < awesomeconf[screen].snap)
|
||||
else if(abs((si[c->screen].x_org + si[c->screen].width) - (nx + c->w + 2 * c->border)) < awesomeconf->snap)
|
||||
nx = si[c->screen].x_org + si[c->screen].width - c->w - 2 * c->border;
|
||||
if(abs(si[c->screen].y_org - ny) < awesomeconf[screen].snap)
|
||||
if(abs(si[c->screen].y_org - ny) < awesomeconf->snap)
|
||||
ny = si[c->screen].y_org;
|
||||
else if(abs((si[c->screen].y_org + si[c->screen].height) - (ny + c->h + 2 * c->border)) < awesomeconf[screen].snap)
|
||||
else if(abs((si[c->screen].y_org + si[c->screen].height) - (ny + c->h + 2 * c->border)) < awesomeconf->snap)
|
||||
ny = si[c->screen].y_org + si[c->screen].height - c->h - 2 * c->border;
|
||||
resize(c, nx, ny, c->w, c->h, False);
|
||||
break;
|
||||
|
@ -190,7 +190,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
|||
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
|
||||
else
|
||||
restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
|
||||
movemouse(c, screen, awesomeconf);
|
||||
movemouse(c, &awesomeconf[c->screen]);
|
||||
}
|
||||
else if(ev->button == Button2)
|
||||
{
|
||||
|
|
14
layout.c
14
layout.c
|
@ -195,10 +195,8 @@ uicb_setlayout(Display *disp,
|
|||
}
|
||||
|
||||
static void
|
||||
maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomeconf)
|
||||
maximize(Display *disp, int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomeconf)
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
if(!sel)
|
||||
return;
|
||||
|
||||
|
@ -217,9 +215,7 @@ maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomecon
|
|||
else
|
||||
sel->isfloating = False;
|
||||
|
||||
drawstatusbar(sel->display, sel->screen, drawcontext, awesomeconf);
|
||||
|
||||
while(XCheckMaskEvent(sel->display, EnterWindowMask, &ev));
|
||||
restack(disp, drawcontext, awesomeconf);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -231,7 +227,7 @@ uicb_togglemax(Display *disp,
|
|||
int dummy;
|
||||
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||
|
||||
maximize(si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org,
|
||||
maximize(disp, si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org,
|
||||
si[awesomeconf->screen].width - 2 * awesomeconf->borderpx,
|
||||
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||
drawcontext, awesomeconf);
|
||||
|
@ -247,7 +243,7 @@ uicb_toggleverticalmax(Display *disp,
|
|||
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||
|
||||
if(sel)
|
||||
maximize(sel->x, si[awesomeconf->screen].y_org,
|
||||
maximize(disp, sel->x, si[awesomeconf->screen].y_org,
|
||||
sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||
drawcontext, awesomeconf);
|
||||
}
|
||||
|
@ -263,7 +259,7 @@ uicb_togglehorizontalmax(Display *disp,
|
|||
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||
|
||||
if(sel)
|
||||
maximize(si[awesomeconf->screen].x_org, sel->y,
|
||||
maximize(disp, si[awesomeconf->screen].x_org, sel->y,
|
||||
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h,
|
||||
drawcontext, awesomeconf);
|
||||
}
|
||||
|
|
|
@ -55,12 +55,12 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso
|
|||
if(awesomeconf->selected_tags[i])
|
||||
{
|
||||
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i], drawcontext->sel);
|
||||
drawsquare(disp, *drawcontext, sel && sel->tags[i], isoccupied(i, screen), drawcontext->sel, &awesomeconf->statusbar);
|
||||
drawsquare(disp, *drawcontext, sel && sel->tags[i], isoccupied(i, screen), drawcontext->sel[ColFG], &awesomeconf->statusbar);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i], drawcontext->norm);
|
||||
drawsquare(disp, *drawcontext, sel && sel->tags[i], isoccupied(i, screen), drawcontext->norm, &awesomeconf->statusbar);
|
||||
drawsquare(disp, *drawcontext, sel && sel->tags[i], isoccupied(i, screen), drawcontext->norm[ColFG], &awesomeconf->statusbar);
|
||||
}
|
||||
drawcontext->x += drawcontext->w;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso
|
|||
if(sel)
|
||||
{
|
||||
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, sel->name, drawcontext->sel);
|
||||
drawsquare(disp, *drawcontext, sel->ismax, sel->isfloating, drawcontext->sel, &awesomeconf->statusbar);
|
||||
drawsquare(disp, *drawcontext, sel->ismax, sel->isfloating, drawcontext->sel[ColFG], &awesomeconf->statusbar);
|
||||
}
|
||||
else
|
||||
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm);
|
||||
|
|
Loading…
Reference in New Issue