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
It seems the problem occurs with RHEL v6.5 distro, that comes with Gnome 2, gnome-terminal v2.31.3., xorg v7.0.0. I made some short tests on RHEL v7.1 and it wasn't influenced by the issue.
ping