aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authoroga2008-05-20 14:50:51 +0000
committeroga2008-05-20 14:50:51 +0000
commitc4a8f44931713f32f250264ca00520aae30fc0e3 (patch)
tree28a04445e99404bad46b8fbdc9070d8635e0fe72 /client.c
parent073225cc6903924869d463a1014860a78f73b008 (diff)
downloadcwm-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 '')
-rw-r--r--client.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/client.c b/client.c
index a5cd9af..691f9bd 100644
--- a/client.c
+++ b/client.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.
*
- * $Id: client.c,v 1.26 2008/05/19 17:24:19 okan Exp $
+ * $Id: client.c,v 1.27 2008/05/20 14:50:51 oga Exp $
*/
#include "headers.h"
@@ -657,7 +657,7 @@ client_placecalc(struct client_ctx *cc)
{
struct screen_ctx *sc = CCTOSC(cc);
int yslack, xslack;
- int x, y, height, width, ymax, xmax, mousex, mousey;
+ int x, y, height, width, mousex, mousey;
y = cc->geom.y;
x = cc->geom.x;
@@ -665,11 +665,9 @@ client_placecalc(struct client_ctx *cc)
height = cc->geom.height;
width = cc->geom.width;
- ymax = DisplayHeight(X_Dpy, sc->which) - cc->bwidth;
- xmax = DisplayWidth(X_Dpy, sc->which) - cc->bwidth;
- yslack = ymax - cc->geom.height;
- xslack = xmax - cc->geom.width;
+ yslack = sc->ymax - cc->geom.height;
+ xslack = sc->xmax - cc->geom.width;
xu_ptr_getpos(sc->rootwin, &mousex, &mousey);
@@ -695,7 +693,7 @@ client_placecalc(struct client_ctx *cc)
} else {
if (yslack < 0) {
y = cc->bwidth;
- height = ymax;
+ height = sc->ymax;
} else {
if (y == 0 || y > yslack)
y = MIN(mousey, yslack);
@@ -704,7 +702,7 @@ client_placecalc(struct client_ctx *cc)
if (xslack < 0) {
x = cc->bwidth;
- width = xmax;
+ width = sc->xmax;
} else {
if (x == 0 || x > xslack)
x = MIN(mousex, xslack);