vcxsrv icon indicating copy to clipboard operation
vcxsrv copied to clipboard

switching focus to gnome-terminal from a windows application selects a whole line of text clearing the clipboard

Open swizzly opened this issue 9 years ago • 8 comments

Hi,

Switching focus from outside of the x-session (i.e. from a windows application) by clicking with the left mouse button into a gnome-terminal window inside the x-session a whole line of text get selected/highlighted, that also cleans out the content of the clipboard... Switching from an other linux applications/window (i.e. from inside the x-session) to the gnome-terminal window doesn't have this issue. Using other x-server application like Opentext Exceed, the problem doesn't occur.

I analysed with xev the x-events:


Using vcxsrv v1.15.2.4, switching from a linux application to the gnome-terminal:

KeymapNotify event, serial 32, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonPress event, serial 32, synthetic NO, window 0x980001,
    root 0x9c, subw 0x0, time 350207814, (130,570), root:(1703,962),
    state 0x10, button 1, same_screen YES

ButtonRelease event, serial 32, synthetic NO, window 0x980001,
    root 0x9c, subw 0x0, time 350208001, (130,570), root:(1703,962),
    state 0x110, button 1, same_screen YES

Using vcxsrv v1.15.2.4, switching from a windows application to the gnome-terminal:

KeymapNotify event, serial 32, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonPress event, serial 32, synthetic NO, window 0x980001,
    root 0x9c, subw 0x0, time 350244271, (52,577), root:(1625,969),
    state 0x10, button 1, same_screen YES

MotionNotify event, serial 32, synthetic NO, window 0x980001,
    root 0x9c, subw 0x0, time 350244271, (52,577), root:(1625,969),
    state 0x110, is_hint 0, same_screen YES

ButtonRelease event, serial 32, synthetic NO, window 0x980001,
    root 0x9c, subw 0x0, time 350244459, (52,577), root:(1625,969),
    state 0x110, button 1, same_screen YES

Using Exceed v14.0.2.424, switching from a linux application to the gnome-terminal:

KeymapNotify event, serial 30, synthetic NO, window 0x0,
    keys:  70  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonPress event, serial 30, synthetic NO, window 0x3000001,
    root 0x46, subw 0x0, time 202934, (14,174), root:(2222,918),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 30, synthetic NO, window 0x3000001,
    root 0x46, subw 0x0, time 203003, (14,174), root:(2222,918),
    state 0x100, button 1, same_screen YES

Using Exceed v14.0.2.424, switching from a windows application to the gnome-terminal:

KeymapNotify event, serial 30, synthetic NO, window 0x0,
    keys:  70  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonPress event, serial 30, synthetic NO, window 0x3000001,
    root 0x46, subw 0x0, time 176479, (5,176), root:(2213,920),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 30, synthetic NO, window 0x3000001,
    root 0x46, subw 0x0, time 176517, (5,176), root:(2213,920),
    state 0x100, button 1, same_screen YES

It seems vcxsrv adds an additional MotionNotify event between the ButtonPress and ButtonRelease events, which triggers the line selection in gnome-terminal.

Question: why does this happen, how can it be resolved?

Swizzly

swizzly avatar Apr 24 '15 10:04 swizzly

Hi @swizzly

I just tried to reproduce this, but I was unable to.

When I clicked into the gnome-terminal window form another window in the x-session, I produced 2 events. But clicking a Windows application, and then clicking on the gnome-terminal again, produced 0 events.

Please describe your setup in greater detail.

My setup is: VcXsrv 1.15.2.6 (nearly identical to 1.15.2.4 like you are using.) Windows 10 64-bit build 10074 gnome-terminal 3.8.4-8.el7 RHEL 7.1. XDMCP (XLaunch details below) GNOME Classic Session Launched by GDM

<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Windowed" ClientMode="XDMCP" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="narada" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="-from 192.168.1.30" Wgl="False" DisableAC="False" XDMCPTerminate="True"/>

mikedep333 avatar May 10 '15 21:05 mikedep333

Hi @mikedep333

I see the following differences between your and mine config:

  • you have Red Hat v7.1 while we have v6.5
  • you use windows 10 while we use windows 7
  • we use vcxsrv v1.15.2.4 while you have v1.15.2.6
  • on RHEL 6.5 the gnome-terminal is v2.31.3 vs. your v3.8.4-8.el7

Do you have the possibility to do a test on the above described config as well? My colleagues have the exact same config as me, and all of them have the same bug.

thanks and best regards Swizzly

swizzly avatar May 18 '15 08:05 swizzly

Hi @swizzly

Yes, I can install a RHEL 6.5 test VM and I have a Windows 7 PC.

However, I also need to know: How are you launching gnome-terminal? Are you using XLaunch? Are you using XDMCP, SSH, or just exporting $DISPLAY? Are you using "Multiple windows" mode or "One window" mode? (You can see what I mean by opening XLaunch.)

mikedep333 avatar May 18 '15 21:05 mikedep333

Hi Mike

I copy the text of my last mail also here as replying to the mail doesn't publish my post to this forum. I mainly use x2go. I tried both single and multi window mode. I also tried w/o x2go, only with vcxsrv + xdmcp + gnome. All of these have the same issue.

Regards swizzly

PS: I tried now to start vcxsrv w/o any parameters and then start gnome-terminal from a ssh session. Same result, left click selects a whole empty line in gnome-terminal.

swizzly avatar May 19 '15 06:05 swizzly

For test purpose I installed RHEL 7.0 and tried it. It is working as expected. Unfortunatelly, me and my coworkers are currently bound to RHEL 6.5, so we need a solution for this version.

swizzly avatar May 19 '15 11:05 swizzly

Hi Mike Can I hope for any advances in this topic? regards Swizzly

swizzly avatar Jul 17 '15 11:07 swizzly

Hi @swizzly,

Sorry, I have been busy with other stuff.

I do not know of any sort of workaround, nor can I offer an estimate on when it will be fixed in VcXsrv

I have managed to reproduce it, both on my Windows 7 laptop and on my Windows 10 desktop. I also managed to reproduce it with mate-terminal, on newer distros. mate-terminal is forked from GNOME2's gnome-terminal.

I have mentioned it to Jon Turney, who is the Cygwin/X maintainer. Cygwin/X is affected also.

When I reproduced it, the events often differed. I think the MotionNotify event was sometimes missing; I need to double-check.

I will try to investigate and fix it within the next month. The fact that mate-terminal is affected means that I personally am affected.

-Mike

mikedep333 avatar Jul 17 '15 11:07 mikedep333

Hi @mikedep333, Thanks for the answer. I am glad that you could reproduce the problem and I am not left alone with it. I thought that only the older Gnome (v2.x) versions have this issue, I am surprised that Mate is also failing, but it is strange, that there are no many bugreports about it. Regards Swizzly

swizzly avatar Jul 22 '15 07:07 swizzly