aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/place.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/place.c b/src/place.c
index 188945b..b9cdaf4 100644
--- a/src/place.c
+++ b/src/place.c
@@ -361,13 +361,14 @@ void UpdateStrutBounds(BoundingBox *box) {
****************************************************************************/
void PlaceClient(ClientNode *np, int alreadyMapped) {
+ static int offset = 0;
static int prevx = -1;
static int prevy = -1;
static TimeType last = ZERO_TIME;
BoundingBox box;
const ScreenType *sp;
- int height, offset, overflow, width, winx, winy, x, y;
+ int height, overflow, width, winx, winy, x, y;
int north, south, east, west;
TimeType now;
unsigned int mask;
@@ -405,7 +406,7 @@ void PlaceClient(ClientNode *np, int alreadyMapped) {
if(prevx > -1 && prevy > -1
&& (abs(x - prevx) <= borderWidth
|| abs(y - prevy) <= borderWidth))
- offset = borderWidth + titleHeight;
+ offset += borderWidth + titleHeight;
else
offset = 0;
@@ -415,6 +416,10 @@ void PlaceClient(ClientNode *np, int alreadyMapped) {
offset = 0;
last = now;
+ /* Save cursor location. */
+ prevx = x;
+ prevy = y;
+
/* Show window at cursor. */
width = np->width;
height = np->height;
@@ -436,15 +441,10 @@ void PlaceClient(ClientNode *np, int alreadyMapped) {
/* Correct for overflow. */
ReturnToBorder(np, north, west);
+ /* Add offset. */
np->x += offset;
np->y += offset;
- MoveMouseToClient(np);
-
- /* Save cursor location. */
- JXQueryPointer(display, rootWindow, &rootReturn, &childReturn,
- &x, &y, &winx, &winy, &mask);
- prevx = x;
- prevy = y;
+ if(offset) ReturnToBorder(np, north, west);
}