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. Different resolution values returned by qGuiApp->primaryScreen().size() on different Graphic Environments (XFCE vs GNOME)
Forum Updated to NodeBB v4.3 + New Features

Different resolution values returned by qGuiApp->primaryScreen().size() on different Graphic Environments (XFCE vs GNOME)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 293 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.
  • P Offline
    P Offline
    poor_robert
    wrote on 1 Sept 2020, 06:40 last edited by
    #1

    Hello Qt Friends,

    I'm working on GUI application and I've tested on different Graphic Environments. I have noticed that when I run it on XFCE my application gets wrong screen size from:
    https://doc.qt.io/qt-5/qguiapplication.html#primaryScreen-prop

    I have multiple Graphic Environments. I use Ubuntu 20
    There is only 1 screen that has 1920 x 1080 resolution in settings. Also xrand command returns the same resolution.
    In my code I use:

    qGuiApp->primaryScreen().size()
    

    On Gnome3 and Plasma it returns proper value i.e. 1920 x 1080.
    However, on XCFE (and LXDE) this command returns: 960 x 540

    What's also strange when I run Plasma and then switch to XFCE it works fine. But after reseting PC and opening XFCE it returns wrong values...

    Do you have idea what is missing?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 1 Sept 2020, 19:10 last edited by
      #2

      Hi,

      That rather looks like an XFCE issue. Did you check the settings of that desktop environment ?

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

      P 1 Reply Last reply 2 Sept 2020, 06:26
      0
      • S SGaist
        1 Sept 2020, 19:10

        Hi,

        That rather looks like an XFCE issue. Did you check the settings of that desktop environment ?

        P Offline
        P Offline
        poor_robert
        wrote on 2 Sept 2020, 06:26 last edited by
        #3

        @SGaist Hello :)
        Yes, and the Screen resolution is set to 1920 x 1080. Also xrandr returns the same value...

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Sept 2020, 18:20 last edited by
          #4

          Is there some "magnifying" settings ?
          The factor 2 you have is troubling.

          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

          1/4

          1 Sept 2020, 06:40

          • Login

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