Code cosmetic..

This commit is contained in:
Martin Duquesnoy 2010-04-12 18:33:32 +02:00
parent b31d54b7e6
commit b0b74b46eb
9 changed files with 47 additions and 32 deletions

View File

@ -67,6 +67,7 @@ barwin_create(Window parent,
|ButtonMask|MouseMask
|ExposureMask|VisibilityChangeMask
|StructureNotifyMask|SubstructureRedirectMask;
if(entermask)
at.event_mask |= EnterWindowMask|LeaveWindowMask|FocusChangeMask;
@ -219,10 +220,7 @@ barwin_move(BarWindow *bw, int x, int y)
{
CHECK(bw);
bw->geo.x = x;
bw->geo.y = y;
XMoveWindow(dpy, bw->win, x, y);
XMoveWindow(dpy, bw->win, (bw->geo.x = x), (bw->geo.y = y));
return;
}

View File

@ -40,6 +40,7 @@ client_attach(Client *c)
{
if(clients)
clients->prev = c;
c->next = clients;
clients = c;
@ -96,6 +97,7 @@ client_get_next(void)
return NULL;
for(c = sel->next; c && ishide(c, selscreen); c = c->next);
if(!c && conf.client_round)
for(c = clients; c && ishide(c, selscreen); c = c->next);
@ -290,7 +292,7 @@ client_focus(Client *c)
return;
}
/* The following function have the same point :
/* The following functions have the same point :
* find a client member with a Window {{{
*/
@ -386,6 +388,8 @@ client_get_name(Client *c)
int rf;
ulong ir, il;
IFREE(c->title);
/* This one instead XFetchName for utf8 name support */
if(XGetWindowProperty(dpy, c->win, net_atom[net_wm_name], 0, 4096,
False, net_atom[utf8_string], &rt, &rf, &ir, &il, (uchar**)&c->title) != Success)
@ -396,6 +400,7 @@ client_get_name(Client *c)
if(!c->title)
{
XFetchName(dpy, c->win, &(c->title));
if(!c->title)
c->title = _strdup("WMFS");
}
@ -583,13 +588,21 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
frame_create(c);
client_size_hints(c);
XChangeWindowAttributes(dpy, c->win, CWEventMask, &at);
XSetWindowBorderWidth(dpy, c->win, 0); /* client win sould _not_ have borders */
/* client win should _not_ have borders */
XSetWindowBorderWidth(dpy, c->win, 0);
mouse_grabbuttons(c, False);
/* Transient */
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
for(t = clients; t && t->win != trans; t = t->next);
if(t)
{
c->tag = t->tag;
c->screen = t->screen;
}
if(!(c->flags & FreeFlag)
&& (rettrans == Success || (c->flags & HintFlag)))
c->flags |= FreeFlag;
@ -892,7 +905,7 @@ client_update_attributes(Client *c)
XChangeProperty(dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->screen), 1);
f = (c->flags & FreeFlag) ? True : False;
f = (c->flags & FreeFlag);
XChangeProperty(dpy, c->win, ATOM("_WMFS_ISFREE"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&f, 1);
@ -920,6 +933,8 @@ client_raise(Client *c)
void
uicb_client_raise(uicb_t cmd)
{
CHECK(sel);
client_raise(sel);
return;

View File

@ -95,6 +95,7 @@ key_name_list_t key_list[] =
{"Mod3", Mod3Mask },
{"Mod4", Mod4Mask },
{"Super", Mod4Mask },
{"Home", Mod4Mask },
{"Mod5", Mod5Mask },
{NULL, NoSymbol }
};

View File

@ -49,6 +49,8 @@ buttonpress(XButtonEvent *ev)
{
client_focus(c);
client_raise(c);
return;
}
/* Titlebar */
@ -436,6 +438,8 @@ keypress(XKeyPressedEvent *ev)
void
mappingnotify(XMappingEvent *ev)
{
XRefreshKeyboardMapping(ev);
if(ev->request == MappingKeyboard)
grabkeys();

View File

@ -149,13 +149,11 @@ void
ewmh_update_current_tag_prop(void)
{
int t;
char *s = NULL;
char s[8] = { 0 };
screen_get_sel();
t = seltag[selscreen] - 1;
s = emalloc(8, sizeof(char));
/* Get current desktop (tag) */
XChangeProperty(dpy, ROOT, net_atom[net_current_desktop], XA_CARDINAL, 32,
PropModeReplace, (uchar*)&t, 1);
@ -180,8 +178,6 @@ ewmh_update_current_tag_prop(void)
PropModeReplace, (uchar*)tags[selscreen][seltag[selscreen]].layout.symbol,
strlen(tags[selscreen][seltag[selscreen]].layout.symbol));
free(s);
return;
}
@ -203,7 +199,7 @@ ewmh_get_client_list(void)
XChangeProperty(dpy, ROOT, net_atom[net_client_list], XA_WINDOW, 32,
PropModeReplace, (uchar *)list, win_n);
free(list);
XFree(list);
return;
}

View File

@ -35,23 +35,23 @@
const func_name_list_t layout_list[] =
{
{"tile", tile },
{"tile_right", tile },
{"tile_left", tile_left },
{"tile_top", tile_top },
{"tile_bottom", tile_bottom },
{"tile_grid", grid },
{"grid", grid },
{"mirror_vertical", mirror_vertical },
{"tile_mirror_vertical", mirror_vertical },
{"mirror_horizontal", mirror_horizontal },
{"tile_mirror_horizontal", mirror_horizontal },
{"layer", layer },
{"max", maxlayout },
{"maxlayout", maxlayout },
{"freelayout", freelayout },
{"free", freelayout },
{ NULL, NULL }
{"tile", tile },
{"tile_right", tile },
{"tile_left", tile_left },
{"tile_top", tile_top },
{"tile_bottom", tile_bottom },
{"tile_grid", grid },
{"grid", grid },
{"mirror_vertical", mirror_vertical },
{"tile_mirror_vertical", mirror_vertical },
{"mirror_horizontal", mirror_horizontal },
{"tile_mirror_horizontal", mirror_horizontal },
{"layer", layer },
{"max", maxlayout },
{"maxlayout", maxlayout },
{"freelayout", freelayout },
{"free", freelayout },
{ NULL, NULL }
};
/** Init WMFS

View File

@ -35,7 +35,6 @@
void
menu_init(Menu *menu, char *name, int nitem, uint bg_f, char *fg_f, uint bg_n, char *fg_n)
{
/* Item */
menu->nitem = nitem;
menu->item = emalloc(sizeof(MenuItem), nitem);

View File

@ -262,6 +262,8 @@ void
uicb_spawn(uicb_t cmd)
{
spawn("%s", cmd);
return;
}
#ifdef HAVE_IMLIB

View File

@ -91,7 +91,7 @@
#define DEF_CONF ".config/wmfs/wmfsrc"
#define DEF_STATUS ".config/wmfs/status.sh"
#define PAD conf.pad
#define MAXSTATUS 4096
#define MAXSTATUS (4096)
#define CWIN(win, parent, x, y, w, h, b, mask, col, at) \
do { \