Skip to content

Modal Dialog - #4627

Draft
Murmele wants to merge 9 commits into
rust-windowing:masterfrom
Murmele:mm/modal-dialog
Draft

Murmele wants to merge 9 commits into
rust-windowing:masterfrom
Murmele:mm/modal-dialog

Conversation

@Murmele

@Murmele Murmele commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Implement modal dialogs. This branch is based on the work of the Popup branch so this must be merged first. Only the last commit here is relevant for dialog

  • 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

What is missing to be ready

Os

  • Wayland (Xdg Dialog v1)
  • X11
  • Windows
  • MacOs

@redstrate

Copy link
Copy Markdown

Implement modal dialogs. This branch is based on the work of the Popup branch so this must be merged first. Only the last commit here is relevant for dialog

Was that #4543 ?

@Murmele

Murmele commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Implement modal dialogs. This branch is based on the work of the Popup branch so this must be merged first. Only the last commit here is relevant for dialog

Was that #4543 ?

Yes it was

Murmele and others added 8 commits September 15, 2026 08:41
Extract the logic shared by Window and Popup into a common `WindowCommon`
struct (window/common.rs), so `CoreWindow` implementations become thin
delegation to shared code instead of duplicating it per window type.
Popup is rewired to use it instead of its own separate implementations.

Split the large window/state.rs into focused submodules along existing
seams: window_type.rs (the WindowType enum and its trait impls),
configure.rs (configure_window/configure_popup and the shared frame/size
computation), cursor.rs (cursor and pointer-grab handling), frame.rs (CSD
frame interaction and decoration state), and ime.rs (IME/text-input state).

This is purely internal restructuring with no behavior change; it exists
to make adding further window types (e.g. dialogs) straightforward
without duplicating logic across each one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implement native dialog windows on Wayland (via the xdg_dialog protocol,
built on the WindowCommon/WindowType infrastructure from the previous
commit) and on Windows (an owned window that's always on top of its
parent; when modal, the parent is disabled via EnableWindow for as long
as the dialog is open, and re-enabled and reactivated on close).

macOS, X11, Web, Android, iOS, and Orbital return NotSupportedError for
WindowType::Dialog, matching the existing Popup convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
#Conflicts:
#	winit-wayland/src/window/state/frame.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