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. Start Qt Application without going through a window manager
Forum Updated to NodeBB v4.3 + New Features

Start Qt Application without going through a window manager

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 5 Posters 7.8k Views 3 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.
  • N Offline
    N Offline
    nwoki
    wrote on 19 Jul 2017, 10:41 last edited by
    #1

    Hi all. I'm facing a problem with my application. I have a Qt application starting via Systemd (need it this way). What I did before was start the kwin_x11 window manager from a .xinitrc file and then attach to the X server via the DISPLAY=:0 variable in the launch command.

    Is there any way to start the application from systemd without going through a window manager?

    Thanks in advance

    J 1 Reply Last reply 19 Jul 2017, 10:43
    0
    • N nwoki
      19 Jul 2017, 10:41

      Hi all. I'm facing a problem with my application. I have a Qt application starting via Systemd (need it this way). What I did before was start the kwin_x11 window manager from a .xinitrc file and then attach to the X server via the DISPLAY=:0 variable in the launch command.

      Is there any way to start the application from systemd without going through a window manager?

      Thanks in advance

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 19 Jul 2017, 10:43 last edited by
      #2

      @nwoki Does it have to be a GUI application? If not you can just create a console application.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply 19 Jul 2017, 10:43
      0
      • J jsulm
        19 Jul 2017, 10:43

        @nwoki Does it have to be a GUI application? If not you can just create a console application.

        N Offline
        N Offline
        nwoki
        wrote on 19 Jul 2017, 10:43 last edited by
        #3

        @jsulm said in Start Qt Application without going through a window manager:

        @nwoki Does it have to be a GUI application? If not you can just create a console application.

        Yes. It has to be a Gui application

        J 1 Reply Last reply 19 Jul 2017, 10:45
        0
        • N nwoki
          19 Jul 2017, 10:43

          @jsulm said in Start Qt Application without going through a window manager:

          @nwoki Does it have to be a GUI application? If not you can just create a console application.

          Yes. It has to be a Gui application

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 19 Jul 2017, 10:45 last edited by
          #4

          @nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 1 Reply Last reply 19 Jul 2017, 10:47
          0
          • J jsulm
            19 Jul 2017, 10:45

            @nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?

            N Offline
            N Offline
            nwoki
            wrote on 19 Jul 2017, 10:47 last edited by
            #5

            @jsulm said in Start Qt Application without going through a window manager:

            @nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?

            Because i need the application to restart in case of a crash. I expect to see my Qt application window shown on the screen connected to the pc in use. This is how it's supposed to work:

            1 - attach the ac plug to the pc
            2 - switch on the pc
            3 - application starts automatically WITHOUT passing through sddm/kdm/gdm/kwin_x11/twm/fluxbox etc. It's a pc with a product that starts on boot.

            J 1 Reply Last reply 19 Jul 2017, 10:54
            0
            • N nwoki
              19 Jul 2017, 10:47

              @jsulm said in Start Qt Application without going through a window manager:

              @nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?

              Because i need the application to restart in case of a crash. I expect to see my Qt application window shown on the screen connected to the pc in use. This is how it's supposed to work:

              1 - attach the ac plug to the pc
              2 - switch on the pc
              3 - application starts automatically WITHOUT passing through sddm/kdm/gdm/kwin_x11/twm/fluxbox etc. It's a pc with a product that starts on boot.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 19 Jul 2017, 10:54 last edited by
              #6

              @nwoki said in Start Qt Application without going through a window manager:

              I expect to see my Qt application window shown on the screen connected to the pc in use

              Do you use a desktop manager? If so do you want to show the app for the currently logged on user? If no user is logged on and only the log-in window is shown: where do you want to show the app?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nwoki
                wrote on 19 Jul 2017, 10:58 last edited by nwoki
                #7
                • I do not use a Desktop manager and I don't want to
                • I want my application to start ONLY X server and nothing else

                Is there a way to actually acheive this or am i missing something?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  artwaw
                  wrote on 19 Jul 2017, 11:09 last edited by
                  #8

                  Hi,
                  it possible that I am missing something here but I my solution would be two-fold:

                  • small deamon-like program that actually monitors if target app is running and if requirements for it to run are met;
                  • target app (your main program) that runs in front the way you like.

                  For more information please re-read.

                  Kind Regards,
                  Artur

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 19 Jul 2017, 20:15 last edited by
                    #9

                    Hi,

                    Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    N 1 Reply Last reply 21 Jul 2017, 08:39
                    0
                    • S SGaist
                      19 Jul 2017, 20:15

                      Hi,

                      Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?

                      N Offline
                      N Offline
                      nwoki
                      wrote on 21 Jul 2017, 08:39 last edited by
                      #10

                      @SGaist said in Start Qt Application without going through a window manager:

                      Hi,

                      Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?

                      Why? The application is running on a normal pc. Anyway, I'll stick to using kwin_x11 and figure something out

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 21 Jul 2017, 09:34 last edited by
                        #11

                        Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.

                        From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        N 1 Reply Last reply 25 Jul 2017, 22:02
                        3
                        • B Offline
                          B Offline
                          bask185
                          wrote on 25 Jul 2017, 13:28 last edited by
                          #12

                          I also have a window-less GUI application on ubuntu. To get rid of the window manager I made a new desktop which auto launches the app.

                          However if it crashes, it does not restart and I still did not manage to prevent the display from going to sleep after x minutes. But I do not expect my application to crash on my target system. This might be a solution?

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 25 Jul 2017, 21:19 last edited by
                            #13

                            @bask185 What might be a solution ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • S SGaist
                              21 Jul 2017, 09:34

                              Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.

                              From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.

                              N Offline
                              N Offline
                              nwoki
                              wrote on 25 Jul 2017, 22:02 last edited by
                              #14

                              @SGaist said in Start Qt Application without going through a window manager:

                              Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.

                              From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.

                              Sorry for the late reply.

                              Yeah, I looked that up but didn't think it was necessary and that maybe there was another way. I'll try the eglfs platform plugin (via the -platform eglfs switch) and see if it does what I expect it to. I'll get back to you

                              1 Reply Last reply
                              0
                              • N Offline
                                N Offline
                                nwoki
                                wrote on 26 Jul 2017, 12:57 last edited by
                                #15

                                In the end i'm using matchbox and launching the application with the -platform eglfs flag activated. There's no way in getting the app to run directly on X (which is what I wanted to achieve in the beginning) so I'm going with a very slim window manager.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 26 Jul 2017, 21:51 last edited by
                                  #16

                                  Then you need the xcb backend.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0

                                  4/16

                                  19 Jul 2017, 10:45

                                  topic:navigator.unread, 12
                                  • Login

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