Skip to content

Popup anchor system refinement - #4646

Open
Murmele wants to merge 46 commits into
rust-windowing:masterfrom
Murmele:popup-anchor
Open

Popup anchor system refinement#4646
Murmele wants to merge 46 commits into
rust-windowing:masterfrom
Murmele:popup-anchor

Conversation

@Murmele

@Murmele Murmele commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Implement possibility to change the anchor properties of a popup on wayland and imitate the behaviour for other platforms which do not support such anchoring system

  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

Tested on:

  • Windows
  • Wayland
  • MacOs
  • X11 Does not support popups

In the example for wayland when clicking outside of the window all popups get closed

  • This is a compositor request because with_active (request keyboard grab) is true. Setting in the example active to false the popup will not be dismissed by the compositor. It is just because it looses the grab and then it gets dismissed

@Murmele Murmele mentioned this pull request Jul 27, 2026
8 tasks
@Murmele
Murmele marked this pull request as ready for review July 28, 2026 05:51
Comment thread winit-appkit/src/window_delegate.rs Outdated
Comment thread winit-appkit/src/window_delegate.rs Outdated
Comment thread winit-appkit/src/window_delegate.rs Outdated
Comment thread winit-core/src/window/positioner.rs Outdated
Comment thread winit-core/src/window.rs Outdated

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there should be an example?

Comment thread winit-core/src/window.rs Outdated
use dpi::{
LogicalPosition, LogicalSize, PhysicalInsets, PhysicalPosition, PhysicalSize, Position, Size,
};
pub use positioner::{WindowAnchor, WindowConstraintAdjustment, WindowGravity, place_window};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can't re-use it for ChildWindow in Slint because slint-core don't depend on winit on purpose.

in fact, the implementation of that function might be better placed in winit-common

Comment thread winit-core/src/window/positioner.rs Outdated
Comment thread winit-core/src/window.rs
Comment thread winit-appkit/src/window_delegate.rs Outdated
Previously every close request left the event_loop which is not correct when only a popup closes
Reason: otherwise the popup might disappear behind the task bar
@Murmele
Murmele requested a review from ogoffart August 12, 2026 14:47
@Murmele

Murmele commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

But we can't re-use it for ChildWindow in Slint because slint-core don't depend on winit on purpose. in fact, the implementation of that function might be better placed in winit-common

winit-common depends on winit-core so we cannot use this as well. It has to be public otherwise the winit-win32 crate and the macos crate are not able to access it

Comment thread winit-core/src/window.rs
Comment thread winit-core/src/window.rs Outdated
Comment thread winit-wayland/src/popup.rs Outdated
Comment thread winit-win32/src/window.rs Outdated
Reason: otherwise the popup will be placed wrongly
@Murmele
Murmele requested a review from ogoffart August 20, 2026 07:02
#Conflicts:
#	winit-core/src/window.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants