Fix some things, render, code, typo
This commit is contained in:
parent
22c0e81df6
commit
d856ec1012
56
src/bar.c
56
src/bar.c
@ -52,7 +52,7 @@ bar_create(Window parent,
|
|||||||
|
|
||||||
bw = emalloc(1, sizeof(BarWindow));
|
bw = emalloc(1, sizeof(BarWindow));
|
||||||
|
|
||||||
at.override_redirect = 1;
|
at.override_redirect = True;
|
||||||
at.background_pixmap = ParentRelative;
|
at.background_pixmap = ParentRelative;
|
||||||
if(entermask)
|
if(entermask)
|
||||||
at.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
at.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
||||||
@ -91,8 +91,9 @@ bar_create(Window parent,
|
|||||||
void
|
void
|
||||||
bar_delete(BarWindow *bw)
|
bar_delete(BarWindow *bw)
|
||||||
{
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
XSelectInput(dpy, bw->win, NoEventMask);
|
XSelectInput(dpy, bw->win, NoEventMask);
|
||||||
XDestroySubwindows(dpy, bw->win);
|
|
||||||
XDestroyWindow(dpy, bw->win);
|
XDestroyWindow(dpy, bw->win);
|
||||||
XFreePixmap(dpy, bw->dr);
|
XFreePixmap(dpy, bw->dr);
|
||||||
free(bw);
|
free(bw);
|
||||||
@ -100,6 +101,19 @@ bar_delete(BarWindow *bw)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Delete the BarWindow sub windows
|
||||||
|
* \param bw BarWindow pointer
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
bar_delete_subwin(BarWindow *bw)
|
||||||
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
|
XDestroySubwindows(dpy, bw->win);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Map a BarWindow
|
/** Map a BarWindow
|
||||||
* \param bw BarWindow pointer
|
* \param bw BarWindow pointer
|
||||||
*/
|
*/
|
||||||
@ -109,13 +123,27 @@ bar_map(BarWindow *bw)
|
|||||||
CHECK(!bw->mapped);
|
CHECK(!bw->mapped);
|
||||||
|
|
||||||
XMapWindow(dpy, bw->win);
|
XMapWindow(dpy, bw->win);
|
||||||
XMapSubwindows(dpy, bw->win);
|
|
||||||
|
|
||||||
bw->mapped = True;
|
bw->mapped = True;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Map the subwindows of a BarWindow
|
||||||
|
* Use for the BarWindow special border...
|
||||||
|
* \param bw BarWindow pointer
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
bar_map_subwin(BarWindow *bw)
|
||||||
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
|
XMapSubwindows(dpy, bw->win);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Unmap a BarWindow
|
/** Unmap a BarWindow
|
||||||
* \param bw BarWindow pointer
|
* \param bw BarWindow pointer
|
||||||
*/
|
*/
|
||||||
@ -124,7 +152,6 @@ bar_unmap(BarWindow *bw)
|
|||||||
{
|
{
|
||||||
CHECK(bw->mapped);
|
CHECK(bw->mapped);
|
||||||
|
|
||||||
XUnmapSubwindows(dpy, bw->win);
|
|
||||||
XUnmapWindow(dpy, bw->win);
|
XUnmapWindow(dpy, bw->win);
|
||||||
|
|
||||||
bw->mapped = False;
|
bw->mapped = False;
|
||||||
@ -132,6 +159,19 @@ bar_unmap(BarWindow *bw)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Unmap the BarWindow sub windows
|
||||||
|
* \param bw BarWindow pointer
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
bar_unmap_subwin(BarWindow *bw)
|
||||||
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
|
XUnmapSubwindows(dpy, bw->win);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Move a BarWindow
|
/** Move a BarWindow
|
||||||
* \param bw BarWindow pointer
|
* \param bw BarWindow pointer
|
||||||
* \param x X position
|
* \param x X position
|
||||||
@ -140,6 +180,8 @@ bar_unmap(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
bar_move(BarWindow *bw, int x, int y)
|
bar_move(BarWindow *bw, int x, int y)
|
||||||
{
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
bw->geo.x = x;
|
bw->geo.x = x;
|
||||||
bw->geo.y = y;
|
bw->geo.y = y;
|
||||||
|
|
||||||
@ -156,6 +198,8 @@ bar_move(BarWindow *bw, int x, int y)
|
|||||||
void
|
void
|
||||||
bar_resize(BarWindow *bw, uint w, uint h)
|
bar_resize(BarWindow *bw, uint w, uint h)
|
||||||
{
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
bw->geo.width = w;
|
bw->geo.width = w;
|
||||||
bw->geo.height = h;
|
bw->geo.height = h;
|
||||||
XFreePixmap(dpy, bw->dr);
|
XFreePixmap(dpy, bw->dr);
|
||||||
@ -180,6 +224,8 @@ bar_resize(BarWindow *bw, uint w, uint h)
|
|||||||
void
|
void
|
||||||
bar_refresh_color(BarWindow *bw)
|
bar_refresh_color(BarWindow *bw)
|
||||||
{
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
draw_rectangle(bw->dr, 0, 0, bw->geo.width, bw->geo.height, bw->color);
|
draw_rectangle(bw->dr, 0, 0, bw->geo.width, bw->geo.height, bw->color);
|
||||||
|
|
||||||
XSetWindowBackground(dpy, bw->border.left , bw->border.light);
|
XSetWindowBackground(dpy, bw->border.left , bw->border.light);
|
||||||
@ -201,6 +247,8 @@ bar_refresh_color(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
bar_refresh(BarWindow *bw)
|
bar_refresh(BarWindow *bw)
|
||||||
{
|
{
|
||||||
|
CHECK(bw);
|
||||||
|
|
||||||
XCopyArea(dpy, bw->dr, bw->win, gc, 0, 0, bw->geo.width, bw->geo.height, 0, 0);
|
XCopyArea(dpy, bw->dr, bw->win, gc, 0, 0, bw->geo.width, bw->geo.height, 0, 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
21
src/client.c
21
src/client.c
@ -223,6 +223,9 @@ client_focus(Client *c)
|
|||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
if(!TBARH)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for(c = clients; c && c->titlebar->win != w; c = c->next);
|
for(c = clients; c && c->titlebar->win != w; c = c->next);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
@ -313,7 +316,11 @@ client_map(Client *c)
|
|||||||
|
|
||||||
XMapWindow(dpy, c->frame);
|
XMapWindow(dpy, c->frame);
|
||||||
XMapSubwindows(dpy, c->frame);
|
XMapSubwindows(dpy, c->frame);
|
||||||
|
if(TBARH)
|
||||||
|
{
|
||||||
bar_map(c->titlebar);
|
bar_map(c->titlebar);
|
||||||
|
bar_map_subwin(c->titlebar);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -340,7 +347,6 @@ client_manage(Window w, XWindowAttributes *wa)
|
|||||||
frame_create(c);
|
frame_create(c);
|
||||||
XSelectInput(dpy, c->win, PropertyChangeMask | StructureNotifyMask);
|
XSelectInput(dpy, c->win, PropertyChangeMask | StructureNotifyMask);
|
||||||
mouse_grabbuttons(c, False);
|
mouse_grabbuttons(c, False);
|
||||||
client_size_hints(c);
|
|
||||||
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
||||||
for(t = clients; t && t->win != trans; t = t->next);
|
for(t = clients; t && t->win != trans; t = t->next);
|
||||||
if(t) c->tag = t->tag;
|
if(t) c->tag = t->tag;
|
||||||
@ -348,6 +354,7 @@ client_manage(Window w, XWindowAttributes *wa)
|
|||||||
efree(t);
|
efree(t);
|
||||||
|
|
||||||
client_attach(c);
|
client_attach(c);
|
||||||
|
client_size_hints(c);
|
||||||
client_map(c);
|
client_map(c);
|
||||||
client_get_name(c);
|
client_get_name(c);
|
||||||
client_raise(c);
|
client_raise(c);
|
||||||
@ -423,7 +430,7 @@ client_moveresize(Client *c, XRectangle geo, bool r)
|
|||||||
{
|
{
|
||||||
c->geo = geo;
|
c->geo = geo;
|
||||||
frame_moveresize(c, geo);
|
frame_moveresize(c, geo);
|
||||||
XResizeWindow(dpy, c->win, geo.width, geo.height);
|
XMoveResizeWindow(dpy, c->win, BORDH, BORDH + TBARH, geo.width, geo.height);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,6 +557,7 @@ client_unmanage(Client *c)
|
|||||||
int i;
|
int i;
|
||||||
Client *cc;
|
Client *cc;
|
||||||
|
|
||||||
|
XGrabServer(dpy);
|
||||||
XSetErrorHandler(errorhandlerdummy);
|
XSetErrorHandler(errorhandlerdummy);
|
||||||
|
|
||||||
/* Unset all focus stuff {{{ */
|
/* Unset all focus stuff {{{ */
|
||||||
@ -564,10 +572,15 @@ client_unmanage(Client *c)
|
|||||||
setwinstate(c->win, WithdrawnState);
|
setwinstate(c->win, WithdrawnState);
|
||||||
XDestroySubwindows(dpy, c->frame);
|
XDestroySubwindows(dpy, c->frame);
|
||||||
XDestroyWindow(dpy, c->frame);
|
XDestroyWindow(dpy, c->frame);
|
||||||
|
if(TBARH)
|
||||||
|
{
|
||||||
|
bar_delete_subwin(c->titlebar);
|
||||||
bar_delete(c->titlebar);
|
bar_delete(c->titlebar);
|
||||||
|
}
|
||||||
XFree(c->title);
|
XFree(c->title);
|
||||||
efree(c);
|
efree(c);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
XUngrabServer(dpy);
|
||||||
arrange();
|
arrange();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -583,7 +596,11 @@ client_unmap(Client *c)
|
|||||||
|
|
||||||
XUnmapWindow(dpy, c->frame);
|
XUnmapWindow(dpy, c->frame);
|
||||||
XUnmapSubwindows(dpy, c->frame);
|
XUnmapSubwindows(dpy, c->frame);
|
||||||
|
if(TBARH)
|
||||||
|
{
|
||||||
|
bar_unmap_subwin(c->titlebar);
|
||||||
bar_unmap(c->titlebar);
|
bar_unmap(c->titlebar);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
24
src/event.c
24
src/event.c
@ -121,25 +121,20 @@ configurerequest(XConfigureRequestEvent *ev)
|
|||||||
geo.width = ev->width;
|
geo.width = ev->width;
|
||||||
if(ev->value_mask & CWHeight)
|
if(ev->value_mask & CWHeight)
|
||||||
geo.height = ev->height;
|
geo.height = ev->height;
|
||||||
|
if((ev->value_mask & (CWX | CWY))
|
||||||
|
&& !(ev->value_mask & (CWWidth | CWHeight)))
|
||||||
|
client_configure(c);
|
||||||
if(geo.x != c->geo.x
|
if(geo.x != c->geo.x
|
||||||
|| geo.y != c->geo.y
|
|| geo.y != c->geo.y
|
||||||
|| geo.width != c->geo.width
|
|| geo.width != c->geo.width
|
||||||
|| geo.height != c->geo.height)
|
|| geo.height != c->geo.height)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Adjust the client's future geo to
|
|
||||||
* set the correct position of the frame
|
|
||||||
*/
|
|
||||||
geo.x += BORDH;
|
geo.x += BORDH;
|
||||||
geo.y += TBARH;
|
geo.y += TBARH;
|
||||||
/* Resize */
|
if((geo.x < MAXW && geo.x > 0 - geo.width)
|
||||||
if((geo.x < MAXW && geo.x > geo.width)
|
&& (geo.y < MAXH && geo.y > 0 - geo.height))
|
||||||
&& geo.y < MAXH && geo.y > geo.height)
|
|
||||||
client_moveresize(c, geo, True);
|
client_moveresize(c, geo, True);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
client_configure(c);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -150,8 +145,10 @@ configurerequest(XConfigureRequestEvent *ev)
|
|||||||
wc.border_width = ev->border_width;
|
wc.border_width = ev->border_width;
|
||||||
wc.sibling = ev->above;
|
wc.sibling = ev->above;
|
||||||
wc.stack_mode = ev->detail;
|
wc.stack_mode = ev->detail;
|
||||||
|
|
||||||
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
|
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -164,6 +161,7 @@ void
|
|||||||
destroynotify(XDestroyWindowEvent *ev)
|
destroynotify(XDestroyWindowEvent *ev)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
if((c = client_gb_win(ev->window)))
|
if((c = client_gb_win(ev->window)))
|
||||||
client_unmanage(c);
|
client_unmanage(c);
|
||||||
|
|
||||||
@ -203,14 +201,14 @@ expose(XExposeEvent *ev)
|
|||||||
|
|
||||||
if(ev->count == 0
|
if(ev->count == 0
|
||||||
&& (ev->window == infobar->bar->win))
|
&& (ev->window == infobar->bar->win))
|
||||||
infobar_draw();
|
bar_refresh(infobar->bar);
|
||||||
|
|
||||||
for(i = 1; i < conf.ntag + 1; ++i)
|
for(i = 1; i < conf.ntag + 1; ++i)
|
||||||
if(ev->window == infobar->tags[i]->win)
|
if(ev->window == infobar->tags[i]->win)
|
||||||
infobar_draw_taglist();
|
bar_refresh(infobar->tags[i]);
|
||||||
|
|
||||||
if(ev->window == infobar->layout_button->win)
|
if(ev->window == infobar->layout_button->win)
|
||||||
infobar_draw_layout();
|
bar_refresh(infobar->layout_button);
|
||||||
|
|
||||||
if((c = client_gb_titlebar(ev->window)))
|
if((c = client_gb_titlebar(ev->window)))
|
||||||
frame_update(c);
|
frame_update(c);
|
||||||
|
|||||||
@ -158,7 +158,7 @@ frame_update(Client *c)
|
|||||||
XClearWindow(dpy, c->right);
|
XClearWindow(dpy, c->right);
|
||||||
XClearWindow(dpy, c->bottom);
|
XClearWindow(dpy, c->bottom);
|
||||||
|
|
||||||
if((TBARH + BORDH + 1) > font->height)
|
if(TBARH && (TBARH + BORDH + 1) > font->height)
|
||||||
{
|
{
|
||||||
draw_text(c->titlebar->dr,
|
draw_text(c->titlebar->dr,
|
||||||
(c->frame_geo.width / 2) - (textw(c->title) / 2),
|
(c->frame_geo.width / 2) - (textw(c->title) / 2),
|
||||||
|
|||||||
@ -53,7 +53,7 @@ infobar_init(void)
|
|||||||
infobar->tags[i] = bar_create(infobar->bar->win, j, 0, textw(tags[i].name) + PAD,
|
infobar->tags[i] = bar_create(infobar->bar->win, j, 0, textw(tags[i].name) + PAD,
|
||||||
infobar->geo.height, conf.colors.bar, False);
|
infobar->geo.height, conf.colors.bar, False);
|
||||||
j += textw(tags[i].name) + PAD;
|
j += textw(tags[i].name) + PAD;
|
||||||
XMapSubwindows(dpy, infobar->tags[i]->win);
|
bar_map_subwin(infobar->tags[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create layout switch & layout type switch barwindow */
|
/* Create layout switch & layout type switch barwindow */
|
||||||
@ -61,11 +61,12 @@ infobar_init(void)
|
|||||||
textw(tags[seltag].layout.symbol) + PAD,
|
textw(tags[seltag].layout.symbol) + PAD,
|
||||||
infobar->geo.height, conf.colors.layout_bg, False);
|
infobar->geo.height, conf.colors.layout_bg, False);
|
||||||
|
|
||||||
/* Map all */
|
/* Map/Refresh all */
|
||||||
bar_map(infobar->bar);
|
bar_map(infobar->bar);
|
||||||
|
bar_map_subwin(infobar->bar);
|
||||||
|
bar_map_subwin(infobar->layout_button);
|
||||||
bar_refresh_color(infobar->bar);
|
bar_refresh_color(infobar->bar);
|
||||||
bar_refresh(infobar->bar);
|
bar_refresh(infobar->bar);
|
||||||
XMapSubwindows(dpy, infobar->layout_button->win);
|
|
||||||
|
|
||||||
strcpy(infobar->statustext, "WMFS-" WMFS_VERSION);
|
strcpy(infobar->statustext, "WMFS-" WMFS_VERSION);
|
||||||
infobar_draw();
|
infobar_draw();
|
||||||
@ -135,12 +136,15 @@ infobar_destroy(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
bar_delete(infobar->bar);
|
bar_delete(infobar->bar);
|
||||||
|
bar_delete_subwin(infobar->bar);
|
||||||
for(i = 1; i < conf.ntag + 1; ++i)
|
for(i = 1; i < conf.ntag + 1; ++i)
|
||||||
{
|
{
|
||||||
XFreePixmap(dpy, infobar->tags[i]->dr);
|
bar_delete_subwin(infobar->tags[i]);
|
||||||
XDestroySubwindows(dpy, infobar->tags[i]->win);
|
bar_delete(infobar->tags[i]);
|
||||||
}
|
}
|
||||||
XDestroySubwindows(dpy, infobar->layout_button->win);
|
bar_delete(infobar->layout_button);
|
||||||
|
bar_delete_subwin(infobar->layout_button);
|
||||||
|
efree(infobar);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
37
src/init.c
37
src/init.c
@ -38,18 +38,16 @@ void
|
|||||||
init(void)
|
init(void)
|
||||||
{
|
{
|
||||||
/* First init */
|
/* First init */
|
||||||
XSetErrorHandler(errorhandlerdummy);
|
|
||||||
gc = DefaultGC(dpy, screen);
|
gc = DefaultGC(dpy, screen);
|
||||||
screen = DefaultScreen(dpy);
|
screen = DefaultScreen(dpy);
|
||||||
init_font();
|
init_font();
|
||||||
init_cursor();
|
init_cursor();
|
||||||
init_key();
|
init_key();
|
||||||
init_atom();
|
|
||||||
init_root();
|
init_root();
|
||||||
|
init_atom();
|
||||||
infobar_init();
|
infobar_init();
|
||||||
init_geometry();
|
init_geometry();
|
||||||
grabkeys();
|
grabkeys();
|
||||||
XSetErrorHandler(errorhandler);
|
|
||||||
|
|
||||||
/* Warning about font */
|
/* Warning about font */
|
||||||
if(TBARH + BORDH < font->height)
|
if(TBARH + BORDH < font->height)
|
||||||
@ -106,22 +104,6 @@ init_key(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Init atoms
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
init_atom(void)
|
|
||||||
{
|
|
||||||
wm_atom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
|
||||||
wm_atom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
|
||||||
wm_atom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
|
||||||
wm_atom[WMName] = XInternAtom(dpy, "WM_NAME", False);
|
|
||||||
net_atom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
|
||||||
net_atom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
|
||||||
XChangeProperty(dpy, root, net_atom[NetSupported], XA_ATOM, 32,
|
|
||||||
PropModeReplace, (unsigned char *) net_atom, NetLast);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Init root Window
|
/** Init root Window
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -142,6 +124,23 @@ init_root(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Init atoms
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
init_atom(void)
|
||||||
|
{
|
||||||
|
wm_atom[WMState] = XInternAtom(dpy, "WM_STATE", False);
|
||||||
|
wm_atom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
||||||
|
wm_atom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
||||||
|
wm_atom[WMName] = XInternAtom(dpy, "WM_NAME", False);
|
||||||
|
net_atom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
|
net_atom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
|
|
||||||
|
XChangeProperty(dpy, root, net_atom[NetSupported], XA_ATOM, 32,
|
||||||
|
PropModeReplace, (unsigned char *) net_atom, NetLast);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Init screen geometry
|
/** Init screen geometry
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
|||||||
@ -186,7 +186,7 @@ uicb_set_mwfact(uicb_t cmd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
tags[seltag].mwfact += c;
|
tags[seltag].mwfact += c;
|
||||||
arrange();
|
tags[seltag].layout.func();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ uicb_set_nmaster(uicb_t cmd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
tags[seltag].nmaster += n;
|
tags[seltag].nmaster += n;
|
||||||
arrange();
|
tags[seltag].layout.func();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -456,7 +456,7 @@ uicb_tile_switch(uicb_t cmd)
|
|||||||
client_detach(c);
|
client_detach(c);
|
||||||
client_attach(c);
|
client_attach(c);
|
||||||
client_focus(c);
|
client_focus(c);
|
||||||
arrange();
|
tags[seltag].layout.func();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -474,8 +474,7 @@ uicb_togglefree(uicb_t cmd)
|
|||||||
sel->max = False;
|
sel->max = False;
|
||||||
sel->lmax = False;
|
sel->lmax = False;
|
||||||
client_moveresize(sel, sel->ogeo, True);
|
client_moveresize(sel, sel->ogeo, True);
|
||||||
|
tags[seltag].layout.func();
|
||||||
arrange();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,8 +163,7 @@ mouse_resize(Client *c)
|
|||||||
mwf = tags[seltag].mwfact;
|
mwf = tags[seltag].mwfact;
|
||||||
|
|
||||||
tags[seltag].mwfact = (mwf < 0.05) ? 0.05 : ((mwf > 0.95) ? 0.95 : mwf);
|
tags[seltag].mwfact = (mwf < 0.05) ? 0.05 : ((mwf > 0.95) ? 0.95 : mwf);
|
||||||
|
tags[seltag].layout.func();
|
||||||
arrange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!c->tile)
|
if(!c->tile)
|
||||||
|
|||||||
@ -55,11 +55,10 @@ typedef enum { CloseButton = 0, MaxButton = 1, FreeButton = 2, LastButton } Butt
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* BarWindow Structure
|
* BarWindow Structure
|
||||||
* (titlebar, topbar..)
|
* (titlebar, infobar..)
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* Frame window */
|
|
||||||
Window win;
|
Window win;
|
||||||
Drawable dr;
|
Drawable dr;
|
||||||
struct
|
struct
|
||||||
@ -143,7 +142,6 @@ typedef struct
|
|||||||
void (*func)(void);
|
void (*func)(void);
|
||||||
} Layout;
|
} Layout;
|
||||||
|
|
||||||
|
|
||||||
/* Tag Structure */
|
/* Tag Structure */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,7 +73,6 @@ quit(void)
|
|||||||
XFreeCursor(dpy, cursor[CurMove]);
|
XFreeCursor(dpy, cursor[CurMove]);
|
||||||
XFreeCursor(dpy, cursor[CurResize]);
|
XFreeCursor(dpy, cursor[CurResize]);
|
||||||
infobar_destroy();
|
infobar_destroy();
|
||||||
efree(infobar);
|
|
||||||
efree(keys);
|
efree(keys);
|
||||||
efree(conf.titlebar.mouse);
|
efree(conf.titlebar.mouse);
|
||||||
efree(conf.client.mouse);
|
efree(conf.client.mouse);
|
||||||
|
|||||||
@ -89,8 +89,11 @@
|
|||||||
/* bar.c */
|
/* bar.c */
|
||||||
BarWindow *bar_create(Window parent, int x, int y, uint w, uint h, uint color, Bool entermask);
|
BarWindow *bar_create(Window parent, int x, int y, uint w, uint h, uint color, Bool entermask);
|
||||||
void bar_delete(BarWindow *bw);
|
void bar_delete(BarWindow *bw);
|
||||||
|
void bar_delete_subwin(BarWindow *bw);
|
||||||
void bar_map(BarWindow *bw);
|
void bar_map(BarWindow *bw);
|
||||||
|
void bar_map_subwin(BarWindow *bw);
|
||||||
void bar_unmap(BarWindow *bw);
|
void bar_unmap(BarWindow *bw);
|
||||||
|
void bar_unmap_subwin(BarWindow *bw);
|
||||||
void bar_move(BarWindow *bw, int x, int y);
|
void bar_move(BarWindow *bw, int x, int y);
|
||||||
void bar_resize(BarWindow *bw, uint w, uint h);
|
void bar_resize(BarWindow *bw, uint w, uint h);
|
||||||
void bar_refresh_color(BarWindow *bw);
|
void bar_refresh_color(BarWindow *bw);
|
||||||
@ -206,10 +209,10 @@ void uicb_set_nmaster(uicb_t);
|
|||||||
|
|
||||||
/* init.c */
|
/* init.c */
|
||||||
void init(void);
|
void init(void);
|
||||||
|
void init_root(void);
|
||||||
void init_atom(void);
|
void init_atom(void);
|
||||||
void init_font(void);
|
void init_font(void);
|
||||||
void init_cursor(void);
|
void init_cursor(void);
|
||||||
void init_root(void);
|
|
||||||
void init_key(void);
|
void init_key(void);
|
||||||
void init_geometry(void);
|
void init_geometry(void);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user