Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Application not starting maximized on Mac, when started from script.
Forum Update on Monday, May 27th 2025

Application not starting maximized on Mac, when started from script.

Scheduled Pinned Locked Moved Solved General and Desktop
qt6.5qapplicationmacosscripting
8 Posts 3 Posters 979 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jammin44fm
    wrote on last edited by
    #1

    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?

    C 1 Reply Last reply
    0
    • J Jammin44fm

      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?

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @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?

      J 1 Reply Last reply
      0
      • C ChrisW67

        @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?

        J Offline
        J Offline
        Jammin44fm
        wrote on last edited by
        #3

        @ChrisW67

        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.

        C D 2 Replies Last reply
        0
        • J Jammin44fm

          @ChrisW67

          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.

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          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?

          J 1 Reply Last reply
          0
          • J Jammin44fm

            @ChrisW67

            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.

            D Offline
            D Offline
            DerReisende
            wrote on last edited by
            #5

            @Jammin44fm sounds like you are running your app sandboxed/ or with hardened runtime and the network server entitlement is missing?

            J 1 Reply Last reply
            0
            • D DerReisende

              @Jammin44fm sounds like you are running your app sandboxed/ or with hardened runtime and the network server entitlement is missing?

              J Offline
              J Offline
              Jammin44fm
              wrote on last edited by
              #6

              @DerReisende

              Nah, this application is not running sandboxed, no special entitlements are required.
              I have actually added the network entitlement and no change in behavior.

              1 Reply Last reply
              0
              • C ChrisW67

                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?

                J Offline
                J Offline
                Jammin44fm
                wrote on last edited by
                #7

                @ChrisW67

                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 QTcpServer

                Keep in min everything works fine in the Qt5 version of the application.

                J 1 Reply Last reply
                0
                • J Jammin44fm

                  @ChrisW67

                  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 QTcpServer

                  Keep in min everything works fine in the Qt5 version of the application.

                  J Offline
                  J Offline
                  Jammin44fm
                  wrote on last edited by
                  #8

                  @Jammin44fm

                  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.

                  1 Reply Last reply
                  0
                  • J Jammin44fm has marked this topic as solved on

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved