Skip to content

Wayland, Windows, MacOS: Popup Implementation - #4543

Merged
ogoffart merged 82 commits into
rust-windowing:masterfrom
Murmele:popup
Jul 27, 2026
Merged

ogoffart merged 82 commits into
rust-windowing:masterfrom
Murmele:popup

Conversation

@Murmele

@Murmele Murmele commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Implement proper decorationless popups by specifying the type of the child window with with_type()

With this PR different kind of child windows can be created

  • Popups: Special windows without any decoration which can be positioned relative to the parent
  • Window: Normal window with a parent or not

The type can be specified during creation of the Window using the window_attributes and the with_type() function. As default a normal Window is used. If Popup is choosen a parent must be specified, otherwise the Popup creation fails with an Error returned by the new() function.

Related issues: #403 and #4256

  • Tested on all platforms changed
  • 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

Platforms

  • Wayland
    • Testing grabbing
      • Gnome (Mutter)
      • Kde Plasma
  • Windows
  • MacOs
  • X11

Wayland:

Bildschirmaufzeichnung.vom.2026-06-04.13-18-16.mp4

This work is sponsored by the NLnet foundation

@madsmtm madsmtm added DS - wayland Affects the Wayland backend, or generally free Unix platforms S - platform parity Unintended platform differences labels Mar 26, 2026
Comment thread winit-wayland/src/window/state.rs Resolved
Comment thread winit-wayland/src/window/state.rs Resolved
@Murmele
Murmele marked this pull request as ready for review May 18, 2026 08:06
@Murmele
Murmele requested a review from kchibisov as a code owner May 18, 2026 08:06
Comment thread winit-wayland/src/state.rs Resolved
Comment thread winit-wayland/src/state.rs Resolved
Comment thread winit-core/src/window.rs Resolved
Comment thread winit-core/src/window.rs Resolved
Comment thread winit-core/src/window.rs Resolved
Comment thread winit-wayland/src/popup.rs Resolved
Comment thread winit-wayland/src/popup.rs Resolved
Comment thread winit-wayland/src/state.rs Resolved
Comment thread winit-wayland/src/popup.rs Resolved
Comment thread winit-win32/src/window.rs Resolved
@Murmele
Murmele requested a review from madsmtm as a code owner May 28, 2026 15:09
@Murmele
Murmele force-pushed the popup branch 2 times, most recently from facdfde to 87f6327 Compare June 4, 2026 12:59
Martin Marmsoler added 15 commits June 4, 2026 15:07
Reason: Because a normal window can have a parent window as well, like a Dialog
Reason: otherwise the child surface is anchored to the center
Reason: otherwise the height of the client side decoration is not considered and therefore the location is shifted
Reason: There are multiple pointers to the smithay popup. Once in state.windows and one time in the popup object it self. Just dropping the popup object releases only one pointer but we have to notify the state to release also the other
…he position

Reason: Much easier in the resize handle
Reason: we have to call resize to initialize the viewport to map to correct window size
@Murmele Murmele changed the title Wayland: Popup Implementation Wayland, Windows, MacOS: Popup Implementation Jun 4, 2026
@Murmele
Murmele requested a review from ogoffart July 17, 2026 14:01
@Murmele
Murmele requested a review from jackpot51 as a code owner July 20, 2026 15:10
@Murmele
Murmele requested a review from MarijnS95 as a code owner July 24, 2026 06:27
@Murmele
Murmele requested a review from daxpedda as a code owner July 24, 2026 06:30

@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.

This is IMHO good enough to be merged now.

Work on the cross-platform anchoring system can be done in a follow-up. (this is already a big PR enough)

@CryZe

CryZe commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

I'd like to test again how well the current branch addresses my remaining problems I had. I think I can get around to it today.

Murmele added 2 commits July 27, 2026 13:49
#Conflicts:
#	winit-wayland/src/seat/pointer/mod.rs
#	winit-wayland/src/state.rs
#	winit-wayland/src/window/mod.rs
#	winit-wayland/src/window/state.rs
@ogoffart
ogoffart merged commit 9674d8c into rust-windowing:master Jul 27, 2026
50 checks passed
@ogoffart

Copy link
Copy Markdown
Contributor

Merging this to unlock further work.
@CryZe please open issues if you find some bugs.

kchibisov pushed a commit that referenced this pull request Sep 4, 2026
Implement proper decorationless popups by specifying the type of the child window with with_type()

With this commit, different kind of child windows can be created

-  Popups: Special windows without any decoration which can be positioned relative to the parent
-  Window: Normal window with a parent or not

The type can be specified during creation of the Window using the window_attributes and the with_type() function. As default a normal Window is used. If Popup is choosen a parent must be specified, otherwise the Popup creation fails with an Error returned by the new() function.

Related issues: #403 and #4256
@ogoffart ogoffart mentioned this pull request Sep 12, 2026
@redstrate redstrate mentioned this pull request Sep 14, 2026
13 of 14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - wayland Affects the Wayland backend, or generally free Unix platforms S - platform parity Unintended platform differences

Development

Successfully merging this pull request may close these issues.

7 participants