1. Tomas Beran
  2. PowerBuilder
  3. Wednesday, 4 May 2022 15:59 PM UTC

Hi

Dual monitor vs. Response window behave strangely. Maybe someone has solved it before.

I've a main window and an about box. In the about box there's code

move ( w_genapp_main.x , w_genapp_main.y)

in the Open event.

It works almost everywhere as expected with one exception: In case w_genapp_main starts on left screen and bigger part is on the right screen then the about box is catapulted to outer space.

I tried different windows setups but with no any significant change. It looks like Windows tries to push the window to a screen where the most of the window surface is present. It collides with PB and the result is the window is moved with Windows and then again with PB.

If I change the open script to

POST move ( w_genapp_main.x , w_genapp_main.y)

then it works everywhere. But it's nasty because I'm afraid internally the window moves somewhere and then it's re-positioned. Plus I don't like personally asynchronous calls because it's hard to debug such code. I can use Activate() event but it's almost the same.

Printscreens are attached, example application is attached.

For reproduction you need two or more monitors.

Do you have any idea how to solve it?

Attachments (3)
Tomas Beran Accepted Answer Pending Moderation
  1. Thursday, 5 May 2022 09:29 AM UTC
  2. PowerBuilder
  3. # 1

Hi Daryl

Thank you for your reply. I migrated from PB11 to PB2021 and this is the first time I've noticed this behavior. So I think Appeon has changed something. I see it as a bug because I think the behavior should be consistent and if I force opening at some position then the window should be opened there. It can be an attempt of solving some dual monitor issue or Appeon changed timing of some events.

Comment
  1. Daryl Foster
  2. Friday, 6 May 2022 02:16 AM UTC
Hi Tomas, I think the change Appeon made was so that response and popup windows would open up on the same screen as the calling window, which is a great idea when you've got the Center option checked for a response or popup window. Previously they would open up Centered on the primary monitor even if the calling window was on a different screen.



If the Center option isn't checked though I think it's a bug to ignore the Move call in the Open event. I don't think Appeon understand what I'm saying though. I need to give them a test application similar to yours which will reproduce the problem for my support ticket, but I haven't had a chance to yet.
  1. Helpful
  1. Tomas Beran
  2. Friday, 6 May 2022 10:07 AM UTC
Hi

Be careful about using the "Center feature" in MS Terminal Server environment. The screen is calculated from the host. Not from the client screen and you can get window which is out boundaries of the host or out of reach of your guest's screen. This is why I don't use it.
  1. Helpful
There are no comments made yet.
Daryl Foster Accepted Answer Pending Moderation
  1. Thursday, 5 May 2022 00:39 AM UTC
  2. PowerBuilder
  3. # 2

Hi Tomas, what version of Powerbuilder are you using? They've changed the way open works in Powerbuilder 2019R3 for Popup and Response windows, which I reckon is a bug.  A Move in the Open event seems to move it relative to the screen the parent window is on for popup and response windows, rather than move it to the absolute position. Here is my issue:

https://community.appeon.com/index.php/qna/q-a/popup-window-move-function-works-differently-in-pb2017-and-pb2019r3

https://www.appeon.com/standardsupport/search/view?id=7957

 

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 4 May 2022 18:32 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Tomas -

The information in the thread listed below may be of help to you:

   https://community.appeon.com/index.php/qna/q-a/centering-windows-with-multiple-monitors

Regards, John

Comment
  1. Tomas Beran
  2. Thursday, 5 May 2022 09:37 AM UTC
Hi John

I saw this theread and I was surprised Ivan centers the window in Open event. I don't understand how it can work. I think he has to have the same issue as I have.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 4 May 2022 16:19 PM UTC
  2. PowerBuilder
  3. # 4

Hi Tomas;

  I resolved that issue in my STD Framework over a decade ago ... http://chrispollach.blogspot.com/2022/03/stdfc.html. It also handles MIMD (Multiple Interface Multiple Document) & SDI App interfaces along with MDI=>Main, Response & Pop-Up window centering by App, by Monitor. It can also restore the above upon an App restart. ;-)

The framework is free BTW & open source. Feel free to use whatever code you find helpful. If you need some guidance on where to look for the relevant code (and architecture explanation), let me know.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.