Add support for Wayland session management protocol (PR #26793)

25 views
Skip to first unread message

VZ

unread,
Aug 6, 2026, 1:30:30 PM (4 days ago) Aug 6
to wx-...@googlegroups.com, Subscribed

This PR implements #26324, i.e. support for saving and restoring window geometry using Wayland XDG session management protocol.

It requires very new GTK (later than the last released 3.24.52) both at compile- and run-time and, for Gnome users, very new Mutter (51.alpha).

There is no support for detecting this in CMake yet but I'll add it soon (maybe by just checking for GTK 3.24.53 as the current configure checks will become unnecessary as soon as this version is released).


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26793

Commit Summary

  • f4b679a Detect Wayland session management protocol in configure
  • 4d0e544 Add support for Wayland XDG session management to wxPersistentTLW

File Changes

(12 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793@github.com>

VZ

unread,
Aug 6, 2026, 2:09:45 PM (4 days ago) Aug 6
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 84ca3b7 Install wayland-protocols-devel for Fedora CI builds


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/before/4d0e5449df300527823618a74c78b14a4b8140fd/after/84ca3b7b5b6b653e7775c97047bcc22e39ca7d3b@github.com>

VZ

unread,
Aug 6, 2026, 5:00:50 PM (3 days ago) Aug 6
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • a61b473 Add reusable wx_generate_wayland_protocol() CMake function
  • fdb7f04 Detect XDG session management protocol support in CMake too


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/before/84ca3b7b5b6b653e7775c97047bcc22e39ca7d3b/after/fdb7f04af17e17325d94920b57e29a4f1c14659e@github.com>

VZ

unread,
Aug 7, 2026, 8:56:06 AM (3 days ago) Aug 7
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26793)

@MaartenBent Please let me know if you see anything wrong with my CMake changes, TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/c5217305245@github.com>

Maarten

unread,
Aug 7, 2026, 1:34:57 PM (3 days ago) Aug 7
to wx-...@googlegroups.com, Subscribed

@MaartenBent commented on this pull request.


In build/cmake/init.cmake:

> +                            )
+
+                            execute_process(
+                                COMMAND ${CMAKE_COMMAND} -E copy_if_different
+                                        ${wx_protocols_temp_dir}/${protocol}-client-protocol.h
+                                        ${wx_protocols_temp_dir}/${protocol}-client-protocol.c
+                                        ${wx_protocols_output_dir}
+                            )
+                        endfunction()
+
+                        wx_generate_wayland_protocol(${wx_protocols_input_dir} pointer-warp-v1)
+
+                        # Check if we have GTK new enough to allow using XDG
+                        # session management protocol: 3.24.53 is the earliest one
+                        # with gdk_wayland_window_get_xdg_toplevel() that we need.
+                        if(${GTK3_VERSION} VERSION_GREATER_EQUAL 3.24.53)
⬇️ Suggested change
-                        if(${GTK3_VERSION} VERSION_GREATER_EQUAL 3.24.53)
+                        if(GTK3_VERSION VERSION_GREATER_EQUAL 3.24.53)

Better to remove the reference so it doesn't error if the variable doesn't exist (which could happen when testing gtk4?).
Another approach is to wrap it in quotes ("${GTK3_VERSION}") so it compares against an empty string if the variable doesn't exist.

The rest looks fine. Maybe when Ubuntu 27.04 releases I'll see if it works :)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/review/4885178084@github.com>

VZ

unread,
Aug 7, 2026, 3:57:20 PM (2 days ago) Aug 7
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 4f4edab Detect XDG session management protocol support in CMake too


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/before/fdb7f04af17e17325d94920b57e29a4f1c14659e/after/4f4edab98bf2805e68452491210f119162f44c30@github.com>

VZ

unread,
Aug 7, 2026, 3:57:29 PM (2 days ago) Aug 7
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In build/cmake/init.cmake:

> +                            )
+
+                            execute_process(
+                                COMMAND ${CMAKE_COMMAND} -E copy_if_different
+                                        ${wx_protocols_temp_dir}/${protocol}-client-protocol.h
+                                        ${wx_protocols_temp_dir}/${protocol}-client-protocol.c
+                                        ${wx_protocols_output_dir}
+                            )
+                        endfunction()
+
+                        wx_generate_wayland_protocol(${wx_protocols_input_dir} pointer-warp-v1)
+
+                        # Check if we have GTK new enough to allow using XDG
+                        # session management protocol: 3.24.53 is the earliest one
+                        # with gdk_wayland_window_get_xdg_toplevel() that we need.
+                        if(${GTK3_VERSION} VERSION_GREATER_EQUAL 3.24.53)

Better to remove the reference so it doesn't error if the variable doesn't exist

Thanks, I forgot about this charming CMake peculiarity again (not for the first time).

Updated now and also added a warning as I've realized it might be surprising that support for this protocol is not available even with new enough GTK.

The rest looks fine. Maybe when Ubuntu 27.04 releases I'll see if it works :)

Fedora seems to be the only distribution that has recent stuff :-( Luckily, it can be installed in toolbox.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/review/4886149426@github.com>

VZ

unread,
Aug 9, 2026, 1:37:15 PM (13 hours ago) Aug 9
to wx-...@googlegroups.com, Subscribed

Merged #26793 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26793/issue_event/29188509981@github.com>

Reply all
Reply to author
Forward
0 new messages