Xpra: Ticket #2366: some tcl/tk dialog can not close

Looks like some tcl/tk application dialog can not close.
I found the code 'grab -global .dialog2' in tcl script that make a mistake.


  1. Xpra Version
[root@CentOS241 irony]# rpm -qa | grep xpra
python2-xpra-server-2.5.3-1.r23270.el7_6.x86_64
xpra-2.5.3-1.r23270.el7_6.x86_64
ffmpeg-xpra-4.1.1-1.el7_6.x86_64
libvpx-xpra-1.8.0-1.el7_6.x86_64
x264-xpra-20190109-0.el7_6.x86_64
xpra-html5-2.5.2-0.r22875.el7_6.noarch
xpra-common-server-2.5.3-1.r23270.el7_6.noarch
python2-pyopengl-3.1.1a1-10xpra1.el7_6.x86_64
python2-xpra-client-2.5.3-1.r23270.el7_6.x86_64
xpra-common-2.5.3-1.r23270.el7_6.noarch
libwebp-xpra-1.0.0-1.el7_6.x86_64
python2-rencode-1.0.6-1.xpra1.el7_6.x86_64
python2-xpra-2.5.3-1.r23270.el7_6.x86_64
pygtkglext-1.1.0-27.xpra3.el7_6.x86_64
xorg-x11-drv-dummy-0.3.8-1.xpra2.el7.x86_64
xpra-common-client-2.5.3-1.r23270.el7_6.noarch

  1. dummy version
[root@CentOS241 irony]# rpm -qa | grep drv-dummy
xorg-x11-drv-dummy-0.3.8-1.xpra2.el7.x86_64

  1. xpra config
[root@CentOS241 irony]# xpra showconfig
Warning: running as root
add-printer-options            = '-E', '-o printer-is-shared=false', '-u allow:$USER'
attach                         = None
auth                           = []
auto-refresh-delay             = 0.15
av-sync                        = True
bandwidth-detection            = True
bandwidth-limit                = 'auto'
bell                           = True
bind                           = 'auto'
bind-rfb                       = []
bind-ssh                       = []
bind-ssl                       = []
bind-tcp                       = []
bind-udp                       = []
bind-vsock                     = []
bind-ws                        = []
bind-wss                       = []
border                         = 'auto,5:off'
challenge-handlers             = 'all'
chdir                          = ''
clipboard                      = 'yes'
clipboard-direction            = 'both'
clipboard-filter-file           = ''
compression_level              = 1
compressors                    = 'lz4', 'lzo', 'zlib'
csc-modules                    = 'swscale', 'libyuv'
cursors                        = True
daemon                         = True
dbus-control                   = True
dbus-launch                    = 'dbus-launch --sh-syntax --close-stderr'
dbus-proxy                     = True
debug                          = ''
delay-tray                     = False
desktop-fullscreen             = False
desktop-scaling                = 'auto'
display                        = ''
displayfd                      = 0
download-path                  = '~'
dpi                            = 0
encoding                       = 'auto'
encodings                      = 'h264', 'vp9', 'vp8', 'mpeg4', 'mpeg4+mp4', 'h264+mp4', 'vp8+webm', 'vp9+webm', 'png', 'png/P', 'png/L', 'webp', 'rgb', 'rgb24', 'rgb32', 'jpeg', 'h265', 'jpeg2000', 'mpeg1', 'mpeg2'
encryption                     = ''
encryption-keyfile             = ''
env                            = []
exec-wrapper                   = ''
exit-ssh                       = True
exit-with-children             = False
exit-with-client               = False
fake-xinerama                  = True
file-size-limit                = 100
file-transfer                  = 'auto'
forward-xdg-open               = True
gid                            = 0
global-menus                   = True
html                           = 'auto'
idle-timeout                   = 0
input-devices                  = 'auto'
input-method                   = 'none'
key-shortcut                   = 'Control+Menu:toggle_keyboard_grab', 'Shift+Menu:toggle_pointer_grab', 'Shift+F11:toggle_fullscreen', '#+F1:show_menu', '#+F2:show_start_new_command', '#+F3:show_bug_report', '#+F4:quit', '#+F5:increase_quality', '#+F6:decrease_quality', '#+F7:increase_speed', '#+F8:decrease_speed', '#+F10:magic_key', '#+F11:show_session_info', '#+F12:toggle_debug', '#+plus:scaleup', '#+minus:scaledown', '#+underscore:scaledown', '#+KP_Add:scaleup', '#+KP_Subtract:scaledown', '#+KP_Multiply:scalereset', '#+bar:scalereset', '#+question:scalingoff'
keyboard-layout                = ''
keyboard-layouts               = []
keyboard-options               = ''
keyboard-raw                   = False
keyboard-sync                  = True
keyboard-variant               = ''
keyboard-variants              = []
local-clipboard                = 'CLIPBOARD'
lock                           = None
log-dir                        = 'auto'
log-file                       = '$DISPLAY.log'
lpadmin                        = '/usr/sbin/lpadmin'
lpinfo                         = '/usr/sbin/lpinfo'
max-size                       = ''
mdns                  (used)   = False                             <type 'bool'>
mdns                 (default) = True                              <type 'bool'>
microphone            (used)   = 'off'                             <type 'str'>
microphone           (default) = 'disabled'                        <type 'str'>
microphone-codec               = []
min-port                       = 1024
min-quality                    = 30
min-size                       = ''
min-speed                      = 30
mmap                           = 'yes'
mmap-group                     = 'auto'
modal-windows                  = False
mousewheel                     = 'on'
notifications                  = True
open-command                   = '/usr/bin/xdg-open'
open-files                     = 'auto'
open-url                       = 'auto'
opengl                         = 'probe'
packet-encoders                = 'rencode', 'bencode', 'yaml'
password                       = ''
password-file                  = []
pdf-printer                    = '/usr/share/ppd/cupsfilters/Generic-PDF_Printer-PDF.ppd'
pidfile                        = ''
pings                          = 5
pixel-depth                    = 0
postscript-printer             = 'drv:///sample.drv/generic.ppd'
printing                       = 'yes'
proxy-start-sessions           = True
proxy-video-encoders           = []
pulseaudio                     = None
pulseaudio-command             = 'pulseaudio --start -n --daemonize=false --system=false --exit-idle-time=-1 --load=module-suspend-on-idle '--load=module-null-sink sink_name="Xpra-Speaker" sink_properties=device.description="Xpra\ Speaker"' '--load=module-null-sink sink_name="Xpra-Microphone" sink_properties=device.description="Xpra\ Microphone"' '--load=module-native-protocol-unix socket=$XPRA_PULSE_SERVER' --load=module-dbus-protocol --load=module-x11-publish --log-level=2 --log-target=stderr --enable-memfd=no'
pulseaudio-configure-commands           = 'pactl set-default-sink Xpra-Speaker', 'pactl set-default-source Xpra-Microphone.monitor'
quality                        = 0
readonly                       = False
remote-clipboard               = 'CLIPBOARD'
remote-logging                 = 'both'
remote-xpra                    = '$XDG_RUNTIME_DIR/xpra/run-xpra', 'xpra', '/usr/local/bin/xpra', '~/.xpra/run-xpra'
resize_display                 = True
rfb-auth                       = []
rfb-upgrade                    = 5
server-idle-timeout            = 0
session-name                   = ''
sharing                        = None
shortcut-modifiers             = 'auto'
socket-dir                     = ''
socket-dirs                    = '/run/user/$UID/xpra', '/run/xpra'
socket-permissions             = '600'
sound-source                   = ''
speaker               (used)   = 'on'                              <type 'str'>
speaker              (default) = 'disabled'                        <type 'str'>
speaker-codec                  = []
speed                          = 0
ssh                            = 'auto'
ssh-auth                       = []
ssh-upgrade                    = True
ssl                            = 'auto'
ssl-auth                       = []
ssl-ca-certs                   = 'default'
ssl-ca-data                    = ''
ssl-cert                       = ''
ssl-check-hostname             = False
ssl-ciphers                    = 'DEFAULT'
ssl-client-verify-mode           = 'optional'
ssl-key                        = ''
ssl-options                    = 'ALL,NO_COMPRESSION'
ssl-protocol                   = 'SSLv23'
ssl-server-hostname            = 'localhost'
ssl-server-verify-mode           = 'required'
ssl-verify-flags               = 'X509_STRICT'
start                          = []
start-after-connect            = []
start-child                    = []
start-child-after-connect           = []
start-child-on-connect           = []
start-child-on-last-client-exit           = []
start-env                      = '#avoid Ubuntu's global menu, which is a mess and cannot be forwarded:', 'UBUNTU_MENUPROXY=', 'QT_X11_NO_NATIVE_MENUBAR=1', '#fix for MainSoft's MainWin buggy window management:', 'MWNOCAPTURE=true', 'MWNO_RIT=true', 'MWWM=allwm', '#force GTK3 applications to use X11 so we can intercept them:', 'GDK_BACKEND=x11', '#force Qt applications to use X11 so we can intercept them:', 'QT_QPA_PLATFORM=xcb', '#overlay scrollbars complicate things:GTK_OVERLAY_SCROLLING=0', '#some versions of GTK3 honour this option, sadly not all:', 'GTK_CSD=0', '#silence some AT-SPI and atk-bridge warnings:', 'NO_AT_BRIDGE=1'
start-new-commands             = False
start-on-connect               = []
start-on-last-client-exit           = []
start-via-proxy                = False
sync-xvfb                      = 0
system-proxy-socket            = '/run/xpra/system'
system-tray                    = True
systemd-run                    = 'no'
systemd-run-args               = ''
tcp-auth                       = []
tcp-encryption                 = ''
tcp-encryption-keyfile           = ''
tcp-proxy                      = ''
terminate-children             = False
title                          = '@title@ on @client-machine@'
tray                           = True
tray-icon                      = ''
udp-auth                       = []
uid                            = 0
use-display                    = False
username                       = 'root'
video-decoders                 = 'avcodec2', 'vpx'
video-encoders                 = 'x264', 'vpx', 'nvenc', 'ffmpeg'
video-scaling                  = 'auto'
vsock-auth                     = []
webcam                         = 'auto'
window-close                   = 'auto'
window-icon                    = ''
windows                        = True
wm-name                        = 'Xpra'
ws-auth                        = []
wss-auth                       = []
xsettings                      = True
xvfb                           = 'xpra_Xdummy -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /etc/xpra/xorg.conf'

  1. Server log

https://www.xpra.org/trac/attachment/ticket/2366/Server_Logs.txt


  1. start command
xpra start --bind-tcp=0.0.0.0:10011 --start=/home/irony/numeca.sh --no-daemon --debug=window

  1. screenshot

https://www.xpra.org/trac/attachment/ticket/2366/cannotclose.gif



Thu, 25 Jul 2019 02:41:29 GMT - Irony: attachment set

Server_Logs.txt


Thu, 25 Jul 2019 02:47:16 GMT - Irony: attachment set

cannotclose.gif


Thu, 25 Jul 2019 02:49:07 GMT - Irony: attachment set

cannotclose.png


Thu, 25 Jul 2019 03:36:32 GMT - Antoine Martin: owner changed

Please share some sample TCL / TK code I can use for reproducing this issue.


Thu, 25 Jul 2019 08:13:24 GMT - Irony: attachment set

test.png


Thu, 25 Jul 2019 08:19:17 GMT - Irony:

It's work ok, dialog can close, but grab -global failed, this may be tcl/tk bug,I run code like this,

code:

# test.tcl --
proc showDialog {} {
    after 100 {
        grab -global .dialog2
    }
    tk_dialog .dialog2 "Dialog with global grab" {This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below.  Global grabs are almost always a bad idea; don't use them unless you're truly desperate.} warning 0 OK Cancel
}
grid [button .myButton1  -text "Button 1" -command showDialog]

https://www.xpra.org/trac/raw-attachment/ticket/2366/test.png


But, I test app named Numeca Fine (https://www.numeca.com/home), the dialog can not close https://www.xpra.org/trac/raw-attachment/ticket/2366/cannotclose.png


Thu, 25 Jul 2019 09:09:14 GMT - Irony:

and I test on Xmanager, my code and the numeca application work ok, have no error


Thu, 25 Jul 2019 09:12:43 GMT - Antoine Martin:

That example does not run:

$ tclsh ./test.tcl
invalid command name "button"
    while executing
"button .myButton1  -text "Button 1" -command showDialog"
    invoked from within
"grid [button .myButton1  -text "Button 1" -command showDialog]"
    (file "./test.tcl" line 11)

Thu, 25 Jul 2019 10:05:05 GMT - Irony: attachment set

xpra_vnc.gif


Thu, 25 Jul 2019 10:06:24 GMT - Irony:

Replying to Antoine Martin:

That example does not run:

$ tclsh ./test.tcl
invalid command name "button"
    while executing
"button .myButton1  -text "Button 1" -command showDialog"
    invoked from within
"grid [button .myButton1  -text "Button 1" -command showDialog]"
    (file "./test.tcl" line 11)

I test use wish command:

wish ./test.tcl


Thu, 25 Jul 2019 10:13:44 GMT - Irony:

There is five ways that I tried.

  1. start numeca app on xmanager, it's ok.
  2. use xvfb create display, 'xvfb-run -n 98 /home/irony/numeca.sh', vnc connect display, it's ok
  3. use xorg create display, 'xvfb-run -n 98 /home/irony/numeca.sh', vnc connect display, it's ok
  4. use xpra, dialog can not close
  5. use xorg create display, xpra use display start app(numeca), vnc connect display as same time.
    5.1 vnc show black window,but can click and dialog close ok
    5.2 xpra show color window,but can click and dialog close failed

Left is xpra, Right is vnc

https://raw.githubusercontent.com/892768447/static/master/xpra_vnc.gif


Thu, 25 Jul 2019 11:20:01 GMT - Antoine Martin:

Your example works for me. I can close the dialog that comes up just fine. What is this sample code supposed to show?

Note: VNC doesn't have any problems, the same way that xpra start-desktop doesn't have any problems or that a native X11 server with a regular window manager doesn't have any problems: the grabs bypass the window manager but since they're on the same display, that's not a problem.

Grabs cannot be forwarded with xpra seamless, that's just a limitation of X11, not of xpra. (more details can be found in #139) I will probably close this ticket as "wontfix".


Fri, 26 Jul 2019 03:26:51 GMT - Irony:

Okay,I will find some maybe error example and report it


Sun, 25 Aug 2019 03:06:58 GMT - Antoine Martin: status changed; resolution set

Feel free to re-open if you can provide a test case.


Sat, 23 Jan 2021 05:49:22 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2366