Program window does not open under macOS at first start as notarized AppBundle

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
hneubauer
Earned a small fee
Earned a small fee
Posts: 20
Joined: Wed May 13, 2020 4:08 pm

Program window does not open under macOS at first start as notarized AppBundle

Post by hneubauer »

I have a very strange effect that occurred when switching from wxWidgets 3.0.4 to wxWidgets 3.1.3 under macOS. We are developing and testing under macOS 10.15 Catalina. Maybe somebody has an idea what this could be due to. That would be great.

The program window is not opened when the application is loaded from the Internet as a notarized AppBundle and started for the first time.

When you open it for the first time, the usual question comes up if you really want to open the application that comes from the Internet. However, nothing happens after the confirmation.

The dock shows the application open. If you click on the icon there, the application window appears.

If you then close the application and open it again, the window opens as desired. Even during development when starting the application from the IDE (CLion) or as a local Appbundle there is no problem. Only at the very first start after the download the problem exists.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by ONEEYEMAN »

Hi,
Are you doing the regular

[code[
open <myApp.app/>
[/code]

Thank you.
hneubauer
Earned a small fee
Earned a small fee
Posts: 20
Joined: Wed May 13, 2020 4:08 pm

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by hneubauer »

Thank you very much for your answer.

I'm not quite sure what exactly you mean. Should I try to open the AppBundle from the terminal via "open"? Or adjust something in the AppBundle or in the source code. So far I thought we'd go the regular way, but maybe not :).

Unfortunately I'm not a macOS specialist and usually follow some tutorials :).
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by ONEEYEMAN »

Hi,
Yes, try to do:

Code: Select all

open <myApp>.app//
from the Terminal.

Thank you.
hneubauer
Earned a small fee
Earned a small fee
Posts: 20
Joined: Wed May 13, 2020 4:08 pm

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by hneubauer »

Thanks a lot for your support.

Starting from the command line works. So it makes a difference if I start our application by "open" or by double-clicking from the Finder.

Can you explain me what the difference is? And do you have an idea what exactly I have to do to make it work again when I start our application from the Finder?

Somehow wxWidgets 3 and 3.1 seem to be different.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by ONEEYEMAN »

Hi,
Does your project contains any dylib files?
Also, are you saying that the program built against 3.0 is successfully running from the Finder, but built against 3.1 don't?

In this case - try to compare info.plist content.

Thank you,
yves31
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Dec 04, 2015 6:15 pm

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by yves31 »

I had a similar issue when moving from 3.1.0 to 3.1.3, but it was with PropertySheet in Wizard mode. A custom draw control on a sheet used to work well, but in 3.1.3 the control does not show up when the sheet is opened for the first time. After moving back and then forward in wizard sheets, the control shows up.
It turns out that control client area position (x,y) is not automatically set to 0 in the new version of wxwidgets. After set to 0 during propertysheet initialization the control works properly in the new version of wxWidgets.
You may try to set Window and Client positions properly when starting program.
hneubauer
Earned a small fee
Earned a small fee
Posts: 20
Joined: Wed May 13, 2020 4:08 pm

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by hneubauer »

Many thanks for your answers

Our project does not include dylib files. The AppBundle contains only the binary, a txt with copyright information and two icns files and of course the pinfo.list.

And the problem is only the very first time with a notarized bundle when you start the AppBundle and the security question comes up. If I start it again after that, there is no more security prompt and the start from the Finder works immediately.

I had the version rebuilt (with 3.0.4) before I exchanged wxwidgets from the repository. There the problem does not exist. For the version after that with wxWidgets 3.1.3 the problem is there.

I don't think that the problem has anything to do with a control and positioning, because the problem really results from the exchange of the libraries and the startup works without problems after the program has been started once after the download.

The info.plist content has not changed.

Do you still have an idea what I could try?

What exactly is the difference between opening by "open" and by Finder?
hneubauer
Earned a small fee
Earned a small fee
Posts: 20
Joined: Wed May 13, 2020 4:08 pm

Re: Program window does not open under macOS at first start as notarized AppBundle

Post by hneubauer »

We found that not one line of our OnInit method is executed.

In summary, the program does not appear in the foreground when it's the first start of the notarized app bundle with security question:
  • it is started from the Finder
  • is started via terminal with "open -F"
It appears in the foreground when:
  • it is started from the dock (downlaods) immediately after downloading (so the problem is a little less critical for us now)
  • is started via terminal with "open"
The second start from the finder always works.

The notarized debug version has the same problem. Debugging the app with a breakpoint, the problem doesn't occur.

If you follow the logging in the Console, the app will hang with "SIGNAL: pid=xxxx asn=xxx" and the following "LSExceptions shared instance infalidated for timeout".

The old app built with wxwidgets 3.0.4 shows in the Console "NSApp cache appearance..." after the SIGNAL and then the following "LSExceptions shared ...". After that it will show the normal output until the program is in the foreground.

Otherwise the problem does not seem to occur with others. Only one other app seems to have the same problem (https://github.com/psychopy/psychopy/issues/3060)
Post Reply