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:

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.