omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Displaying to an external display stopped working.

    Pythonista
    objcutil
    2
    9
    3331
    Loading More Posts
    • 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.
    • samfrank
      samfrank last edited by

      I have an app that I created a few years back to teach in my classroom. The app is using dual display with an HDMI cable.

      To get dual display to work I used the code from this post. When iOS 13 came I had to tweak the code to get it to work:

      # second_window.setHidden(False) <<-- changed to
      second_windows.makeKeyAndVisible()
      

      However, now with the newest update to iOS, every time the app tries to set the screen in the code for the second display, Pythonista completely crashes. I have tried the app store version and the beta version of Pythonista. So I am fairly sure that it is a change in the way iOS handles displaying to an external monitor. I checked the documentation but I still couldn't get it to work.

      I don't know much about Objective-C so I am having a difficult time solving the issue. Any help or ideas would be appreciated.

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @samfrank last edited by

        @samfrank do you have some info about the crash reason?

        1 Reply Last reply Reply Quote 0
        • samfrank
          samfrank last edited by

          The app crashes Pythonista to the iOS home screen without producing an error. If I debug through the code the line that causes the crash is: second_window.setHidden(False). If I use makeKeyAndVisible() the crash still occurs. I wish I had more information to provide. Are there some hidden crash logs in Pythonista that I don't know about?

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @samfrank last edited by cvp

            @samfrank there is a file named _objc_exception.txt in the root of Pythonista

            1 Reply Last reply Reply Quote 0
            • cvp
              cvp last edited by

              You could also install the marvelous script of @dgelessus from here

              1 Reply Last reply Reply Quote 0
              • samfrank
                samfrank last edited by

                Thank you for your quick reply. I haven't tried the script yet, but the log contained the following:

                This app was terminated due to an Objective-C exception.
                
                threading violation: expected the main thread
                
                cvp 1 Reply Last reply Reply Quote 0
                • cvp
                  cvp @samfrank last edited by

                  @samfrank ok, you have to put

                  @on_main_thread	 
                  

                  just before the def calling the objectivec stuff. Could you post your code?

                  cvp 1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @cvp last edited by

                    @cvp said:

                    Could you post your code?

                    Only if you need more help

                    1 Reply Last reply Reply Quote 0
                    • samfrank
                      samfrank last edited by

                      @cvp Thank you so much. It works perfectly! I learned a lot total about the Objective-C side of Pythonista, today.

                      I put the decorator @objc_util.on_main_thread on the function calling all of the second display code and now the app is running just like it used to before the iOS 13 updates.

                      Thanks again!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Powered by NodeBB Forums | Contributors