rafallopatka / ToastNotifications

Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

WaldemarCoding opened this issue · 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

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

Tracked it down to collapsing the NotificationsWindow:


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

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.

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.