Non modal Window


#1

Hi All,

How can I open a DialogWindow or DocumentWindow non modal?

I’ve tried to create a derived DocumentWindow instance from the main app and I managed to be non modal, but the main window lost its focus and it stop doing its repaint until it regain the focus.

Any idea?

Thank you,

Gabriel


#2

What are you doing? Any window which become visible is non modal by default.


#3

The new window has to update its visual information ( by paint() ) but also the main window. Is something similar when a plug-in window is open in a host.

By now, I managed to creat the new window but the host window stop painting its content until it retake the focus.

Gabriel


#4

Repainting and modality are completely unrelated… If a component stops repainting, it’s because you’ve stopped calling repaint, not because something is modal.


#5

Jules, I was tracing the code and my component does not repaint because when the repaint() method reach the Component class (juce_component.cpp), the flag flags.hasHeavyweightPeerFlag is false.

Why is it turned off?

Thank you.

Gabriel


#6

Hi Jules, Hi all,

I realized that HasHeavyweightPeerFlag has nothing to do with my issue, sorry for that.

But, I’ve trace until the Win API and the Stack is the following:

> juce::HWNDComponentPeer::repaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::internalRepaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::internalRepaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::internalRepaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::internalRepaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::internalRepaint C++ juce::Component::internalRepaintUnchecked C++ juce::Component::repaint C++ CArrayComponent::paintBoxes C++ CArrayComponent::handleCommandMessage C++ `juce::Component::postCommandMessage'::`2'::CustomCommandMessage::messageCallback C++ juce::WindowsMessageHelpers::dispatchMessageFromLParam C++ juce::MessageManager::dispatchNextMessageOnSystemQueue C++ juce::MessageManager::runDispatchLoopUntil C++ juce::MessageManager::runDispatchLoop C++ juce::JUCEApplication::main C++ WinMain C++ __tmainCRTStartup C WinMainCRTStartup C 75348543 Desconocido [Los marcos siguientes pueden no ser correctos o faltar, no se han cargado símbolos para kernel32.dll] 7738ac69 Desconocido 7738ac3c Desconocido

Same stack trace happens if the main window (CArrayComponent) has the focus or the secondary window, as it must be. But, if the secondary window has the focus, the main window is not repainted.

My knowledge ends here, I cannot imagine why happens that.

Do you have any idea, please? I am deeply stuck with this problem.

Thank you,

Gabriel


#7

Gabriel, it seems you doing something unusual, and with you given information its almost impossible to help. We can’t read your mind. Thats why you don’t get any help.
So if you want some help, please post as much information we need (maybe the whole project as zip-archive) or something similar that makes it possible to reconstruct the problem in a few seconds.


#8

You’re misunderstanding something, but I’m not sure exactly what it is!

When you get stuck on a problem like this, a good approach might be to try building a minimal test app to replicate the problem?


#9

Chkn, Jules, Thank you.

Without any doubt, you are right.

I have to build a mock-up.

Gabriel