Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
6 posts • Page 1 of 1
User avatar
joost.lijster@siemens.com
Posts: 19
Joined: Wed Sep 21, 2016 1:51 pm

Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by joost.lijster@siemens.com »

Hi all,

At the moment we are dealing with quite a nasty bug, causing QT widgets to be broken (dropdown for example: the dropdown is on screen 3, but opens on screen 1..), popups to be opened at the wrong position, screencount to be incorrect, screensize to return (0, 0) instead of (1920,1200).

The setup:

- Simatic Rack PC (IPC847D) with 3 monitors ([strike]iiyama[/strike] Edit: EIZO screens), each at a resolution of 1920*1200. Screens ordered from LEFT(1) to CENTER (2) to RIGHT (3) in windows.
- OS: Windows Server 2012 R2 standard
- WinCC OA 3.14 P002
- Running project with 1 basepanel, containing a dropdown-widget and a button that triggers a popup using ChildPanelOnCentral

The bug is easy to reproduce:

- The basepanel is positioned on a random screen. Popups open up nicely on the center of the basepanel, the dropdown widget works fine
- A random screen is turned off, this may be the screen at which the popup is visible or another screen.
- The bug has now been triggered. The screen may be turned on again, but this doesnt influence anything.

This results in the following:
- Popups are only opened on screen 1 regardless of the position of the basepanel. Note: if the basepanel is on screen 1, all seems fine. If the basepanel is on screen 2 or 3, the popup opens on the RIGHT HAND SIDE of screen 1 (so the X-position is wrong), but it does take the correct Y-position.
- The Dropdown opens on screen 1. If the basepanel is on screen 1, all seems fine. If the basepanel is on screen 2 or 3, the same behaviour as the popup occurs
- getScreenCount() always returns 1 (even though more screens are connected)
- getScreenSize() always returns 0, 0 with an offset of 0, 0 from screen 1.

On top of this: the function panelPosition() always returns the CORRECT x/y position.

The bug was discovered due to the QT widget opening its dropdown on the wrong screen. To get more details, I had written the following snippet of code which runs as a thread in the basepanel:

Code: Select all

void showPosition()
{
  while( 1 )
  {
    // Count the number of screens
    int    iScreenCount = getScreenCount();

    string strScreenCount = "Number of screens: " + iScreenCount;
    
    // Now create an information string, containing
    // details about each screen
    string strScreenInformation;
    for( int i = 1; i

User avatar
kilianvp
Posts: 443
Joined: Fri Jan 16, 2015 10:29 am

Re: Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by kilianvp »

Patch 002? Give Patch 011 a try.

getScreenCount() works for me

User avatar
joost.lijster@siemens.com
Posts: 19
Joined: Wed Sep 21, 2016 1:51 pm

Re: Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by joost.lijster@siemens.com »

Hi Kilian,

I will give this patch a try, but according to the documentation, I cannot find major changes to the functions I described.

Still, the bug behaves different on my laptop:

- Fujitsu laptop, 2 Fujitsu screens connected through DisplayPort, Windows 7.

Using the same code snippet:
- The screen count functions great
- The getScreenSize does not - the resolution of the 3rd screen is (0,0) after switching off a random display, and switching it back on.

The bug therefore seems hardware/software dependant, but exists nonetheless.

I will update you as soon as I tried P011

User avatar
kilianvp
Posts: 443
Joined: Fri Jan 16, 2015 10:29 am

Re: Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by kilianvp »

I tried with 2 screens and removed one while running your snippet.. and it worked like it should

User avatar
joost.lijster@siemens.com
Posts: 19
Joined: Wed Sep 21, 2016 1:51 pm

Re: Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by joost.lijster@siemens.com »

Hi Kilian,

It has been a while, but I have followed your advice: updating to the latest patch (which happens to be P012 by now). Unfortunately this did not bring any improvements. and the same behaviour is shown.

Something weird I discovered today:

The screens are connected by either DP (2x, screen 2 and 3) or DVI-D (1x, screen 1). If i turn off one of the DP connected screens, the problem occurs. If I turn of the DVI connected one, it does not. I will start some more investigation..

Kind regards,

Joost

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: Broken popups, QT widgets, getScreenCount() and getScreenSize() on turning off/on monitors

Post by leoknipp »

A similar problem we have also seen at another project. In that case also Windows programs (e.g. a file explorer) have been shifted from one monitor to another one if the monitor was turned off.

Do you observe the same behaviour in your system?

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
6 posts • Page 1 of 1