From 84cedde03cd0348ece19bba187a59fc9e56581f5 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 14 Feb 2010 19:04:06 +0000 Subject: [PATCH] No need to query pointer in move/resize start. SVN revision: 46171 --- src/events.c | 2 +- src/events.h | 4 ++-- src/ewins.c | 13 ++++++------- src/moveresize.c | 7 ++++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/events.c b/src/events.c index 7105223f..dc6cf6ca 100644 --- a/src/events.c +++ b/src/events.c @@ -367,7 +367,7 @@ EventsInit(void) } int -EventsGetXY(int *px, int *py) +EventsUpdateXY(int *px, int *py) { int ss; diff --git a/src/events.h b/src/events.h index 794c9252..9c15f1d8 100644 --- a/src/events.h +++ b/src/events.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2008 Kim Woelders + * Copyright (C) 2006-2010 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -46,6 +46,6 @@ typedef void (EventFdHandler) (void); EventFdDesc *EventFdRegister(int fd, EventFdHandler * handler); void EventFdUnregister(EventFdDesc * efd); -int EventsGetXY(int *px, int *py); +int EventsUpdateXY(int *px, int *py); #endif /* _EVENTS_H_ */ diff --git a/src/ewins.c b/src/ewins.c index 3909e867..7a0ceae4 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -859,7 +859,7 @@ AddToFamily(EWin * ewin, Window xwin, int startup) /* the window there */ DeskGoto(dsk); - EventsGetXY(&cx, &cy); + EventsUpdateXY(&cx, &cy); /* try to center the window on the mouse pointer */ cx -= EoGetW(ewin) / 2; @@ -907,19 +907,18 @@ AddToFamily(EWin * ewin, Window xwin, int startup) /* if we should slide it in and are not currently in the middle of a slide */ if ((manplace) && (!ewin->state.placed)) { - int rx, ry; + int cx, cy; /* if the loser has manual placement on and the app asks to be on */ /* a desktop, then send E to that desktop so the user can place */ /* the window there */ DeskGoto(dsk); - EQueryPointer(NULL, &rx, &ry, NULL, NULL); - Mode.events.cx = rx; - Mode.events.cy = ry; + EventsUpdateXY(&cx, &cy); + ewin->state.placed = 1; - x = Mode.events.cx - 8; - y = Mode.events.cy - 8; + x = cx - 8; + y = cy - 8; GrabPointerSet(VROOT, ECSR_GRAB, 0); EoSetFloating(ewin, 1); /* Causes reparenting to root */ EwinOpFloatAt(ewin, OPSRC_USER, x, y); diff --git a/src/moveresize.c b/src/moveresize.c index b1327e52..02e59bdd 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -26,7 +26,6 @@ #include "cursors.h" #include "desktops.h" #include "emodule.h" -#include "events.h" #include "ewins.h" #include "focus.h" #include "grabs.h" @@ -98,7 +97,8 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup) Mode_mr.using_kbd = kbd; Mode_mr.nogroup = nogroup; - EventsGetXY(&cx, &cy); + cx = Mode.events.cx; + cy = Mode.events.cy; SoundPlay(SOUND_MOVE_START); @@ -305,7 +305,8 @@ MoveResizeResizeStart(EWin * ewin, int kbd, int hv) Mode_mr.ewin = ewin; - EventsGetXY(&cx, &cy); + cx = Mode.events.cx; + cy = Mode.events.cy; SoundPlay(SOUND_RESIZE_START);