add screen arg to uicb*

This commit is contained in:
Julien Danjou 2007-09-16 01:05:43 +02:00
parent 3ab80f68b8
commit 933b0413ea
16 changed files with 89 additions and 56 deletions

View File

@ -197,6 +197,7 @@ xerrorstart(Display * dsply __attribute__ ((unused)), XErrorEvent * ee __attribu
void void
uicb_quit(Display *disp __attribute__ ((unused)), uicb_quit(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext __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)))

View File

@ -24,7 +24,7 @@
#include "config.h" #include "config.h"
void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */ void uicb_quit(Display *, int, DC *, awesome_config *, const char *); /* quit awesome nicely */
int xerror(Display *, XErrorEvent *); /* awesome's X error handler */ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
int __attribute__ ((deprecated)) get_windows_area_x(Statusbar); int __attribute__ ((deprecated)) get_windows_area_x(Statusbar);
int __attribute__ ((deprecated)) get_windows_area_y(Statusbar); int __attribute__ ((deprecated)) get_windows_area_y(Statusbar);

View File

@ -301,6 +301,7 @@ focus(Display *disp, int screen, DC *drawcontext, Client * c, Bool selscreen, aw
*/ */
void void
uicb_killclient(Display *disp __attribute__ ((unused)), uicb_killclient(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext __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)))
@ -490,6 +491,7 @@ resize(Client * c, int x, int y, int w, int h, Bool sizehints)
void void
uicb_moveresize(Display *disp __attribute__ ((unused)), uicb_moveresize(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)),
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg) const char *arg)
@ -658,6 +660,7 @@ set_shape(Client *c)
void void
uicb_settrans(Display *disp __attribute__ ((unused)), uicb_settrans(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)),
awesome_config *awesomeconf __attribute__ ((unused)), awesome_config *awesomeconf __attribute__ ((unused)),
const char *arg) const char *arg)

View File

@ -62,8 +62,8 @@ 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 */
void set_shape(Client *); void set_shape(Client *);
void uicb_killclient(Display *, DC *, awesome_config *, const char *); /* kill client */ void uicb_killclient(Display *, int, DC *, awesome_config *, const char *); /* kill client */
void uicb_moveresize(Display *, DC *, awesome_config *, const char *); /* move and resize window */ void uicb_moveresize(Display *, int, DC *, awesome_config *, const char *); /* move and resize window */
void uicb_settrans(Display *, DC *, awesome_config *, const char *); void uicb_settrans(Display *, int, DC *, awesome_config *, const char *);
#endif #endif

View File

@ -72,7 +72,7 @@ typedef struct
{ {
unsigned long mod; unsigned long mod;
KeySym keysym; KeySym keysym;
void (*func) (Display *, DC *, awesome_config *, const char *); void (*func) (Display *, int, DC *, awesome_config *, const char *);
const char *arg; const char *arg;
} Key; } Key;

29
event.c
View File

@ -159,22 +159,22 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if(ev->button == Button1) if(ev->button == Button1)
{ {
if(ev->state & awesomeconf->modkey) if(ev->state & awesomeconf->modkey)
uicb_tag(e->xany.display, &dc, awesomeconf, awesomeconf->tags[i]); uicb_tag(e->xany.display, awesomeconf->statusbar.screen, &dc, awesomeconf, awesomeconf->tags[i]);
else else
uicb_view(e->xany.display, &dc, awesomeconf, awesomeconf->tags[i]); uicb_view(e->xany.display, awesomeconf->statusbar.screen, &dc, awesomeconf, awesomeconf->tags[i]);
} }
else if(ev->button == Button3) else if(ev->button == Button3)
{ {
if(ev->state & awesomeconf->modkey) if(ev->state & awesomeconf->modkey)
uicb_toggletag(e->xany.display, &dc, awesomeconf, awesomeconf->tags[i]); uicb_toggletag(e->xany.display, awesomeconf->statusbar.screen, &dc, awesomeconf, awesomeconf->tags[i]);
else else
uicb_toggleview(e->xany.display, &dc, awesomeconf, awesomeconf->tags[i]); uicb_toggleview(e->xany.display, awesomeconf->statusbar.screen, &dc, awesomeconf, awesomeconf->tags[i]);
} }
return; return;
} }
} }
if((ev->x < x + awesomeconf->statusbar.width) && ev->button == Button1) if((ev->x < x + awesomeconf->statusbar.width) && ev->button == Button1)
uicb_setlayout(e->xany.display, &dc, awesomeconf, NULL); uicb_setlayout(e->xany.display, awesomeconf->statusbar.screen, &dc, awesomeconf, NULL);
} }
else if((c = getclient(ev->window))) else if((c = getclient(ev->window)))
{ {
@ -187,7 +187,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
movemouse(c, awesomeconf); movemouse(c, awesomeconf);
} }
else if(ev->button == Button2) else if(ev->button == Button2)
uicb_zoom(e->xany.display, &dc, awesomeconf, NULL); uicb_zoom(e->xany.display, c->screen, &dc, awesomeconf, NULL);
else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed) else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed)
{ {
restack(e->xany.display, c->screen, &dc, awesomeconf); restack(e->xany.display, c->screen, &dc, awesomeconf);
@ -199,9 +199,9 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if(RootWindow(e->xany.display, i) == ev->window) if(RootWindow(e->xany.display, i) == ev->window)
{ {
if(ev->button == Button4) if(ev->button == Button4)
uicb_tag_viewnext(e->xany.display, &dc, awesomeconf, NULL); uicb_tag_viewnext(e->xany.display, i, &dc, awesomeconf, NULL);
else if(ev->button == Button5) else if(ev->button == Button5)
uicb_tag_viewprev(e->xany.display, &dc, awesomeconf, NULL); uicb_tag_viewprev(e->xany.display, i, &dc, awesomeconf, NULL);
} }
} }
@ -317,15 +317,24 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
void void
handle_event_keypress(XEvent * e, awesome_config *awesomeconf) handle_event_keypress(XEvent * e, awesome_config *awesomeconf)
{ {
int i; int i, screen, x, y, d;
unsigned int m;
KeySym keysym; KeySym keysym;
XKeyEvent *ev = &e->xkey; XKeyEvent *ev = &e->xkey;
Window dummy;
keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0); keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0);
for(i = 0; i < awesomeconf->nkeys; i++) for(i = 0; i < awesomeconf->nkeys; i++)
if(keysym == awesomeconf->keys[i].keysym if(keysym == awesomeconf->keys[i].keysym
&& CLEANMASK(awesomeconf->keys[i].mod) == CLEANMASK(ev->state) && awesomeconf->keys[i].func) && CLEANMASK(awesomeconf->keys[i].mod) == CLEANMASK(ev->state) && awesomeconf->keys[i].func)
awesomeconf->keys[i].func(e->xany.display, &dc, awesomeconf, awesomeconf->keys[i].arg); {
if(sel)
awesomeconf->keys[i].func(e->xany.display, sel->screen, &dc, awesomeconf, awesomeconf->keys[i].arg);
else
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &y, &x, &d, &d, &m))
awesomeconf->keys[i].func(e->xany.display, screen, &dc, awesomeconf, awesomeconf->keys[i].arg);
}
} }
void void

View File

@ -49,6 +49,7 @@ arrange(Display * disp, int screen, DC *drawcontext, awesome_config *awesomeconf
void void
uicb_focusnext(Display *disp __attribute__ ((unused)), uicb_focusnext(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config * awesomeconf, awesome_config * awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -69,6 +70,7 @@ uicb_focusnext(Display *disp __attribute__ ((unused)),
void void
uicb_focusprev(Display *disp __attribute__ ((unused)), uicb_focusprev(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -156,6 +158,7 @@ saveawesomeprops(Display *disp, int screen, awesome_config *awesomeconf)
void void
uicb_setlayout(Display *disp, uicb_setlayout(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config * awesomeconf, awesome_config * awesomeconf,
const char *arg) const char *arg)
@ -180,11 +183,11 @@ uicb_setlayout(Display *disp,
c->ftview = True; c->ftview = True;
if(sel) if(sel)
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
else else
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf); drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf); saveawesomeprops(disp, screen, awesomeconf);
for(j = 0; j < awesomeconf->ntags; j++) for(j = 0; j < awesomeconf->ntags; j++)
if (awesomeconf->selected_tags[j]) if (awesomeconf->selected_tags[j])
@ -221,6 +224,7 @@ maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomecon
void void
uicb_togglemax(Display *disp, uicb_togglemax(Display *disp,
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -235,6 +239,7 @@ uicb_togglemax(Display *disp,
void void
uicb_toggleverticalmax(Display *disp, uicb_toggleverticalmax(Display *disp,
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -251,6 +256,7 @@ uicb_toggleverticalmax(Display *disp,
void void
uicb_togglehorizontalmax(Display *disp, uicb_togglehorizontalmax(Display *disp,
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -266,6 +272,7 @@ uicb_togglehorizontalmax(Display *disp,
void void
uicb_zoom(Display *disp __attribute__ ((unused)), uicb_zoom(Display *disp __attribute__ ((unused)),
int screen __attribute__ ((unused)),
DC *drawcontext __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)),
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))

View File

@ -31,13 +31,13 @@
void arrange(Display *, int, DC *, awesome_config *); /* arranges all windows depending on the layout in use */ void arrange(Display *, int, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
void restack(Display *, int, DC *, awesome_config *); /* restores z layers of all clients */ void restack(Display *, int, DC *, awesome_config *); /* restores z layers of all clients */
void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */ void uicb_focusnext(Display *, int, DC *, awesome_config *, const char *); /* focuses next visible client */
void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */ void uicb_focusprev(Display *, int, DC *, awesome_config *, const char *); /* focuses prev visible client */
void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */ void uicb_setlayout(Display *, int, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */
void uicb_togglemax(Display *, DC *, awesome_config *, const char *); /* toggles maximization of floating client */ void uicb_togglemax(Display *, int, DC *, awesome_config *, const char *); /* toggles maximization of floating client */
void uicb_toggleverticalmax(Display *, DC *, awesome_config *, const char *); void uicb_toggleverticalmax(Display *, int, DC *, awesome_config *, const char *);
void uicb_togglehorizontalmax(Display *, DC *, awesome_config *, const char *); void uicb_togglehorizontalmax(Display *, int, DC *, awesome_config *, const char *);
void uicb_zoom(Display *, DC *, awesome_config *, const char *); /* set current window first in stack */ void uicb_zoom(Display *, int, DC *, awesome_config *, const char *); /* set current window first in stack */
void loadawesomeprops(Display *, int, awesome_config *); void loadawesomeprops(Display *, int, awesome_config *);
void saveawesomeprops(Display *disp, int, awesome_config *); void saveawesomeprops(Display *disp, int, awesome_config *);

View File

@ -33,6 +33,7 @@ extern Client *sel, *clients;
void void
uicb_setnmaster(Display *disp, uicb_setnmaster(Display *disp,
int screen,
DC * drawcontext, DC * drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char * arg) const char * arg)
@ -43,11 +44,12 @@ 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, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
void void
uicb_setncols(Display *disp, uicb_setncols(Display *disp,
int screen,
DC * drawcontext, DC * drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char * arg) const char * arg)
@ -58,12 +60,13 @@ uicb_setncols(Display *disp,
if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1) if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1)
awesomeconf->ncols = 1; awesomeconf->ncols = 1;
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
void void
uicb_setmwfact(Display *disp, uicb_setmwfact(Display *disp,
DC *drawcontext, int screen,
DC *drawcontext,
awesome_config * awesomeconf, awesome_config * awesomeconf,
const char *arg) const char *arg)
{ {
@ -75,7 +78,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, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
static void static void

View File

@ -25,9 +25,9 @@
#include <config.h> #include <config.h>
void uicb_setnmaster(Display *, DC *, awesome_config *, const char *); /* change number of master windows */ void uicb_setnmaster(Display *, int, DC *, awesome_config *, const char *); /* change number of master windows */
void uicb_setncols(Display *, DC *, awesome_config *, const char *); void uicb_setncols(Display *, int, DC *, awesome_config *, const char *);
void uicb_setmwfact(Display *, DC *, awesome_config *, const char *); /* sets master width factor */ void uicb_setmwfact(Display *, int, DC *, awesome_config *, const char *); /* sets master width factor */
void tile(Display *, awesome_config *); void tile(Display *, awesome_config *);
void tileleft(Display *, awesome_config *); void tileleft(Display *, awesome_config *);

View File

@ -140,6 +140,7 @@ updatebarpos(Display *disp, Statusbar statusbar)
void void
uicb_togglebar(Display *disp, uicb_togglebar(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -149,6 +150,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, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }

View File

@ -27,6 +27,6 @@
void initstatusbar(Display *, int, DC *, Statusbar *); void initstatusbar(Display *, int, DC *, Statusbar *);
void drawstatusbar(Display *, int, DC *, awesome_config *); void drawstatusbar(Display *, int, DC *, awesome_config *);
void updatebarpos(Display *, Statusbar); void updatebarpos(Display *, Statusbar);
void uicb_togglebar(Display *, DC *, awesome_config *, const char *); void uicb_togglebar(Display *, int, DC *, awesome_config *, const char *);
#endif #endif

30
tag.c
View File

@ -145,6 +145,7 @@ isvisible(Client * c, Bool * tags, int ntags)
*/ */
void void
uicb_tag(Display *disp, uicb_tag(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg) const char *arg)
@ -159,7 +160,7 @@ 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, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** Toggle floating state of a client /** Toggle floating state of a client
@ -169,6 +170,7 @@ uicb_tag(Display *disp,
*/ */
void void
uicb_togglefloating(Display *disp, uicb_togglefloating(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config * awesomeconf, awesome_config * awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -188,7 +190,7 @@ uicb_togglefloating(Display *disp,
sel->rh = sel->h; sel->rh = sel->h;
} }
saveprops(sel, awesomeconf->ntags); saveprops(sel, awesomeconf->ntags);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** Toggle tag view /** Toggle tag view
@ -198,6 +200,7 @@ uicb_togglefloating(Display *disp,
*/ */
void void
uicb_toggletag(Display *disp, uicb_toggletag(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg) const char *arg)
@ -213,7 +216,7 @@ 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, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** Add a tag to viewed tags /** Add a tag to viewed tags
@ -223,6 +226,7 @@ uicb_toggletag(Display *disp,
*/ */
void void
uicb_toggleview(Display *disp, uicb_toggleview(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg) const char *arg)
@ -236,7 +240,7 @@ uicb_toggleview(Display *disp,
if(j == awesomeconf->ntags) if(j == awesomeconf->ntags)
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */ awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf); saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** View tag /** View tag
@ -247,6 +251,7 @@ uicb_toggleview(Display *disp,
*/ */
void void
uicb_view(Display *disp, uicb_view(Display *disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg) const char *arg)
@ -264,8 +269,8 @@ uicb_view(Display *disp,
awesomeconf->selected_tags[i] = True; awesomeconf->selected_tags[i] = True;
awesomeconf->current_layout = awesomeconf->tag_layouts[i]; awesomeconf->current_layout = awesomeconf->tag_layouts[i];
} }
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf); saveawesomeprops(disp, screen, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** View previously selected tags /** View previously selected tags
@ -276,6 +281,7 @@ uicb_view(Display *disp,
*/ */
void void
uicb_viewprevtags(Display * disp, uicb_viewprevtags(Display * disp,
int screen,
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -289,7 +295,7 @@ uicb_viewprevtags(Display * disp,
awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i]; awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i];
awesomeconf->prev_selected_tags[i] = t; awesomeconf->prev_selected_tags[i] = t;
} }
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** View next tag /** View next tag
@ -299,6 +305,7 @@ uicb_viewprevtags(Display * disp,
*/ */
void void
uicb_tag_viewnext(Display *disp, uicb_tag_viewnext(Display *disp,
int screen,
DC * drawcontext, DC * drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -315,8 +322,8 @@ uicb_tag_viewnext(Display *disp,
if(++firsttag >= awesomeconf->ntags) if(++firsttag >= awesomeconf->ntags)
firsttag = 0; firsttag = 0;
awesomeconf->selected_tags[firsttag] = True; awesomeconf->selected_tags[firsttag] = True;
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf); saveawesomeprops(disp, screen, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }
/** View previous tag /** View previous tag
@ -326,6 +333,7 @@ uicb_tag_viewnext(Display *disp,
*/ */
void void
uicb_tag_viewprev(Display *disp, uicb_tag_viewprev(Display *disp,
int screen __attribute__ ((unused)),
DC *drawcontext, DC *drawcontext,
awesome_config *awesomeconf, awesome_config *awesomeconf,
const char *arg __attribute__ ((unused))) const char *arg __attribute__ ((unused)))
@ -342,6 +350,6 @@ uicb_tag_viewprev(Display *disp,
if(--firsttag < 0) if(--firsttag < 0)
firsttag = awesomeconf->ntags - 1; firsttag = awesomeconf->ntags - 1;
awesomeconf->selected_tags[firsttag] = True; awesomeconf->selected_tags[firsttag] = True;
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf); saveawesomeprops(disp, screen, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf); arrange(disp, screen, drawcontext, awesomeconf);
} }

16
tag.h
View File

@ -31,14 +31,14 @@
void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */ void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */
Bool isvisible(Client *, Bool *, int); Bool isvisible(Client *, Bool *, int);
void applyrules(Client * c, awesome_config *); /* applies rules to c */ void applyrules(Client * c, awesome_config *); /* applies rules to c */
void uicb_tag(Display *, DC *, awesome_config *, const char *); /* tags sel with arg's index */ void uicb_tag(Display *, int, DC *, awesome_config *, const char *); /* tags sel with arg's index */
void uicb_togglefloating(Display *, DC *, awesome_config *, const char *); /* toggles sel between floating/tiled state */ void uicb_togglefloating(Display *, int, DC *, awesome_config *, const char *); /* toggles sel between floating/tiled state */
void uicb_toggletag(Display *, DC *, awesome_config *, const char *); /* toggles sel tags with arg's index */ void uicb_toggletag(Display *, int, DC *, awesome_config *, const char *); /* toggles sel tags with arg's index */
void uicb_toggleview(Display *, DC *, awesome_config *, const char *); /* toggles the tag with arg's index (in)visible */ void uicb_toggleview(Display *, int, DC *, awesome_config *, const char *); /* toggles the tag with arg's index (in)visible */
void uicb_view(Display *, DC *, awesome_config *, const char *); /* views the tag with arg's index */ void uicb_view(Display *, int, DC *, awesome_config *, const char *); /* views the tag with arg's index */
void uicb_viewprevtags(Display *, DC *, awesome_config *, const char *); void uicb_viewprevtags(Display *, int, DC *, awesome_config *, const char *);
void uicb_tag_viewnext(Display *, DC *, awesome_config *, const char *); /* view only tag just after the first selected */ void uicb_tag_viewnext(Display *, int, DC *, awesome_config *, const char *); /* view only tag just after the first selected */
void uicb_tag_viewprev(Display *, DC *, awesome_config *, const char *); /* view only tag just before the first selected */ void uicb_tag_viewprev(Display *, int, DC *, awesome_config *, const char *); /* view only tag just before the first selected */
typedef struct typedef struct
{ {

7
util.c
View File

@ -43,9 +43,10 @@ eprint(const char *fmt, ...)
void void
uicb_spawn(Display * disp, uicb_spawn(Display * disp,
DC *drawcontext __attribute__ ((unused)), int screen __attribute__ ((unused)),
awesome_config * awesomeconf __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)),
const char *arg) awesome_config * awesomeconf __attribute__ ((unused)),
const char *arg)
{ {
static char *shell = NULL; static char *shell = NULL;

2
util.h
View File

@ -119,7 +119,7 @@ static inline char *a_strdup(const char *s)
} }
void eprint(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2))); void eprint(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2)));
void uicb_spawn(Display *, DC *, awesome_config *, const char *); void uicb_spawn(Display *, int, DC *, awesome_config *, const char *);
Bool xgettextprop(Display *, Window, Atom, char *, unsigned int); Bool xgettextprop(Display *, Window, Atom, char *, unsigned int);
double compute_new_value_from_arg(const char *, double); double compute_new_value_from_arg(const char *, double);