diff options
-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); |