From 317929baeaad18b487ac9463f5c01f2a7132746e Mon Sep 17 00:00:00 2001 From: marco candrian Date: Sat, 1 Mar 2008 12:45:59 +0100 Subject: [PATCH] Is the pointer inside client with including the borders... it didn't reshift the pointer when the pointer was on the right border (or even somebit in the client) because it didn't calculate the border with to the dimensions. Also, it wrapped the pointer inside the client. now it leaves it on the border when that was the case before. Or on resizing (smaller) the pointer might also move (relativ to the client) to the most outside point of the left or top border. There is still the problem so: the client gets moved/resize, the pointer might get out of the area temprarly and the client loses the focus - despite that the pointer will reshifted onto it again. A general: client_focus(sel, screen, False); at the end seems to help, but is probably not clean etc. Signed-off-by: Julien Danjou --- client.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index 3607b811..6f8963fe 100644 --- a/client.c +++ b/client.c @@ -830,14 +830,17 @@ uicb_client_moveresize(int screen, char *arg) get_phys_screen(screen)), &dummy, &dummy, &mx, &my, &dx, &dy, &dui); client_resize(sel, area, globalconf.screens[sel->screen].resize_hints); - if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my) + if (xqp && ox <= mx && (ox + 2 * sel->border + ow) >= mx && + oy <= my && (oy + 2 * sel->border + oh) >= my) { nmx = mx - (ox + sel->border) + sel->geometry.width - ow; - if(nmx < 0) - nmx = 0; nmy = my - (oy + sel->border) + sel->geometry.height - oh; - if(nmy < 0) - nmy = 0; + + if(nmx < -sel->border) /* can happen on a resize */ + nmx = -sel->border; + if(nmy < -sel->border) + nmy = -sel->border; + XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, nmx, nmy);