fix toggle floating with Button2 in tileleft layout, and prefix layout functions with layouts_

This commit is contained in:
Julien Danjou 2007-09-20 22:07:59 +02:00
parent 4ef83a4e40
commit 2f43209c34
8 changed files with 21 additions and 21 deletions

View File

@ -513,7 +513,7 @@ uicb_moveresize(Display *disp __attribute__ ((unused)),
unsigned int dui;
Window dummy;
if(!IS_ARRANGE(floating))
if(!IS_ARRANGE(layout_floating))
if(!sel || !sel->isfloating || sel->isfixed || !arg)
return;
if(sscanf(arg, "%d%c %d%c %d%c %d%c", &x, &xabs, &y, &yabs, &w, &wabs, &h, &habs) != 8)

View File

@ -71,9 +71,9 @@ static const KeyMod KeyModList[] =
/** List of available layouts and link between name and functions */
static const NameFuncLink LayoutsList[] =
{
{"tile", tile},
{"tileleft", tileleft},
{"floating", floating},
{"tile", layout_tile},
{"tileleft", layout_tileleft},
{"floating", layout_floating},
{NULL, NULL}
};
@ -166,9 +166,9 @@ set_default_config(awesome_config *awesomeconf)
awesomeconf->nlayouts = 2;
awesomeconf->layouts = p_new(Layout, awesomeconf->nlayouts + 1);
awesomeconf->layouts[0].symbol = a_strdup("[]=");
awesomeconf->layouts[0].arrange = tile;
awesomeconf->layouts[0].arrange = layout_tile;
awesomeconf->layouts[1].symbol = a_strdup("<><");
awesomeconf->layouts[1].arrange = floating;
awesomeconf->layouts[1].arrange = layout_floating;
awesomeconf->layouts[2].symbol = NULL;
awesomeconf->layouts[2].arrange = NULL;

View File

@ -186,7 +186,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
return;
if(ev->button == Button1)
{
if(!IS_ARRANGE(floating) && !c->isfloating)
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
else
restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
@ -194,14 +194,14 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
}
else if(ev->button == Button2)
{
if(IS_ARRANGE(tile) && !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);
else
uicb_zoom(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
}
else if(ev->button == Button3)
{
if(!IS_ARRANGE(floating) && !c->isfloating)
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL);
else
restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]);
@ -231,7 +231,7 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
c->ismax = False;
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
if(c->isfixed || c->isfloating || IS_ARRANGE(floating))
if(c->isfixed || c->isfloating || IS_ARRANGE(layout_floating))
{
if(ev->value_mask & CWX)
c->x = ev->x;

View File

@ -118,9 +118,9 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf);
if(!sel)
return;
if(sel->isfloating || IS_ARRANGE(floating))
if(sel->isfloating || IS_ARRANGE(layout_floating))
XRaiseWindow(disp, sel->win);
if(!IS_ARRANGE(floating))
if(!IS_ARRANGE(layout_floating))
{
wc.stack_mode = Below;
wc.sibling = awesomeconf->statusbar.window;

View File

@ -27,7 +27,7 @@
extern Client *clients; /* global client */
void
floating(Display *disp __attribute__ ((unused)), awesome_config *awesomeconf)
layout_floating(Display *disp __attribute__ ((unused)), awesome_config *awesomeconf)
{ /* default floating layout */
Client *c;

View File

@ -23,6 +23,6 @@
#ifndef AWESOME_FLOATING_H
#define AWESOME_FLOATING_H
void floating(Display *, awesome_config *); /* floating layout */
void layout_floating(Display *, awesome_config *); /* floating layout */
#endif

View File

@ -37,7 +37,7 @@ uicb_setnmaster(Display *disp,
awesome_config *awesomeconf,
const char * arg)
{
if(!arg || (!IS_ARRANGE(tile) && !IS_ARRANGE(tileleft)))
if(!arg || (IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft)))
return;
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
@ -52,7 +52,7 @@ uicb_setncols(Display *disp,
awesome_config *awesomeconf,
const char * arg)
{
if(!arg || (!IS_ARRANGE(tile) && !IS_ARRANGE(tileleft)))
if(!arg || (!IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft)))
return;
if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1)
@ -67,7 +67,7 @@ uicb_setmwfact(Display *disp,
awesome_config * awesomeconf,
const char *arg)
{
if(!IS_ARRANGE(tile) && !IS_ARRANGE(tileleft))
if(!IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft))
return;
if((awesomeconf->mwfact = compute_new_value_from_arg(arg, awesomeconf->mwfact)) < 0.1)
@ -192,13 +192,13 @@ _tile(Display *disp, awesome_config *awesomeconf, const Bool right)
}
void
tile(Display *disp, awesome_config *awesomeconf)
layout_tile(Display *disp, awesome_config *awesomeconf)
{
_tile(disp, awesomeconf, True);
}
void
tileleft(Display *disp, awesome_config *awesomeconf)
layout_tileleft(Display *disp, awesome_config *awesomeconf)
{
_tile(disp, awesomeconf, False);
}

View File

@ -28,7 +28,7 @@
void uicb_setnmaster(Display *, DC *, awesome_config *, const char *); /* change number of master windows */
void uicb_setncols(Display *, DC *, awesome_config *, const char *);
void uicb_setmwfact(Display *, DC *, awesome_config *, const char *); /* sets master width factor */
void tile(Display *, awesome_config *);
void tileleft(Display *, awesome_config *);
void layout_tile(Display *, awesome_config *);
void layout_tileleft(Display *, awesome_config *);
#endif