ToastNotifications icon indicating copy to clipboard operation
ToastNotifications copied to clipboard

Toastnotifications are not displayed after reconnecting to Terminalserver (RDP) sessions

Open WaldemarCoding opened this issue 6 years ago • 4 comments

Connecting to a Terminalserver ToastNotifications are displayed. If the User sessions is disconnected (by Admin or after timeout for example) and the user reconnects, the session and software is still open but no Messages are displayed anymore.

Library version

ToastNotification.Messages 2.5.1

Expected behaviour

Messages should be displayed after reconnect.

Actual behaviour

Messages are not displayed/visible after reconnect.

Steps to reproduce behaviour

Run attached demo in Terminalserver sessions, disconnect user and reconnect again. ToastNotificationsError

Code to reproduce behaviour

ToastNotificationDemo.zip

Questions

WaldemarCoding avatar Nov 04 '19 15:11 WaldemarCoding

I installed VS on a the terminalserver and ran the BasicUsageExample from source in Debug with "JustMyCode" disabled. When I disconnnect the user while a notification is still visible it will continue to work after reconnect. Doing so after all notifications were closed it stops working. Both times there is a COMExecption thrown. Let me know if I can check/debug something else.

Exception thrown: 'System.Runtime.InteropServices.COMException' in PresentationCore.dll
System.Runtime.InteropServices.COMException
  HResult=0x8000FFFF
  Message=Schwerwiegender Fehler (Ausnahme von HRESULT: 0x8000FFFF (E_UNEXPECTED))
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

grafik

WaldemarCoding avatar Nov 05 '19 08:11 WaldemarCoding

Tracked it down to collapsing the NotificationsWindow: https://github.com/rafallopatka/ToastNotifications/blob/95ab84fe76fdf1380c52cacdb861ee0aa0280d29/Src/ToastNotifications/Display/NotificationsWindow.xaml.cs#L64 When setting this.Visibility = Visibility.Hidden the issue does not seem to occur.

There seem to be some obscure RDP/WPF issues at play here.

Edit: This also occurs when using the "normal" remote desktop and not only when using TerminalServer

jidel avatar Mar 31 '20 12:03 jidel

Not sure what happend here but closing this was not on purpose. Actually I just wanted to merge the PR of @jidel in my Fork, not closing the original Issue.

WaldemarCoding avatar Apr 16 '20 06:04 WaldemarCoding

There are chances toast will not show after computer wake up or after screen saver closed. Change this.Visibility = Visibility.Collapsed; to this.Visibility = Visibility.Hidden ; solves the problem.

cuiliang avatar May 17 '20 00:05 cuiliang