Why do dropdown menus appear as detached windows?

Newbie question,

I had this issue at one point before and I’m unsure what causes it, is this a bug or just a weird setting? I dont know why but it started doing this again and its very annoying.

Fedora 40 Workstation, installed kde myself

Screenshot:

1 Like

After a little bit of testing, this only appears to happen when a window is in focus while i’m opening the menu, so I assume its a bug?

This is a known issue that is (to my understanding) being worked on.

Thanks for the reply but where did you see this ? I feel like I searched the whole internet :sweat_smile: was i using the wrong terms?

On X11 menus are positioned according to absolute positions (like cursor position on the screen), but on Wayland this is no longer accessible. Instead, you need to set a parent window for the menu. See:

https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes

1 Like

It was in a matrix chat

The screenshot looks like plasmashell’s desktop right-click menu. So I guess the OP can’t fix it.

1 Like

As @Herzenschein explained, Wayland applications must declare a parent window for a menu, otherwise it will be presented as a new window - something that was optional in X11. There’s a lot of cases where this declaration was missing in applications and Plasma parts (as can be seen in bugs 453532, 481933, 442375, 437163, 450637, 430662, and others).

This is still an issue in some specific cases (my pet peave is right clicking on a non-focused konsole kpart, for example in dolphin, but that is being worked on/already fixed). I believe I experienced the OP issue myself - a while ago and it was fixed - I definitely cannot find an open ticket for this ATM. If you can reproduce the issue (and have a reliable process for that) on recent Plasma (at least 6.0.4) then you should open a new ticket about it.

1 Like

@guss77, does that mean that instances where this occurs outside of KDE software are not the fault of KWin (or not always, per id=485806#c0)? I ask per the undermentioned:

@rokejulianlockhart “fault” is a dangerous term :upside_down_face:

The compositor can always have better heuristics, and kwin has tons of them. But generally speaking - from years of working on Wayland - we have learned that if an application menu is rendered as a Window, it’s most likely because the application didn’t specify the menu’s parent properly.

It can’t, this is all purely on the application side. The compositor doesn’t convert a popup into a window, it’s a workaround Qt does to get the menu on the screen at all.

Iow, this is always something the application has to fix.

3 Likes