Add support for xdg_toplevel.wm_capabilities #1061

Manually merged
emersion merged 2 commits from emersion/foot:wm-caps into master 4 months ago
See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
emersion added 2 commits 7 months ago
emersion changed title from Add support for xdg_toplevel.wm_capabilities to WIP: Add support for xdg_toplevel.wm_capabilities 7 months ago
Owner

Nice! Been waiting for this :)

Oh, and the patch looks good!

Nice! Been waiting for this :) Oh, and the patch looks good!
mahkoh reviewed 6 months ago
render.c Outdated
const int button_minimize_width = term->width >= 3 * button_width
const int button_minimize_width =
term->width >= 3 * button_width && term->window->wm_capabilities.maximize

wm_capabilities.minimize

`wm_capabilities.minimize`
Poster

Good catch! Fixed.

Good catch! Fixed.
emersion marked this conversation as resolved
emersion force-pushed wm-caps from 5ce5ddefb9 to 72edaabf0b 6 months ago
Owner

Since Wayland protocols 1.26 has been released, and includes the new capabilities() event, I think it's time to clean this up and get it merged.

The things I see missing are #ifdefs to allow compiling against older Wayland protocol versions, and a changelog entry.

@emersion is there anything else you'd like to add or change?

Let me know if you want to make the changes mentioned above, or if I should do it.

Since Wayland protocols 1.26 has been released, and includes the new `capabilities()` event, I think it's time to clean this up and get it merged. The things I see missing are `#ifdefs` to allow compiling against older Wayland protocol versions, and a changelog entry. @emersion is there anything else you'd like to add or change? Let me know if you want to make the changes mentioned above, or if I should do it.
emersion force-pushed wm-caps from 72edaabf0b to b5c4420e77 4 months ago
emersion changed title from WIP: Add support for xdg_toplevel.wm_capabilities to Add support for xdg_toplevel.wm_capabilities 4 months ago
Poster

Done!

Done!
dnkl reviewed 4 months ago
meson.build Outdated
endif
if wayland_protocols.version().version_compare('>=1.26')
add_project_arguments('-DHAVE_XDG_SHELL_WM_CAPABILITIES', language: 'c')
endif
Owner

In past, similar cases (adding support for a newer protocol version), I've always piggy backed on the *_SINCE_VERSION macros: ffdac61e2a/wayland.c (L465-L484)

Is that a bad idea? If not, I kind of like that better, since we don't have to modify meson.build, and also don't have to assume/hardcode a wayland protocol version number.

In past, similar cases (adding support for a newer protocol version), I've always piggy backed on the `*_SINCE_VERSION` macros: https://codeberg.org/dnkl/foot/src/commit/ffdac61e2a95aa31a9c69eb5152a7dd79346ddf0/wayland.c#L465-L484 Is that a bad idea? If not, I kind of like that better, since we don't have to modify `meson.build`, and also don't have to assume/hardcode a wayland protocol version number.
Poster

I see, done! I've mimicked the logic around wl_output.

I see, done! I've mimicked the logic around `wl_output`.
dnkl marked this conversation as resolved
emersion force-pushed wm-caps from b5c4420e77 to 129e1a9b8e 4 months ago
emersion merged commit 129e1a9b8e into master manually 4 months ago
Owner

Thanks!

Thanks!
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
The pull request has been manually merged as 129e1a9b8e.
Sign in to join this conversation.
Loading…
There is no content yet.