Application not starting maximized on Mac, when started from script.
-
Hello,
My application runs on Windows, Mac and Linux.
I also have an automated scripting system that allows me to interact with the
application while it is running. This scripting system not only allows for users to
write and use scripts to automate parts of the application, it also allows
me to run a number of automated tests.I've recently migrated the Application from Qt5.12.3 to Qt6.5.3, and noticed some
slight changes in behavior on my app on the Mac platform.Specifically, the application is not starting maximized when started from a python script.
Some details:
we run the automated tests, which use a python script to launch the
application, ( via subprocess ) and then launch another process to conect to the
scripting interface of our application, via a standard IP and socket interface.
( this time via socket.create_connection ).The problem is that on Mac I am not able to connect to the application,
it is started in a minimized form, and never responds to the incoming socket connection.
If I manually click on the application in the toolbar of the Mac, it maximizes, and then everything starts working.The python script is fine, because it all works on older versions using 5.12.
The windows platform is fine. So there must be some specific behavior with the Mac that is causing this issue.I am using QWidget::showMaximized() to show the window in question.
any thoughts?
-
@Jammin44fm said in Application not starting maximized on Mac, when started from script.:
it is started in a minimized form, and never responds to the incoming socket connection.
If I manually click on the application in the toolbar of the Mac, it maximizes, and then everything starts working.Then I would conclude that it is not running at all (i.e. crashed) until you launch it again by clicking on the toolbar. Have you confirmed the application is actually running?
-
Oh it's definitely running correctly, it normally does not have an icon in the toolbar.
The icon only appears in the toolbar after it is started for the script, but any attempts to talk to the application, fail. ie I am trying to connect to the scripting port.As soon as I click on the icon in the toolbar it jumps to be displayed on screen, and the network interface starts responding.
-
I am not a Mac person, so forgive any platform faux pas on my part
Can you see the open, listening port when the application is in this minimised, non-responsive state?
-
@Jammin44fm sounds like you are running your app sandboxed/ or with hardened runtime and the network server entitlement is missing?
-
Nah, this application is not running sandboxed, no special entitlements are required.
I have actually added the network entitlement and no change in behavior. -
It appears the application is not listening to the port when in the minimized state.
Checking the system for any applications listening on the given port i get no results when the app is minimized, as soon as a maximize the app, I see the app listed appropriately.With further testing it appears the application is not fully starting at all.
After starting it from the python script, it has an icon in the system tray/taskbar,
an entry in the Activity monitor and a PID, but it has not proceeded to fully start the application, and definitely not getting as far as starting the QTcpServerKeep in min everything works fine in the Qt5 version of the application.
-
Thanks for everyones input I've traced the issue to a problem with process input, and i'm going to create a more specific issue to address that.
-