From a99824e4857d7ce3947f4cafd93e013590936d9e Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Mon, 21 Jun 2021 19:48:22 +0100 Subject: [PATCH] move: Warp: move pointer to centre of window When a user issues a Move command, such as: Move -10p -10p Warp The mouse pointer would move to the window's same resting place coordinate, rather than to the window itself. This appears to have been broken in fvwm2 for some time. Rather than reimplement the logic found in WarpToWindow, let "Warp" imply warping the pointer to the centre of the window. Eventually, "Warp" as an option will go away entirely, so this is only meant as a temporary solution as it's technically something which we support. Should the user want anything more granular or a different pointer location than what "Warp" now implies with this comment, then the "WarpToWindow" command can be used instead. Fixes #551 --- fvwm/move_resize.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c index f0e2c678e..57d56f945 100644 --- a/fvwm/move_resize.c +++ b/fvwm/move_resize.c @@ -1903,9 +1903,8 @@ static void __move_window(F_CMD_ARGS, Bool do_animate, int mode) fw->g.frame.height, True); if (fWarp & !do_animate) { - FWarpPointer( - dpy, None, None, 0, 0, 0, 0, FinalX - x, - FinalY - y); + char *cmd = "WarpToWindow 50 50"; + execute_function_override_window(NULL, exc, cmd, 0, fw); } if (IS_MAXIMIZED(fw)) { @@ -2169,7 +2168,7 @@ static void DoSnapAttract( /* horizontally */ if (!(*py + self.height < mon_y || *py > mon_y + mon_h)) { - if (*px + self.width >= + if (*px + self.width >= mon_w + mon_x - fw->snap_attraction.proximity && *px + self.width <= mon_w + mon_x + fw->snap_attraction.proximity)