Lincoln Ramsay wrote:
> 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) :)
This looks like the wrong solution. I suspect that for some reason the
"need_mouse_correct" flag is set when it shouldn't. I can't reproduce
the problem, thus it's hard to find.
Simplest way is probably to disable lines where need_mouse_correct is
set one by one and check if the problem goes away.
If you can run Vim in a debugger, you could also put a breakpoint at the
code you deleted and find out where it's called from. If it's becaues
the need_mouse_correct flag was set, you still need to do the work of
disabling that.
--
[SIR LAUNCELOT runs back up the stairs, grabs a rope
of the wall and swings out over the heads of the CROWD in a
swashbuckling manner towards a large window. He stops just short
of the window and is left swing pathetically back and forth.]
LAUNCELOT: Excuse me ... could somebody give me a push ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---