Bug 499148 - Tooltips fail with error: Cannot attach popup of unknown type
Summary: Tooltips fail with error: Cannot attach popup of unknown type
Status: REPORTED
Alias: None
Product: layer-shell-qt
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-26 03:23 UTC by dawsers
Modified: 2025-01-26 03:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dawsers 2025-01-26 03:23:51 UTC
SUMMARY

When creating a Qt application that uses the layer-shell-qt library, "tooltips" don't work; instead the library outputs an error message to the console: "layershellqt: Cannot attach popup of unknown type".

Building and running the application through the debugger, the problem lies in the file qwaylandlayersurface.cpp, function void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *popup).

I believe this bug could be related to [Bub 480240](https://bugs.kde.org/show_bug.cgi?id=480240)

STEPS TO REPRODUCE
1.  Compile and run this small example

``` cpp
#include <QApplication>
#include <QPushButton>
#include <LayerShellQt/Window>
#include <LayerShellQt/Shell>

int main (int argc, char *argv[])
{
    LayerShellQt::Shell::useLayerShell();

    QApplication app(argc, argv);

    QPushButton button("Button");
    button.setToolTip("Tooltip");
    button.show();
    LayerShellQt::Window *layer_shell = LayerShellQt::Window::get(button.windowHandle());
    layer_shell->setLayer(LayerShellQt::Window::LayerTop);
    layer_shell->setAnchors(LayerShellQt::Window::AnchorBottom);

    return app.exec();
}
```
 

OBSERVED RESULT

The layer shell works and shows the button. If you hover over the button, its tooltip doesn't show, and instead you get an error on the console: "layershellqt: Cannot attach popup of unknown type"

EXPECTED RESULT

The tooltip should show as it does on a normal window not using layer-shell-qt.


SOFTWARE/OS VERSIONS
Arch Linux last  updated on 2025-01-25.
layer-shell-qt: 6.2.5
Qt Version:  6.8.1
Compiler: gcc/g++ 14.2.1 and clang 19.1.7