Skip to content

Commit

Permalink
move: Warp: move pointer to centre of window
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ThomasAdam committed Jun 21, 2021
1 parent ef930e5 commit a99824e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fvwm/move_resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a99824e

Please sign in to comment.