Barwin: Remove useless check and fix wmfsrc
This commit is contained in:
22
src/barwin.c
22
src/barwin.c
@@ -123,8 +123,6 @@ barwin_draw_text(BarWindow *bw, int x, int y, char *text)
|
|||||||
void
|
void
|
||||||
barwin_color_set(BarWindow *bw, uint bg, char *fg)
|
barwin_color_set(BarWindow *bw, uint bg, char *fg)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
bw->bg = bg;
|
bw->bg = bg;
|
||||||
bw->fg = fg;
|
bw->fg = fg;
|
||||||
|
|
||||||
@@ -146,8 +144,6 @@ barwin_color_set(BarWindow *bw, uint bg, char *fg)
|
|||||||
void
|
void
|
||||||
barwin_delete(BarWindow *bw)
|
barwin_delete(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
XSelectInput(dpy, bw->win, NoEventMask);
|
XSelectInput(dpy, bw->win, NoEventMask);
|
||||||
XDestroyWindow(dpy, bw->win);
|
XDestroyWindow(dpy, bw->win);
|
||||||
XFreePixmap(dpy, bw->dr);
|
XFreePixmap(dpy, bw->dr);
|
||||||
@@ -162,8 +158,6 @@ barwin_delete(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_delete_subwin(BarWindow *bw)
|
barwin_delete_subwin(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
XDestroySubwindows(dpy, bw->win);
|
XDestroySubwindows(dpy, bw->win);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -175,8 +169,6 @@ barwin_delete_subwin(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_map(BarWindow *bw)
|
barwin_map(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(!(bw->flags & MappedFlag));
|
|
||||||
|
|
||||||
XMapWindow(dpy, bw->win);
|
XMapWindow(dpy, bw->win);
|
||||||
|
|
||||||
bw->flags |= MappedFlag;
|
bw->flags |= MappedFlag;
|
||||||
@@ -192,8 +184,6 @@ barwin_map(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_map_subwin(BarWindow *bw)
|
barwin_map_subwin(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
XMapSubwindows(dpy, bw->win);
|
XMapSubwindows(dpy, bw->win);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -205,8 +195,6 @@ barwin_map_subwin(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_unmap(BarWindow *bw)
|
barwin_unmap(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw->flags & MappedFlag);
|
|
||||||
|
|
||||||
XUnmapWindow(dpy, bw->win);
|
XUnmapWindow(dpy, bw->win);
|
||||||
|
|
||||||
bw->flags &= ~MappedFlag;
|
bw->flags &= ~MappedFlag;
|
||||||
@@ -220,8 +208,6 @@ barwin_unmap(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_unmap_subwin(BarWindow *bw)
|
barwin_unmap_subwin(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
XUnmapSubwindows(dpy, bw->win);
|
XUnmapSubwindows(dpy, bw->win);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -235,7 +221,7 @@ barwin_unmap_subwin(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_move(BarWindow *bw, int x, int y)
|
barwin_move(BarWindow *bw, int x, int y)
|
||||||
{
|
{
|
||||||
if(!bw || (bw->geo.x == x && bw->geo.y == y))
|
if(bw->geo.x == x && bw->geo.y == y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XMoveWindow(dpy, bw->win, (bw->geo.x = x), (bw->geo.y = y));
|
XMoveWindow(dpy, bw->win, (bw->geo.x = x), (bw->geo.y = y));
|
||||||
@@ -251,7 +237,7 @@ barwin_move(BarWindow *bw, int x, int y)
|
|||||||
void
|
void
|
||||||
barwin_resize(BarWindow *bw, int w, int h)
|
barwin_resize(BarWindow *bw, int w, int h)
|
||||||
{
|
{
|
||||||
if(!bw || (bw->geo.width == w && bw->geo.height == h))
|
if(bw->geo.width == w && bw->geo.height == h)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Frame */
|
/* Frame */
|
||||||
@@ -285,8 +271,6 @@ barwin_resize(BarWindow *bw, int w, int h)
|
|||||||
void
|
void
|
||||||
barwin_refresh_color(BarWindow *bw)
|
barwin_refresh_color(BarWindow *bw)
|
||||||
{
|
{
|
||||||
CHECK(bw);
|
|
||||||
|
|
||||||
XSetForeground(dpy, gc, bw->bg);
|
XSetForeground(dpy, gc, bw->bg);
|
||||||
XFillRectangle(dpy, bw->dr, gc, 0, 0, bw->geo.width, bw->geo.height);
|
XFillRectangle(dpy, bw->dr, gc, 0, 0, bw->geo.width, bw->geo.height);
|
||||||
|
|
||||||
@@ -318,8 +302,6 @@ barwin_refresh_color(BarWindow *bw)
|
|||||||
void
|
void
|
||||||
barwin_refresh(BarWindow *bw)
|
barwin_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;
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *ol = "csS";
|
char *ol = "cs";
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
|||||||
2
wmfsrc
2
wmfsrc
@@ -309,6 +309,8 @@
|
|||||||
prompt = "Exec: "
|
prompt = "Exec: "
|
||||||
command = "exec"
|
command = "exec"
|
||||||
[/set_launcher]
|
[/set_launcher]
|
||||||
|
[/launcher]
|
||||||
|
|
||||||
[keys]
|
[keys]
|
||||||
# Reload the configuration of wmfs.
|
# Reload the configuration of wmfs.
|
||||||
[key] mod = {"Alt", "Control"} key = "r" func = "reload" [/key]
|
[key] mod = {"Alt", "Control"} key = "r" func = "reload" [/key]
|
||||||
|
|||||||
Reference in New Issue
Block a user