remove drawcontext everywhere
This commit is contained in:
parent
1a1146eff2
commit
e733af41ec
32
awesome.c
32
awesome.c
|
@ -43,17 +43,15 @@
|
||||||
Client *clients = NULL;
|
Client *clients = NULL;
|
||||||
Client *sel = NULL;
|
Client *sel = NULL;
|
||||||
Client *stack = NULL;
|
Client *stack = NULL;
|
||||||
DC *dc;
|
|
||||||
|
|
||||||
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
||||||
static Bool readin = True, running = True;
|
static Bool readin = True, running = True;
|
||||||
|
|
||||||
/** Cleanup everything on quit
|
/** Cleanup everything on quit
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cleanup(DC *drawcontext, awesome_config *awesomeconf)
|
cleanup(awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
int screen, i;
|
int screen, i;
|
||||||
|
|
||||||
|
@ -62,7 +60,7 @@ cleanup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
while(stack)
|
while(stack)
|
||||||
{
|
{
|
||||||
unban(stack);
|
unban(stack);
|
||||||
unmanage(stack, drawcontext, NormalState, awesomeconf);
|
unmanage(stack, NormalState, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(screen = 0; screen < get_screen_count(awesomeconf->display); screen++)
|
for(screen = 0; screen < get_screen_count(awesomeconf->display); screen++)
|
||||||
|
@ -72,7 +70,6 @@ cleanup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
XUngrabKey(awesomeconf->display, AnyKey, AnyModifier, RootWindow(awesomeconf->display, awesomeconf[screen].phys_screen));
|
XUngrabKey(awesomeconf->display, AnyKey, AnyModifier, RootWindow(awesomeconf->display, awesomeconf[screen].phys_screen));
|
||||||
|
|
||||||
XFreePixmap(awesomeconf->display, awesomeconf[screen].statusbar.drawable);
|
XFreePixmap(awesomeconf->display, awesomeconf[screen].statusbar.drawable);
|
||||||
XFreeGC(awesomeconf->display, drawcontext[screen].gc);
|
|
||||||
XDestroyWindow(awesomeconf->display, awesomeconf[screen].statusbar.window);
|
XDestroyWindow(awesomeconf->display, awesomeconf[screen].statusbar.window);
|
||||||
XFreeCursor(awesomeconf->display, awesomeconf[screen].cursor[CurNormal]);
|
XFreeCursor(awesomeconf->display, awesomeconf[screen].cursor[CurNormal]);
|
||||||
XFreeCursor(awesomeconf->display, awesomeconf[screen].cursor[CurResize]);
|
XFreeCursor(awesomeconf->display, awesomeconf[screen].cursor[CurResize]);
|
||||||
|
@ -97,7 +94,6 @@ cleanup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
XSetInputFocus(awesomeconf->display, PointerRoot, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(awesomeconf->display, PointerRoot, RevertToPointerRoot, CurrentTime);
|
||||||
XSync(awesomeconf->display, False);
|
XSync(awesomeconf->display, False);
|
||||||
p_delete(&awesomeconf);
|
p_delete(&awesomeconf);
|
||||||
p_delete(&dc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get a window state (WM_STATE)
|
/** Get a window state (WM_STATE)
|
||||||
|
@ -126,11 +122,10 @@ getstate(Display *disp, Window w)
|
||||||
|
|
||||||
/** Scan X to find windows to manage
|
/** Scan X to find windows to manage
|
||||||
* \param screen Screen number
|
* \param screen Screen number
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
scan(DC *drawcontext, awesome_config *awesomeconf)
|
scan(awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
unsigned int i, num;
|
unsigned int i, num;
|
||||||
int screen, real_screen;
|
int screen, real_screen;
|
||||||
|
@ -152,7 +147,7 @@ scan(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
if(screen == 0)
|
if(screen == 0)
|
||||||
real_screen = get_screen_bycoord(awesomeconf->display, wa.x, wa.y);
|
real_screen = get_screen_bycoord(awesomeconf->display, wa.x, wa.y);
|
||||||
manage(awesomeconf->display, &drawcontext[real_screen], wins[i], &wa, &awesomeconf[real_screen]);
|
manage(awesomeconf->display, wins[i], &wa, &awesomeconf[real_screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* now the transients */
|
/* now the transients */
|
||||||
|
@ -165,7 +160,7 @@ scan(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
if(screen == 0)
|
if(screen == 0)
|
||||||
real_screen = get_screen_bycoord(awesomeconf->display, wa.x, wa.y);
|
real_screen = get_screen_bycoord(awesomeconf->display, wa.x, wa.y);
|
||||||
manage(awesomeconf->display, &drawcontext[real_screen], wins[i], &wa, &awesomeconf[real_screen]);
|
manage(awesomeconf->display, wins[i], &wa, &awesomeconf[real_screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,7 +175,7 @@ scan(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
* \todo clean things...
|
* \todo clean things...
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
setup(DC *drawcontext, awesome_config *awesomeconf)
|
setup(awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
|
|
||||||
|
@ -205,8 +200,6 @@ setup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
/* bar */
|
/* bar */
|
||||||
awesomeconf->statusbar.height = awesomeconf->font->height + 2;
|
awesomeconf->statusbar.height = awesomeconf->font->height + 2;
|
||||||
initstatusbar(awesomeconf->display, awesomeconf->screen, &awesomeconf->statusbar, awesomeconf->cursor[CurNormal]);
|
initstatusbar(awesomeconf->display, awesomeconf->screen, &awesomeconf->statusbar, awesomeconf->cursor[CurNormal]);
|
||||||
drawcontext->gc = XCreateGC(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), 0, 0);
|
|
||||||
XSetLineAttributes(awesomeconf->display, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Startup Error handler to check if another window manager
|
/** Startup Error handler to check if another window manager
|
||||||
|
@ -222,14 +215,12 @@ xerrorstart(Display * disp __attribute__ ((unused)), XErrorEvent * ee __attribut
|
||||||
|
|
||||||
/** Quit awesome
|
/** Quit awesome
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg nothing
|
* \param arg nothing
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_quit(Display *disp __attribute__ ((unused)),
|
uicb_quit(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf __attribute__((unused)),
|
awesome_config *awesomeconf __attribute__((unused)),
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -320,14 +311,13 @@ main(int argc, char *argv[])
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
||||||
/* allocate stuff */
|
/* allocate stuff */
|
||||||
dc = p_new(DC, get_screen_count(dpy));
|
|
||||||
awesomeconf = p_new(awesome_config, get_screen_count(dpy));
|
awesomeconf = p_new(awesome_config, get_screen_count(dpy));
|
||||||
|
|
||||||
for(screen = 0; screen < get_screen_count(dpy); screen++)
|
for(screen = 0; screen < get_screen_count(dpy); screen++)
|
||||||
{
|
{
|
||||||
parse_config(dpy, screen, confpath, &awesomeconf[screen]);
|
parse_config(dpy, screen, confpath, &awesomeconf[screen]);
|
||||||
setup(&dc[screen], &awesomeconf[screen]);
|
setup(&awesomeconf[screen]);
|
||||||
drawstatusbar(dpy, &dc[screen], &awesomeconf[screen]);
|
drawstatusbar(dpy, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
|
@ -375,7 +365,7 @@ main(int argc, char *argv[])
|
||||||
awesomeconf[screen].have_randr = awesomeconf[0].have_randr;
|
awesomeconf[screen].have_randr = awesomeconf[0].have_randr;
|
||||||
}
|
}
|
||||||
|
|
||||||
scan(dc, awesomeconf);
|
scan(awesomeconf);
|
||||||
|
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
||||||
|
@ -415,7 +405,7 @@ main(int argc, char *argv[])
|
||||||
a_strncpy(awesomeconf[0].statustext, sizeof(awesomeconf[0].statustext),
|
a_strncpy(awesomeconf[0].statustext, sizeof(awesomeconf[0].statustext),
|
||||||
p + 1, sizeof(awesomeconf[0].statustext));
|
p + 1, sizeof(awesomeconf[0].statustext));
|
||||||
}
|
}
|
||||||
drawstatusbar(dpy, &dc[0], &awesomeconf[0]);
|
drawstatusbar(dpy, &awesomeconf[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(XPending(dpy))
|
while(XPending(dpy))
|
||||||
|
@ -425,7 +415,7 @@ main(int argc, char *argv[])
|
||||||
handler[ev.type](&ev, awesomeconf); /* call handler */
|
handler[ev.type](&ev, awesomeconf); /* call handler */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanup(dc, awesomeconf);
|
cleanup(awesomeconf);
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
29
client.c
29
client.c
|
@ -303,13 +303,12 @@ detach(Client * c)
|
||||||
|
|
||||||
/** Give focus to client, or to first client if c is NULL
|
/** Give focus to client, or to first client if c is NULL
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext drawcontext ref
|
|
||||||
* \param c client
|
* \param c client
|
||||||
* \param selscreen True if current screen is selected
|
* \param selscreen True if current screen is selected
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config *awesomeconf)
|
focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
/* if c is NULL or invisible, take next client in the stack */
|
/* if c is NULL or invisible, take next client in the stack */
|
||||||
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
|
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
|
||||||
|
@ -333,7 +332,7 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config
|
||||||
if(!selscreen)
|
if(!selscreen)
|
||||||
return;
|
return;
|
||||||
sel = c;
|
sel = c;
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, awesomeconf);
|
||||||
if(sel)
|
if(sel)
|
||||||
{
|
{
|
||||||
XSetWindowBorder(sel->display, sel->win, awesomeconf->colors_selected[ColBorder].pixel);
|
XSetWindowBorder(sel->display, sel->win, awesomeconf->colors_selected[ColBorder].pixel);
|
||||||
|
@ -379,13 +378,12 @@ loadprops(Client * c, int ntags)
|
||||||
|
|
||||||
/** Manage a new client
|
/** Manage a new client
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param w The window
|
* \param w The window
|
||||||
* \param wa Window attributes
|
* \param wa Window attributes
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
manage(Display *disp, DC *drawcontext, Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
manage(Display *disp, Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Client *c, *t = NULL;
|
Client *c, *t = NULL;
|
||||||
|
@ -453,7 +451,7 @@ manage(Display *disp, DC *drawcontext, Window w, XWindowAttributes *wa, awesome_
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
|
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
|
||||||
c->isbanned = True;
|
c->isbanned = True;
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -567,7 +565,7 @@ unban(Client * c)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
|
unmanage(Client * c, long state, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
|
@ -579,14 +577,14 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
|
||||||
detach(c);
|
detach(c);
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
if(sel == c)
|
if(sel == c)
|
||||||
focus(c->display, drawcontext, NULL, True, awesomeconf);
|
focus(c->display, NULL, True, awesomeconf);
|
||||||
XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
|
XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
|
||||||
setclientstate(c, state);
|
setclientstate(c, state);
|
||||||
XSync(c->display, False);
|
XSync(c->display, False);
|
||||||
XSetErrorHandler(xerror);
|
XSetErrorHandler(xerror);
|
||||||
XUngrabServer(c->display);
|
XUngrabServer(c->display);
|
||||||
if(state != NormalState)
|
if(state != NormalState)
|
||||||
arrange(c->display, drawcontext, awesomeconf);
|
arrange(c->display, awesomeconf);
|
||||||
p_delete(&c->tags);
|
p_delete(&c->tags);
|
||||||
p_delete(&c);
|
p_delete(&c);
|
||||||
}
|
}
|
||||||
|
@ -668,14 +666,12 @@ set_shape(Client *c)
|
||||||
|
|
||||||
/** Set selected client transparency
|
/** Set selected client transparency
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg unused arg
|
* \param arg unused arg
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_settrans(Display *disp __attribute__ ((unused)),
|
uicb_settrans(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf __attribute__ ((unused)),
|
awesome_config *awesomeconf __attribute__ ((unused)),
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -721,14 +717,12 @@ uicb_settrans(Display *disp __attribute__ ((unused)),
|
||||||
|
|
||||||
/** Set borrder size
|
/** Set borrder size
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg X, +X or -X
|
* \param arg X, +X or -X
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_setborder(Display *disp __attribute__ ((unused)),
|
uicb_setborder(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -741,7 +735,6 @@ uicb_setborder(Display *disp __attribute__ ((unused)),
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_swapnext(Display *disp,
|
uicb_swapnext(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -754,13 +747,12 @@ uicb_swapnext(Display *disp,
|
||||||
if(next)
|
if(next)
|
||||||
{
|
{
|
||||||
client_swap(sel, next);
|
client_swap(sel, next);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_swapprev(Display *disp,
|
uicb_swapprev(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -773,13 +765,12 @@ uicb_swapprev(Display *disp,
|
||||||
if(prev)
|
if(prev)
|
||||||
{
|
{
|
||||||
client_swap(prev, sel);
|
client_swap(prev, sel);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_moveresize(Display *disp __attribute__ ((unused)),
|
uicb_moveresize(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -816,14 +807,12 @@ uicb_moveresize(Display *disp __attribute__ ((unused)),
|
||||||
|
|
||||||
/** Kill selected client
|
/** Kill selected client
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg unused
|
* \param arg unused
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_killclient(Display *disp __attribute__ ((unused)),
|
uicb_killclient(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf __attribute__ ((unused)),
|
awesome_config *awesomeconf __attribute__ ((unused)),
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
|
6
client.h
6
client.h
|
@ -66,11 +66,11 @@ inline void attach(Client *); /* attaches c to global client list */
|
||||||
void ban(Client *); /* bans c */
|
void ban(Client *); /* bans c */
|
||||||
void configure(Client *); /* send synthetic configure event */
|
void configure(Client *); /* send synthetic configure event */
|
||||||
void detach(Client *); /* detaches c from global client list */
|
void detach(Client *); /* detaches c from global client list */
|
||||||
void focus(Display *, DC *, Client *, Bool, awesome_config *); /* focus c if visible && !NULL, or focus top visible */
|
void focus(Display *, Client *, Bool, awesome_config *); /* focus c if visible && !NULL, or focus top visible */
|
||||||
void manage(Display *, DC *, Window, XWindowAttributes *, awesome_config *);
|
void manage(Display *, Window, XWindowAttributes *, awesome_config *);
|
||||||
void resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */
|
void resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */
|
||||||
void unban(Client *); /* unbans c */
|
void unban(Client *); /* unbans c */
|
||||||
void unmanage(Client *, DC *, long, awesome_config *); /* unmanage c */
|
void unmanage(Client *, long, awesome_config *); /* unmanage c */
|
||||||
inline void updatesizehints(Client *); /* update the size hint variables of c */
|
inline void updatesizehints(Client *); /* update the size hint variables of c */
|
||||||
void updatetitle(Client *); /* update the name of c */
|
void updatetitle(Client *); /* update the name of c */
|
||||||
void saveprops(Client * c, int); /* saves client properties */
|
void saveprops(Client * c, int); /* saves client properties */
|
||||||
|
|
2
common.h
2
common.h
|
@ -25,7 +25,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/** Common prototype definition for ui_callbak functions */
|
/** Common prototype definition for ui_callbak functions */
|
||||||
#define UICB_PROTO(name) void name(Display *, DC *, awesome_config *, const char *)
|
#define UICB_PROTO(name) void name(Display *, awesome_config *, const char *)
|
||||||
|
|
||||||
/** Common prototype definition for layouts function */
|
/** Common prototype definition for layouts function */
|
||||||
#define LAYOUT_PROTO(name) void name(Display *, awesome_config *)
|
#define LAYOUT_PROTO(name) void name(Display *, awesome_config *)
|
||||||
|
|
1
config.c
1
config.c
|
@ -162,7 +162,6 @@ name_func_lookup(const char *funcname, const NameFuncLink * list)
|
||||||
/** Parse configuration file and initialize some stuff
|
/** Parse configuration file and initialize some stuff
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param scr Screen number
|
* \param scr Screen number
|
||||||
* \param drawcontext Draw context
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
parse_config(Display * disp, int scr,const char *confpatharg, awesome_config *awesomeconf)
|
parse_config(Display * disp, int scr,const char *confpatharg, awesome_config *awesomeconf)
|
||||||
|
|
7
config.h
7
config.h
|
@ -37,11 +37,6 @@ enum
|
||||||
enum
|
enum
|
||||||
{ CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
{ CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
GC gc;
|
|
||||||
} DC;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *prop;
|
char *prop;
|
||||||
|
@ -61,7 +56,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
unsigned long mod;
|
unsigned long mod;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
void (*func) (Display *, DC *, awesome_config *, char *);
|
void (*func) (Display *, awesome_config *, char *);
|
||||||
char *arg;
|
char *arg;
|
||||||
} Key;
|
} Key;
|
||||||
|
|
||||||
|
|
65
event.c
65
event.c
|
@ -36,7 +36,6 @@
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
extern DC *dc; /* global draw context */
|
|
||||||
extern Client *clients, *sel; /* global client list */
|
extern Client *clients, *sel; /* global client list */
|
||||||
|
|
||||||
#define CLEANMASK(mask, screen) (mask & ~(awesomeconf[screen].numlockmask | LockMask))
|
#define CLEANMASK(mask, screen) (mask & ~(awesomeconf[screen].numlockmask | LockMask))
|
||||||
|
@ -161,68 +160,68 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
if(ev->button == Button1)
|
if(ev->button == Button1)
|
||||||
{
|
{
|
||||||
if(ev->state & awesomeconf[screen].modkey)
|
if(ev->state & awesomeconf[screen].modkey)
|
||||||
uicb_tag(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
uicb_tag(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
||||||
else
|
else
|
||||||
uicb_view(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
uicb_view(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button3)
|
else if(ev->button == Button3)
|
||||||
{
|
{
|
||||||
if(ev->state & awesomeconf[screen].modkey)
|
if(ev->state & awesomeconf[screen].modkey)
|
||||||
uicb_toggletag(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
uicb_toggletag(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
||||||
else
|
else
|
||||||
uicb_toggleview(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
uicb_toggleview(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button4)
|
else if(ev->button == Button4)
|
||||||
uicb_tag_viewnext(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_tag_viewnext(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
uicb_tag_viewprev(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_tag_viewprev(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x += awesomeconf[screen].statusbar.width;
|
x += awesomeconf[screen].statusbar.width;
|
||||||
if(ev->x < x && (ev->button == Button1 || ev->button == Button4))
|
if(ev->x < x && (ev->button == Button1 || ev->button == Button4))
|
||||||
uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], "+1");
|
uicb_setlayout(e->xany.display, &awesomeconf[screen], "+1");
|
||||||
else if(ev->x < x && (ev->button == Button3 || ev->button == Button5))
|
else if(ev->x < x && (ev->button == Button3 || ev->button == Button5))
|
||||||
uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], "-1");
|
uicb_setlayout(e->xany.display, &awesomeconf[screen], "-1");
|
||||||
else if(ev->button == Button4)
|
else if(ev->button == Button4)
|
||||||
uicb_focusnext(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_focusnext(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
uicb_focusprev(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_focusprev(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((c = getclient(ev->window)))
|
if((c = getclient(ev->window)))
|
||||||
{
|
{
|
||||||
focus(c->display, &dc[c->screen], c, ev->same_screen, &awesomeconf[c->screen]);
|
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]);
|
||||||
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey)
|
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey)
|
||||||
return;
|
return;
|
||||||
if(ev->button == Button1)
|
if(ev->button == Button1)
|
||||||
{
|
{
|
||||||
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
|
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
|
||||||
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
|
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
|
||||||
else
|
else
|
||||||
restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
|
restack(e->xany.display, &awesomeconf[c->screen]);
|
||||||
movemouse(c, &awesomeconf[c->screen]);
|
movemouse(c, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button2)
|
else if(ev->button == Button2)
|
||||||
{
|
{
|
||||||
if(!IS_ARRANGE(layout_floating) && !c->isfixed && c->isfloating)
|
if(!IS_ARRANGE(layout_floating) && !c->isfixed && c->isfloating)
|
||||||
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
|
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
|
||||||
else
|
else
|
||||||
uicb_zoom(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
|
uicb_zoom(e->xany.display, &awesomeconf[c->screen], NULL);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button3)
|
else if(ev->button == Button3)
|
||||||
{
|
{
|
||||||
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
|
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
|
||||||
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
|
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
|
||||||
else
|
else
|
||||||
restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
|
restack(e->xany.display, &awesomeconf[c->screen]);
|
||||||
resizemouse(c, &awesomeconf[c->screen]);
|
resizemouse(c, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button4)
|
else if(ev->button == Button4)
|
||||||
uicb_settrans(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], "+5");
|
uicb_settrans(e->xany.display, &awesomeconf[c->screen], "+5");
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
uicb_settrans(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], "-5");
|
uicb_settrans(e->xany.display, &awesomeconf[c->screen], "-5");
|
||||||
}
|
}
|
||||||
else if(!sel)
|
else if(!sel)
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
|
@ -231,9 +230,9 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
screen = get_screen_bycoord(e->xany.display, x, y);
|
screen = get_screen_bycoord(e->xany.display, x, y);
|
||||||
if(ev->button == Button4)
|
if(ev->button == Button4)
|
||||||
uicb_tag_viewnext(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_tag_viewnext(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
else if(ev->button == Button5)
|
else if(ev->button == Button5)
|
||||||
uicb_tag_viewprev(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
uicb_tag_viewprev(e->xany.display, &awesomeconf[screen], NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,7 +310,7 @@ handle_event_configurenotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
si[screen].width, awesomeconf[screen].statusbar.height);
|
si[screen].width, awesomeconf[screen].statusbar.height);
|
||||||
XFree(si);
|
XFree(si);
|
||||||
updatebarpos(e->xany.display, awesomeconf[screen].statusbar);
|
updatebarpos(e->xany.display, awesomeconf[screen].statusbar);
|
||||||
arrange(e->xany.display, &dc[screen], &awesomeconf[screen]);
|
arrange(e->xany.display, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +321,7 @@ handle_event_destroynotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
XDestroyWindowEvent *ev = &e->xdestroywindow;
|
XDestroyWindowEvent *ev = &e->xdestroywindow;
|
||||||
|
|
||||||
if((c = getclient(ev->window)))
|
if((c = getclient(ev->window)))
|
||||||
unmanage(c, &dc[c->screen], WithdrawnState, &awesomeconf[c->screen]);
|
unmanage(c, WithdrawnState, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -335,11 +334,11 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
|
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
|
||||||
return;
|
return;
|
||||||
if((c = getclient(ev->window)))
|
if((c = getclient(ev->window)))
|
||||||
focus(c->display, &dc[c->screen], c, ev->same_screen, &awesomeconf[c->screen]);
|
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]);
|
||||||
else
|
else
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
if(ev->window == RootWindow(e->xany.display, screen))
|
if(ev->window == RootWindow(e->xany.display, screen))
|
||||||
focus(e->xany.display, &dc[screen], NULL, True, &awesomeconf[screen]);
|
focus(e->xany.display, NULL, True, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -351,7 +350,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
|
||||||
if(!ev->count)
|
if(!ev->count)
|
||||||
for(screen = 0; screen < get_screen_count(e->xany.display); screen++)
|
for(screen = 0; screen < get_screen_count(e->xany.display); screen++)
|
||||||
if(awesomeconf[screen].statusbar.window == ev->window)
|
if(awesomeconf[screen].statusbar.window == ev->window)
|
||||||
drawstatusbar(e->xany.display, &dc[screen], &awesomeconf[screen]);
|
drawstatusbar(e->xany.display, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -381,7 +380,7 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf)
|
||||||
for(i = 0; i < awesomeconf[screen].nkeys; i++)
|
for(i = 0; i < awesomeconf[screen].nkeys; i++)
|
||||||
if(keysym == awesomeconf[screen].keys[i].keysym
|
if(keysym == awesomeconf[screen].keys[i].keysym
|
||||||
&& CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func)
|
&& CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func)
|
||||||
awesomeconf[screen].keys[i].func(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].keys[i].arg);
|
awesomeconf[screen].keys[i].func(e->xany.display, &awesomeconf[screen], awesomeconf[screen].keys[i].arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -392,7 +391,7 @@ handle_event_leavenotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
|
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
if((ev->window == RootWindow(e->xany.display, screen)) && !ev->same_screen)
|
if((ev->window == RootWindow(e->xany.display, screen)) && !ev->same_screen)
|
||||||
focus(e->xany.display, &dc[screen], NULL, ev->same_screen, &awesomeconf[screen]);
|
focus(e->xany.display, NULL, ev->same_screen, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -423,7 +422,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf)
|
||||||
for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++);
|
for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++);
|
||||||
if(screen == 0)
|
if(screen == 0)
|
||||||
screen = get_screen_bycoord(e->xany.display, wa.x, wa.y);
|
screen = get_screen_bycoord(e->xany.display, wa.x, wa.y);
|
||||||
manage(e->xany.display, &dc[screen], ev->window, &wa, &awesomeconf[screen]);
|
manage(e->xany.display, ev->window, &wa, &awesomeconf[screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +442,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
case XA_WM_TRANSIENT_FOR:
|
case XA_WM_TRANSIENT_FOR:
|
||||||
XGetTransientForHint(e->xany.display, c->win, &trans);
|
XGetTransientForHint(e->xany.display, c->win, &trans);
|
||||||
if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
|
if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
|
||||||
arrange(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
|
arrange(e->xany.display, &awesomeconf[c->screen]);
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
updatesizehints(c);
|
updatesizehints(c);
|
||||||
|
@ -453,7 +452,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
if(c == sel)
|
if(c == sel)
|
||||||
drawstatusbar(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
|
drawstatusbar(e->xany.display, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,7 +465,7 @@ handle_event_unmapnotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
|
|
||||||
if((c = getclient(ev->window))
|
if((c = getclient(ev->window))
|
||||||
&& ev->event == RootWindow(e->xany.display, c->phys_screen) && (ev->send_event || !c->unmapped))
|
&& ev->event == RootWindow(e->xany.display, c->phys_screen) && (ev->send_event || !c->unmapped))
|
||||||
unmanage(c, &dc[c->screen], WithdrawnState, &awesomeconf[c->screen]);
|
unmanage(c, WithdrawnState, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
44
layout.c
44
layout.c
|
@ -34,11 +34,10 @@ extern Client *clients, *sel; /* global client list */
|
||||||
|
|
||||||
/** Arrange windows following current selected layout
|
/** Arrange windows following current selected layout
|
||||||
* \param disp display ref
|
* \param disp display ref
|
||||||
* \param drawcontext drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
|
arrange(Display * disp, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
@ -51,13 +50,12 @@ arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
ban(c);
|
ban(c);
|
||||||
}
|
}
|
||||||
awesomeconf->current_layout->arrange(disp, awesomeconf);
|
awesomeconf->current_layout->arrange(disp, awesomeconf);
|
||||||
focus(disp, drawcontext, NULL, True, awesomeconf);
|
focus(disp, NULL, True, awesomeconf);
|
||||||
restack(disp, drawcontext, awesomeconf);
|
restack(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_focusnext(Display *disp __attribute__ ((unused)),
|
uicb_focusnext(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -70,14 +68,13 @@ uicb_focusnext(Display *disp __attribute__ ((unused)),
|
||||||
for(c = clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->next);
|
for(c = clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->next);
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, drawcontext, c, True, awesomeconf);
|
focus(c->display, c, True, awesomeconf);
|
||||||
restack(c->display, drawcontext, awesomeconf);
|
restack(c->display, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_focusprev(Display *disp __attribute__ ((unused)),
|
uicb_focusprev(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -93,8 +90,8 @@ uicb_focusprev(Display *disp __attribute__ ((unused)),
|
||||||
}
|
}
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, drawcontext, c, True, awesomeconf);
|
focus(c->display, c, True, awesomeconf);
|
||||||
restack(c->display, drawcontext, awesomeconf);
|
restack(c->display, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +111,13 @@ loadawesomeprops(Display *disp, awesome_config * awesomeconf)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
|
restack(Display * disp, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, awesomeconf);
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
if(sel->isfloating || IS_ARRANGE(layout_floating))
|
if(sel->isfloating || IS_ARRANGE(layout_floating))
|
||||||
|
@ -166,7 +163,6 @@ saveawesomeprops(Display *disp, awesome_config *awesomeconf)
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_setlayout(Display *disp,
|
uicb_setlayout(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -191,9 +187,9 @@ uicb_setlayout(Display *disp,
|
||||||
c->ftview = True;
|
c->ftview = True;
|
||||||
|
|
||||||
if(sel)
|
if(sel)
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
else
|
else
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, awesomeconf);
|
||||||
|
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, awesomeconf);
|
||||||
|
|
||||||
|
@ -203,7 +199,7 @@ uicb_setlayout(Display *disp,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomeconf)
|
maximize(int x, int y, int w, int h, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
|
@ -223,12 +219,11 @@ maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomecon
|
||||||
else
|
else
|
||||||
sel->isfloating = False;
|
sel->isfloating = False;
|
||||||
|
|
||||||
arrange(sel->display, drawcontext, awesomeconf);
|
arrange(sel->display, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_togglemax(Display *disp,
|
uicb_togglemax(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -237,13 +232,12 @@ uicb_togglemax(Display *disp,
|
||||||
maximize(si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org,
|
maximize(si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org,
|
||||||
si[awesomeconf->screen].width - 2 * awesomeconf->borderpx,
|
si[awesomeconf->screen].width - 2 * awesomeconf->borderpx,
|
||||||
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||||
drawcontext, awesomeconf);
|
awesomeconf);
|
||||||
XFree(si);
|
XFree(si);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_toggleverticalmax(Display *disp,
|
uicb_toggleverticalmax(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -252,14 +246,13 @@ uicb_toggleverticalmax(Display *disp,
|
||||||
if(sel)
|
if(sel)
|
||||||
maximize(sel->x, si[awesomeconf->screen].y_org,
|
maximize(sel->x, si[awesomeconf->screen].y_org,
|
||||||
sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||||
drawcontext, awesomeconf);
|
awesomeconf);
|
||||||
XFree(si);
|
XFree(si);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_togglehorizontalmax(Display *disp,
|
uicb_togglehorizontalmax(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -268,13 +261,12 @@ uicb_togglehorizontalmax(Display *disp,
|
||||||
if(sel)
|
if(sel)
|
||||||
maximize(si[awesomeconf->screen].x_org, sel->y,
|
maximize(si[awesomeconf->screen].x_org, sel->y,
|
||||||
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h,
|
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h,
|
||||||
drawcontext, awesomeconf);
|
awesomeconf);
|
||||||
XFree(si);
|
XFree(si);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_zoom(Display *disp __attribute__ ((unused)),
|
uicb_zoom(Display *disp __attribute__ ((unused)),
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -282,7 +274,7 @@ uicb_zoom(Display *disp __attribute__ ((unused)),
|
||||||
return;
|
return;
|
||||||
detach(sel);
|
detach(sel);
|
||||||
attach(sel);
|
attach(sel);
|
||||||
focus(sel->display, drawcontext, sel, True, awesomeconf);
|
focus(sel->display, sel, True, awesomeconf);
|
||||||
arrange(sel->display, drawcontext, awesomeconf);
|
arrange(sel->display, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
layout.h
4
layout.h
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
|
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
|
||||||
|
|
||||||
void arrange(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
|
void arrange(Display *, awesome_config *); /* arranges all windows depending on the layout in use */
|
||||||
void restack(Display *, DC *, awesome_config *); /* restores z layers of all clients */
|
void restack(Display *, awesome_config *); /* restores z layers of all clients */
|
||||||
void loadawesomeprops(Display *, awesome_config *);
|
void loadawesomeprops(Display *, awesome_config *);
|
||||||
void saveawesomeprops(Display *, awesome_config *);
|
void saveawesomeprops(Display *, awesome_config *);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ extern Client *clients;
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_setnmaster(Display *disp,
|
uicb_setnmaster(Display *disp,
|
||||||
DC * drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char * arg)
|
const char * arg)
|
||||||
{
|
{
|
||||||
|
@ -44,12 +43,11 @@ uicb_setnmaster(Display *disp,
|
||||||
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
|
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
|
||||||
awesomeconf->nmaster = 0;
|
awesomeconf->nmaster = 0;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_setncol(Display *disp,
|
uicb_setncol(Display *disp,
|
||||||
DC * drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char * arg)
|
const char * arg)
|
||||||
{
|
{
|
||||||
|
@ -59,12 +57,11 @@ uicb_setncol(Display *disp,
|
||||||
if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1)
|
if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1)
|
||||||
awesomeconf->ncol = 1;
|
awesomeconf->ncol = 1;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_setmwfact(Display *disp,
|
uicb_setmwfact(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +84,7 @@ uicb_setmwfact(Display *disp,
|
||||||
else if(awesomeconf->mwfact > 0.9)
|
else if(awesomeconf->mwfact > 0.9)
|
||||||
awesomeconf->mwfact = 0.9;
|
awesomeconf->mwfact = 0.9;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
p_delete(&newarg);
|
p_delete(&newarg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
screen.c
16
screen.c
|
@ -191,7 +191,6 @@ move_mouse_pointer_to_screen(Display *disp, int screen)
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_focusnextscreen(Display *disp,
|
uicb_focusnextscreen(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -201,15 +200,14 @@ uicb_focusnextscreen(Display *disp,
|
||||||
for(c = clients; c && !isvisible(c, next_screen, awesomeconf[next_screen - awesomeconf->screen].tags, awesomeconf[next_screen - awesomeconf->screen].ntags); c = c->next);
|
for(c = clients; c && !isvisible(c, next_screen, awesomeconf[next_screen - awesomeconf->screen].tags, awesomeconf[next_screen - awesomeconf->screen].ntags); c = c->next);
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, &drawcontext[next_screen - awesomeconf->screen], c, True, &awesomeconf[next_screen - awesomeconf->screen]);
|
focus(c->display, c, True, &awesomeconf[next_screen - awesomeconf->screen]);
|
||||||
restack(c->display, &drawcontext[next_screen - awesomeconf->screen], &awesomeconf[next_screen - awesomeconf->screen]);
|
restack(c->display, &awesomeconf[next_screen - awesomeconf->screen]);
|
||||||
}
|
}
|
||||||
move_mouse_pointer_to_screen(disp, next_screen);
|
move_mouse_pointer_to_screen(disp, next_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_focusprevscreen(Display *disp,
|
uicb_focusprevscreen(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -219,22 +217,20 @@ uicb_focusprevscreen(Display *disp,
|
||||||
for(c = clients; c && !isvisible(c, prev_screen, awesomeconf[prev_screen - awesomeconf->screen].tags, awesomeconf[prev_screen - awesomeconf->screen].ntags); c = c->next);
|
for(c = clients; c && !isvisible(c, prev_screen, awesomeconf[prev_screen - awesomeconf->screen].tags, awesomeconf[prev_screen - awesomeconf->screen].ntags); c = c->next);
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, &drawcontext[prev_screen - awesomeconf->screen], c, True, &awesomeconf[prev_screen - awesomeconf->screen]);
|
focus(c->display, c, True, &awesomeconf[prev_screen - awesomeconf->screen]);
|
||||||
restack(c->display, &drawcontext[prev_screen - awesomeconf->screen], &awesomeconf[prev_screen - awesomeconf->screen]);
|
restack(c->display, &awesomeconf[prev_screen - awesomeconf->screen]);
|
||||||
}
|
}
|
||||||
move_mouse_pointer_to_screen(disp, prev_screen);
|
move_mouse_pointer_to_screen(disp, prev_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move client to a virtual screen (if Xinerama is active)
|
/** Move client to a virtual screen (if Xinerama is active)
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext drawcontext ref
|
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg screen number
|
* \param arg screen number
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_movetoscreen(Display *disp,
|
uicb_movetoscreen(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -256,6 +252,6 @@ uicb_movetoscreen(Display *disp,
|
||||||
prev_screen = sel->screen;
|
prev_screen = sel->screen;
|
||||||
move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True);
|
move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True);
|
||||||
move_mouse_pointer_to_screen(disp, new_screen);
|
move_mouse_pointer_to_screen(disp, new_screen);
|
||||||
arrange(disp, drawcontext, &awesomeconf[prev_screen - awesomeconf->screen]);
|
arrange(disp, &awesomeconf[prev_screen - awesomeconf->screen]);
|
||||||
arrange(disp, &drawcontext[new_screen - awesomeconf->screen], &awesomeconf[new_screen - awesomeconf->screen]);
|
arrange(disp, &awesomeconf[new_screen - awesomeconf->screen]);
|
||||||
}
|
}
|
||||||
|
|
32
statusbar.c
32
statusbar.c
|
@ -48,30 +48,34 @@ isoccupied(unsigned int t, int screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
|
drawstatusbar(Display *disp, awesome_config * awesomeconf)
|
||||||
{
|
{
|
||||||
int z, i, x = 0, y = 0, w;
|
int z, i, x = 0, y = 0, w;
|
||||||
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, NULL);
|
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, NULL);
|
||||||
|
GC gc;
|
||||||
|
|
||||||
|
gc = XCreateGC(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), 0, 0);
|
||||||
|
XSetLineAttributes(awesomeconf->display, gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
|
|
||||||
for(i = 0; i < awesomeconf->ntags; i++)
|
for(i = 0; i < awesomeconf->ntags; i++)
|
||||||
{
|
{
|
||||||
w = textwidth(disp, awesomeconf->font, awesomeconf->tags[i].name, a_strlen(awesomeconf->tags[i].name)) + awesomeconf->font->height;
|
w = textwidth(disp, awesomeconf->font, awesomeconf->tags[i].name, a_strlen(awesomeconf->tags[i].name)) + awesomeconf->font->height;
|
||||||
if(awesomeconf->tags[i].selected)
|
if(awesomeconf->tags[i].selected)
|
||||||
{
|
{
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_selected);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_selected);
|
||||||
if(isoccupied(i, awesomeconf->screen))
|
if(isoccupied(i, awesomeconf->screen))
|
||||||
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], awesomeconf->colors_selected[ColFG]);
|
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], awesomeconf->colors_selected[ColFG]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_normal);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_normal);
|
||||||
if(isoccupied(i, awesomeconf->screen))
|
if(isoccupied(i, awesomeconf->screen))
|
||||||
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], awesomeconf->colors_normal[ColFG]);
|
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], awesomeconf->colors_normal[ColFG]);
|
||||||
}
|
}
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
w = awesomeconf->statusbar.width;
|
w = awesomeconf->statusbar.width;
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->current_layout->symbol, awesomeconf->colors_normal);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->current_layout->symbol, awesomeconf->colors_normal);
|
||||||
z = x + w;
|
z = x + w;
|
||||||
w = textwidth(disp, awesomeconf->font, awesomeconf->statustext, a_strlen(awesomeconf->statustext)) + awesomeconf->font->height;
|
w = textwidth(disp, awesomeconf->font, awesomeconf->statustext, a_strlen(awesomeconf->statustext)) + awesomeconf->font->height;
|
||||||
x = si[awesomeconf->screen].width - w;
|
x = si[awesomeconf->screen].width - w;
|
||||||
|
@ -80,26 +84,27 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
|
||||||
x = z;
|
x = z;
|
||||||
w = si[awesomeconf->screen].width - z;
|
w = si[awesomeconf->screen].width - z;
|
||||||
}
|
}
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->statustext, awesomeconf->colors_normal);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->statustext, awesomeconf->colors_normal);
|
||||||
if((w = x - z) > awesomeconf->statusbar.height)
|
if((w = x - z) > awesomeconf->statusbar.height)
|
||||||
{
|
{
|
||||||
x = z;
|
x = z;
|
||||||
if(sel)
|
if(sel)
|
||||||
{
|
{
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, sel->name, awesomeconf->colors_selected);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, sel->name, awesomeconf->colors_selected);
|
||||||
if(sel->isfloating)
|
if(sel->isfloating)
|
||||||
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel->ismax, awesomeconf->colors_selected[ColFG]);
|
drawsquare(disp, x, y, (awesomeconf->font->height + 2) / 4, gc, awesomeconf->statusbar.drawable, sel->ismax, awesomeconf->colors_selected[ColFG]);
|
||||||
}
|
}
|
||||||
else if(IS_ARRANGE(layout_tile) || IS_ARRANGE(layout_tileleft))
|
else if(IS_ARRANGE(layout_tile) || IS_ARRANGE(layout_tileleft))
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf, sizeof(buf), "nmaster: %d ncol: %d mwfact: %.2lf", awesomeconf->nmaster, awesomeconf->ncol, awesomeconf->mwfact);
|
snprintf(buf, sizeof(buf), "nmaster: %d ncol: %d mwfact: %.2lf", awesomeconf->nmaster, awesomeconf->ncol, awesomeconf->mwfact);
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, buf, awesomeconf->colors_normal);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, buf, awesomeconf->colors_normal);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, awesomeconf->font, NULL, awesomeconf->colors_normal);
|
drawtext(disp, awesomeconf->phys_screen, x, y, w, awesomeconf->statusbar.height, gc, awesomeconf->statusbar.drawable, awesomeconf->font, NULL, awesomeconf->colors_normal);
|
||||||
}
|
}
|
||||||
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, si[awesomeconf->screen].width, awesomeconf->statusbar.height, 0, 0);
|
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, gc, 0, 0, si[awesomeconf->screen].width, awesomeconf->statusbar.height, 0, 0);
|
||||||
|
XFreeGC(awesomeconf->display, gc);
|
||||||
XSync(disp, False);
|
XSync(disp, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +165,6 @@ updatebarpos(Display *disp, Statusbar statusbar)
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_togglebar(Display *disp,
|
uicb_togglebar(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -169,6 +173,6 @@ uicb_togglebar(Display *disp,
|
||||||
else
|
else
|
||||||
awesomeconf->statusbar.position = BarOff;
|
awesomeconf->statusbar.position = BarOff;
|
||||||
updatebarpos(disp, awesomeconf->statusbar);
|
updatebarpos(disp, awesomeconf->statusbar);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
void initstatusbar(Display *, int, Statusbar *, Cursor);
|
void initstatusbar(Display *, int, Statusbar *, Cursor);
|
||||||
void drawstatusbar(Display *, DC *, awesome_config *);
|
void drawstatusbar(Display *, awesome_config *);
|
||||||
void updatebarpos(Display *, Statusbar);
|
void updatebarpos(Display *, Statusbar);
|
||||||
|
|
||||||
UICB_PROTO(uicb_togglebar);
|
UICB_PROTO(uicb_togglebar);
|
||||||
|
|
30
tag.c
30
tag.c
|
@ -154,13 +154,11 @@ isvisible(Client * c, int screen, Tag * tags, int ntags)
|
||||||
|
|
||||||
/** Tag selected window with tag
|
/** Tag selected window with tag
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg Tag name
|
* \param arg Tag name
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_tag(Display *disp,
|
uicb_tag(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -174,18 +172,16 @@ uicb_tag(Display *disp,
|
||||||
if(i >= 0 && i < awesomeconf->ntags)
|
if(i >= 0 && i < awesomeconf->ntags)
|
||||||
sel->tags[i] = True;
|
sel->tags[i] = True;
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle floating state of a client
|
/** Toggle floating state of a client
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg unused
|
* \param arg unused
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_togglefloating(Display *disp,
|
uicb_togglefloating(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -204,18 +200,16 @@ uicb_togglefloating(Display *disp,
|
||||||
sel->rh = sel->h;
|
sel->rh = sel->h;
|
||||||
}
|
}
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle tag view
|
/** Toggle tag view
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg Tag name
|
* \param arg Tag name
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_toggletag(Display *disp,
|
uicb_toggletag(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -230,18 +224,16 @@ uicb_toggletag(Display *disp,
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
sel->tags[i] = True;
|
sel->tags[i] = True;
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add a tag to viewed tags
|
/** Add a tag to viewed tags
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg Tag name
|
* \param arg Tag name
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_toggleview(Display *disp,
|
uicb_toggleview(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -254,7 +246,7 @@ uicb_toggleview(Display *disp,
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
awesomeconf->tags[i].selected = True;
|
awesomeconf->tags[i].selected = True;
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View tag
|
/** View tag
|
||||||
|
@ -265,7 +257,6 @@ uicb_toggleview(Display *disp,
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_view(Display *disp,
|
uicb_view(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -283,7 +274,7 @@ uicb_view(Display *disp,
|
||||||
awesomeconf->current_layout = awesomeconf->tags[i].layout;
|
awesomeconf->current_layout = awesomeconf->tags[i].layout;
|
||||||
}
|
}
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View previously selected tags
|
/** View previously selected tags
|
||||||
|
@ -294,7 +285,6 @@ uicb_view(Display *disp,
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_tag_prev_selected(Display * disp,
|
uicb_tag_prev_selected(Display * disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -307,18 +297,16 @@ uicb_tag_prev_selected(Display * disp,
|
||||||
awesomeconf->tags[i].selected = awesomeconf->tags[i].was_selected;
|
awesomeconf->tags[i].selected = awesomeconf->tags[i].was_selected;
|
||||||
awesomeconf->tags[i].was_selected = t;
|
awesomeconf->tags[i].was_selected = t;
|
||||||
}
|
}
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View next tag
|
/** View next tag
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg unused
|
* \param arg unused
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_tag_viewnext(Display *disp,
|
uicb_tag_viewnext(Display *disp,
|
||||||
DC * drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -336,18 +324,16 @@ uicb_tag_viewnext(Display *disp,
|
||||||
awesomeconf->tags[firsttag].selected = True;
|
awesomeconf->tags[firsttag].selected = True;
|
||||||
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
|
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View previous tag
|
/** View previous tag
|
||||||
* \param disp Display ref
|
* \param disp Display ref
|
||||||
* \param drawcontext Drawcontext ref
|
|
||||||
* \param arg unused
|
* \param arg unused
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
uicb_tag_viewprev(Display *disp,
|
uicb_tag_viewprev(Display *disp,
|
||||||
DC *drawcontext,
|
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
@ -365,5 +351,5 @@ uicb_tag_viewprev(Display *disp,
|
||||||
awesomeconf->tags[firsttag].selected = True;
|
awesomeconf->tags[firsttag].selected = True;
|
||||||
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
|
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
2
util.c
2
util.c
|
@ -56,7 +56,6 @@ eprint(const char *fmt, ...)
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_exec(Display * disp,
|
uicb_exec(Display * disp,
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config * awesomeconf __attribute__ ((unused)),
|
awesome_config * awesomeconf __attribute__ ((unused)),
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -70,7 +69,6 @@ uicb_exec(Display * disp,
|
||||||
|
|
||||||
void
|
void
|
||||||
uicb_spawn(Display * disp,
|
uicb_spawn(Display * disp,
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
|
||||||
awesome_config * awesomeconf __attribute__ ((unused)),
|
awesome_config * awesomeconf __attribute__ ((unused)),
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue