Commit 50986efe authored by David Edmundson's avatar David Edmundson Committed by Christoph Cullmann
Browse files

Remove code to keep lsptooltips on screen on wayland

On wayland this is uneeded as the popups are always kept on screen using
a semantic positioning system.

It's also wrong as the client considers itself at 0,0, even if it's not.
So any attempts to help only make things worse.
parent f3dcd235
Pipeline #91388 passed with stage
in 3 minutes and 59 seconds
......@@ -25,6 +25,8 @@
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/SyntaxHighlighter>
#include <KWindowSystem>
class Tooltip : public QTextBrowser
{
Q_OBJECT
......@@ -171,6 +173,15 @@ public:
void place(QPoint p)
{
const auto offset = QPoint(3, 21);
p += offset;
// wayland automatically keeps popups on screen
if (KWindowSystem::isPlatformWayland()) {
move(p);
return;
}
// try to get right screen, important: QApplication::screenAt(p) might return nullptr
// see crash in bug 439804
const QScreen *screenForTooltip = QApplication::screenAt(p);
......@@ -179,9 +190,6 @@ public:
}
const QRect screen = screenForTooltip->availableGeometry();
const auto offset = QPoint(3, 21);
p += offset;
if (p.x() + width() > screen.x() + screen.width())
p.rx() -= 4 + width();
if (p.y() + this->height() > screen.y() + screen.height())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment