dnkl/foot
41
2.0k
Fork
You've already forked foot
244

Add support for xdg_toplevel.wm_capabilities #1061

Manually merged
emersion merged 2 commits from emersion/foot:wm-caps into master 2022年08月04日 18:54:06 +02:00
Contributor
Copy link
See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
emersion changed title from (削除) Add support for xdg_toplevel.wm_capabilities (削除ここまで) to WIP: Add support for xdg_toplevel.wm_capabilities 2022年05月06日 20:06:00 +02:00
Owner
Copy link

Nice! Been waiting for this :)

Oh, and the patch looks good!

Nice! Been waiting for this :) Oh, and the patch looks good!
render.c Outdated
@ -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
First-time contributor
Copy link

wm_capabilities.minimize

`wm_capabilities.minimize`
Author
Contributor
Copy link

Good catch! Fixed.

Good catch! Fixed.
emersion marked this conversation as resolved
emersion force-pushed wm-caps from 5ce5ddefb9
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
to 72edaabf0b
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
2022年06月02日 10:17:54 +02:00
Compare
Owner
Copy link

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
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
to b5c4420e77
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2022年08月03日 13:58:30 +02:00
Compare
emersion changed title from (削除) WIP: Add support for xdg_toplevel.wm_capabilities (削除ここまで) to Add support for xdg_toplevel.wm_capabilities 2022年08月03日 13:58:44 +02:00
Author
Contributor
Copy link

Done!

Done!
meson.build Outdated
@ -115,1 +115,4 @@
endif
ifwayland_protocols.version().version_compare('>=1.26')
add_project_arguments('-DHAVE_XDG_SHELL_WM_CAPABILITIES',language:'c')
endif
Owner
Copy link

In past, similar cases (adding support for a newer protocol version), I've always piggy backed on the *_SINCE_VERSION macros:

Lines 465 to 484 in ffdac61
#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;
}
#endif

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.
Author
Contributor
Copy link

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
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
to 129e1a9b8e
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022年08月04日 14:23:09 +02:00
Compare
emersion manually merged commit 129e1a9b8e into master 2022年08月04日 18:54:06 +02:00
Owner
Copy link

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot!1061
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "emersion/foot:wm-caps"

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?