aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-04-17 14:29:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-04-17 14:34:04 +0000
commit24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed (patch)
treef5871e5c51a51600326a001ca592afddb3fa01f8 /wayland.c
parentkey-binding: NOINLINE a couple of functions, for a minor code size reduction (diff)
wayland: refactor: remove ‘struct config’ pointer from wayland struct
The global config doesn’t necessarily reflect the correct configuration to use - we should *always* use the current terminal instance’s conf pointer. * Move selection override modifier mask to the key_binding_set struct * Always warn if XDG activation is unavailable, not just if bell.urgent is set (we no longer have access to this information) * Pass ‘bool presentation_timings’ as a parameter to wayl_init() * Remove ‘presentation_timings’ member from the ‘terminal’ struct Closes #932
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wayland.c b/wayland.c
index 2eeb1d72..d65a571b 100644
--- a/wayland.c
+++ b/wayland.c
@@ -1013,7 +1013,7 @@ handle_global(void *data, struct wl_registry *registry,
}
else if (strcmp(interface, wp_presentation_interface.name) == 0) {
- if (wayl->conf->presentation_timings) {
+ if (wayl->presentation_timings) {
const uint32_t required = 1;
if (!verify_iface_version(interface, version, required))
return;
@@ -1190,8 +1190,8 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data)
}
struct wayland *
-wayl_init(const struct config *conf, struct fdm *fdm,
- struct key_binding_manager *key_binding_manager)
+wayl_init(struct fdm *fdm, struct key_binding_manager *key_binding_manager,
+ bool presentation_timings)
{
struct wayland *wayl = calloc(1, sizeof(*wayl));
if (unlikely(wayl == NULL)) {
@@ -1199,10 +1199,10 @@ wayl_init(const struct config *conf, struct fdm *fdm,
return NULL;
}
- wayl->conf = conf;
wayl->fdm = fdm;
wayl->key_binding_manager = key_binding_manager;
wayl->fd = -1;
+ wayl->presentation_timings = presentation_timings;
if (!fdm_hook_add(fdm, &fdm_hook, wayl, FDM_HOOK_PRIORITY_LOW)) {
LOG_ERR("failed to add FDM hook");
@@ -1253,16 +1253,16 @@ wayl_init(const struct config *conf, struct fdm *fdm,
LOG_WARN("no primary selection available");
#if defined(HAVE_XDG_ACTIVATION)
- if (wayl->xdg_activation == NULL && conf->bell.urgent) {
+ if (wayl->xdg_activation == NULL) {
#else
- if (conf->bell.urgent) {
+ if (true) {
#endif
LOG_WARN(
"no XDG activation support; "
"bell.urgent will fall back to coloring the window margins red");
}
- if (conf->presentation_timings && wayl->presentation == NULL) {
+ if (presentation_timings && wayl->presentation == NULL) {
LOG_ERR("presentation time interface not implemented by compositor");
goto out;
}