aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2012-12-17 02:53:29 +0000
committerokan2012-12-17 02:53:29 +0000
commit03176d219db80f5577b1945a0b32533a5263b933 (patch)
tree2d1617dea4be39bf1aa03ad2efd3733efc485f01
parent413da1eebb4612d1fe0c55b2b9a5957b5379285d (diff)
downloadcwm-03176d219db80f5577b1945a0b32533a5263b933.tar.gz
knf
-rw-r--r--calmwm.h16
-rw-r--r--conf.c12
-rw-r--r--cwmrc.52
-rw-r--r--font.c17
-rw-r--r--menu.c14
-rw-r--r--parse.y4
6 files changed, 34 insertions, 31 deletions
diff --git a/calmwm.h b/calmwm.h
index 9fe66e3..bea9467 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.164 2012/12/17 02:28:45 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.165 2012/12/17 02:53:29 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -317,7 +317,8 @@ __dead void usage(void);
void client_applysizehints(struct client_ctx *);
struct client_ctx *client_current(void);
void client_cycle(struct screen_ctx *, int);
-void client_cycle_leave(struct screen_ctx *, struct client_ctx *);
+void client_cycle_leave(struct screen_ctx *,
+ struct client_ctx *);
void client_delete(struct client_ctx *);
void client_draw_border(struct client_ctx *);
struct client_ctx *client_find(Window);
@@ -364,8 +365,8 @@ void search_match_client(struct menu_q *, struct menu_q *,
char *);
void search_match_exec(struct menu_q *, struct menu_q *,
char *);
-void search_match_exec_path(struct menu_q *, struct menu_q *,
- char *);
+void search_match_exec_path(struct menu_q *,
+ struct menu_q *, char *);
void search_match_path_any(struct menu_q *, struct menu_q *,
char *);
void search_match_text(struct menu_q *, struct menu_q *,
@@ -475,6 +476,8 @@ void xu_ptr_setpos(Window, int, int);
void xu_ptr_ungrab(void);
void xu_sendmsg(Window, Atom, long);
void xu_setstate(struct client_ctx *, int);
+void xu_xorcolor(XRenderColor, XRenderColor,
+ XRenderColor *);
void xu_ewmh_net_supported(struct screen_ctx *);
void xu_ewmh_net_supported_wm_check(struct screen_ctx *);
@@ -487,12 +490,11 @@ void xu_ewmh_net_wm_number_of_desktops(struct screen_ctx *);
void xu_ewmh_net_showing_desktop(struct screen_ctx *);
void xu_ewmh_net_virtual_roots(struct screen_ctx *);
void xu_ewmh_net_current_desktop(struct screen_ctx *, long);
-void xu_ewmh_net_desktop_names(struct screen_ctx *, char *, int);
+void xu_ewmh_net_desktop_names(struct screen_ctx *, char *,
+ int);
void xu_ewmh_net_wm_desktop(struct client_ctx *);
-void xu_xorcolor(XRenderColor, XRenderColor, XRenderColor *);
-
void u_exec(char *);
void u_spawn(char *);
diff --git a/conf.c b/conf.c
index a7b00a3..2b7fded 100644
--- a/conf.c
+++ b/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: conf.c,v 1.111 2012/12/17 02:28:45 okan Exp $
+ * $OpenBSD: conf.c,v 1.112 2012/12/17 02:53:29 okan Exp $
*/
#include <sys/param.h>
@@ -62,14 +62,14 @@ conf_gap(struct conf *c, struct screen_ctx *sc)
void
conf_font(struct conf *c, struct screen_ctx *sc)
{
- font_init(sc, c->font, (const char**)c->menucolor);
+ font_init(sc, c->font, (const char **)c->menucolor);
}
static char *menu_color_binds[CWM_COLOR_MENU_MAX] = {
- "black", /* CWM_COLOR_MENU_FG */
- "white", /* CWM_COLOR_MENU_BG */
- "black", /* CWM_COLOR_MENU_FONT */
- "", /* CWM_COLOR_MENU_FONT_SEL */
+ "black", /* CWM_COLOR_MENU_FG */
+ "white", /* CWM_COLOR_MENU_BG */
+ "black", /* CWM_COLOR_MENU_FONT */
+ "", /* CWM_COLOR_MENU_FONT_SEL */
};
static struct color color_binds[CWM_COLOR_MAX] = {
diff --git a/cwmrc.5 b/cwmrc.5
index 81e21bc..5c48d89 100644
--- a/cwmrc.5
+++ b/cwmrc.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cwmrc.5,v 1.50 2012/12/17 02:28:45 okan Exp $
+.\" $OpenBSD: cwmrc.5,v 1.51 2012/12/17 02:53:29 okan Exp $
.\"
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
.\"
diff --git a/font.c b/font.c
index 7268b7e..75d5686 100644
--- a/font.c
+++ b/font.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: font.c,v 1.21 2012/12/17 02:28:45 okan Exp $
+ * $OpenBSD: font.c,v 1.22 2012/12/17 02:53:29 okan Exp $
*/
#include <sys/param.h>
@@ -51,8 +51,8 @@ font_height(struct screen_ctx *sc)
void
font_init(struct screen_ctx *sc, const char *name, const char **color)
{
- int i;
- XRenderColor c;
+ int i;
+ XRenderColor c;
sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which));
@@ -62,7 +62,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color)
sc->font = XftFontOpenName(X_Dpy, sc->which, name);
if (sc->font == NULL)
errx(1, "XftFontOpenName");
- for(i = 0; i < CWM_COLOR_MENU_MAX; i++) {
+
+ for (i = 0; i < CWM_COLOR_MENU_MAX; i++) {
if (*color[i] == '\0')
break;
if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which),
@@ -74,11 +75,11 @@ font_init(struct screen_ctx *sc, const char *name, const char **color)
return;
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG].color,
- sc->xftcolor[CWM_COLOR_MENU_FG].color, &c);
+ sc->xftcolor[CWM_COLOR_MENU_FG].color, &c);
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT].color, c, &c);
if (!XftColorAllocValue(X_Dpy, DefaultVisual(X_Dpy, sc->which),
- DefaultColormap(X_Dpy, sc->which), &c,
- &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
+ DefaultColormap(X_Dpy, sc->which), &c,
+ &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
errx(1, "XftColorAllocValue");
}
@@ -97,7 +98,7 @@ void
font_draw(struct screen_ctx *sc, const char *text, int len,
Drawable d, int active, int x, int y)
{
- int color;
+ int color;
color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
XftDrawChange(sc->xftdraw, d);
diff --git a/menu.c b/menu.c
index 96558ce..0023637 100644
--- a/menu.c
+++ b/menu.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: menu.c,v 1.46 2012/12/17 02:28:45 okan Exp $
+ * $OpenBSD: menu.c,v 1.47 2012/12/17 02:53:29 okan Exp $
*/
#include <sys/param.h>
@@ -473,17 +473,16 @@ menu_draw_entry(struct screen_ctx *sc, struct menu_ctx *mc,
TAILQ_FOREACH(mi, resultq, resultentry)
if (entry == i++)
break;
-
if (mi == NULL)
return;
+
color = active ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG;
- text = mi->print[0] != '\0' ?
- mi->print : mi->text;
+ text = mi->print[0] != '\0' ? mi->print : mi->text;
XftDrawRect(sc->xftdraw, &sc->xftcolor[color], 0,
- font_height(sc) * entry, mc->width,
- font_height(sc) + font_descent(sc));
+ font_height(sc) * entry, mc->width,
+ font_height(sc) + font_descent(sc));
font_draw(sc, text, strlen(text), sc->menuwin, active,
- 0, font_height(sc) * entry + font_ascent(sc) + 1);
+ 0, font_height(sc) * entry + font_ascent(sc) + 1);
}
static void
@@ -503,6 +502,7 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
menu_draw_entry(sc, mc, resultq, mc->entry, 1);
} else
(void)xu_ptr_regrab(MENUGRABMASK, Cursor_default);
+
if (mc->hasprompt)
menu_draw_entry(sc, mc, resultq, 1, 1);
}
diff --git a/parse.y b/parse.y
index fa22814..238bebc 100644
--- a/parse.y
+++ b/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.35 2012/12/17 02:28:45 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.36 2012/12/17 02:53:29 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -582,7 +582,7 @@ parse_config(const char *filename, struct conf *xconf)
xconf->color[i].name = conf->color[i].name;
for (i = 0; i < CWM_COLOR_MENU_MAX; i++)
- xconf->menucolor[i]= conf->menucolor[i];
+ xconf->menucolor[i] = conf->menucolor[i];
xconf->font = conf->font;
}