Bug 480240 - Use of QMenu widgets result in `layershellqt: Cannot attach popup of unknown type`
Summary: Use of QMenu widgets result in `layershellqt: Cannot attach popup of unknown ...
Status: REPORTED
Alias: None
Product: layer-shell-qt
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-01-23 18:45 UTC by Grigory
Modified: 2024-12-01 18:16 UTC (History)
3 users (show)

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


Attachments
Screenshot of fullscreen menu (11.47 KB, image/png)
2024-01-23 18:45 UTC, Grigory
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grigory 2024-01-23 18:45:46 UTC
Created attachment 165165 [details]
Screenshot of fullscreen menu

SUMMARY

When using layer-shell-qt in application which uses QMenu widgets, warning "layershellqt: Cannot attach popup of unknown type" is written on menu activation. I assume it occurs in QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *popup) method.

The bad thing about it is that menus break, actually. Without layer-shell-qt they work perfectly fine and only when I call LayerShellQt::Shell::useLayerShell() they go fullscreen and hard to navigate.

STEPS TO REPRODUCE

1. Integrate layer-shell-qt into project
2. Create any QMenu

OBSERVED RESULT

Menu goes fullscreen.

EXPECTED RESULT

Menu stays normal, as in Qt without layer-shell-qt enabled.

SOFTWARE/OS VERSIONS
Linux: 6.6.11 
Qt Version: 6.6.0

ADDITIONAL INFORMATION

Screenshot of fullscreen menu attached.
Comment 1 Grigory 2024-01-23 18:50:39 UTC
Example code:

https://codeberg.org/stolick/stolick

You don't have to edit anything, I committed problematic code in master branch.
Comment 2 Nicolas Fella 2024-03-08 11:39:02 UTC
Are you building with clang? This sounds like https://bugs.kde.org/show_bug.cgi?id=479679
Comment 3 Grigory 2024-03-08 12:20:29 UTC
(In reply to Nicolas Fella from comment #2)
> Are you building with clang? This sounds like
> https://bugs.kde.org/show_bug.cgi?id=479679

Hi, Nicolas! Thank you for a reply :)

I just tried to build with clang like that:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake -B build
cmake --build build

CMake said that it's using clang and it built successfully but the bug persists. I still get "layershellqt: Cannot attach popup of unknown type" message and QMenu objects continue to go fullscreen. In case you want to test this code with my example and layer-shell-qt module enabled you have to build against https://codeberg.org/stolick/stolick/commit/5c70e291d4ee4a07b2bfb388a3fce2f926994c13 commit (named "use broken layer-shell-qt for a while").

Best regards, Grigory.
Comment 4 Demi Marie Obenour 2024-12-01 18:16:30 UTC
(In reply to Grigory from comment #3)
> (In reply to Nicolas Fella from comment #2)
> > Are you building with clang? This sounds like
> > https://bugs.kde.org/show_bug.cgi?id=479679
> 
> Hi, Nicolas! Thank you for a reply :)
> 
> I just tried to build with clang like that:
> 
> export CC=/usr/bin/clang
> export CXX=/usr/bin/clang++
> cmake -B build
> cmake --build build
> 
> CMake said that it's using clang and it built successfully but the bug
> persists.

Does your clang use libc++ or libstdc++?  The former will trip this bug.