feat(gtk3): bind dialog transient parent using RawWindowHandle#327
Open
bet4it wants to merge 1 commit into
Open
feat(gtk3): bind dialog transient parent using RawWindowHandle#327bet4it wants to merge 1 commit into
bet4it wants to merge 1 commit into
Conversation
Resolve RawWindowHandle to GtkWindow at runtime by iterating gtk_window_list_toplevels and matching via dlsym-loaded gdk_x11_window_get_xid (Xlib/XCB) or gdk_wayland_window_get_wl_surface (Wayland). Set the resolved GtkWindow as transient parent for both file chooser and message dialogs, enabling proper window manager modality and GNOME CSD sheet-style dialog attachment. Per GNOME HIG: "Dialogs should always have a parent window, to which they are modal."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement parent window binding in the GTK3 backend using
RawWindowHandle(supporting X11 and Wayland).Currently,
rfdhas a cross-platform API for setting a parent window via.set_parent(). However, while this was supported on Windows, macOS, and the XDG portal backend, the native GTK3 backend completely ignored the parent window parameter and hardcodedptr::null_mut().This PR dynamically resolves the
GtkWindowpointer corresponding to the providedRawWindowHandleby searching the list of top-levels usinggdk_x11_window_get_xid(X11) andgdk_wayland_window_get_wl_surface(Wayland) resolved at runtime viadlsym.This ensures that: