New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAIL windows hidden once can never be shown again #5078

Closed
hualet opened this Issue Nov 29, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@hualet
Copy link
Contributor

hualet commented Nov 29, 2018

Describe the bug

Rail windows hidden once can never be shown again.

To Reproduce
Steps to reproduce the behavior:

  1. make the test application attached a remote app and give it a fixed command line argument 5000 or time interval in milliseconds.
  2. run the remote app with xfreerdp.
  3. you can see the main window can show once, hide and never be shown again.

Expected behavior
The rail window should do showing and hiding in every 5s or the time interval you specified.

Application details

  • FreeRDP 2.0.0
  • Command line used
    freerdp /sec:rdp /u:Administrator /p:'larry+1s' /app:'||test_window' /v:10.0.13.216
  • output of /buildconfig

This is FreeRDP version 2.0.0-rc4 (e21b72c+debian)
Build configuration: BUILD_TESTING=OFF BUILTIN_CHANNELS=ON HAVE_AIO_H=1 HAVE_EXECINFO_H=1 HAVE_FCNTL_H=1 HAVE_INTTYPES_H=1 HAVE_JOURNALD_H=TRUE HAVE_MATH_C99_LONG_DOUBLE=1 HAVE_POLL_H=1 HAVE_PTHREAD_MUTEX_TIMEDLOCK=ON HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB=1 HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL= HAVE_SYSLOG_H=1 HAVE_SYS_EVENTFD_H=1 HAVE_SYS_FILIO_H= HAVE_SYS_MODEM_H= HAVE_SYS_SELECT_H=1 HAVE_SYS_SOCKIO_H= HAVE_SYS_STRTIO_H= HAVE_SYS_TIMERFD_H=1 HAVE_TM_GMTOFF=1 HAVE_UNISTD_H=1 HAVE_XI_TOUCH_CLASS=1 WITH_ALSA=ON WITH_CCACHE=ON WITH_CHANNELS=ON WITH_CLIENT=ON WITH_CLIENT_AVAILABLE=1 WITH_CLIENT_CHANNELS=ON WITH_CLIENT_CHANNELS_AVAILABLE=1 WITH_CLIENT_COMMON=ON WITH_CLIENT_INTERFACE=OFF WITH_CUPS=ON WITH_DEBUG_ALL=OFF WITH_DEBUG_CAPABILITIES=OFF WITH_DEBUG_CERTIFICATE=OFF WITH_DEBUG_CHANNELS=OFF WITH_DEBUG_CLIPRDR=OFF WITH_DEBUG_DVC=OFF WITH_DEBUG_KBD=OFF WITH_DEBUG_LICENSE=OFF WITH_DEBUG_MUTEX=OFF WITH_DEBUG_NEGO=OFF WITH_DEBUG_NLA=OFF WITH_DEBUG_NTLM=OFF WITH_DEBUG_RAIL=OFF WITH_DEBUG_RDP=OFF WITH_DEBUG_RDPDR=OFF WITH_DEBUG_RDPEI=OFF WITH_DEBUG_REDIR=OFF WITH_DEBUG_RFX=OFF WITH_DEBUG_RINGBUFFER=OFF WITH_DEBUG_SCARD=OFF WITH_DEBUG_SND=OFF WITH_DEBUG_SVC=OFF WITH_DEBUG_SYMBOLS=OFF WITH_DEBUG_THREADS=OFF WITH_DEBUG_TIMEZONE=OFF WITH_DEBUG_TRANSPORT=OFF WITH_DEBUG_TSG=OFF WITH_DEBUG_TSMF=OFF WITH_DEBUG_WND=OFF WITH_DEBUG_X11=OFF WITH_DEBUG_X11_CLIPRDR=OFF WITH_DEBUG_X11_LOCAL_MOVESIZE=OFF WITH_DEBUG_XV=OFF WITH_DIRECTFB=OFF WITH_DSP_EXPERIMENTAL=OFF WITH_DSP_FFMPEG=OFF WITH_EVENTFD_READ_WRITE=1 WITH_FAAC=OFF WITH_FAAD2=OFF WITH_FFMPEG=TRUE WITH_FFMPEG=TRUE WITH_GFX_H264=ON WITH_GPROF=OFF WITH_GSM=ON WITH_GSSAPI=OFF WITH_GSTREAMER_0_10=OFF WITH_GSTREAMER_1_0=ON WITH_ICU=ON WITH_IPP=OFF WITH_JPEG=ON WITH_LAME=OFF WITH_LIBRARY_VERSIONING=ON WITH_LIBSYSTEMD=ON WITH_MACAUDIO=OFF WITH_MACAUDIO=OFF WITH_MACAUDIO_AVAILABLE=0 WITH_MANPAGES=ON WITH_MBEDTLS=OFF WITH_OPENH264=OFF WITH_OPENSLES=OFF WITH_OPENSSL=ON WITH_OSS=ON WITH_PAM=ON WITH_PCSC=ON WITH_PROFILER=OFF WITH_PULSE=ON WITH_SAMPLE=OFF WITH_SANITIZE_ADDRESS=OFF WITH_SANITIZE_ADDRESS_AVAILABLE=1 WITH_SANITIZE_MEMORY=OFF WITH_SANITIZE_MEMORY_AVAILABLE=1 WITH_SANITIZE_THREAD=OFF WITH_SANITIZE_THREAD_AVAILABLE=1 WITH_SERVER=ON WITH_SERVER_CHANNELS=ON WITH_SERVER_INTERFACE=ON WITH_SMARTCARD_INSPECT=OFF WITH_SOXR=OFF WITH_SSE2=ON WITH_THIRD_PARTY=OFF WITH_VALGRIND_MEMCHECK=OFF WITH_VALGRIND_MEMCHECK_AVAILABLE=1 WITH_WAYLAND=ON WITH_X11=ON WITH_X264=OFF WITH_XCURSOR=ON WITH_XDAMAGE=ON WITH_XEXT=ON WITH_XFIXES=ON WITH_XI=ON WITH_XINERAMA=ON WITH_XKBFILE=ON WITH_XRANDR=ON WITH_XRENDER=ON WITH_XSHM=ON WITH_XTEST=ON WITH_XV=ON WITH_ZLIB=ON
Build type: RELWITHDEBINFO
CFLAGS: -g -O2 -fdebug-prefix-map=/home/hualet/temp/freerdp2-2.0.0~git20181120.1.e21b72c95+dfsg1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -Wno-unused-result -Wno-unused-but-set-variable -Wno-deprecated-declarations -fvisibility=hidden -Wimplicit-function-declaration -Wredundant-decls -g -DWINPR_DLL
Compiler: GNU, 8.2.0
Target architecture: x64

  • OS version connecting to
    windows server 2008

Additional context
I checked the source code and printed the window order infos:

[12:50:08:793] [6087:6088] [INFO][com.freerdp.client.x11] - window id: 0x00020074 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] - WINDOW_ORDER_INFO { 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_STYLE 0x800b0000 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_SHOW 0x00000000 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_VISIBILITY 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] - } 
[12:50:08:794] [6087:6088] [INFO][com.freerdp.client.x11] - window state: 0 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] - window id: 0x00020074 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] - WINDOW_ORDER_INFO { 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_STYLE 0x96cf0000 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_SHOW 0x00000005 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_VISIBILITY 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] - } 
[12:50:08:891] [6087:6088] [INFO][com.freerdp.client.x11] - window state: 5 

[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] - window id: 0x00020074 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] - WINDOW_ORDER_INFO { 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_STYLE 0x800b0000 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_SHOW 0x00000000 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_VISIBILITY 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] - } 
[12:50:18:798] [6087:6088] [INFO][com.freerdp.client.x11] - window state: 0 

[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] - window id: 0x00020074 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] - WINDOW_ORDER_INFO { 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_STYLE 0x96cf0000 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_SHOW 0x00000005 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] -     WINDOW_ORDER_FIELD_VISIBILITY 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] - } 
[12:50:18:895] [6087:6088] [INFO][com.freerdp.client.x11] - window state: 5

it seems that the HIDE event is sent along with SHOW event. Because window show state change should happen every 5s, but actually every 10s there were 2 continuous show state changes.

test_window.zip

@akallabeth akallabeth added this to the next milestone Nov 29, 2018

@akallabeth

This comment has been minimized.

Copy link
Member

akallabeth commented Nov 29, 2018

Added it to the future target. Rail support is currently tailored for specific use cases only lacking a lot of features of the protocol.
Would appreciate any pull requests fixing such issues, but I'm not too familiar with the specifics of that so I can't actually tell you if this window show/hide thing should work as you expect it, sorry.
(only note: orders are not delayed/reordered/whatever, they are processed as they are received, so most likely some capability/setting is missing to handle that properly)

@hualet

This comment has been minimized.

Copy link
Contributor

hualet commented Nov 30, 2018

Added it to the future target. Rail support is currently tailored for specific use cases only lacking a lot of features of the protocol.
Would appreciate any pull requests fixing such issues, but I'm not too familiar with the specifics of that so I can't actually tell you if this window show/hide thing should work as you expect it, sorry.
(only note: orders are not delayed/reordered/whatever, they are processed as they are received, so most likely some capability/setting is missing to handle that properly)

Hmmm... that's so sad :( do you know someone else that can help me with that?
Anyway thank you @akallabeth

hualet added a commit to hualet/FreeRDP that referenced this issue Dec 4, 2018

Fixed RAIL window can't show again once hidden
The cause is very simple: we didn't map the xwindow on receiving
WINDOW_SHOW. but doing that causes another problem that you can't
hide a window anymore, and that is because whlie window hiding, the
_NET_WM_STATE and WM_STATE properies of the xwindow may change, in
the function `xf_event_PropertyNotify` we just assume that windows
not maximized, not minimized, yet not showing normally should be
corrected to be shown, we just need to consider the situation that
the window is hidden here.

fix: FreeRDP#5078
@hualet

This comment has been minimized.

Copy link
Contributor

hualet commented Dec 4, 2018

@akallabeth I found a fix for this, please review my code :)

@akallabeth akallabeth modified the milestones: next, 2.0.0 Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment