Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QWS VNC doesn't work on Portrait mode
Forum Updated to NodeBB v4.3 + New Features

QWS VNC doesn't work on Portrait mode

Scheduled Pinned Locked Moved Mobile and Embedded
vncqwsembedded4.8rotate
29 Posts 3 Posters 15.1k Views 2 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 4 Aug 2015, 16:11 last edited by
    #13

    Silly idea (and just to verify) but what about just dropping the if and do the transform for all screens anyway ?

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

    K 2 Replies Last reply 4 Aug 2015, 16:36
    0
    • K kumararajas
      4 Aug 2015, 15:15

      No success yet!

      While running the application with Multi for VNC, still the touch inputs on the device is still not rotated.

      K Offline
      K Offline
      kumararajas
      wrote on 4 Aug 2015, 16:34 last edited by kumararajas 8 Apr 2015, 16:35
      #14

      Just for more information:

      export QWS_DISPLAY="Multi: VNC:0:size=480x640 Transformed:rot0"
      

      This displays the UI in a landscape mode and the touch input works as per the UI.

      export QWS_DISPLAY="Multi: VNC:0:size=480x640 Transformed:rot90"
      

      This rotates the UI to 90 degrees. But the touch input is as same as 0 degrees.

      This clearly indicates that the display transformation works good but the transformation to touch input mapping is not working.

      --Kumar

      1 Reply Last reply
      0
      • S SGaist
        4 Aug 2015, 16:11

        Silly idea (and just to verify) but what about just dropping the if and do the transform for all screens anyway ?

        K Offline
        K Offline
        kumararajas
        wrote on 4 Aug 2015, 16:36 last edited by
        #15

        @SGaist Sam, can you please send me the code snippet to be on same page?

        Thanks,
        Kumara

        --Kumar

        1 Reply Last reply
        0
        • S SGaist
          4 Aug 2015, 16:11

          Silly idea (and just to verify) but what about just dropping the if and do the transform for all screens anyway ?

          K Offline
          K Offline
          kumararajas
          wrote on 6 Aug 2015, 13:45 last edited by
          #16

          @SGaist You mean to try this kind of code:

          QList<QScreen*> screens = qt_screen->subScreens();
          if (screens.size()) 
          {
              for (int i = 0; i < screens.size(); ++i) 
              {
                  QScreen *screen = screens.at(i);
                  QSize s = QSize(screen->deviceWidth(), screen->deviceHeight());
                  tpos = screen->mapFromDevice(pos, s);
                  break;
              }
          }
          

          instead of

          if (qt_screen->isTransformed()) 
              {
                  QSize s = QSize(qt_screen->deviceWidth(), qt_screen->deviceHeight());
                  tpos = qt_screen->mapFromDevice(pos, s);
              } 
              else 
              {
                  //tpos = pos;
                  // Only in case of Multi Display
                  // If main screen is not transformed, then check if sub screens are transformed
                  QList<QScreen*> screens = qt_screen->subScreens();
                  if (screens.size() && !bRemote) 
                  {
                      for (int i = 0; i < screens.size(); ++i) 
                      {
                          QScreen *screen = screens.at(i);
                          if (screen->isTransformed())
                          {
                              QSize s = QSize(screen->deviceWidth(), screen->deviceHeight());
                              tpos = screen->mapFromDevice(pos, s);
                              break;
                          }
                      }
                  }
              }
          

          Sam, if you confirm, I can make these changes and build my packages.

          Thanks,
          Kumara

          --Kumar

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 6 Aug 2015, 21:03 last edited by
            #17

            Yes that's what I had in mind, without forgetting the main screen first.

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

            K 2 Replies Last reply 6 Aug 2015, 22:02
            0
            • S SGaist
              6 Aug 2015, 21:03

              Yes that's what I had in mind, without forgetting the main screen first.

              K Offline
              K Offline
              kumararajas
              wrote on 6 Aug 2015, 22:02 last edited by
              #18

              @SGaist Oh ya, I missed the main screen

              So here is the code which I can do the test:

              // Main screen
              QSize s = QSize(qt_screen->deviceWidth(), qt_screen->deviceHeight());
              tpos = qt_screen->mapFromDevice(pos, s);
              
              // Subscreens
              QList<QScreen*> screens = qt_screen->subScreens();
              if (screens.size()) 
              {
                  for (int i = 0; i < screens.size(); ++i) 
                  {
                      QScreen *screen = screens.at(i);
                      QSize s = QSize(screen->deviceWidth(), screen->deviceHeight());
                      tpos = screen->mapFromDevice(pos, s);
                      break;
                  }
              }
              

              Right?

              --Kumar

              1 Reply Last reply
              0
              • S SGaist
                6 Aug 2015, 21:03

                Yes that's what I had in mind, without forgetting the main screen first.

                K Offline
                K Offline
                kumararajas
                wrote on 6 Aug 2015, 22:23 last edited by
                #19

                @SGaist Below the patch code, I see

                    QPoint tpos;
                    // Main screen
                    QSize s = QSize(qt_screen->deviceWidth(), qt_screen->deviceHeight());
                    tpos = qt_screen->mapFromDevice(pos, s);
                
                    // Sub screens
                    QList<QScreen*> screens = qt_screen->subScreens();
                    if (screens.size()) 
                    {
                        for (int i = 0; i < screens.size(); ++i) 
                        {
                            QScreen *screen = screens.at(i);
                            QSize s = QSize(screen->deviceWidth(), screen->deviceHeight());
                            tpos = screen->mapFromDevice(pos, s);
                            break;
                        }
                    }
                
                    if (qt_last_x) {
                         *qt_last_x = tpos.x();
                         *qt_last_y = tpos.y();
                    }
                    QWSServer::mousePosition = tpos;
                    qwsServerPrivate->mouseState = state;
                

                We use the tpos and mouse the mousePosition just once. Even though, we have many subscreens, we just do it once.

                Is this correct?

                Should we not do this in a loop for all the screens?

                Please let me know.

                --Kumar

                K 1 Reply Last reply 7 Aug 2015, 19:27
                0
                • K kumararajas
                  6 Aug 2015, 22:23

                  @SGaist Below the patch code, I see

                      QPoint tpos;
                      // Main screen
                      QSize s = QSize(qt_screen->deviceWidth(), qt_screen->deviceHeight());
                      tpos = qt_screen->mapFromDevice(pos, s);
                  
                      // Sub screens
                      QList<QScreen*> screens = qt_screen->subScreens();
                      if (screens.size()) 
                      {
                          for (int i = 0; i < screens.size(); ++i) 
                          {
                              QScreen *screen = screens.at(i);
                              QSize s = QSize(screen->deviceWidth(), screen->deviceHeight());
                              tpos = screen->mapFromDevice(pos, s);
                              break;
                          }
                      }
                  
                      if (qt_last_x) {
                           *qt_last_x = tpos.x();
                           *qt_last_y = tpos.y();
                      }
                      QWSServer::mousePosition = tpos;
                      qwsServerPrivate->mouseState = state;
                  

                  We use the tpos and mouse the mousePosition just once. Even though, we have many subscreens, we just do it once.

                  Is this correct?

                  Should we not do this in a loop for all the screens?

                  Please let me know.

                  K Offline
                  K Offline
                  kumararajas
                  wrote on 7 Aug 2015, 19:27 last edited by
                  #20

                  Looks like I am in a wrong direction.

                  I suspect "Transformed" driver is not having problem.

                  I think, it is "multi" screen driver is what not working good.

                  Because, when VNC option is selected, Transformed works food.
                  When LinuxFb is selected, Transformed works good.

                  When both are used, there lies the problem.

                  I guess, we may have to look at Multi Screen driver source code to see how it has been implemented.

                  Can you please point me to the right location?

                  Thanks,
                  Kumara

                  --Kumar

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 8 Aug 2015, 11:43 last edited by
                    #21

                    I'd take a look a the qscreenmulti_qws.cpp file

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

                    K 2 Replies Last reply 8 Aug 2015, 15:27
                    0
                    • S SGaist
                      8 Aug 2015, 11:43

                      I'd take a look a the qscreenmulti_qws.cpp file

                      K Offline
                      K Offline
                      kumararajas
                      wrote on 8 Aug 2015, 15:27 last edited by
                      #22

                      @SGaist Oh!
                      Any thing you found?

                      --Kumar

                      1 Reply Last reply
                      0
                      • S SGaist
                        8 Aug 2015, 11:43

                        I'd take a look a the qscreenmulti_qws.cpp file

                        K Offline
                        K Offline
                        kumararajas
                        wrote on 8 Aug 2015, 15:31 last edited by
                        #23

                        @SGaist Later I gave a try with

                        export QWS_DISPLAY="VNC:Transformed:Rot270"
                        

                        I dont know the magic behind this.

                        In my LCD display UI, looks good. And even touch works well.

                        And now, in the VNC client, Application was rotated. So, I used RealVNC client and rotated the screen to 270.
                        With that, UI looks good and even operation works well.

                        I dont know what magic behind the scene.

                        But the problem I see is, display refresh in VNC client. The screen doesnt gets refreshed. There is a hug lag while updating the screen..

                        I am totally confused now, to understand the problem.

                        Based on your experience,
                        Where do you see the problem?

                        Thanks a lot for your immense support!

                        --Kumar

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 8 Aug 2015, 21:12 last edited by
                          #24

                          90 and 270 are "complementary" meaning that 270 is equivalent to -90 so it might be that the position calculation were done wrong (or just not taking the angle in account correctly)

                          Do you mean that with 90, the refreshing is done correctly on both but not the mouse handling and with 270, the refreshing is wrong but the mouse move are handled correctly ?

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

                          K 2 Replies Last reply 10 Aug 2015, 17:43
                          0
                          • S SGaist
                            8 Aug 2015, 21:12

                            90 and 270 are "complementary" meaning that 270 is equivalent to -90 so it might be that the position calculation were done wrong (or just not taking the angle in account correctly)

                            Do you mean that with 90, the refreshing is done correctly on both but not the mouse handling and with 270, the refreshing is wrong but the mouse move are handled correctly ?

                            K Offline
                            K Offline
                            kumararajas
                            wrote on 10 Aug 2015, 17:43 last edited by
                            #25

                            @SGaist No. With both 90 or 270, I can see the mouse move is perfect. But the refreshing is not working good.

                            --Kumar

                            1 Reply Last reply
                            0
                            • S SGaist
                              8 Aug 2015, 21:12

                              90 and 270 are "complementary" meaning that 270 is equivalent to -90 so it might be that the position calculation were done wrong (or just not taking the angle in account correctly)

                              Do you mean that with 90, the refreshing is done correctly on both but not the mouse handling and with 270, the refreshing is wrong but the mouse move are handled correctly ?

                              K Offline
                              K Offline
                              kumararajas
                              wrote on 14 Aug 2015, 14:01 last edited by kumararajas
                              #26

                              @SGaist Sam, any further thoughts?

                              I don't want to give up. I want to fix this Qt bug. For sure, I will need your / Qt experts help.

                              Thank you,
                              Kumara

                              --Kumar

                              K 1 Reply Last reply 19 Aug 2015, 13:58
                              0
                              • K kumararajas
                                14 Aug 2015, 14:01

                                @SGaist Sam, any further thoughts?

                                I don't want to give up. I want to fix this Qt bug. For sure, I will need your / Qt experts help.

                                Thank you,
                                Kumara

                                K Offline
                                K Offline
                                kumararajas
                                wrote on 19 Aug 2015, 13:58 last edited by
                                #27

                                Still no success so far.

                                Any thoughts on how to handle this?

                                Thank you!
                                Kumara

                                --Kumar

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 22 Aug 2015, 22:10 last edited by
                                  #28

                                  Can you remind me the current "multiscreen" setup you have ?

                                  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
                                  • M Offline
                                    M Offline
                                    majis
                                    wrote on 16 Dec 2016, 09:37 last edited by
                                    #29

                                    This is a quite old topic but what is the current situation for this problem?

                                    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