Not losing focus for toast messages


#1

I have created a toast messages generator which allows displaying notifications on the desktop’s top right end.
The Toast class extends DocumentWindow.
How can i avoid that my main application window (which also extends DocumentWindow) loses focus whenever a new toast message is opened?
I tried

toast->setWantsKeyboardFocus(false);
toast->setAlwaysOnTop(false);

without any luck.
Thanks for your help!


#2

Why did you derive from DocumentWindow and not just Component?

Rail


#3

Your’re right, that solved the problem, thanks a lot!