Replies: 2 comments
|
A little known fact is that Wayfire actually already allows clients to position their surfaces, but only for Xwayland windows. Unfortunately, the problem with patching toolkits is that going forward, you'd have to be able to deliver your patched version somehow and then clients that care would have to implement their handling. They would have to assume wayfire+gtk3, which is increasingly a narrow subset of usage, with gtk4 well under way. I think the common consensus is that Wayfire should position the clients as is expected in Wayland compositors. I would recommend exploring Wayfire's IPC interface, which would allow you to record client window geometry and restore it, based on criteria like app-id and title. You could write a file with the data to be persistent across sessions. If you have questions about Wayfire IPC, feel free to ask. |
|
You are absolutely right about the maintenance burden of patching toolkits, especially with GTK4 adoption, and the confirmation of what I found while digging through the XWayland view code ( Regarding the IPC approach: The second plugin ( Thank you for the feedback. |
Uh oh!
There was an error while loading. Please reload this page.
I have developed a custom Wayland protocol extension and supporting components designed for absolute toplevel window positioning under Wayfire.
As xdg-shell deliberately lacks absolute coordinate setters/queries, this project addresses tasks such as geometry restoration across application restarts and programmatic positioning of auxiliary UI elements relative to the screen.
The solution consists of a client-side patch for the GDK-Wayland backend of GTK3 and a compositor-side implementation that includes two distinct Wayfire plugins:
pos_restore— Automatically saves the last on-screen position of a window and restores it upon the next application launch. Note that this plugin operates independently and does not require the custom protocol or the GTK3 patch to function.winpos— Implements the customzwp_winpos_manager_v1protocol extension to handle absolute coordinate setters and queries. This allows standardgtk_window_move()andgtk_window_get_position()calls to work as expected without modifications to the applications, but required GTK3 patch. For GTK4 the same patch is also possible to create.Environment & Compatibility
Repository Structure
proto/— XML description of thezwp_winpos_manager_v1protocol.src/— Wayfire plugins:pos_restore(geometry restoration by app_id/title),winpos(protocol itself)test/— Native Wayland client for isolated protocol testing, GTK3 test.patches/— GTK/GDK-Wayland backend patch for GTK3.The source code and initial release (v1.0.0) are available on GitHub:
https://github.com/froloffw7/wayfire-plugin-window_position
Feedback, testing results, and technical discussions regarding this implementation are welcome.
All reactions