summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-08-10 23:35:05 +0000
committersabetts <sabetts>2003-08-10 23:35:05 +0000
commitfeb5b1ad8873e110191e7510b334171e06e671dc (patch)
tree88cb2f6febf818eed0b6ea291a24a1dfe3f6b588 /src/window.c
parent458692956c3f885f74d73116ac484fac9d666c57 (diff)
downloadratpoison-feb5b1ad8873e110191e7510b334171e06e671dc.zip
(give_window_focus): only save the pointer position
when win and last_win aren't the same window.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c13
1 files changed, 9 insertions, 4 deletions
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);