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 stops when loosing focus
Forum Updated to NodeBB v4.3 + New Features

Application stops when loosing focus

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 834 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    ck01
    wrote on last edited by
    #1

    I have noticed that applications which do not need user interaction do stop running when they have no focus and continue when they get back focus. This is undesirable in these cases. How to keep a Qt application running without focus?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      on Android or what platform?

      C 1 Reply Last reply
      0
      • mrjjM mrjj

        hi
        on Android or what platform?

        C Offline
        C Offline
        ck01
        wrote on last edited by
        #3

        @mrjj On Desktop, Linux openSUSE 42.3, Qt 5.6.2, FVWM2 window manager.

        aha_1980A 1 Reply Last reply
        0
        • C ck01

          @mrjj On Desktop, Linux openSUSE 42.3, Qt 5.6.2, FVWM2 window manager.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @ck01,

          • what do you exactly mean with "stop running"?
          • can you provide a minimal example that exhibits that behavior?

          Thanks

          Qt has to stay free or it will die.

          C 1 Reply Last reply
          1
          • aha_1980A aha_1980

            Hi @ck01,

            • what do you exactly mean with "stop running"?
            • can you provide a minimal example that exhibits that behavior?

            Thanks

            C Offline
            C Offline
            ck01
            wrote on last edited by
            #5

            @aha_1980 It would be quite some work to provide a minimum example, but I could try that. There is e.g. a Unix file system application which just has a GUI (simple table) to present the results. Even when this table is not displayed (it is an else window-less application) but some qt classes are constructed an destroyed qt stops processing at some point and starts again when it has focus again. In my example I leave X11 and switch to the virtual consoles with Ctrl+Meta+F1 (pure text consoles). When switch back after a long time there is little progress in the application. Is there some flag which can be set to tell Qt to not put the process in sleep mode when X11 is not displayed (but the virtual consoles instead)?

            aha_1980A 1 Reply Last reply
            0
            • C ck01

              @aha_1980 It would be quite some work to provide a minimum example, but I could try that. There is e.g. a Unix file system application which just has a GUI (simple table) to present the results. Even when this table is not displayed (it is an else window-less application) but some qt classes are constructed an destroyed qt stops processing at some point and starts again when it has focus again. In my example I leave X11 and switch to the virtual consoles with Ctrl+Meta+F1 (pure text consoles). When switch back after a long time there is little progress in the application. Is there some flag which can be set to tell Qt to not put the process in sleep mode when X11 is not displayed (but the virtual consoles instead)?

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi @ck01: I'm not aware of such a switch, and I don't think that's normal behavior. Normally you have to actually react on FocusOut to stop background operations, except on mobile OS like Android.

              To ask a different question: does it also happen if you stay in X11, but only minimize your app (or switch it to background)? I'm pretty sure going to text console is part of the problem. If it is really a but in Qt, a minimal example would nevertheless be needed to reproduce the behavior.

              Thanks

              Qt has to stay free or it will die.

              C 1 Reply Last reply
              0
              • aha_1980A aha_1980

                Hi @ck01: I'm not aware of such a switch, and I don't think that's normal behavior. Normally you have to actually react on FocusOut to stop background operations, except on mobile OS like Android.

                To ask a different question: does it also happen if you stay in X11, but only minimize your app (or switch it to background)? I'm pretty sure going to text console is part of the problem. If it is really a but in Qt, a minimal example would nevertheless be needed to reproduce the behavior.

                Thanks

                C Offline
                C Offline
                ck01
                wrote on last edited by
                #7

                @aha_1980 It does seem to work when it is minimized only. This is somehow acceptable. So I mark this as solved though I would be interested in the switch-from-X11 solution...

                1 Reply Last reply
                0

                • Login

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