diff options
author | sabetts <sabetts> | 2003-08-10 23:35:05 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-08-10 23:35:05 +0000 |
commit | feb5b1ad8873e110191e7510b334171e06e671dc (patch) | |
tree | 88cb2f6febf818eed0b6ea291a24a1dfe3f6b588 | |
parent | 458692956c3f885f74d73116ac484fac9d666c57 (diff) | |
download | ratpoison-feb5b1ad8873e110191e7510b334171e06e671dc.zip |
(give_window_focus): only save the pointer position
when win and last_win aren't the same window.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/window.c | 13 |
2 files changed, 12 insertions, 4 deletions
@@ -1,5 +1,8 @@ 2003-08-10 Shawn Betts <sabetts@sfu.ca> + * src/window.c (give_window_focus): only save the pointer position + when win and last_win aren't the same window. + * src/actions.h (cmd_listhook): new prototype * src/actions.c (use_commands): new command listhook diff --git a/src/window.c b/src/window.c index 70b9e30..10a359f 100644 --- a/src/window.c +++ b/src/window.c @@ -327,12 +327,17 @@ give_window_focus (rp_window *win, rp_window *last_win) unhide_window (win); - /* Warp the cursor to the window's saved position. */ - if (last_win != NULL) save_mouse_position (last_win); + /* Warp the cursor to the window's saved position if last_win and + win are different windows. */ + if (last_win != NULL && win != last_win) + save_mouse_position (last_win); if (defaults.warp) - XWarpPointer (dpy, None, win->scr->root, - 0, 0, 0, 0, win->mouse_x, win->mouse_y); + { + PRINT_DEBUG (("Warp pointer\n")); + XWarpPointer (dpy, None, win->scr->root, + 0, 0, 0, 0, win->mouse_x, win->mouse_y); + } /* Swap colormaps */ if (last_win != NULL) XUninstallColormap (dpy, last_win->colormap); |