aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan2013-05-02 19:30:10 +0000
committerokan2013-05-02 19:30:10 +0000
commitcff63bd60e3e85fd463ba9db72a48f9f610b3dd0 (patch)
tree025c8f2e1389a0a52a9f24a5072bcaea957cf404 /mousefunc.c
parenta0f62e37b272c6a5f0ea3189df531cb94de8ced6 (diff)
downloadcwm-cff63bd60e3e85fd463ba9db72a48f9f610b3dd0.tar.gz
only redraw the name/size box when the client resizes, not every time
there's movement; should slightly help with resize syncs.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/mousefunc.c b/mousefunc.c
index a011bf8..8db4423 100644
--- a/mousefunc.c
+++ b/mousefunc.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: mousefunc.c,v 1.47 2013/05/02 17:25:15 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.48 2013/05/02 19:30:10 okan Exp $
*/
#include <sys/param.h>
@@ -31,14 +31,12 @@
#include "calmwm.h"
-static int mousefunc_sweep_calc(struct client_ctx *, int, int, int, int);
+static void mousefunc_sweep_calc(struct client_ctx *, int, int, int, int);
static void mousefunc_sweep_draw(struct client_ctx *);
-static int
+static void
mousefunc_sweep_calc(struct client_ctx *cc, int x, int y, int mx, int my)
{
- int width = cc->geom.w, height = cc->geom.h;
-
cc->geom.w = abs(x - mx) - cc->bwidth;
cc->geom.h = abs(y - my) - cc->bwidth;
@@ -46,8 +44,6 @@ mousefunc_sweep_calc(struct client_ctx *cc, int x, int y, int mx, int my)
cc->geom.x = x <= mx ? x : x - cc->geom.w;
cc->geom.y = y <= my ? y : y - cc->geom.h;
-
- return (width != cc->geom.w || height != cc->geom.h);
}
static void
@@ -103,15 +99,14 @@ mousefunc_window_resize(struct client_ctx *cc, void *arg)
client_draw_border(cc);
break;
case MotionNotify:
- if (mousefunc_sweep_calc(cc, x, y,
- ev.xmotion.x_root, ev.xmotion.y_root))
- /* Recompute window output */
- mousefunc_sweep_draw(cc);
+ mousefunc_sweep_calc(cc, x, y,
+ ev.xmotion.x_root, ev.xmotion.y_root);
/* don't resize more than 60 times / second */
if ((ev.xmotion.time - ltime) > (1000 / 60)) {
ltime = ev.xmotion.time;
client_resize(cc, 1);
+ mousefunc_sweep_draw(cc);
}
break;
case ButtonRelease: