You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, is there any way to create pop-ups like for right click menus with winit? Since right-click menus can also go across the borders of a window, I suppose they need to have their own window and surface.
It would be nice if functionality like this could be included.
Reacted by Raimundo Saona, jgcodes2020, Andy Bao, bbb651 🇮🇱, Ícar, Andy Terra, José Luis Cruz, Pedro Macedo, druskus and Kirill Olenev
This is done as a higher level function of glutin or other UI lib that creates the windows and text on them.
Unless an extension binds to the native UI. React Native without the HTML garbage. It would be a most excellent direction but not a small mandate/extension. As a consultant I see a lot of wasted money and lives porting the same app to many platforms just to get the native components.
I am not talking about the drawing of the menu content. My current understanding is that those are basically specialized windows. If I want to spawn a window like that it's currently not possible with winit, because it will behave like a regular window.
Perhaps it would be enough to make it possible to hide windows from the task manager.
I believe that is correct- small "windows" without edge decoration or appearing in the taskbar for things like menus. It is then up to a higher level lib (out of scope- you choose what to do) to populate these.
Borderless window handling is already supported. As far as the other two features go, implementing them on Windows seems to be pretty easy, and I've done so in these two branches: focus and taskbar.
I don't know how it would be handled on other platforms, but I can't imagine it's too much of a challenge.
It looks like, on OSX, windows can be excluded from the dock with this flag, and focus can be handled with modal windows. I'd need to actually test those, but that should be fairly easy to do.
Something worth noting is that Wayland doesn't let you specify where a window will be placed on-screen, which complicates right-click menu creation - it's expected that a menu would be created at the mouse pointer, but there's currently no way to ensure that happens on Wayland.
@vberger Does Wayland provide any way to work around this?
I would also be interested in this, what is the current status on this?
I think a good first step would be to provide a platform-specific API on wayland to at least make it possible to position child windows/subsurfaces. I tried implementing a context menu (right-click menu) with winit's existing APIs and it roughly works on X11, Windows and MacOS with some visual inconsistencies with shadows, so that would also be something to look into in the future.
We're not blocked on anything in client-toolkit, since we can implement everything ourselves and already do for a lot of parts. And I'm pretty sure it's all present in sctk nowadays and the issue just obsolete.
what's that status on this? it doesn't feel all too difficult to implement, every desktop platform has a concept of "owned"/"transient" windows. all that's needed is making sure the child window always shows up above the parent, isn't on the taskbar, and optionally locks input to the parent, right?
ruguysgoingtrickortreating commented on Jan 8, 2026
feels related to #4256 no? in fact, maybe that solution would be better, as most popups that I can think of are transient windows themselves. (aka owned on win32)
I really want to make a push to get this finished, in no small part because I need it badly for my software.
I think it would make sense to design the API around xdg_popup and keep less restrictive features platform-specific, since it's our only realistic option on Wayland and an already solid abstraction of what we need to do:
"transient"; not exactly a window—not shown in taskbar or elsewhere
subordinate to parent window
able to be positioned (albeit only window-relative)
customizable—arbitrary size, normal drawing surface
This would mean a popup would be a separate entity to a Window (which we already seem to be leaning towards). It would also, however, very likely require the addition of some kind of TopLevel struct or trait for common behavior (I'm partial to a trait for this).
I'm going to start a new branch, get an API in place, then open a draft PR for feedback.
ruguysgoingtrickortreating commented on Jan 11, 2026
is xdg_popup what we want? doesn't that one disappear when you click outside of it? for behavior that's not that, they have .set_parent(toplevel) on xdg_toplevels. unless popup behavior is what's wanted but i would really like windows that behave like Qt's "dialog", Windows' "owned" windows, and x11's "transient" windows.
"Transient" / "owned" / dialog windows are slightly different; possibly the main difference is that menus windows are closed if they lose focus (though this should be implementable in client code). "Owned" windows are already supported but only on the Windows platform I think (at least, I was able to test that functionality under wine).
FYI winit seems to have some maintenance issues with existing features, so I'm not sure if a new feature would get merged at the moment. (Personally I'd love to see v0.31 soon.)
Activity
paulirotta commentedon Feb 10, 2018
This is done as a higher level function of glutin or other UI lib that creates the windows and text on them.
Unless an extension binds to the native UI. React Native without the HTML garbage. It would be a most excellent direction but not a small mandate/extension. As a consultant I see a lot of wasted money and lives porting the same app to many platforms just to get the native components.
Shookbelf commentedon Feb 10, 2018
I am not talking about the drawing of the menu content. My current understanding is that those are basically specialized windows. If I want to spawn a window like that it's currently not possible with winit, because it will behave like a regular window.
Perhaps it would be enough to make it possible to hide windows from the task manager.
Please correct me if my understanding is wrong.
Osspial commentedon Feb 21, 2018
Do you mean having some way to create windows that aren't placed on the taskbar?
paulirotta commentedon Feb 21, 2018
I believe that is correct- small "windows" without edge decoration or appearing in the taskbar for things like menus. It is then up to a higher level lib (out of scope- you choose what to do) to populate these.
Shookbelf commentedon Feb 22, 2018
@paulirotta Unfortunately I don't know exactly how it is done on different platforms.
This could be enough if the following features are supported:
Most things can probably be handled by users of winit if the basics work.
There might be more subtle behaviour on different platforms though.
In xdg_shell there is a protocol xdg_popup for exactly this type of windows.
Osspial commentedon Feb 27, 2018
Borderless window handling is already supported. As far as the other two features go, implementing them on Windows seems to be pretty easy, and I've done so in these two branches: focus and taskbar.
I don't know how it would be handled on other platforms, but I can't imagine it's too much of a challenge.
francesca64 commentedon Mar 29, 2018
This would be straightforward for me to implement on X11. I'm in favor of moving forward on this, provided it's viable to implement on macOS as well.
Osspial commentedon Apr 3, 2018
It looks like, on OSX, windows can be excluded from the dock with this flag, and focus can be handled with modal windows. I'd need to actually test those, but that should be fairly easy to do.
Osspial commentedon May 11, 2018
Something worth noting is that Wayland doesn't let you specify where a window will be placed on-screen, which complicates right-click menu creation - it's expected that a menu would be created at the mouse pointer, but there's currently no way to ensure that happens on Wayland.
@vberger Does Wayland provide any way to work around this?
21 remaining items
LinusDikomey commentedon May 11, 2024
I would also be interested in this, what is the current status on this?
I think a good first step would be to provide a platform-specific API on wayland to at least make it possible to position child windows/subsurfaces. I tried implementing a context menu (right-click menu) with winit's existing APIs and it roughly works on X11, Windows and MacOS with some visual inconsistencies with shadows, so that would also be something to look into in the future.
jgcodes2020 commentedon Jul 5, 2024
I believe for Wayland, we're blocked by Smithay/client-toolkit#5; as
@elinorbgrmentioned above.kchibisov commentedon Jul 5, 2024
We're not blocked on anything in
client-toolkit, since we can implement everything ourselves and already do for a lot of parts. And I'm pretty sure it's all present in sctk nowadays and the issue just obsolete.tgy3300 commentedon Apr 9, 2025
https://github.com/slint-ui/slint/discussions/8062
Is not the effect you want, but still a little problem, hope to solve together
ruguysgoingtrickortreating commentedon Jan 8, 2026
what's that status on this? it doesn't feel all too difficult to implement, every desktop platform has a concept of "owned"/"transient" windows. all that's needed is making sure the child window always shows up above the parent, isn't on the taskbar, and optionally locks input to the parent, right?
ruguysgoingtrickortreating commentedon Jan 8, 2026
feels related to #4256 no? in fact, maybe that solution would be better, as most popups that I can think of are transient windows themselves. (aka owned on win32)
justDeeevin commentedon Jan 11, 2026
I really want to make a push to get this finished, in no small part because I need it badly for my software.
I think it would make sense to design the API around
xdg_popupand keep less restrictive features platform-specific, since it's our only realistic option on Wayland and an already solid abstraction of what we need to do:This would mean a popup would be a separate entity to a
Window(which we already seem to be leaning towards). It would also, however, very likely require the addition of some kind ofTopLevelstruct or trait for common behavior (I'm partial to a trait for this).I'm going to start a new branch, get an API in place, then open a draft PR for feedback.
ruguysgoingtrickortreating commentedon Jan 11, 2026
is
xdg_popupwhat we want? doesn't that one disappear when you click outside of it? for behavior that's not that, they have.set_parent(toplevel)onxdg_toplevels. unless popup behavior is what's wanted but i would really like windows that behave like Qt's "dialog", Windows' "owned" windows, and x11's "transient" windows.justDeeevin commentedon Jan 11, 2026
This does sound separate to what this issue has thus far been about, and more pertinent to #4256, though admittedly the distinction isn't very clear.
ruguysgoingtrickortreating commentedon Jan 12, 2026
that's fair. i really hope that any who implement popups also make an effort to implement dialogs, they seem about equally very useful.
dhardy commentedon Jan 12, 2026
"Transient" / "owned" / dialog windows are slightly different; possibly the main difference is that menus windows are closed if they lose focus (though this should be implementable in client code). "Owned" windows are already supported but only on the Windows platform I think (at least, I was able to test that functionality under wine).
FYI winit seems to have some maintenance issues with existing features, so I'm not sure if a new feature would get merged at the moment. (Personally I'd love to see v0.31 soon.)
Wayland, Windows, MacOS: Popup Implementation (#4543)
Wayland, Windows, MacOS: Popup Implementation (#4543)
ogoffart commentedon Sep 12, 2026
This should now be fixed by #4543