diff options
author | oga | 2008-05-20 14:50:51 +0000 |
---|---|---|
committer | oga | 2008-05-20 14:50:51 +0000 |
commit | c4a8f44931713f32f250264ca00520aae30fc0e3 (patch) | |
tree | 28a04445e99404bad46b8fbdc9070d8635e0fe72 /calmwm.c | |
parent | 073225cc6903924869d463a1014860a78f73b008 (diff) | |
download | cwm-c4a8f44931713f32f250264ca00520aae30fc0e3.tar.gz |
Pull out the behaviour in grab_label and search_start into one utility
function menu_filter(). The plan is to eventually merge in grab_menu too.
Shrinks the code a fair bit.
Also, change XMaskEvent for XWindowEvent to prevent getting exposes for other
windows. This is particuarly noticable on slow machines with a LOT of xterms
(todd, you're an odd man).
ok okan@, todd@.
Diffstat (limited to 'calmwm.c')
-rw-r--r-- | calmwm.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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. * - * $Id: calmwm.c,v 1.18 2008/05/19 18:53:09 oga Exp $ + * $Id: calmwm.c,v 1.19 2008/05/20 14:50:51 oga Exp $ */ #include "headers.h" @@ -152,6 +152,10 @@ x_setupscreen(struct screen_ctx *sc, u_int which) sc->display = x_screenname(which); sc->which = which; sc->rootwin = RootWindow(X_Dpy, which); + + sc->xmax = DisplayWidth(X_Dpy, sc->which); + sc->ymax = DisplayHeight(X_Dpy, sc->which); + XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, which), "black", &sc->fgcolor, &tmp); XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, which), @@ -204,6 +208,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which) font_init(sc); DefaultFont = font_getx(sc, Conf.DefaultFontName); + sc->fontheight = font_ascent(DefaultFont) + + font_descent(DefaultFont) + 1; /* * XXX - this should *really* be in screen_init(). ordering @@ -213,7 +219,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which) /* Initialize menu window. */ grab_menuinit(sc); - search_init(sc); /* Deal with existing clients. */ XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins); |