What can I do for my QtWidget-Program's Window correctly positioned on the screen?
-
@foghere2023
You simply keep saying you don't know what to do and asking for help. We know it's know in the place you want. We know what your code is. We have said this is a Wayland issue, there is no more to ask about.Let us know when you have tried, say, @JoeCFD's suggestions....
-
Thank you for your patient explanation,
but the matter of refactoring wedgit is limited by my skills, and I can't solve it by myself.
I hope someone can give an example that can be used for reference.
Of course, it would be even better if the organization that promotes wayland or the Qt official can fix this problem.
I've been looking for discussions on the internet these days, but it's very strange to find so few people suffering from this problem.
-
@foghere2023 said in What can I do for my QtWidget-Program's Window correctly positioned on the screen?:
but the matter of refactoring wedgit
The suggestion was not to refactor anything.
This was suggested by @JoeCFD1. Replace weston with Qtwayland compositor 2. Don't use wayland at all, but use the eglfs platform plugin.
-
@jsulm thank you, but I don't konw what is ' Replace weston with Qtwayland compositor ':
this is a Demo,it is very simple, only a line sentence to delimit a popup message
https://github.com/cppxiaozhu/Demo
Where is ' weston ' ,and how to 'Replace weston with Qtwayland compositor' ?
On these most basic things, I can't figure it out.
-
@foghere2023 https://www.youtube.com/watch?v=mIg1P3i2ZfI
I guess the default compositor on Wayland is weston. What you need to do is to replace it with Qtwayland compositor.
Turn weston off and turn Qtwayland compositor on.
Watch the video above and you may get some ideas. -
thank you very much,
but I had watch that Video several days ago, the Video show us How to create a new Class by Qtwayland compositor with QML.
so I think maybe I need refactor all UI-Class such as QMessageBox or QDialog,This challenge is too difficult for me.
in my ubuntu22.04-lts,the wayland compositor is Xwayland.
my friend, your suggested「Turn weston off and turn Qtwayland compositor on」is mean I need do something with my Qtcreator or My PC system?
for example,what should I do in this Demo?
https://github.com/cppxiaozhu/Demo
If it is only for the correct position of the message prompt window of the compiled APP, then it is the easiest way to let their users no longer use the wayland desktop.
But I'm trying to do something to adapt this program to the wayland desktop.
I'm very depressed now because you guys say it's a wayland bug, and considering wayland's slow update mechanism, I don't think I'll see a solution in my lifetime.
As far as I know, the time it takes for wayland to fix some of its inherent problems needs to be counted in decades.
I've tried my best to find information, but almost none of them are particularly detailed.
-
@foghere2023 I do not have an answer for you now. But I will take a look at it later.
-
After a long time, the problem remains unsolved.
-
@foghere2023 said in What can I do for my QtWidget-Program's Window correctly positioned on the screen?:
After a long time, the problem remains unsolved.
I don't think it's the correct place here when you want wayland improvements.
-
It's a pity that qwidget can't adapt to the new changes brought by wayland.
-
Maybe a workaround?
QMessageBox mMessageBox; int x = this->x(); int y = this->y(); mMessageBox.setGeometry(x,y,300,100);
-
thank you , but it doesn't work,the Dialog cannot move itself to by 'move' func ,somebody says that wayland not provide coordinate data
-
someone tell me :『Wayland does not support manual positioning』
-
int x = this->geometry().x(); int y = this->geometry().y(); qDebug() << "Window position: (" << x << ", " << y << ")";
the 「window position」is (0,0) forever
-
@foghere2023 Yes thank you! I apologize. I should have checked better.
-
now,just use xcb like this for wayland user『QT_QPA_PLATFORM=xcb ./testApp』
-
@foghere2023
thanks for the tip , mid 2024 and the issue is still here with wayland