Ujjal,
Although it fixed the problem (or perhaps only masked it, as the underlying problem is with Cygwin X), the patch I submitted to Vim was rejected. Bram maintained that since the bug pertained to Cygwin XWindows, so should the fix. I actually did not disagree with him on this point. The reason I had started with Vim rather than XWindows was that I was more familiar with Vim's source code. However, since Bram refused to incorporate the patch, I proceeded to post to the XWindows list. It was suggested that I write a patch and submit it. I wrote a patch, and Colin Harrison (who was more familiar with the patch submission process) tested the patch and submitted it to the Bugzilla bug tracking database. I also tested on my own PC running Cygwin X and gVim compiled from unix sources. Months after patch submission, the patch was accepted and the issue changed to FIXED / RESOLVED. I have not yet checked to see whether the patch has actually been rolled into the most recently released version of XWin. You can see a full description of the bug and how I fixed it by reading the thread below. Also, I've included the link to the Bugzilla submission page, so you can obtain and apply the Xwin patch if you like. Alternatively, you could obtain and apply the Vim patch, but since it's not likely ever to find its way into Vim (and really is kind of a kludge anyways), I'd recommend the former approach...

Hope this helps,
   Brett Stahlman

Thread subject: "Serious flaw in Cygwin X clipboard integration prevents paste from 
X to Windows app"
http://www.cygwin.com/ml/cygwin-xfree/2006-01/msg00030.html

Bugzilla entry 5375:
https://bugs.freedesktop.org/show_bug.cgi?id=5735

----- Original Message ----- From: Ujjal Bose
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2006 3:16 AM
Subject: Fwd: gvim cut paste selection


Hi,

I saw ur patch that you have posted to the URL mentioned below. So will the same patch work for a unix vim or is it only for Win32 ? As you can see from the thread below that I am also facing similar problems , but from Unix Gvim <----> Windows Apps.

Thanks,
Ujjal




Forwarded Conversation
Subject: gvim cut paste selection
------------------------
From: Ujjal Bose <[EMAIL PROTECTED]>
To: vim@vim.org
Date: Sat, Nov 4, 2006 at 9:30 PM


Hi ,

I was having problem with cut-paste selections from X <-----> Windows
for gvim (6.2) , and this is the reply I got from the RealVNC team .
So is there a way to solve this in gvim ?

Thanks in advance !

-Ujjal

---------- Forwarded message ----------
From: James Weatherall <[EMAIL PROTECTED] >
Date: Nov 3, 2006 9:59 PM
Subject: RE: Xvnc cut paste problem
To: Ujjal Bose <[EMAIL PROTECTED]>, [EMAIL PROTECTED]

Hi Ujjal,

It sounds like gvim doesn't set the timestamp on the X selection correctly
when it sets it, so vncconfig doesn't think it's changed.  Selecting text in
another X application, then selecting the desired text in gvim should cause
vncconfig to see the selection ownership change and to then send the gvim
text to the viewer.

Cheers,

Wez @ RealVNC Ltd.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] ] On
Behalf Of Ujjal Bose
Sent: 01 November 2006 19:09
To: [EMAIL PROTECTED]
Subject: Xvnc cut paste problem

For the laste few days my cut paste selections from
Unix->Windows is not working properly but Windows->Unix works
perfectly.
I was using "autocutsel" to enable cut-paste between various
X11 selections, and also had a line for "vncconfig -nowin
-iconic" in my VNC xstartup file but nothing seems to help.

0) I am using Xvnc 4.2.1 server in my Linux m/c and TightVNC
viewer on Windows XP side.

1) A "Copy" selection from a unix application (gvim) seems to
work intermittently.

2) If I do a mouse based visual selection (also called
PRIMARY selection in X11) from my gvim windows , and paste it
in Windows notepad, only a partial paste happens for the
first time, and then onwards , the same stuff is pasted over
and over again, in spite of selecting some other text in gvim.

3) Pasting from xterm->Notepad(Windows) seems to work correctly.

4) I even started a new VNC session on another Linux m/c
(same xstartup file) but didnt help.

5) Another thing I observed : from gvim , irrespective of my
selection method ("copy" or mouse based) , the paste in
Notepad seems to work only (partially in case of mouse
selection and fully in case of "Copy") for the first time. If
I select something else now and then try to paste , the last
stuff only gets pasted. BUT IF I COPY BACK SOME TEXT FROM
WINDOWS->UNIX and then try again , IT WORKS FOR THE NEW
SELECTION , but again , only for once, till I repeat the process.

6) Again, pasting from xterm always works perfectly.

Any help appreciated.

-Ujjal



##### My xstartup file ####################

vncconfig -nowin &
if ($OSTYPE == "Linux") then
# Linux
 xrdb $HOME/.Xresources
 \xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 #/usr/bin/gnome-session &
 #/usr/bin/startkde &
 #fvwm2 &
/home/ubose/local/bin/startxfce4 &
 xhost +
else
# sun
 xrdb $HOME/.Xresources
 xrdb -load glx
 \xterm  -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 xsetroot -solid grey
#/usr/dt/bin/dtwm&
/usr/dt/bin/Xsession &
 xhost +
endif

#######################################





-------- From: Yakov Lerner <[EMAIL PROTECTED]>
To: Ujjal Bose <[EMAIL PROTECTED]>
Cc: vim@vim.org
Date: Sun, Nov 5, 2006 at 1:54 AM


On 11/4/06, Ujjal Bose <[EMAIL PROTECTED]> wrote:
Hi ,

I was having problem with cut-paste selections from X <-----> Windows
for gvim (6.2) , and this is the reply I got from the RealVNC team .
So is there a way to solve this in gvim ?

---------- Forwarded message ----------
From: James Weatherall <[EMAIL PROTECTED]>
Date: Nov 3, 2006 9:59 PM
Subject: RE: Xvnc cut paste problem
To: Ujjal Bose <[EMAIL PROTECTED]>, [EMAIL PROTECTED]

Hi Ujjal,

It sounds like gvim doesn't set the timestamp on the X selection correctly
when it sets it, so vncconfig doesn't think it's changed.  Selecting text in
another X application, then selecting the desired text in gvim should cause
vncconfig to see the selection ownership change and to then send the gvim
text to the viewer.

Cheers,

Wez @ RealVNC Ltd.


The last time this issue was discussed, Bram blamed
the problem on VNC. Namely that VNC doesn't handle
value 0 as CurrntTime correctly. Still nobody made a
patch to gvim to fill non-0 value into CurrentTime. See:

1. 2004-05-28  Re: Suggested addition to 'clipboard' for X windows
vim-dev   Bram Moolenaar
2. 2004-05-28  Re: Suggested addition to 'clipboard' for X windows
vim-dev   waggoner
3. 2004-05-19  Re: Suggested addition to 'clipboard' for X windows
vim-dev   Bram Moolenaar
4. 2004-05-19  Re: Suggested addition to 'clipboard' for X windows
vim-dev   Mark Waggoner
5. 2004-05-18  Re: Copy/cut/paste between unix vim under VNC and win
vim-dev   Bram Moolenaar
6. 2004-05-18  Re: Copy/cut/paste between unix vim under VNC and win
vim-dev   waggoner
7. 2004-05-17  Re: Copy/cut/paste between unix vim under VNC and win
vim-dev   Bram Moolenaar
8. 2004-05-17  Copy/cut/paste between unix vim under VNC and windows
vim-dev   waggoner

1. http://marc.theaimsgroup.com/?l=vim-dev&m=108575072405702&w=2
2. http://marc.theaimsgroup.com/?l=vim-dev&m=108572611818054&w=2
3. http://marc.theaimsgroup.com/?l=vim-dev&m=108496125926436&w=2
4. http://marc.theaimsgroup.com/?l=vim-dev&m=108495869813701&w=2
5. http://marc.theaimsgroup.com/?l=vim-dev&m=108487127321270&w=2
6. http://marc.theaimsgroup.com/?l=vim-dev&m=108484164403886&w=2
7. http://marc.theaimsgroup.com/?l=vim-dev&m=108482463303900&w=2
8. http://marc.theaimsgroup.com/?l=vim-dev&m=108481673228379&w=2

Yakov



-------- From: Bram Moolenaar <[EMAIL PROTECTED] >
To: Ujjal Bose <[EMAIL PROTECTED]>
Cc: vim@vim.org
Date: Mon, Nov 6, 2006 at 3:20 AM



Ujjal Bose wrote:

I was having problem with cut-paste selections from X <-----> Windows
for gvim (6.2) , and this is the reply I got from the RealVNC team .
So is there a way to solve this in gvim ?

Thanks in advance !

-Ujjal

---------- Forwarded message ----------
From: James Weatherall < [EMAIL PROTECTED]>
Date: Nov 3, 2006 9:59 PM
Subject: RE: Xvnc cut paste problem
To: Ujjal Bose < [EMAIL PROTECTED]>, [EMAIL PROTECTED]

Hi Ujjal,

It sounds like gvim doesn't set the timestamp on the X selection correctly
when it sets it, so vncconfig doesn't think it's changed.  Selecting text in
another X application, then selecting the desired text in gvim should cause
vncconfig to see the selection ownership change and to then send the gvim
text to the viewer.

Cheers,

Wez @ RealVNC Ltd.

This is a known problem that nobody has found a solution for yet.  The
"Time" type is some special kind of timestamp.  I don't even know how to
get the timestamp for "now".  That's why CurrentTime is used.  Getting
the timestamp from an event (e.g. a mouse click) is not always possible
(e.g., in an xterm we don't get it) and certainly difficult to pass all
the way from the input to the selection.

Problem with Xvnc is that they stick to the specification instead of
to what applications do in practice.

--
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
   know, but, boy can he/she TYPE!!!!!!

/// 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    ///



-------- From: Yakov Lerner <[EMAIL PROTECTED]>
To: Ujjal Bose <[EMAIL PROTECTED]>
Cc: vim@vim.org
Date: Tue, Nov 7, 2006 at 2:09 AM


On 11/4/06, Ujjal Bose <[EMAIL PROTECTED]> wrote:
I was having problem with cut-paste selections from X <-----> Windows
for gvim (6.2) , and this is the reply I got from the RealVNC team .
So is there a way to solve this in gvim ?

I found the patch someone made for very similar problem:

   http://permalink.gmane.org/gmane.editors.vim/38505

I wonder whether this patch also fixes your problem with vnc
if you replace '#ifdef WIN32UNIX' in the patch to just '#if 1' ?

Yakov



--------

Reply via email to