Loading ...
Sorry, an error occurred while loading the content.

Re: Windows XP (X-Mouse) and new window issues [was posted on vim_use]

Expand Messages
  • Bram Moolenaar
    ... That change would break anything that is interactive. And may even crash your system for some old DOS commands (although Windows XP appears to work better
    Message 1 of 7 , Nov 3, 2008
    • 0 Attachment
      M. Brotherston wrote:

      > I posted this thread originally on vim_use, but I the only 'solution'
      > I found so far was to modify the source code. So here goes:
      >
      > [Quoted from original post]
      > Situation. I downloaded and installed 'TweakUI' for Windows XP. I
      > turned on the 'X-Mouse :: Activation Follows Mouse' feature, and
      > selected on 'General :: Focus :: Prevent applications from stealing
      > focus". - I'm trying to get the closest feel I can to running Linux,
      > without actually running Linux [requirement]
      >
      > I use the Windows Version of Vim [downloaded from the vim.org website]
      > VIM - Vi IMproved 7.1 (2007 May 12, compiled May 12 2007 14:19:39)
      > MS-Windows 32 bit GUI version with OLE support
      > Compiled by Bram@KIBAALE
      >
      > And have a mapping setup for interaction with Cygwin in my .vimrc:
      > if has("win32")
      > set shellslash
      > " F2 -- map F2 key to read-write file (autoload should be set for
      > this!)
      > map <silent> <f2> :silent! !chmod u+w `cygpath "%"`<CR>
      > " F3 -- map F3 key to read-only file (autoload should be set for
      > this!)
      > map <silent> <f3> :silent! !chmod u-w `cygpath "%"`<CR>
      > else
      > " F2 -- map F2 key to read-write file (autoload should be set for
      > this!)
      > map <silent> <f2> :silent! !chmod u+w %<CR>
      > " F3 -- map F3 key to read-only file (autoload should be set for
      > this!)
      > map <silent> <f3> :silent! !chmod u-w %<CR>
      > endif
      >
      > Now every time I press F2/F3 to change permissions of the files, the
      > mouse jumps half-way across my screen, and I lose focus on Vim. I
      > think a new window appears/disappears on the screen [like a flicker],
      > taking the mouse for a ride.
      > I use this method because I have set up my cpoptions with the value
      > of: +=W
      > [End-Quote]
      >
      > The only solution I found at this time, was to modify the call to
      > CreateProcess in os_win32.c and change the parameter "Creation Flags"
      > to use CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE. My question is
      > could this flag be changed without affecting existing functionality,
      > or else somehow be made more dynamic so that in my situation [WinXP +
      > XMouse] things would 'just work'? I'm fine with 'hacking' my own copy
      > of gvim with this change to stop my own insanity, but I'd really like
      > to know if this could somehow be integrated into the main stream?
      >
      > Thank you for your understanding.

      That change would break anything that is interactive. And may even
      crash your system for some old DOS commands (although Windows XP appears
      to work better these days).

      I've tried what you did, focus-follows-mouse in MS-Windows. Gave up on
      it after too many applications failed to work properly. I don't think
      there are more than a few people who use it.

      --
      hundred-and-one symptoms of being an internet addict:
      173. You keep tracking down the email addresses of all your friends
      (even childhood friends).

      /// Bram Moolenaar -- Bram@... -- 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
      -~----------~----~----~----~------~----~------~--~---
    • MBro
      ... Thank you Bram for your response. I m hoping to move to a *nix OS soon, and then my insanity will settle. I ve done a few more tests and slight code
      Message 2 of 7 , Nov 13, 2008
      • 0 Attachment
        On Nov 3, 4:14 pm, Bram Moolenaar <B...@...> wrote:
        > M. Brotherston wrote:
        > > I posted this thread originally on vim_use, but I the only 'solution'
        > > I found so far was to modify the source code. So here goes:
        >
        > > [Quoted from original post]
        > > Situation. I downloaded and installed 'TweakUI' for Windows XP. I
        > > turned on the 'X-Mouse :: Activation Follows Mouse' feature, and
        > > selected on 'General :: Focus :: Prevent applications from stealing
        > > focus". - I'm trying to get the closest feel I can to running Linux,
        > > without actually running Linux [requirement]
        >
        > > I use the Windows Version of Vim [downloaded from the vim.org website]
        > > VIM - Vi IMproved 7.1 (2007 May 12, compiled May 12 2007 14:19:39)
        > > MS-Windows 32 bit GUI version with OLE support
        > > Compiled by Bram@KIBAALE
        >
        > > And have a mapping setup for interaction with Cygwin in my .vimrc:
        > > if has("win32")
        > >   set shellslash
        > >   " F2  -- map F2 key to read-write file (autoload should be set for
        > > this!)
        > >   map <silent> <f2>  :silent! !chmod u+w `cygpath "%"`<CR>
        > >   " F3  -- map F3 key to read-only file (autoload should be set for
        > > this!)
        > >   map <silent> <f3>  :silent! !chmod u-w `cygpath "%"`<CR>
        > > else
        > >   " F2  -- map F2 key to read-write file (autoload should be set for
        > > this!)
        > >   map <silent> <f2>  :silent! !chmod u+w %<CR>
        > >   " F3  -- map F3 key to read-only file (autoload should be set for
        > > this!)
        > >   map <silent> <f3>  :silent! !chmod u-w %<CR>
        > > endif
        >
        > > Now every time I press F2/F3 to change permissions of the files, the
        > > mouse jumps half-way across my screen, and I lose focus on Vim. I
        > > think a new window appears/disappears on the screen [like a flicker],
        > > taking the mouse for a ride.
        > > I use this method because I have set up my cpoptions with the value
        > > of: +=W
        > > [End-Quote]
        >
        > > The only solution I found at this time, was to modify the call to
        > > CreateProcess in os_win32.c and change the parameter "Creation Flags"
        > > to use CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE. My question is
        > > could this flag be changed without affecting existing functionality,
        > > or else somehow be made more dynamic so that in my situation [WinXP +
        > > XMouse] things would 'just work'? I'm fine with 'hacking' my own copy
        > > of gvim with this change to stop my own insanity, but I'd really like
        > > to know if this could somehow be integrated into the main stream?
        >
        > > Thank you for your understanding.
        >
        > That change would break anything that is interactive.  And may even
        > crash your system for some old DOS commands (although Windows XP appears
        > to work better these days).
        >
        > I've tried what you did, focus-follows-mouse in MS-Windows.  Gave up on
        > it after too many applications failed to work properly.  I don't think
        > there are more than a few people who use it.
        >

        Thank you Bram for your response. I'm hoping to move to a *nix OS
        soon,
        and then my insanity will settle. I've done a few more tests and
        slight code
        modifications, and got it working to my own satisfaction.

        As I didn't get a whole lot of interest on the subject, my
        expectations
        for a community fix dropped considerably.

        As you hear, I'm sure from everyone, this is the best text-editing
        software
        this side of the galaxy -- It's true!

        Even though I use about 1/1000th of the functionality, this is the
        only nuance
        I actually had to do something about [And I blame Windows 100%].

        Though, I do wonder how many people shutdown other applications,
        because they're used to whacking the ESC key!

        Great job.... And thanks again to all who responded.

        --
        Mike

        > --
        > hundred-and-one symptoms of being an internet addict:
        > 173. You keep tracking down the email addresses of all your friends
        >      (even childhood friends).
        >
        >  /// Bram Moolenaar -- B...@... --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
        -~----------~----~----~----~------~----~------~--~---
      • Gary Johnson
        ... A few years ago, the company I work for took all the developers Unix workstations away, put the major Unix applications on servers in a back room, and
        Message 3 of 7 , Nov 13, 2008
        • 0 Attachment
          On 2008-11-13, MBro <m.brotherston@...> wrote:

          > Thank you Bram for your response. I'm hoping to move to a *nix OS
          > soon, and then my insanity will settle. I've done a few more tests
          > and slight code modifications, and got it working to my own
          > satisfaction.

          A few years ago, the company I work for took all the developers'
          Unix workstations away, put the major Unix applications on servers
          in a back room, and gave everyone Windows PCs and commercial Windows
          X servers for their desktops. I tried this for a few months and it
          drove be absolutely bonkers, there were so many things it didn't do
          right, even with the aid of utilities such as TXMouse (which I like
          better than X-Mouse). I now also have a Linux workstation on my
          desktop with a real X server and it is _so_ nice--it just works.

          Putting Cygwin on the Windows machine has also helped my disposition
          when I have to use that one.

          > Even though I use about 1/1000th of the functionality, this is the
          > only nuance I actually had to do something about [And I blame
          > Windows 100%].
          >
          > Though, I do wonder how many people shutdown other applications,
          > because they're used to whacking the ESC key!

          During the period when I was trying to use a Windows desktop for
          development, I also used the company-approved IM client, which would
          steal the keyboard focus whenever a new message arrived. I lost a
          lot of messages because they would pop up just as I was hitting Esc
          in vim.

          Regards,
          Gary


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ben Schmidt
          ... IIRC, you can use Vim s system() function instead of the :! command to avoid the dosbox/console window. Or some other Vim function. I seem to remember
          Message 4 of 7 , Nov 14, 2008
          • 0 Attachment
            > The only solution I found at this time, was to modify the call to
            > CreateProcess in os_win32.c and change the parameter "Creation Flags"
            > to use CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE.

            IIRC, you can use Vim's system() function instead of the :! command to
            avoid the dosbox/console window. Or some other Vim function. I seem to
            remember there's something you can use that doesn't require modifying
            the source (I seem to remember somebody pointing it out when I asked
            basically the same question a while back!). Maybe give it a try and let
            us know what you find?

            Ben.




            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • MBro
            ... Ben, Thanks for the advice. I attempted this already. It was suggested by a person on the vim_use mailing list. I had problems setting up my mappings
            Message 5 of 7 , Nov 14, 2008
            • 0 Attachment
              On Nov 14, 7:52 am, Ben Schmidt <mail_ben_schm...@...> wrote:
              > > The only solution I found at this time, was to modify the call to
              > > CreateProcess in os_win32.c and change the parameter "Creation Flags"
              > > to use CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE.
              >
              > IIRC, you can use Vim's system() function instead of the :! command to
              > avoid the dosbox/console window. Or some other Vim function. I seem to
              > remember there's something you can use that doesn't require modifying
              > the source (I seem to remember somebody pointing it out when I asked
              > basically the same question a while back!). Maybe give it a try and let
              > us know what you find?
              >
              > Ben.

              Ben,

              Thanks for the advice. I attempted this already. It was suggested by a
              person on the vim_use mailing list.
              I had problems setting up my mappings though:

              map <silent> <f2> :silent! !chmod u+w `cygpath "%"`<CR>

              As I said before, I only use about 1/1000th of the features, and most
              of that is 'out-of-the-box'.

              The reason I didn't progress down this path too much, is that I also
              found using simple tag jumping
              caused the mouse to jump [Perhaps this was part of 'ctags.vim', but
              whatever the case, I'd have to
              hunt down the root cause of that]. I'd be happy to test out the system
              call though, if someone could assist
              me on converting the above mapping to a call to 'system'. Please note
              that my shell is bash, and my version
              of vim is built for Windows. [I use a Cygwin/Windows hybrid setup], I
              call the Windows gvim from bash.

              Thanks,
              Mike
              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Ben Schmidt
              ... map :call system( chmod u+w `cygpath .expand( % ). ` ) should be close. It probably should use fnameescape or something, but hey, your original
              Message 6 of 7 , Nov 14, 2008
              • 0 Attachment
                > Thanks for the advice. I attempted this already. It was suggested by a
                > person on the vim_use mailing list.
                > I had problems setting up my mappings though:
                >
                > map <silent> <f2> :silent! !chmod u+w `cygpath "%"`<CR>

                map <F2> :call system('chmod u+w `cygpath "'.expand('%').'"`')<CR>

                should be close. It probably should use fnameescape or something, but
                hey, your original map doesn't either. :-p

                > The reason I didn't progress down this path too much, is that I also
                > found using simple tag jumping
                > caused the mouse to jump [Perhaps this was part of 'ctags.vim', but
                > whatever the case, I'd have to
                > hunt down the root cause of that].

                Hmm. Yeah. Hopefully it is ctags.vim doing that. Though I can't really
                think why anything should cause it when just doing tag jumps. But then I
                don't really know what ctags.vim does.

                Smiles,

                Ben.




                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.