0

I think I understand the reasoning behind Wayland preventing windows from being manually positioned but there are a couple of instances in my Qt 5.15.2 application where I really need to have either some or absolute control over the position:

  • In the first instance the window is a pop-up. I'm using a QMainWindow so I can have it borderless with rounded corners, a coloured background and a transparency. I need it to pop-up when I hover over a certain element on my QGraphicsScene but want to ensure that when it appears it is close to the QGraphicsScene element in question but does not obscure it. Using a call to QMainWindow::move was perfect pre-Wayland and works fine on Windows too.
  • In the second instance my application has a number of windows which the user may open and close over time. The first time each one opens I don't care too much where it is positioned but if the user moves it before closing it then the next time the user opens it I want it to reappear where the user previously left it. Again, using the move() method of the various things that inherit from QWidget was perfect pre-Wayland.

Does anyone know of any work-arounds that would solve either of these problems under Qt on Wayland? It seems to me that neither is a particularly uncommon requirement and if Wayland won't let me set a specific position it might have a way of achieving something similar (e.g. a way of telling the compositor to position something near something else without obscuring it) and hopefully that maps onto something in the Qt API.

  • Please clarify the question and provide [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) so we can run and test it. – Parisa.H.R Jul 07 '22 at 05:38
  • @Parisa.H.R - I'm not sure what I could provide that would make this any clearer. It is documented that QWidget::move is not supported on Wayland so adding code to prove it seems redundant. It appears to be considered a feature not an issue. – foxysounds Jul 07 '22 at 08:33
  • Re. `"It is documented that QWidget::move is not supported on Wayland..."`: can you provide a reference? – G.M. Jul 07 '22 at 08:49

0 Answers0