aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan2012-07-04 23:42:03 +0000
committerokan2012-07-04 23:42:03 +0000
commit43b0623ffd37b963e25c844f0f7bbfa162e707b6 (patch)
treed23fc81a824e5420f5e719933b7917fead92fb38 /mousefunc.c
parentf515a39495080eb80c8c8aaa62f44070123fc7c4 (diff)
downloadcwm-43b0623ffd37b963e25c844f0f7bbfa162e707b6.tar.gz
assign and use screen ctx where appropriate and consistently.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/mousefunc.c b/mousefunc.c
index 574ef62..b84e189 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.34 2011/10/17 18:18:38 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.35 2012/07/04 23:42:03 okan Exp $
*/
#include <sys/param.h>
@@ -137,6 +137,7 @@ mousefunc_window_move(struct client_ctx *cc, void *arg)
{
XEvent ev;
Time ltime = 0;
+ struct screen_ctx *sc = cc->sc;
int px, py;
client_raise(cc);
@@ -161,10 +162,10 @@ mousefunc_window_move(struct client_ctx *cc, void *arg)
cc->geom.y = ev.xmotion.y_root - py - cc->bwidth;
cc->geom.x += client_snapcalc(cc->geom.x,
- cc->geom.width, cc->sc->xmax,
+ cc->geom.width, sc->xmax,
cc->bwidth, Conf.snapdist);
cc->geom.y += client_snapcalc(cc->geom.y,
- cc->geom.height, cc->sc->ymax,
+ cc->geom.height, sc->ymax,
cc->bwidth, Conf.snapdist);
/* don't move more than 60 times / second */
@@ -217,13 +218,12 @@ mousefunc_menu_group(struct client_ctx *cc, void *arg)
void
mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
{
- struct screen_ctx *sc;
+ struct screen_ctx *sc = cc->sc;
struct client_ctx *old_cc;
struct menu *mi;
struct menu_q menuq;
char *wname;
- sc = cc->sc;
old_cc = client_current();
TAILQ_INIT(&menuq);
@@ -261,13 +261,11 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
void
mousefunc_menu_cmd(struct client_ctx *cc, void *arg)
{
- struct screen_ctx *sc;
+ struct screen_ctx *sc = cc->sc;
struct menu *mi;
struct menu_q menuq;
struct cmd *cmd;
- sc = cc->sc;
-
TAILQ_INIT(&menuq);
TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
mi = xcalloc(1, sizeof(*mi));