Assertion with new randr code


#1
const Desktop::Displays::Display& Desktop::Displays::getMainDisplay() const noexcept
{
    ASSERT_MESSAGE_MANAGER_IS_LOCKED
    jassert (displays.getReference(0).isMain); <<<<<<<<<
    return displays.getReference(0);
}

I'm repeteadly getting this assert with my 2 monitor setup. the application is on the second monitor and the plugin windows opens there...

here is the stack:


0    kill    syscall-template.S    81    0x7f2d933f41d7    
1    juce::Desktop::Displays::getMainDisplay    juce_Desktop.cpp    267    0x7f2d876bdc2c    
2    juce::Component::ComponentHelpers::getParentOrMainMonitorBounds    juce_Component.cpp    439    0x7f2d87754299    
3    juce::Component::centreWithSize    juce_Component.cpp    1264    0x7f2d876b54c0    
4    juce::TopLevelWindow::centreAroundComponent    juce_TopLevelWindow.cpp    296    0x7f2d87746866    
5    juce::AlertWindow::updateLayout    juce_AlertWindow.cpp    430    0x7f2d8773c824    
6    juce::AlertWindow::addButton    juce_AlertWindow.cpp    105    0x7f2d8773b47c    
7    juce::LookAndFeel_V2::createAlertWindow    juce_LookAndFeel_V2.cpp    402    0x7f2d876f64e3    
8    juce::AlertWindowInfo::show    juce_AlertWindow.cpp    597    0x7f2d87780afe    
9    juce::AlertWindowInfo::showCallback    juce_AlertWindow.cpp    618    0x7f2d87780bf6    
10    juce::MessageManager::callFunctionOnMessageThread    juce_MessageManager.cpp    191    0x7f2d875d2dda    
11    juce::AlertWindowInfo::invoke    juce_AlertWindow.cpp    580    0x7f2d87780a3f    
12    juce::AlertWindow::showOkCancelBox    juce_AlertWindow.cpp    679    0x7f2d8773d500    
13    xxx::showMessageBox    SupernaturalWonderfulGui.cpp    736    0x7f2d8738cbc2    
14    xxx::perform    SupernaturalWonderfulGui.cpp    244    0x7f2d87389794    
15    juce::ApplicationCommandTarget::tryToInvoke    juce_ApplicationCommandTarget.cpp    67    0x7f2d87747eb0    
16    juce::ApplicationCommandTarget::CommandMessage::messageCallback    juce_ApplicationCommandTarget.cpp    36    0x7f2d87781b1b    
17    juce::InternalMessageQueue::dispatchNextInternalMessage    juce_linux_Messaging.cpp    202    0x7f2d875d980b    
18    juce::InternalMessageQueue::dispatchNextEvent    juce_linux_Messaging.cpp    95    0x7f2d875d921b    
19    juce::MessageManager::dispatchNextMessageOnSystemQueue    juce_linux_Messaging.cpp    390    0x7f2d875d6ac5    
...    <More>                

 

here are the locals:

    displays    @0x8d58f60    juce::Array<juce::Desktop::Displays::Display, juce::DummyCriticalSection, 0>
        data    @0x8d58f60    juce::ArrayAllocationBase<juce::Desktop::Displays::Display, juce::DummyCriticalSection>
            [juce::DummyCriticalSection]    @0x8d58f60    juce::DummyCriticalSection
            elements    @0x8d58f60    juce::HeapBlock<juce::Desktop::Displays::Display, false>
                data    @0x96eb3d0    juce::Desktop::Displays::Display
                    userArea    @0x96eb3d0    juce::Rectangle<int>
                    totalArea    @0x96eb3e0    juce::Rectangle<int>
                        pos    @0x96eb3e0    juce::Point<int>
                        w    1680    int
                        h    1050    int
                    scale    1    double
                    dpi    89.84574468085107    double
                    isMain    false    bool
            numAllocated    8    int
        numUsed    2    int

i will try to place the host in the main monitor and see what happens


#2

first or second monitor doesn't change anything. btw, continuing the assertions are fine, but alert windows and also other normal document windows open up on the first monitor even if the main plugin window is on the second one.

is there a way to open the windows in the same screen as the generating component ? 


#3

Thank you for reporting. It's fixed now!


#4

great fabian thanks a lot!

btw couldn’t test it until next week :wink: