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. Position window in linux

Position window in linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
positionmove problemlinuxwindows 10
2 Posts 2 Posters 710 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.
  • N Offline
    N Offline
    normvcr
    wrote on 26 Apr 2020, 01:53 last edited by normvcr
    #1

    QT5.12.5 on fedora 30 x86-64.
    When I use the following code

    QPoint p = pos();
     hide();
     move( p );
     show();
    

    my window moves vertically upwards by the width of the Window Manager's top border (which contains the title of my window). How can I get this width, so that I can compensate with the above move? When I run the same code on Windows 10, my window stays put, as desired.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kent-Dorfman
      wrote on 26 Apr 2020, 21:37 last edited by Kent-Dorfman
      #2

      The above move is superflous so don't do it. Simply hide and show without repositioning the window. window managers and decoractions make the kind of move you are trying ambiguous.

      If you must explicitly position the window then do move() before the initial show and always use that location, understanding that it won't be accurate (because the window manager decorations are not part of the wiget's geometry.

      This is the price you pay for a plethora of plug-in widow managers with different capabilities and styles.

      1 Reply Last reply
      0

      2/2

      26 Apr 2020, 21:37

      • Login

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