How to hide a DocementWindow added to desktop from taskbar?


#1

Hello there;

I have a base window that drives from the DialogWindow that is added to Desktop. My aim is to hide this window displaying at the taskbar. I have searched the form and found this:

http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=881&highlight=taskbar

So implementing something like:

int BaseDialog::getDesktopWindowStyleFlags()
{
	int flags = DocumentWindow::getDesktopWindowStyleFlags();

	flags &= ~(ComponentPeer::windowAppearsOnTaskbar);

	return flags;
}

But it didn’t work as deep inside the TopLevelWindow’s parentHierarchyChanged method there is a call to:

void TopLevelWindow::setDropShadowEnabled (const bool useShadow)
{
    useDropShadow = useShadow;

    if (isOnDesktop())
    {
        deleteAndZero (shadower);
        Component::addToDesktop (getDesktopWindowStyleFlags());
    }
...

which overwrites my style flag by calling its own getDesktopWindowStyleFlags()

Is there any work around for this case or any idea to achieve the issue stated above?

Thanks for advance.


#2

It looks to me like your code there should work fine (?)… Unless the problem is that the setDropShadowEnabled thing happens during the superclass constructor, in which case, maybe just make an extra call to parentHierarchychanged after your own constructor has run.