Hello all,
I noticed that gvim was warping my pointer unexpectedly and as this was
annoying, I thought I'd try to track it down.
It turns out gvim was behaving 'correctly' - exactly as described in the
:mousefocus preference. The thing is though that I do not want this
behaviour.
I use point-to-focus at the window manager level and :mousefocus in gvim
so whenever I point my mouse at a vim window, I expect that window to
get focus. With the current behaviour of gvim, this was not happening
when 2 vim windows were in a single gvim instance because moving the
mouse to the window that was not focused would warp the pointer instead
of focusing that window.
In src/gui.c the function gui_mouse_correct is called when the gvim
window gets focus. Simply removing the call to gui_mch_setmouse makes
gvim behave the way I was expecting it to behave - focusing the window
that I point my mouse at.
Perhaps my situation is somewhat unique. I build vim from source using
the athena widget set and then turn off all the GUI stuff (only the
scrollbar remains). It makes my gvim pretty much the same as a console
vim but with better mouse integration. I use the same config on
Windows/Mac too but with binaries. I use point-to-focus where possible
and abhor pointer warping which is why this got my attention in the
first place.
I have attached a patch showing the change I made in case my description
above was not clear enough. I don't know if this is important enough to
justify an option but I would appreciate an option in order to avoid
having to patch every new version of vim I try to use (and especially
for Windows/Mac where I don't build from source) :)
Thanks for your time.
--
Link
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
diff --git a/src/gui.c b/src/gui.c
index 426cea9..5545cec 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4657,9 +4657,6 @@ gui_mouse_correct()
if (wp != curwin && wp != NULL) /* If in other than current window */
{
validate_cline_row();
- gui_mch_setmouse((int)W_ENDCOL(curwin) * gui.char_width - 3,
- (W_WINROW(curwin) + curwin->w_wrow) * gui.char_height
- + (gui.char_height) / 2);
}
}