aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2013-05-20 20:21:04 +0000
committerokan2013-05-20 20:21:04 +0000
commita4fa4ac623b54b25b58caaba5b717165be6915bb (patch)
tree16391330bcca29b3937500ccd6fb18ebe57b653f /conf.c
parente9251684bd2c326cd3a874f932ccbca1c93b4e2d (diff)
downloadcwm-a4fa4ac623b54b25b58caaba5b717165be6915bb.tar.gz
- configure menuwin with the screen, then create the xft drawable using
the menu window since that's the only place on which we draw - elminate the need to change the drawable on every font draw
Diffstat (limited to '')
-rw-r--r--conf.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/conf.c b/conf.c
index 1f0e2da..1e386a2 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.128 2013/05/19 23:16:29 okan Exp $
+ * $OpenBSD: conf.c,v 1.129 2013/05/20 20:21:04 okan Exp $
*/
#include <sys/param.h>
@@ -103,11 +103,6 @@ conf_screen(struct screen_ctx *sc)
sc->gap = Conf.gap;
- sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
- sc->visual, sc->colormap);
- if (sc->xftdraw == NULL)
- errx(1, "XftDrawCreate");
-
sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
if (sc->xftfont == NULL)
errx(1, "XftFontOpenName");
@@ -134,6 +129,16 @@ conf_screen(struct screen_ctx *sc)
if (!XftColorAllocValue(X_Dpy, sc->visual, sc->colormap,
&xc.color, &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
warnx("XftColorAllocValue: '%s'", Conf.color[i]);
+
+ sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1,
+ Conf.bwidth,
+ sc->xftcolor[CWM_COLOR_MENU_FG].pixel,
+ sc->xftcolor[CWM_COLOR_MENU_BG].pixel);
+
+ sc->xftdraw = XftDrawCreate(X_Dpy, sc->menuwin,
+ sc->visual, sc->colormap);
+ if (sc->xftdraw == NULL)
+ errx(1, "XftDrawCreate");
}
static struct {