Popup opens on wrong screen / position (Windows 10)


#1

A user reported an issue that the popup menu opens on the wrong display. It looks like only one of our plugins is affected and i’m not sure what could lead to that issue. I wasn’t able to reproduce the issue. Here a video that shows the problem:

The code looks like this:

void mouseDown (const MouseEvent& e)
    {
        popupMenu.initializePopupMenu(&mainMenu, this->talCore);
        mainMenu.showMenuAsync (PopupMenu::Options().withTargetComponent (this).withMinimumWidth(this->getWidth() * this->talComponent->getTransform().getScaleFactor()),
                            ModalCallbackFunction::forComponent(optionsMenuStaticCallback, this));
    }

The target component where i attach the popup menu is on the correct position. Anyone has an idea what can go wrong and what i can do to avoid the issue?

I also noticed following issue on windows while trying to reproduce this:


#2

Can you try this with the latest tip of develop? There have been a number of improvements lately with hiDPI and scaling support on Windows.


#3

Thanks for asking. I’m not sure about the wrong screen issue. I let you know if i get some feedback about it.

But the popup still opens at the wrong position (connect a 4k TV screen and use it as a second screen in windows - the popup menu has an offset and isn’t at the right position). I have tested this with a retina mac book pro and a sony tv hdmi input (with parallels). Maybe a very special configuration, but the issue was also reported here:


#4

And this is using the latest tip of the develop branch from GitHub?


#5

Yes, with the latest develop. I also didn’t expect that. I will re-verify my build again this evening or tomorrow.


#6

Just re-checked. I’m using the latest develop and the problems with the popup are the same. The user also reported that the popup still shows up on the wrong screen. All works fine on OSX.


#7

Hi Ed

The user investigated a bit more and it looks as scaling is involved with the issue. Our plugin is scalable. He noticed following (popup on wrong screen):

Restore Original Size the issue went away, and slowly enlarging it, there is a point when the issue still isn’t manifesting but resizing larger than that it shows up.

We scale the plugin with following code (we have a component that we can scale on top of the plugin component):

this->scalablePluginComponent.setTransform(AffineTransform::scale(scale));


#8

Not 100% sure it would work and fit your needs, but perhaps as a workaround (until Ed fixes that) you can give a parent component to your popup via withParentComponent().

something like that :

auto* parent = findParentComponentOfClass<AudioProcessorEditor>();
mainMenu.showMenuAsync (PopupMenu::Options().withTargetComponent (this)
                                            .withParentComponent (parent)
                                            .withMinimumWidth (this->getWidth() * this->talComponent->getTransform().getScaleFactor()),
                                           ModalCallbackFunction::forComponent (optionsMenuStaticCallback, this));

#9

Thanks for that one. I give it a try. Looks promising!


#10

The problem persists also with the latest release. It looks like there is an error in the popup position calculation under some special conditions with multiple screens and scaling on windows.


#11

Can you provide a simple test app which exhibits the problem? That would help to track the issue down as it could be due to any number of things.


#12

I can reproduce. I’m using parallels dektop also (on a macbookpro with retina), so I wonder if it might be related?
Here is how I reproduced :

  • build the DSPModulePluginDemo as vst (I tried as vst2, haven’t tried vst3)
  • open reaper, create a track, insert the plugin
  • click on a combobox -> the popup menu is at the wrong place

If you just close/re-open the plugin UI it is fixed. same if you delete the plugin and reinstantiate it. it’s only wrong the first time.


#13

I can’t reproduce this on a MB Pro retina with a Parallels VM or on a Windows laptop.

To help narrow things down a bit:

  • Are you opening the plug-in on an external monitor?
  • Do you have any scale factors applied to the displays?

#14

it’s my main screen (I don’t have any external screen connected).
I don’t have any particular scale factor. in parallels, I use the ‘best for retina’ option.

I do not use parallels in “coherence mode”. mac 10.13, win 7

Do you have the same set up as me @kunz ?
Did you get the issue with another host?


#15

I was able to reproduce the wrong popup position with a 4k TV connected to my macbook running parallels with a HD cable. Im also using “Best for Retina display”.
I didn’t test DSPModulePluginDemo so far.

The user has the wrong position with two screens connected to a “normal” windows machine. The offset is so big, that the popup shows up in the other monitor. But the y position seems to be right in this case. And it only happens when the plugin is scaled some ratio. It’s hard to reproduce because i don’t have a two monitor setup where i can test that special case. Hope i have time to make a demo project in the near future.

It could be that all is related to the same code.


#16

I forgot to mention that I only have this problem with JUCE_WIN_PER_MONITOR_DPI_AWARE (1)

Also my resizable plugin does not resize properly in Reaper when that flag is on.
the resizing is not smooth (dragging the resizableCorner) as it is without JUCE_WIN_PER_MONITOR_DPI_AWARE, the plugin size is ‘jumping’.
I’ll test on a proper windows installation (i.e not in parallels) tomorrow