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. Fullscreen over multiple screens (Qt 5.6)

Fullscreen over multiple screens (Qt 5.6)

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 6 Posters 9.3k 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.
  • ? A Former User

    @JohanL Hi, and welcome to the Qt forum! What's your desktop environment? Unity?

    JohanLJ Offline
    JohanLJ Offline
    JohanL
    wrote on last edited by
    #4

    @Wieland said:

    @JohanL Hi, and welcome to the Qt forum! What's your desktop environment? Unity?

    Thank you!

    Yes, sorry, I should have mentioned, it's Unity.

    --
    Johan Liseborn
    Systems and Application Programmer
    http://www.castlerock.se | Castlerock AB

    JohanLJ 1 Reply Last reply
    0
    • VRoninV VRonin

      have you tried window->showFullScreen() instead of setting the geometry?

      JohanLJ Offline
      JohanLJ Offline
      JohanL
      wrote on last edited by
      #5

      @VRonin said:

      have you tried window->showFullScreen() instead of setting the geometry?

      Yes, I didn't mention that in my original post, but I did try that as well. That actually gives the behavior I really want from the perspective of removing everything but my application from the screen, including any window borders, menu bars, etc, but it still only shows my application on one of my screens.

      I should also mention that things works as expected if I manually resize the window (by dragging at the window borders) to cover the whole screen (or as close as you can get by doing this manually).

      --
      Johan Liseborn
      Systems and Application Programmer
      http://www.castlerock.se | Castlerock AB

      VRoninV 1 Reply Last reply
      0
      • JohanLJ JohanL

        @Wieland said:

        @JohanL Hi, and welcome to the Qt forum! What's your desktop environment? Unity?

        Thank you!

        Yes, sorry, I should have mentioned, it's Unity.

        JohanLJ Offline
        JohanLJ Offline
        JohanL
        wrote on last edited by
        #6

        @JohanL said:

        @Wieland said:

        @JohanL Hi, and welcome to the Qt forum! What's your desktop environment? Unity?

        Thank you!

        Yes, sorry, I should have mentioned, it's Unity.

        Not being an expert in X11 and window managers, I still suspect there might be a connection to window manager behavior. For Unity for example, window maximation (by pressing the little maximize button) also only expands the window on the current screen).

        --
        Johan Liseborn
        Systems and Application Programmer
        http://www.castlerock.se | Castlerock AB

        1 Reply Last reply
        0
        • JohanLJ JohanL

          @VRonin said:

          have you tried window->showFullScreen() instead of setting the geometry?

          Yes, I didn't mention that in my original post, but I did try that as well. That actually gives the behavior I really want from the perspective of removing everything but my application from the screen, including any window borders, menu bars, etc, but it still only shows my application on one of my screens.

          I should also mention that things works as expected if I manually resize the window (by dragging at the window borders) to cover the whole screen (or as close as you can get by doing this manually).

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #7

          @JohanL Looking around it looks like setting the geometry and then calling showFullScreen() worked in Qt4

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          JohanLJ 1 Reply Last reply
          0
          • VRoninV VRonin

            @JohanL Looking around it looks like setting the geometry and then calling showFullScreen() worked in Qt4

            JohanLJ Offline
            JohanLJ Offline
            JohanL
            wrote on last edited by
            #8

            @VRonin said:

            @JohanL Looking around it looks like setting the geometry and then calling showFullScreen() worked in Qt4

            I've now tested this as well, and it does not seem to work either (I tried it both ways, first setting the geometry and then fullscreen, and the other way around). I also failed to mention in my original post that I am on Qt 5.6.

            I also switched to GNOME, running whatever it is you get by default when installing on Ubuntu 14.04, but same result there, the application only starts in fullscreen on one of the physical screens.

            --
            Johan Liseborn
            Systems and Application Programmer
            http://www.castlerock.se | Castlerock AB

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by VRonin
              #9

              what i'd do then is setting the geometry and then calling

              window->setFlags(
              (window->flags() & ~Qt::WindowTitleHint) 
              | Qt::FramelessWindowHint
              );
              

              This should simulate the apparence of a "full screen" window

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              JohanLJ 1 Reply Last reply
              0
              • VRoninV VRonin

                what i'd do then is setting the geometry and then calling

                window->setFlags(
                (window->flags() & ~Qt::WindowTitleHint) 
                | Qt::FramelessWindowHint
                );
                

                This should simulate the apparence of a "full screen" window

                JohanLJ Offline
                JohanLJ Offline
                JohanL
                wrote on last edited by
                #10

                @VRonin said:

                what i'd do then is setting the geometry and then calling

                window->setFlags(
                (window->flags() & ~Qt::WindowTitleHint) 
                | Qt::FramelessWindowHint
                );
                

                This should simulate the apparence of a "full screen" window

                Yes, this likely works to get the apparence of full screen, except I do not think it will actually make the window cover e.g. the top bar of Ubuntu's Unity desktop.

                Anyway, I still haven't figured out how to solve the original question of getting my main window to span two (or more) physical screens on startup. I'll continue to dig around, but any additional ideas would be highly appreciated!

                Cheers,

                /johan

                --
                Johan Liseborn
                Systems and Application Programmer
                http://www.castlerock.se | Castlerock AB

                kshegunovK F 2 Replies Last reply
                0
                • JohanLJ JohanL

                  @VRonin said:

                  what i'd do then is setting the geometry and then calling

                  window->setFlags(
                  (window->flags() & ~Qt::WindowTitleHint) 
                  | Qt::FramelessWindowHint
                  );
                  

                  This should simulate the apparence of a "full screen" window

                  Yes, this likely works to get the apparence of full screen, except I do not think it will actually make the window cover e.g. the top bar of Ubuntu's Unity desktop.

                  Anyway, I still haven't figured out how to solve the original question of getting my main window to span two (or more) physical screens on startup. I'll continue to dig around, but any additional ideas would be highly appreciated!

                  Cheers,

                  /johan

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #11

                  @JohanL

                  Yes, this likely works to get the apparence of full screen, except I do not think it will actually make the window cover e.g. the top bar of Ubuntu's Unity desktop.

                  Bear in mind some, or I'd say most, window managers explicitly prohibit that, it can be changed manually from the WM's configuration though (at least KDE allows it, and I think Gnome does as well).

                  I'll continue to dig around, but any additional ideas would be highly appreciated!

                  What I'd try is to get the geometry of each screen, union the regions and ultimately set the widget/window's geometry manually.

                  Kind regards.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • JohanLJ JohanL

                    @VRonin said:

                    what i'd do then is setting the geometry and then calling

                    window->setFlags(
                    (window->flags() & ~Qt::WindowTitleHint) 
                    | Qt::FramelessWindowHint
                    );
                    

                    This should simulate the apparence of a "full screen" window

                    Yes, this likely works to get the apparence of full screen, except I do not think it will actually make the window cover e.g. the top bar of Ubuntu's Unity desktop.

                    Anyway, I still haven't figured out how to solve the original question of getting my main window to span two (or more) physical screens on startup. I'll continue to dig around, but any additional ideas would be highly appreciated!

                    Cheers,

                    /johan

                    F Offline
                    F Offline
                    fritzw
                    wrote on last edited by
                    #12

                    @JohanL said in Fullscreen over multiple screens (Qt 5.6):

                    Anyway, I still haven't figured out how to solve the original question of getting my main window to span two (or more) physical screens on startup. I'll continue to dig around, but any additional ideas would be highly appreciated!

                    I know this topic is quite old, but since it's the best match I found, I'll provide a solution anyway. It works on Linux with X11 and xfwm4. The code is PyQt5, but porting it to C++ should be trivial.

                    a = QApplication(sys.argv)
                    widget = QLabel(None)
                    widget.setWindowFlags(Qt.WindowStaysOnTopHint) # optional
                    widget.show() # The order is important. You have to show it BEFORE setting the size.
                    
                    # Negative coordinates are necessary because with (0,0) xfwm will place
                    # the window on the current desktop and below the task bar.
                    taskBarSize = 32
                    allScreens = QApplication.desktop().geometry()
                    widgetSize = allScreens.adjusted(-10, -taskBarSize, 10, taskBarSize)
                    widget.setGeometry(widgetSize) # Now widget should span all screens and cover the task bar
                    
                    a.exec()
                    
                    R 1 Reply Last reply
                    3
                    • F fritzw

                      @JohanL said in Fullscreen over multiple screens (Qt 5.6):

                      Anyway, I still haven't figured out how to solve the original question of getting my main window to span two (or more) physical screens on startup. I'll continue to dig around, but any additional ideas would be highly appreciated!

                      I know this topic is quite old, but since it's the best match I found, I'll provide a solution anyway. It works on Linux with X11 and xfwm4. The code is PyQt5, but porting it to C++ should be trivial.

                      a = QApplication(sys.argv)
                      widget = QLabel(None)
                      widget.setWindowFlags(Qt.WindowStaysOnTopHint) # optional
                      widget.show() # The order is important. You have to show it BEFORE setting the size.
                      
                      # Negative coordinates are necessary because with (0,0) xfwm will place
                      # the window on the current desktop and below the task bar.
                      taskBarSize = 32
                      allScreens = QApplication.desktop().geometry()
                      widgetSize = allScreens.adjusted(-10, -taskBarSize, 10, taskBarSize)
                      widget.setGeometry(widgetSize) # Now widget should span all screens and cover the task bar
                      
                      a.exec()
                      
                      R Offline
                      R Offline
                      Rajprakhar
                      wrote on last edited by
                      #13

                      @fritzw This didn't work for me I also had to add a flag for bypassing window manager, and worked fine if I set the geometry before widget.show() also didn't had to adjust the geometry for the taskbar(tested for KDE only)
                      pyqt5 code:

                      a = QApplication(sys.argv)
                      widget = QLabel(None)
                      widget.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.X11BypassWindowManagementHint)
                      allScreens = QApplication.desktop().geometry()
                      self.setGeometry(allScreens)
                      
                      widget.show()
                      a.exec()
                      
                      1 Reply Last reply
                      1

                      • Login

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