Add support for xdg_toplevel.wm_capabilities #1061
emersion/foot:wm-caps into master Nice! Been waiting for this :)
Oh, and the patch looks good!
@ -1731,2 +1732,3 @@
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
Good catch! Fixed.
5ce5ddefb9
72edaabf0b
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.
72edaabf0b
b5c4420e77
Done!
@ -115,1 +115,4 @@
endif
ifwayland_protocols.version().version_compare('>=1.26')
add_project_arguments('-DHAVE_XDG_SHELL_WM_CAPABILITIES',language:'c')
endif
In past, similar cases (adding support for a newer protocol version), I've always piggy backed on the *_SINCE_VERSION macros:
#if defined(WL_OUTPUT_NAME_SINCE_VERSION)static void
output_name(void *data, struct wl_output *wl_output, const char *name)
{
struct monitor *mon = data;
free(mon->name);
mon->name = name != NULL ? xstrdup(name) : NULL;
}
#endif#if defined(WL_OUTPUT_DESCRIPTION_SINCE_VERSION)static void
output_description(void *data, struct wl_output *wl_output,
const char *description)
{
struct monitor *mon = data;
free(mon->description);
mon->description = description != NULL ? xstrdup(description) : NULL;
}
#endifIs 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.
I see, done! I've mimicked the logic around wl_output.
b5c4420e77
129e1a9b8e
Thanks!
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?