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.
GNU Lesser General Public License v3.0
718 stars 171 forks source link

Notifications disappear behind other windows even when TopMost set to true #72

Open Lakritzator opened 6 years ago

Lakritzator commented 6 years ago

Library version

ToastNotifications 2.3.4 and older

Expected behaviour

Notifications always stay on top

Actual behaviour

Notifications start to hide behind windows

Steps to reproduce behaviour

Show a notification, than show another Window with TopMost set to true -> notifications will no longer be TopMost (any window will go over them!)

Code to reproduce behaviour

Will supply this!

Questions

No

Hi,

I actually noticed this before, but as I couldn't reproduce it until today, I couldn't really tell what the issue was. I will probably make a PR for this, just wanted to report it as soon as possible so I don't forget.

Best wishes, Robin

Lakritzator commented 6 years ago

According to some of the information I found, the should handle the deactived event and when this is called (and DisplayOptions.TopMost is set to true) TopMost should be set to true again.

Lakritzator commented 6 years ago

This seems to be a very specific issue, as it's harder to reproduce in your project as I thought... working on it.

rafallopatka commented 6 years ago

Hi, Thank you for reporting this issue, I can look on this also.

Lakritzator commented 6 years ago

That is really nice, but it seems to be a weird border case which is caused by something in Greenshot, as just creating a new Window with TopMost = true doesn't help

I will keep hunting this issue, as without a fix I cannot release Greenshot with your notifications :smile:

If I can't find a reproducible way, without Greenshot, I will probably just compile your project to see if the way with the deactivated event is a solution for Greenshot.

Lakritzator commented 6 years ago

A short status update:

rafallopatka commented 6 years ago

Hi, I tried to reproduce this behaviour with mahaps. I created a sample where after clicking a button (or via context menu) new window shows, but notifications are still above new window. Maybe it is related to some specific configuration of your settings window as you mention?

Lakritzator commented 6 years ago

I really have no idea, I can reproduce the problem but cannot find what is causing it. And I also tried to see if the NotificationsWindow is deactivated or lost focus, but this doesn't seem to be the case... mysterious!!!

One time I thought I fixed it, but it seems the problem doesn't always occur. (like 1 out of 10 it is not happening).

I'll probably find it, and when I do it's probably clear why it happened, but I didn't have a lot of time the last few days.