public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* retry: Problem transfering X11 cut/copy buffer to windows and back
@ 2019-08-26  3:25 L A Walsh
  2019-09-07 17:27 ` Jon Turney
  0 siblings, 1 reply; 6+ messages in thread
From: L A Walsh @ 2019-08-26  3:25 UTC (permalink / raw)
  To: cygwin



-------- Original Message --------
Subject: 	Problem transfering X11 cut/copy buffer to windows and back
Date: 	Sun, 25 Aug 2019 11:51:18 -0700



Starting a few days ago, after an update to cygwin,
I'm finding it impossible to transfer
my xselection from cygwin X to any Win application or vice versa.

I've tried multpile Windows apps (Windows 7 SP1 x64)
and multiple X apps and no go.

I first noticed it in gvim -- which I run on my linux box
and display via 'X' locally.

The only thing I noticed w/X,u has been a checkmarked value about
Clipboard may use primary selection (which is checked, though I tried both
ways).

My cygwin start script is the same as it has been since
Mar23, 2018 and is below.

Having to write things out ot files is royal pain, so any ideas
would be very appreciated.

Thanks much!

Linda

Had my cygcheck.out attached, but if this gets through
perhaps such isn't allowed?


----startxwin.sh---
#!/bin/bash
# (c) LA Walsh 2004-2014, licenced under GPLv2
#export DISPLAY=:0
#export XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
#export XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
#export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
#export XNLSPATH=/usr/X11R6/lib/X11/locale
#unexport XAPPLRESDIR XCMSDB XKEYSYMDB XNLSPATH

# see cygwin Xwin for more option examples
# relevant ops:
# -multiwindow = use windows manage; not w/(-rootless|-fullscreen)
# -clipboard = use built-in version (integrated w/windows)
# -unixkill = Enable Ctrl-Alt-BS as X-server shutdown cmnd
# -nowinkill = Disable Alt+F4 as a server shutdown key combination.
# -trayicon = (default) windows tray icon enabled
#set -x
export LIBGL_USE_WGL=1
mount -c /
export PATH=/bin:$(/bin/cygpath "$USERPROFILE")/bin:$PATH #ensure our
bin is 1st
shopt -s expand_aliases extglob
alias my=declare int=my\ -i  sub=function array=my\ -a
alias xset=$(type -P xset);
alias notify=$(type -P notifu)

my HKLM='HKEY_LOCAL_MACHINE' MsWinNT='SOFTWARE/Microsoft/Windows NT'
my DPI_Px='FontDPI/LogPixels' proc_reg='/proc/registry'
my pixels_key="$HKLM/$MsWinNT/CurrentVersion/$DPI_Px"
my pixels_path="$proc_reg/$pixels_key"

export DISPLAY="${DISPLAY:-":0"}"

sub xup {
  local stat
  read -t .1 stat <<<$(xset q >&/dev/null; echo $?)   &&
        return $stat
  ((-1)) 
}

Xwin_pids() {
  ( cd /proc  && for exe in [0-9]*/exename; do
      read ln<"$exe"
      ((${#ln})) && [[ $ln =~ Xwin ]] && printf "%d %s\n" "${i%/*}" "$ln"
    done
  )
}


Xwin_running() {
  my nam; int pid
  read pid nam< <(Xwin_pids)
  return $((!pid))
}

kill_Xwin() {
  array sigs=(TERM TERM KILL) # try 2 TERMs then KILL upto maxsigs
  int pd; my pg
  int maxsigs=3 lastsig=${#sigs[*]}
  while ((maxsigs)) && read pd pg; do
    ((pd)) && kill -${sigs[--maxsigs>lastsig ? lastsig : maxsigs]} $pd
    sleep 1
  done < <(Xwin_pids)
}

tidy_old_Xwin() {
  rm -fr /tmp/.X11-unix
}

function ord() { printf "%d" "'$1" ; }

sub get_dpi {
  my dw=""; read -d '' dw< <(<"$pixels_path" cat)
  int dpi=$(ord "$dw")
  # check for insane values
  ((dpi<50||dpi>>400)) && dpi=107
  printf ${1:+-v $1} "%d\n" $dpi
}



sub get_fontpath {
  printf "%s"
"/usr/share/fonts/TTF,/usr/share/fonts/Type1,/usr/share/fonts/misc,/usr/share/fonts/100dpi,built-ins,/windows/fonts"
}

sub start_XWin {
  my fontpath=$(get_fontpath)
  int dpi=$(get_dpi)
  cmd="/bin/run /bin/XWin  ${dpi:+-dpi $dpi}   -listen tcp +iglx -wgl
-compositealpha -compositewm -lesspointer -clipboard  -ac -unixkill
-nowinkill -multiwindow -wm -ardelay 150 -arinterval 30 +bs
-nomultimonitors -noreset -fp \"$fontpath\" "
  echo cmd="$cmd"
  $cmd
}

sub start_syslogd {
  cygrunsrv -n -O -S syslogd
}

sub start_cygserver {
  cygrunsrv -n -O -S -d messagebus cygserver
}

sub start_msgbus {
  cygrunsrv -n -O -S -d syslogd messagebus
}

sub start_sess_dbus {
  /bin/run /bin/dbus-launch --exit_with_session ~/.Xsession
}


sub _in {
  local x=${1:?};shift
  for ((;$#>0;)); do [[ $x == $1 ]] && return 0;shift; done
  return 1
}


int tries=3

if Xwin_running && xup; then
  notify /t info /m "Xserver already running and ready" /d 5000
else
  #echo "No Xserver detected"
 
  tidy_old_Xwin

  while ((1)); do
    start_cygserver
    start_XWin
    sleep 1
 
    for ((i=0;i<5;++i)); do
      xup && break 2
      sleep 1
    done

    if ((--tries<=0)); then
      m="^GEXITING: Timeout Waiting for Xserver Startup!!"
      echo "$m"
      notify /t error /m "$m"
      exit 1;
    fi
  done
  start_sess_dbus
  #start_dbus || { m="^GError Starting Dbus"; echo "$m"; notify /t error
/m "$m"; }
fi

# vim: ts=2:sw=2





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: retry: Problem transfering X11 cut/copy buffer to windows and back
  2019-08-26  3:25 retry: Problem transfering X11 cut/copy buffer to windows and back L A Walsh
@ 2019-09-07 17:27 ` Jon Turney
  2019-09-11  0:03   ` Jim Reisert AD1C
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Turney @ 2019-09-07 17:27 UTC (permalink / raw)
  To: The Cygwin Mailing List; +Cc: L A Walsh

On 26/08/2019 02:57, L A Walsh wrote:
> 
> Starting a few days ago, after an update to cygwin,
> I'm finding it impossible to transfer
> my xselection from cygwin X to any Win application or vice versa.

Are you using xorg-server 1.20.5-1 or later test release package?

I made some significant changes to the clipboard code in that, as noted 
in the announce  mail [1].

[1] https://cygwin.com/ml/cygwin-announce/2019-06/msg00009.html

> I've tried multpile Windows apps (Windows 7 SP1 x64)
> and multiple X apps and no go.
> 
> I first noticed it in gvim -- which I run on my linux box
> and display via 'X' locally.
> 
> The only thing I noticed w/X,u has been a checkmarked value about
> Clipboard may use primary selection (which is checked, though I tried both
> ways).
> 
> Having to write things out ot files is royal pain, so any ideas
> would be very appreciated.
-- 
Jon Turney
Volunteer Cygwin/X X Server maintainer

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: retry: Problem transfering X11 cut/copy buffer to windows and back
  2019-09-07 17:27 ` Jon Turney
@ 2019-09-11  0:03   ` Jim Reisert AD1C
  2019-09-11 17:11     ` Jon Turney
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Reisert AD1C @ 2019-09-11  0:03 UTC (permalink / raw)
  To: cygwin

I didn't see this message before I posted a separate message.  Here is
my report again.

I am using the latest test X server (1.20.5-3 built 2019-09-06),
HOWEVER, I have seen this problem again and again for months now.

After I copy/paste enough, either from Xterm to Xterm, or Xterm to
Windows, eventually it stops working.  I can still select text in the
Xterm, but I'm unable to paste it into windows - nothing happens.  My
fuzzy recollection is that copy/paste from X to X still works, but I
forgot to test that today.

The only way I have found to fix this is to exit the X server and
restart it.  Simply creating a new Xterm does not fix the problem.

1.  Is there any information I can provide to help debug this problem?

2.  Is there a way to reset the X server's (or maybe Windows')
copy/paste buffer without having to close all my X windows and restart
the server?

-- 
Jim Reisert AD1C, <jjreisert@alum.mit.edu>, http://www.ad1c.us

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: retry: Problem transfering X11 cut/copy buffer to windows and back
  2019-09-11  0:03   ` Jim Reisert AD1C
@ 2019-09-11 17:11     ` Jon Turney
  2019-09-11 22:54       ` Jim Reisert AD1C
  2019-09-12  3:59       ` bzs
  0 siblings, 2 replies; 6+ messages in thread
From: Jon Turney @ 2019-09-11 17:11 UTC (permalink / raw)
  To: The Cygwin Mailing List; +Cc: Jim Reisert AD1C

On 11/09/2019 00:17, Jim Reisert AD1C wrote:
> I didn't see this message before I posted a separate message.  Here is
> my report again.
> 
> I am using the latest test X server (1.20.5-3 built 2019-09-06),
> HOWEVER, I have seen this problem again and again for months now.
> 
> After I copy/paste enough, either from Xterm to Xterm, or Xterm to
> Windows, eventually it stops working.  I can still select text in the
> Xterm, but I'm unable to paste it into windows - nothing happens.  My
> fuzzy recollection is that copy/paste from X to X still works, but I
> forgot to test that today.
> 
> The only way I have found to fix this is to exit the X server and
> restart it.  Simply creating a new Xterm does not fix the problem.
> 
> 1.  Is there any information I can provide to help debug this problem?

A reliable way of reproducing the problem would be ideal :)

Failing that, the /var/log/xwin/XWin.0.log might be informative.

> 2.  Is there a way to reset the X server's (or maybe Windows')
> copy/paste buffer without having to close all my X windows and restart
> the server?

Not really.

You can start the X server with the '-noclipboard' option, and then run 
'xwinclip' for clipboard integration (which since it is a separate 
process, rather than a thread in the X server, can be killed and restarted).

Ideally you'd then attach gdb to xwinclip if/when it gets stuck to debug 
why that's happening. :)

-- 
Jon Turney
Volunteer Cygwin/X X Server maintainer

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: retry: Problem transfering X11 cut/copy buffer to windows and back
  2019-09-11 17:11     ` Jon Turney
@ 2019-09-11 22:54       ` Jim Reisert AD1C
  2019-09-12  3:59       ` bzs
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Reisert AD1C @ 2019-09-11 22:54 UTC (permalink / raw)
  To: Jon Turney; +Cc: The Cygwin Mailing List

On Wed, Sep 11, 2019 at 8:52 AM Jon Turney wrote:

> > 1.  Is there any information I can provide to help debug this problem?
>
> A reliable way of reproducing the problem would be ideal :)

I wish!

> Failing that, the /var/log/xwin/XWin.0.log might be informative.
>
> > 2.  Is there a way to reset the X server's (or maybe Windows')
> > copy/paste buffer without having to close all my X windows and restart
> > the server?
>
> Not really.
>
> You can start the X server with the '-noclipboard' option, and then run
> 'xwinclip' for clipboard integration (which since it is a separate
> process, rather than a thread in the X server, can be killed and restarted).
>
> Ideally you'd then attach gdb to xwinclip if/when it gets stuck to debug
> why that's happening. :)

The next time I'm doing an activity which is likely to hit this, I'll
see what I can get.

-- 
Jim Reisert AD1C, <jjreisert@alum.mit.edu>, http://www.ad1c.us

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: retry: Problem transfering X11 cut/copy buffer to windows and back
  2019-09-11 17:11     ` Jon Turney
  2019-09-11 22:54       ` Jim Reisert AD1C
@ 2019-09-12  3:59       ` bzs
  1 sibling, 0 replies; 6+ messages in thread
From: bzs @ 2019-09-12  3:59 UTC (permalink / raw)
  To: Jon Turney; +Cc: The Cygwin Mailing List, Jim Reisert AD1C


I sometimes get in this situation where one and only one xterm
receives a paste no matter which window (X or Windows) I'm trying to
paste into.

THIS IS NOT A BUG REPORT, my cygwin is pretty old.

However I've found oddly enough if I go into the xterm receiving all
the pastes and press CTRL-mousebutton, doesn't matter which button
only that one of the xterm menus appears, "Main Options", "VT Fonts",
whatever, might take a few tries, it seems to reset things and the
pasting problem disappears w/o having to actually restart/reboot/etc
anything.

The menu only has to appear and then let it close, release the
keypresses, nothing in the menu is clicked.

YMMV.

-- 
        -Barry Shein

Software Tool & Die    | bzs@TheWorld.com             | http://www.TheWorld.com
Purveyors to the Trade | Voice: +1 617-STD-WRLD       | 800-THE-WRLD
The World: Since 1989  | A Public Information Utility | *oo*

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-12  3:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  3:25 retry: Problem transfering X11 cut/copy buffer to windows and back L A Walsh
2019-09-07 17:27 ` Jon Turney
2019-09-11  0:03   ` Jim Reisert AD1C
2019-09-11 17:11     ` Jon Turney
2019-09-11 22:54       ` Jim Reisert AD1C
2019-09-12  3:59       ` bzs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).